Secondary key


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by GRANT FORAKER on March 25, 2019 at 11:54:25:

OPEN (2) 'N1'
OPEN (20) 'N1', KEY = 'SELECTKEY'

!================================================================= NC.IBS: 768 POSITION (20) KEY = SELECTORG$ + SELECTGLNO$ + SELECTVNBR$

NC.IBS: 770 LAI10:
NC.IBS: 770 LET SELECTKEY$ = KEY(20, EXCP = LAI80) ! END OF FILE
NC.IBS: 771 IF SUB(SELECTKEY$,1,2) NE SELECTORG$ GOTO LAI70 ! END OF ORG
NC.IBS: 772 IF SUB(SELECTKEY$,3,10) NE SELECTGLNO$ GOTO LAI70 ! END OF A/P ACCT
NC.IBS: 773 IF SUB(SELECTKEY$,13,6) NE SELECTVNBR$ GOTO LAI70 ! END OF VENDOR
NC.IBS: 774 INQUIRE (20,1411) KEY = SELECTKEY$
NC.IBS: 775 PRINT @(0,1);(BF);@(0,1);INV$
NC.IBS: 776 IF STATUS$ EQ 'H' GOTO LAI20 ! HOLD STATUS
NC.IBS: 778 GOSUB CalculateInvoiceBalance

NC.IBS: 1520 CALCULATEINVOICEBALANCE:
NC.IBS: 1520 LET INVBAL = 0
NC.IBS: 1521 LET INVDISC = 0
NC.IBS: 1522 LET N1KEY$ = VNBR$ + INV$
NC.IBS: 1523 POSITION (2) KEY = N1KEY$

NC.IBS: 1525 CIB10:
NC.IBS: 1525 LET N1KEY$ = KEY(2, EXCP = CIB80) ! END OF FILE
NC.IBS: 1526 IF SUB(N1KEY$,1,6) NE VNBR$ GOTO CIB90 ! END OF VENDOR
NC.IBS: 1527 IF SUB(N1KEY$,7,20) NE INV$ GOTO CIB90 ! END OF INVOICE
NC.IBS: 1528 INQUIRE (2,1411) KEY = N1KEY$
NC.IBS: 1529 IF (TRCODE$ EQ 'BI' OR TRCODE$ EQ 'BF') LET SN1KEY$ = N1KEY$
NC.IBS: 1531 CASE 'BI';'BF';'CM';'DM'
NC.IBS: 1532 LET INVBAL = INVBAL + TRAMT
NC.IBS: 1533 CASE 'CP'
NC.IBS: 1537 GOTO CIB10

NC.IBS: 1525 CIB10:
NC.IBS: 1525 LET N1KEY$ = KEY(2, EXCP = CIB80) ! END OF FILE
NC.IBS: 1526 IF SUB(N1KEY$,1,6) NE VNBR$ GOTO CIB90 ! END OF VENDOR
NC.IBS: 1527 IF SUB(N1KEY$,7,20) NE INV$ GOTO CIB90 ! END OF INVOICE
NC.IBS: 1528 INQUIRE (2,1411) KEY = N1KEY$
NC.IBS: 1529 IF (TRCODE$ EQ 'BI' OR TRCODE$ EQ 'BF') LET SN1KEY$ = N1KEY$
NC.IBS: 1531 CASE 'BI';'BF';'CM';'DM'
NC.IBS: 1534 LET INVBAL = INVBAL + (TRAMT + DSCAMT) ! 'CP' NUMBERS ARE MINUS
NC.IBS: 1535 LET INVDISC = INVDISC + DSCAMT
NC.IBS: 1537 GOTO CIB10

NC.IBS: 1525 CIB10:
NC.IBS: 1525 LET N1KEY$ = KEY(2, EXCP = CIB80) ! END OF FILE
NC.IBS: 1526 IF SUB(N1KEY$,1,6) NE VNBR$ GOTO CIB90 ! END OF VENDOR
NC.IBS: 1527 IF SUB(N1KEY$,7,20) NE INV$ GOTO CIB90 ! END OF INVOICE

NC.IBS: 1542 CIB90:
NC.IBS: 1542 RETURN

NC.IBS: 779 IF INVBAL EQ 0 GOTO LAI20 ! PAID IN FULL

NC.IBS: 786 LAI20:
NC.IBS: 786 TRACE PRINT SELECTKEY$
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LUN 20 and LUN 2 are the same file (N1)
When CALCULATEINVOICEBALANCE is done SELECTKEY$ has been
blanked out. SELECTKEY$ is not touched in that routine.
Saving then restoring SELECTKEY$ is the work around
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

NC.IBS: 787 LET SELECTKEY$ = SUB(SELECTKEY$,1,38) + '@FF@'
NC.IBS: 788 POSITION (20) KEY = SELECTKEY$ ! SKIP REST OF INVOICE
NC.IBS: 789 GOTO LAI10

NC.IBS: 770 LAI10:
NC.IBS: 770 LET SELECTKEY$ = KEY(20, EXCP = LAI80) ! END OF FILE
NC.IBS: 771 IF SUB(SELECTKEY$,1,2) NE SELECTORG$ GOTO LAI70 ! END OF ORG

NC.IBS: 792 LAI70:
NC.IBS: 792 PRINT (DeleteWindowEx = ExWindowHandle$) ! CLOSE WINDOW
NC.IBS: 793 PRINT (AllowMaximize=False)
NC.IBS: 795 TRACE OFF





Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]