You are here: Development Standards > Routines > Application-SpecificRoutines > APCJLIB.PUB

# APCJLIB.PUB

APCJLIB.PUB is a public program that handles a variety of Contractors’ Job Cost functions from Accounts Payable, Purchase Order, and Landed Cost, via multiple entry points.

WIP_RANGE:

This entry point will read the JOBGL table from the CJTB file and returns the WIP account range.

`1005 WIP_RANGE:`
`1010 ENTER FILE[ALL],WIP1$,WIP2$,CJWIPDF$,CJTB_INDEX`

Variable | Description
FILE[ALL] | Standard file array
WIP1$ | WIP Account from value
WIP2$ | WIP Account thru value
CJWIPDF$ | Default WIP acount
CJTB_INDEX | FILE[x] index that CJTB is opened on

Exit Points | Explanation
EXIT | WIP_RANGE exits with no error.

CHECK_GL_WIP:

This entry point will check the GL Account you entered against the WIP range and let the user know if the data is valid.

`1105 CHECK_GL_WIP:`
`1110 ENTER FILE[ALL],OK$,WIP1$,WIP2$,GL_ACCT$,JOB_ID$,RET$,MSG$`

Variable | Description
FILE[ALL] | Standard File Array
OK$ | Returns “Y” if GL Account is valid, blank if not valid
WIP1$ | WIP account from
WIP2$ | WIP account thru
GL_ACCT$ | GL Account entered by the user to test
JOB_ID$ | Job ID entered by the user
RET$ | Retainage GL account from the APGL table
MSG$ | Returns an error message if GL account entered was not valid

CHECK_RET_INVOICE:

This entry point will check if the line item you entered is for a retainage invoice.

`1205 CHECK_RET_INVOICE:`
`1210 ENTER FILE[ALL],RET$,GL_ACCT$,VENDOR$,APIN_INDEX,JOB_ID$,OKAY$,RETAMT,MSG$`

Variable | Description
FILE[ALL] | Standard file array
RET$ | Retainage GL account number from the APGL table
GL_ACCT$ | GL account entered by the user
VENDOR$ | Vendor ID entered by the user
APIN_INDEX | FILE[x] index that APINx is opened on
JOB_ID$ | Job ID entered by the user
OKAY$ | "Y" = Retainage invoice entered "N" = No retainage invoice entered
RETAMT | Retainage amount for invoice
MSG$ | Message to display if invoice was not a retainage invoice

GET_GL_WIP:

This entry point will get the WIP GL account if Job/Phases are using specific WIP codes.

`1305 GET_GL_WIP:`
`1310 ENTER FILE[ALL],GL_ACCT$,JOB_ID$,B11$,CJWC_INDEX`

Variable | Description
FILE[ALL] | Standard File Array
GL_ACCT$ | GL WIP account from the CJWCx file
JOB_ID$ | Job/Phase ID entered by the user
B11$ | WIP information for the Job/Phase ID entered
CJWC_INDEX | FILE[x] index the CJWCx file is opened on

JOB_FROM:

This entry point displays an entry prompt for Job ID from.

`1405 JOB_FROM:`
`1410 ENTER FILE[ALL],LISTYN$,JOB_FROM$,JOB_X0,JOB_X1,JOB_GUI,GUI,OSGUI$,Y$`

Variable | Description
FILE[ALL] | Standard File Array
LISTYN$ | "Y" = Display message 'Enter '*' to input a list of jobs'
JOB_FROM$ | Job ID entered by the user
JOB_X0 | X0 position of the Job From field used by GENINPUT.PUB
JOB_X1 | X1 position of the Job Thru field used by GENINPUT.PUB
JOB_GUI | GUI ID of the Job From prompt used by GENINPUT.PUB
GUI | "1" if in GUI mode
OSGUI$ | Standard GUI template
Y$ | Command returned by GENINPUT.PUB

JOB_THRU:

This entry point displays an entry prompt for Job ID thru.

`1505 JOB_THRU:`
`1510 ENTER FILE[ALL],JOB_FROM$,JOB_X0,JOB_X1,JOB_GUI,JOB_THRU$,GUI,OSGUI$,Y$`

Variable | Description
FILE[ALL] | Standard File Array
JOB_FROM$ | Job ID entered previously by the user
JOB_X0 | X0 position of the Job From field used by GENINPUT.PUB
JOB_X1 | X1 position of the Job Thru field used by GENINPUT.PUB
JOB_GUI | GUI ID of the Job From prompt used by GENINPUT.PUB
JOB_THRU$ | Job ID entered by the user
GUI | "1" if in GUI mode
OSGUI$ | Standard GUI template
Y$ | Command returned by GENINPUT.PUB

CLEAR_LIST:

This entry point will clear out the vendor or job list when preparing payments.

`1605 CLEAR_LIST:`
`1610 ENTER FILE[ALL],LIST_TYPE$,GUI,OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
LIST_TYPE$ | "V" = Clear vendor list "J" = Clear job list
GUI | "1" if in GUI mode
OSGUI$ | Standard GUI template

GET_LIST:

This entry point will paint and prompt for a list of either vendors or jobs.

`1705 GET_LIST:`
`1710 ENTER FILE[ALL],FILE_INDEX,FROM_VALUE$,LIST_TYPE$,XXLIST$,XXLIST,GUI,OSGUI$,Y$,X$`

Variable | Description
FILE[ALL] | Standard File Array
FILE_INDEX | FILE[x] element that APVEx or JOBSx is open on
FROM_VALUE$ | Last value entered in the list
LIST_TYPE$ | "V" = Clear vendor list "J" = Clear job list
XXLIST$ | Entire list of vendors or jobs entered
XXLIST | Position to start in list
GUI | "1" if in GUI mode
OSGUI$ | Standard GUI template
Y$ | Command returned by GENINPUT.PUB
X$ | Current vendor or job entered

GET_RET_ACCT:

This entry point will read the APGL table and return the retainage account.

`2005 GET_RET_ACCT:`
`2010 ENTER FILE[ALL],TABLE_INDEX,GL_ACCT$`

Variable | Description
FILE[ALL] | Standard File Array
TABLE_INDEX | FILE[x] element that APTB, POTB, or LCTB is opened on
GL_ACCT$ | Retainage account from APGL table

UPDATE_JOB_TYPE:

This entry point will update the B5[ALL] cost types array with the correct amount

`2105 UPDATE_JOB_TYPE:`
`2110 ENTER FILE[ALL],JOB_ID$,AMOUNT,B2[ALL],B5[ALL],SPREC`

Variable | Description
FILE[ALL] | Standard File Array
JOB_ID$ | Job/Phase/Cost Code entered by the user
AMOUNT | Extended amount of the line item
B2[ALL] | Array from JOBSx record containing overhead amount
B5[ALL] | Array from JOBSx record containing cost type amounts
SPREC | Precision for multiplication

RETAINAGE_INVOICE:

This entry point will process a retainage invoice for the Accounts Payable Post Transactions function.

`2205 RETAINAGE_INVOICE:`
`2210 ENTER FILE[ALL],APTH_INDEX,APIN_INDEX,JOB_ID$,LINE_RETAIN[ALL],ORD_TYPE,BATCH$,TRANS$,VENDOR$,FISCAL,INV_DATE,OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
APTH_INDEX | FILE[x] index the APTHx file is opened on
APIN_INDEX | FILE[x] index the APINx file is opened on
JOB_ID$ | Job/Phase/Cost Code of the line item
LINE_RETAIN[ALL] | Retainage amounts from the line item
ORD_TYPE | "1" = Purchase "5" = Debit Memo
BATCH$ | Batch ID of the line item
TRANS$ | Transaction number of the line item
VENDOR$ | Vendor ID of the line item
FISCAL | Fiscal year this line is being posted to
INV_DATE | Invoice date
OSGUI$ | Standard GUI template

CHECK_ITEMS:

This entry point will check Purchase Order entry to let the user know if they need to apply retainage individually when dealing with retainage line items.

`2405 CHECK_ITEMS:`
`2410 ENTER FILE[ALL],POOR_INDEX,ORDER$,MSG$,OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
POOR_INDEX | FILE[x] index the POORx file is opened on
ORDER$ | Batch and order number of the transactions
MSG$ | Will return a message if entering a retainage line item
OSGUI$ | Standard GUI template

CHECK_PO_RETAINAGE:

This entry point will check line items for retainage when applying invoices debit memos in Purchase Order Enter Order or Enter Returns.

`2605 CHECK_PO_RETAINAGE:`
`2610 ENTER FILE[ALL],POOR_INDEX,PORT_INDEX,INVC_NO$,INVOICE$,RET99[ALL],GL_ACCT$,RET$,O2$,ORDER$,LOC2,WITH_RET$,OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
POOR_INDEX | FILE[x] index the POORx file is opened on
PORT_INDEX | FILE[x] index the PORTx file is opened on
INVC_NO$ | Original invoice number
INVOICE$ | Current invoice number
RET99[ALL] | Retainage amount
GL_ACCT$ | GL Account entered by the user to test
RET$ | Retainage GL account from the APGL table
O2$ | Applications options for PO or LC
ORDER$ | Batch and order number of the transactions
LOC2 | Line item we are applying invoices to
WITH_RET$ | "Y" if we have retainage
OSGUI$ | Standard GUI template

PO_RETAINAGE_INVOICE:

This entry point will process a retainage invoice for the Purchase Order Post Transactions function.

`2805 PO_RETAINAGE_INVOICE:`
`2810 ENTER FILE[ALL], APIN_INDEX, XX99[ALL], XX10$, TRET, BSUB, VENDOR$, E2, INVDATE,DUEDATE, DISDATE, PDYEAR$, PONUM$, OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
APIN_INDEX | FILE[x] index the APINx file is opened on
XX99[ALL] | Retainage amounts
XX10$ | Job/Phase/Cost Code
TRET | Total Retainage
BSUB | Invoice Subtotal
VENDOR$ | Vendor ID of the invoice being processed
E2 | Date of order. Set to -1 for debit memos
INVDATE | Invoice date
DUEDATE | Invoice due date
DISDATE | Invoice discount date
PDYEAR$ | Period and Year to create invoice for
PONUM$ | PO Number to assign to invoice
OSGUI$ | Standard GUI template

RETENTION:

This entry point will display and prompt the user for retainage amount and retainage percent for Accounts Payable, Purchase Order, and Landed Cost.

`3105 RETENTION:`
`3110 ENTER FILE[ALL],Y$,RETAIN_ID,PERCENT_ID,JOB_ID$,GL_ACCT$,RET$,EXT_COST,XX99[ALL],OLDRET,RET_X,RET_Y,PER_X,PER_Y,M2$,PERCENT,GUI,OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
Y$ | Command returned by GENINPUT.PUB
RETAIN_ID | GUI ID of the retainage prompt for GENINPUT
PERCENT_ID | GUI ID of the percent prompt for GENINPUT
JOB_ID$ | Job ID entered by the user
GL_ACCT$ | GL Account entered by the user
RET$ | Retainage GL account from the APGL table
EXT_COST | Extended cost amount entered by the user
XX99[ALL] | Retainage amount entered by the user
OLDRET | Original retainage amount entered by the user
RET_X | X1 position of the Retainage prompt for GENINPUT.PUB
RET_Y | X0 position of the Retainage prompt for GENINPUT.PUB
PER_X | X1 position of the Retainage Percent prompt for GENINPUT.PUB
PER_Y | X0 position of the Retainage Percent prompt for GENINPUT.PUB
M2$ | STBL("DOLL") mask
PERCENT | Vendor default retainage percent
GUI | "1" if in GUI mode
OSGUI$ | Standard GUI template

GET_JOB:

This entry point will calculate and return the retainage amount left for purchase orders and returns when finishing invoice or debit memo entry.

`3505 GET_JOB:`
`3510 ENTER FILE[ALL],PORI_INDEX,PORT_INDEX,POOR_INDEX,INVOICE$,ORDER$,RET99$,RET99[ALL],RET$,OSGUI$`

Variable | Description
FILE[ALL] | Standard File Array
PORI_INDEX | FILE[x] index the PORIx file is opened on
PORT_INDEX | FILE[x] index the PORTx file is opened on
POOR_INDEX | FILE[x] index the POORx file is opened on
INVOICE$ | Invoice or debit memo number we are processing
ORDER$ | Batch and order number of the current transactions
RET99$ | Job/Phase/Cost Code returned
RET99[ALL] | Retainage amount
RET$ | Retainage GL account from the APGL table
OSGUI$ | Standard GUI template