Archive

Posts Tagged ‘developer’

Today’s Date

January 24th, 2009 No comments

It is very often that you need to get current date/time in your development.

T-SQL

To get today date without time as string variable use following script:

Select CONVERT( CHAR(8), GetDate(), 112)

To get datetime variable of today date without time use following script:

Select CAST( CONVERT( CHAR(8), GetDate(), 112) AS DATETIME)

VB

System.DateTime.Now.ToString(“yyyyMMddhhmmss”)

Now()

To initiate a date field as today’s date in Syteline form, need to use CURDATE().

How to block “PO Box” being entered into Customer Ship To Address

January 23rd, 2009 No comments

Problem:

Many business would not allow product shipped to a “PO Box” address.  So would like to block any “PO Box” address being entered into any ship to address.

Solution:

1)      Enter design mode of “Customer Ship Tos” Form.

2)      We are going to first create a script.  Go to “Menu -> Edit -> Script”, a Script window should open.  Click “New”, enter Script Name called “NoPOBox”, then click OK.

NoPOBox1

Put in the following script:

Option Explicit On

Option Strict On

Imports System

Imports Microsoft.VisualBasic

Imports Mongoose.IDO.Protocol

Imports Mongoose.Scripting

Namespace SyteLine.GlobalScripts

Public class NoPOBox

Inherits GlobalScript

Sub Main()

Dim strValue As String

Dim logicYN as boolean

Dim logicYN1 as boolean

Dim logicYN2 as boolean

Dim logicYN3 as boolean

Dim logicYN4 as boolean

strValue = GetParameter(0).ToUpper()

logicYN = strValue like “*PO BOX*”

logicYN1 = strValue like “*P.O BOX*”

logicYN2 = strValue like “*P.O.BOX*”

logicYN3 = strValue like “*PO. BOX*”

logicYN4 = strValue like “*P.O. BOX*”

If logicYN or logicYN1 or logicYN2 or logicYN3 or logicYN4

ReturnValue = “1”

else

ReturnValue = “0”

end if

End Sub

End Class

End Namespace

Then “OK” to save the Script, and “Done” to close the Script window.

3)      Create a Validator.

While we are still in the design mode of “Ship Tos” Form, from menu, go to “Edit -> Validator”.  A “Validator” window open, click “New”.  In the “Validator Properties” window, enter “NoPOBox” as name, “Run Script” as type.  Select “NoPOBox” as script name from the pull-down list, that is the script we just created in step 2).

NoPOBox2

Then, create Error Message: “PO Box Is Not Valid Address”.

NoPOBox3

Click OK all the way back, we now have created a validator called “NoPOBox”, and we can apply it to the fields that we want to validate.

4)      Apply validator

NoPOBox4

Click to enter PV(Addr_1), that means property value of Addr_1, as parameters.

NoPOBox5

5) Now save the change and exit out of design mode, we should be able to see the validation is working:

NoPOBox6

Syteline Payroll Generation Logic.

June 19th, 2008 No comments

Payroll Generation: pr/pr-trxg.p, main logic in pr/pr-trxg1.p

Payroll record prlog can be generated from 4 differ sources:

  1. Manufacturing transaction jobtran.  The Generate Payroll From field on the Employee Master must also be set to M. The summarized transactions include: WC Labor, WC Machine Time and Job Labor.  prlog.posted-from = “M”.
  2. Manufacturing Project transaction projtran.  The Generate Payroll From field on the Employee Master must also be set to M.  prlog.posted-from = “M”.
  3. Time and Attendance record timeatt.  The PR From field must also be set to T. Total Hours are calculated on the time between clock-in and clock-out with all break times subtracted out. After each time & attendance transaction is summed to the Payroll Transaction record, the time & attendance transaction status is changed from Unposted to Posted.  prlog.posted-from = “T”.
  4. Attendance transaction prhrs.  When the reason code is set to Vacation, Holiday, or Sick, the record is treated as if it were the Vacation, Holiday, or Sick record entered into the Payroll Hours file.  prlog.posted-from = “P”.  Noted that prhrs record got deleted after the process (prlog created.)
  5. empabsence.  prlog.posted-from = “X”. 

Pay Rate calculation.   pr/calcrate.p

Example:        run pr/calcrate.p (recid(employee), prlog.hr-type, true,
prlog.shift, prlog.work-date, FALSE, OUTPUT prlog.pay-rate).

Populating An Empty Database

November 24th, 2007 No comments

When populating an empty or initialized database, it is recommended that you enter the

following information on the following forms in the following order:

Step 1: Users

Use this form to register users to the application. A user ID is required for each user who

logs on to the application.

Step 2: Object Authorizations for User

Use this form to set up form-level security for a user or to set up security for a user based

on a middle-tier IDO.

Step 3: Chart of Accounts (In Entity Database ONLY)

Use the Chart of Accounts form to define account numbers which will be used throughout

the SyteLine ERP system to record, track, and report costs. The General Ledger is tied to

other parts of the SyteLine ERP system through the Chart of Accounts and the journals.

Step 4: Accounting Periods (In Entity Database ONLY)

Use the Accounting Periods form to maintain the accounting periods used by General

Ledger.

Step 5: Bank Reconciliations

SyteLine ERP maintains a transaction history of all activity against the bank checking

accounts your company uses. You can view this information through the Bank

Reconciliations form, and also prepare bank reconciliations by tracking what has been

recorded by the bank.

Step 6: General Parameters

Use the General Parameters form to set the parameters used throughout the system.

For more information about the forms listed in this section, refer to SyteLine

ERP’s online help.

Step 7: Shop Floor Control Parameters

Use the Shop Floor Control Parameters form to set up default settings for shop floor data

and for running the Scheduler.

Step 8: Order Entry Parameters

Use the Order Entry Parameters form to set default values for customer order entry.

Step 9: Inventory Parameters

Use the Inventory Parameters form to set parameters in your inventory system for use

throughout the entire SyteLine ERP system. Changing these parameters can affect the

way SyteLine ERP is run and how it handles inventory.

Step 10: Planning Parameters

Use the Planning Parameters form to enable features and options used throughout the

MRP and APS planning functions.

Step 11: Purchasing Parameters

Use the Purchasing Parameters form to enter default values for use throughout

Purchasing.

Step 12: Accounts Payable Parameters

Use the Accounts Payable Parameters form to specify the accounts to use in the General

Ledger. SyteLine ERP uses these accounts throughout A/P for distributions to the G/L.

Step 13: Accounts Receivable Parameters

Use the Accounts Receivable Parameters form to enter the default parameter values

SyteLine ERP applies throughout Accounts Receivable.

Step 14: Departments

Use the Departments form to maintain a list of all departments referenced by work center

and employee records. The Department field also appears on the Fixed Assets Class

Codes form. You use departments to group work centers for application of overhead rates

and direct labor cost. To report departmental shop floor capacity, combine all work centers

of the department.

Step 15: Product Codes

Use product codes to group similar types of items and assign each group an identifying

code. Product codes can override system-wide parameters for a subset of items.

Step 16: Distribution Accounts

Distribution accounts are a set of accounts grouped by Warehouse and Product Code.

Step 17: Tax Codes

Use the Tax Codes form to specify the percentage of tax to charge to a customer and the

G/L Account to which the sales tax is to be posted.

Step 18: Tax Systems

Use the Tax Systems form to establish the tax system and Tax Codes used in processing

Value Added Tax or sales tax related information. The Value Added Tax function

processes items in Customer Order Entry, Purchasing, Accounts Receivable, and

Accounts Payable.

Step 19: Tax Parameters

Use the Tax Parameters form to define global (applying to both tax systems) switches and

dates, and to set optional tax data printing options.

Step 20: Prov/States

Use the Prov/States form to enter state or province abbreviations.

Step 21: Billing Terms

Use the Billing Terms form to identify and maintain billing terms to be applied to customers.

The Billing Terms code displays on the Customers and Vendors forms. You can identify

default billing terms for each customer or vendor.

Step 22: Miscellaneous Receipt Reason Codes

Use the Miscellaneous Receipt Reason Codes form to track the entry of Miscellaneous

Receipt transactions. For example, you could use the code RTS to indicate a return to

stock.

Step 23: Miscellaneous Issues Reason Codes

Use the Miscellaneous Issues Reason Codes form to track the entry of Miscellaneous Issue

transactions. For example, you could use the code TES to indicate the material was issued

for testing.

Step 24: Locations

Use the Locations form to maintain the list of valid places for inventory. These locations

are used when establishing inventory balances and processing inventory transactions.

SyteLine ERP initially creates a location of Stock and strongly recommends that you not

delete this record, since several SyteLine programs assume that Stock exists as a default.

Step 25: Unit of Measure Codes

Use the Unit of Measure Codes form to maintain all units of measure that can be associated

with an item. Transactions can then be tracked in various units. A base unit of measure is

assigned to each item on the Items form.

Step 26: Shift Codes

Use the Shift Codes form to maintain codes that identify particular shifts for use in payroll

administration. You can create as many shifts as needed based on the starting and ending

times for a flex-time work schedule. Use the Scheduling Shifts form to define shifts to

schedule resources for working on operations.

Managing Progress DB Structure

June 8th, 2007 No comments

1) To move around the db extent to differ location

  • Bring down the DB and make a backup of the DB.
  • Copy the db extent file, such as .b1, .b2 or .d1, .d2, to a new location
  • Edit the .st file to point to the new location
  • prostrct repair db-name [.st description file],  This will update the .db with the .st with new file location
  • prostrct list db-name, verify the change and insure .db, .st consistent

2) To Add a new extend

  • Create a new.st file that only contain the new extent information.
  • prostrct add db-name new.st
  • This will turn the last flexible extent to fixed extent with the current file size. 
  • If want to make the file size of all fixed extent consistent, edit the .st file, then use procopy to copy the DB from a backup.

3) Another way to do all of above, like changing the location of extent and changing the file size for fixed extent.

  • Edit the .st file with what ever change you want
  • Use procopy to copy the DB from a backup to rebuild the new DB.

Categories: Progress Tags: , , ,

Build .r comparable DB

December 25th, 2006 No comments

1) For the original DB, dump the .df file.  Can be done by

  • go to Progress -> Data Administration -> Admin -> Dump Data and Definitions -> Data Definitions; or
  • Syteline admin -> Admin -> Database maintenance -> Dump Data Definitions.

2) Create a new DB from Progress empty DB: Progress -> Data Administration -> Database -> Create.  Make sure create from correct code page empty db. For example, if original DB is GB2312, then use the empty db from prolang\sch\gb2312.


3) Load the .df file to new DB. Progress -> Data Administration -> Admin -> Load Data and Definitions -> Data Definitions


4) Compile code against to this new DB, the .r code should be comparable with original DB.

Categories: Progress Tags: , ,

Copy DB in Windows

November 22nd, 2006 No comments

Copy DB in Windows
1) Command prompt, CD to DB directory.
2) %DLC%\bin\procopy oldname newname.  newname can be full path like F:\db\shimadzu\shimadzu
3) This will copy over the .db, .b1, .d1, .st and .lg.  Then manually copy over any .pf and update .pf accordingly.

Categories: Progress Tags: , ,