Some Sage 50 fields—ones that can't be described in Sage 50 data [.DAT] files require custom formulas to extract data for reports. The fields listed below fall into this category. If you need the additional information contained in these special fields while designing reports in Crystal Reports, use the functions listed below in your custom report formulas.
Note: Reports containing these custom formulas must reside in the same directory as your Sage 50 company files. This is so the reports can extract data directly from the company information contained in the files.
Important! If you are working with Crystal on a computer where no previous versions of the Sage product and Crystal Reports have been installed, the special Sage 50 functions need to be loaded into Crystal Reports. Otherwise, they will not be present for use in the reports you are designing.
To load the Sage 50 functions into Crystal, follow these steps:
The report opens in Crystal Reports.
Now when you design a new report in Crystal Reports, all Sage 50 functions will appear in the Crystal Formula Editor.
Do the following:
The Crystal Reports Formula Editor appears.
The Sage 50 functions listed below should appear.
GetPeachCustomFieldHeadingv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, AR=1 AP=2 PR=3 Inventory=6 Jobs=7, (Index 0..4))
The appropriate format for the function is suggested by the displayed text. For example, to return the custom field headings for customers, you would create five formulas, each for a different heading. The function should read
GetPeachCustomFieldHeadingv2 ( Filename, 1, 0)
This returns the first customer custom field heading. (Most indexes with Sage 50 fields begin with zero_
GetPeachCustomFieldHeadingv2 ( Filename, 1, 1)
This returns the second customer custom field heading. Follow the same format for the three remaining formulas.
Tip: To view an example of this function, examine the Customer Detail List or the Vendor Detail List which are Crystal Reports included with Sage 50.
GetPeachRowAmountv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, {JrnlRow.RowType}, {JrnlRow.Amount}, {JrnlRow.Journal}, {JrnlRow.PostOrder}, {JrnlRow.RowNumber}, {JrnlRow.RowDate}, {JrnlRow.ItemRecordNumber}, {Company.IsCashBasis})
This returns appropriate row amounts for cost of sales rows. In the raw data, the cost of sales mount is not necessarily accurate, as the real cost of sales is based on a calculation. The JrnlRow table is required to use this function in a report.
GetPeachPriceLevelNamev2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, (Index 1..20))
This function returns one of the 20 price level names listed in Inventory Item Defaults, the Price Levels tab. When using the function, be sure to replace the string "(Index 1.20)" with the desired number from 1 to 20. To use this function, you must include the LineItem table in your report.
GetPeachItemBegBalv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, {LineItem.ItemRecordNumber})
This function returns the quantity on hand at the beginning of the current accounting period for the item specified. The function requires that you use the LineItem table.
GetPeachItemQtyOnHandv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, {LineItem.ItemRecordNumber})
This function is similar to GetPeachItemBegBal except that it returns the quantity on hand at the end of the current accounting period. It is the same number shown in Maintain Inventory Items in the Qty on Hand field. The function requires that you use the LineItem table.
GetPeachItemQtyOnPOv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, {LineItem.ItemRecordNumber})
This function returns the quantity of the specified item on open purchase orders. It is the same number shown in Maintain Inventory Items in the Qty on PO's field. The function requires that you use the LineItem table.
GetPeachItemQtyOnSOv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, {LineItem.ItemRecordNumber})
This function returns the quantity of the specified item on open sales orders. It is the same number shown in Maintain Inventory Items in the Qty on SO's field. The function requires that you use the LineItem table.
GetPeachItemLastCostv2 ({Company.CompanySpecial1a}, {Company.CompanySpecial1b}, {Company.CompanySpecial1c}, {Company.CompanySpecial1d}, {LineItem.ItemRecordNumber})
This function returns the same number shown in Maintain Inventory Items in the Last Unit Cost field. The function requires a LineItem record. The function requires that you use the LineItem table.
GetPeachCurrentPeriodStart
This function returns the start date of the current accounting period .
GetPeachCurrentPeriodEnd
This function returns the end date of the current accounting period.
GetPeachPeriodStart
This function returns the start date of the accounting period selected by index number within the function
GetPeachPeriodStart(Filename, (Index 1..40) )
For example, the function
GetPeachPeriodStart(Filename, 40)
would return the start date of period 26 in the case of fiscal years set up with thirteen periods.
GetPeachPeriodEnd
This function returns the end date of the accounting period selected by index number within the function:
GetPeachPeriodEnd(Filename, (Index 1..40) )
For example, the function
GetPeachPeriodEnd(Filename, 40)
would return the end date of period 26 in the case of fiscal years set up with thirteen periods.
GetPeachEstJobExpensev2
This function returns the total estimated job expenses seen on the Maintain Jobs window. The function requires that you use the Projects table.
GetPeachEstJobRevenuev2
This function returns the total estimated job revenue seen on the Maintain Jobs window. The function requires that you use the Projects table.
GetPeachActualJobExpensev2
This function returns the total actual job expenses seen on the Maintain Jobs window. The function requires that you use the Projects table.
GetPeachActualJobRevenuev2
This function returns the total actual job revenue seen on the Maintain Jobs window. The function requires that you use the Projects table.
GetPeachThisPeriodActualJobExpensev2
This function returns the total actual job expenses for the chosen period. The function requires that you use the Projects table.
GetPeachThisPeriodActualJobRevenuev2
This function returns the total actual job revenue for the chosen period. The function requires that you use the Projects table.
GetPeachGLAccountIDv2
This function returns the general ledger account ID for the account with the account record number specified in the function.
GetPeachGLAccountIDv2
This function returns the general ledger account description for the account with the account record number specified in the function.
GetPeachTimeStampDatev2
This function returns the date of the time stamp for a particular row in the Audittr.DAT table.
GetPeachTimeStampTimev2
This function returns the time of the time stamp for a particular row in the Audittr.DAT table.
These functions, which are self-explanatory, return company information as entered in the Sage 50 Maintain Company Information window. The functions include the following:
|
|
All bill of material functions discussed below require that you use the LineItem table.
GetPeachBOMCompIDv2
This function returns the ID of a component used in an assembly based on the index specified in the function. In this function, the numbered index of assembly components starts with zero. The function is displayed as follows:
GetPeachBOMCompIDv2 (Filename, {LineItem.ItemRecordNumber}, (Index 0..99) )
To return the desired component ID, you must replace "Index 0..99" with the appropriate number from 0-99. For example, to return the first component in the assembly, the function should read
GetPeachBOMCompIDv2 (Filename, {LineItem.ItemRecordNumber}, 0 )
Use the index field in a similar manner for all BOM functions.
GetPeachBOMCompDesv2
This function returns the description of a component used in an assembly based on the index specified in the function.
GetPeachBOMCompReqv2
This function returns the number of units of an individual component required to build the assembly.
GetPeachBOMComponHandv2
This function returns the quantity on hand of an individual component used in the assembly.
GetPeachBOMCompAvailv2
This function returns the quantity available of an individual component used in the assembly. The quantity available is calculated as the amount on hand plus the quantity on all purchase orders minus the quantity on all sales orders.
GetPeachBOMCompLocv2
This function returns the storage location in your facility of an individual component used in the assembly.
GetPeachBOMCompUPCv2
This function returns the UPC/SKU value of an individual component used in the assembly.
GetPeachBOMCompSalesDesv2
This function returns the sales description (as noted in the Maintain Inventory Items window) of an individual component used in the assembly.
GetPeachBOMCompSalesDesv2
This function returns the purchase description (as noted in the Maintain Inventory Items window) of an individual component used in the assembly.
GetPeachBOMCompLastCostv2
This function returns the last cost (as noted in the Maintain Inventory Items window) of an individual component used in the assembly.
(Available only in Sage 50 Quantum Accounting.)
GetPeachRevisionNo
This function returns the current revision for an assembly.
All Serial Number functions are available only in Sage 50 Premium Accounting.
GetPeachSNoStatus
This function returns the current status of the serial number using status text that is displayed in Maintain Inventory Items. You will be required to provide the file path and name, the item record number, and the serial number.
GetPeachSNoWarDate
This function returns the expiration date. If the item is not covered under warranty, the field will be returned blank.
All Work Ticket functions are available only in Sage 50 Quantum Accounting.
GetPeachWTCompID ( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component ID for a row on a particular work ticket.
GetPeachWTCompDes( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s description for a row on a particular work ticket.
GetPeachWTCompOnHand( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s Quantity On-Hand for a row on a particular work ticket.
GetPeachWTCompAvail( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s Quantity Available for a row on a particular work ticket.
GetPeachWTCompLoc( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s location for a row on a particular work ticket.
GetPeachWTCompUPC( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s UPC for a row on a particular work ticket.
GetPeachWTCompSalesDes( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s Sales description for a row on a particular work ticket.
GetPeachWTCompPurchDes( Filename, {Worktkt.RecordNumber}, ComponentIndex (1-300 ) )
This function gets the component’s Purchase description for a row on a particular work ticket.
All Unit/Measure functions are available only in Sage 50 Quantum Accounting.
GetPeachUMID
This function returns the Unit/Measure ID.
GetPeachUMDescription
This function returns the Unit/Measure Description.