Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accpac/SBT/Sage Payment Terms

Status
Not open for further replies.

bobnbee

MIS
May 23, 2002
6
US
Hi, I have written an applicaion in FoxPro (migrated over 20 years to VFP). I have been inserting records into SBT (now Sage Pro) tables for years without problems, but now I have problems with payment terms. The AccPac table ARPTRMXX table has a ptrules memo field with the following:

LPARAMETERS po_Object

WITH po_Object
AddProperty(po_Object, "SC_PTMETHOD", "D")
AddProperty(po_Object, "SL_DISCOUNT", .T.)
AddProperty(po_Object, "SN_DISCDAYS", 4)
AddProperty(po_Object, "SN_DISCMETHOD", 2)
AddProperty(po_Object, "SN_DISCOUNT", 2.000)
AddProperty(po_Object, "SN_MOVEDATES", 1)
AddProperty(po_Object, "SN_NETDAYS", 20)

END WITH

What I need to know is how much of this data is important for inserting invoice and detail records into AccPac.

Does anyone have a Rosetta Stone for the meaning of the code values?

What object do I need to instantiate to get at the values? Failing that I will have to read the memo field one line at a time and take the scenic southern route.
 
I assume you don't have access to the Payment Terms Maintenance screen within Sage Pro and are only working with the data. So you can't determine what each property means or how to translate them.

The maintenance data is not important for transactions as long as you use a valid, existing Terms Id and the PNET, PDISC and PDAYS fields are calculated correctly and match up with the standard Sage Pro calculation. These values may be re-calculated throughout the system, so they need to match up else the displayed values may be different. If the calculation for the payment terms has not changed from the earlier versions then your old code should still work.

Your example means a Payment Term calculated as Days from Invoice Date with a Discount of 2% if paid within 4 days. The Net is due in 20 days. If the Due Date or Discount Date does not fall on a Business Work Day, the date is left unchanged.
 
I gradually came to figure most of this out. The problem I still have is that since the contents of the pterm memo field are quite variable in nature (not all properties in all pterms), is there some way to read the memo field and add the properties to an object. Here is what I now do:
Create a cursor object
find the termsid I want
copy the memo field to a new .prg file
run the .prg to add the properties to the cursor object
delete the .prg file
Figure out from the type of termsid, and invoice date what the pnet, pdaysand pdisc have to be
drop the cursor object
repeat for each unique set of invoice dates and termsid

I end up with a memory error of too many files or something like that. I suspect I am going the wrong way around the horse and need a better way to use the memo field contents.

Suggestions?
 
Why move the memo field into a prg. That is normally, a program file. I'd just edit the memo record. I think what you are doing is adding a memo record but not updating the memo file header as to the number of records.

By the way what language are you using to this?
 
Well the only reason I moved the memo to a PRG was I needed to get to the ADDPROPERTY so that I could read the values in the memo field:

Code:
WITH po_Object  
AddProperty(po_Object, "SC_PTMETHOD", "D")  
AddProperty(po_Object, "SL_DISCOUNT", .T.)  
AddProperty(po_Object, "SN_DISCDAYS", 4)  
AddProperty(po_Object, "SN_DISCMETHOD", 2)  
AddProperty(po_Object, "SN_DISCOUNT", 2.000)  
AddProperty(po_Object, "SN_MOVEDATES", 1)  
AddProperty(po_Object, "SN_NETDAYS", 20)

I realize it is the long way around the horse, but I don't know anyother way to get access to the value of the propeties. The arptrmXX table itself doesn't have them as normal fields so that the terms can be HIGHLY customized.

Do you have a way?
adTHANKSvance (Thanks in advance) :-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top