Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / one-off / fixinvce.p
blob0684f5169ee97403e1178a3d6c79b475c250510f
1 DEF VAR line-total AS DEC INIT 0 NO-UNDO.
2 DEF VAR n AS INT NO-UNDO.
4 ON ASSIGN OF InvoiceLine.YourShare OVERRIDE DO: END.
6 FIND Office WHERE ThisOffice NO-LOCK.
8 FOR EACH Invoice WHERE
9 Invoice.TaxAmount <> 0 AND
10 ABS( Invoice.TaxAmount ) > ABS( Invoice.Total )
11 BY Invoice.InvoiceNo:
13 line-total = 0.
14 FOR EACH InvoiceLine OF Invoice NO-LOCK:
15 line-total = line-total + InvoiceLine.YourShare.
16 END.
18 ASSIGN
19 Invoice.Total = line-total
20 Invoice.TaxAmount = IF Invoice.TaxApplies THEN
21 ( line-total * ( Office.GST / 100 ) ) ELSE 0
22 n = n + 1.
24 END.
26 MESSAGE n "Invoices have been repaired." VIEW-AS ALERT-BOX INFORMATION
27 TITLE "Done".