×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Accpac/SBT/Sage Payment Terms

Accpac/SBT/Sage Payment Terms

Accpac/SBT/Sage Payment Terms

(OP)
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.
 

RE: Accpac/SBT/Sage Payment Terms

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.

RE: Accpac/SBT/Sage Payment Terms

(OP)
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?

RE: Accpac/SBT/Sage Payment Terms

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?

RE: Accpac/SBT/Sage Payment Terms

(OP)
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) big smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close