home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 16.2 Record customer payment - version 2
- Author: Joe Booth
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- LOCAL ok := .F.
- memvar chk_amount
- begin sequence
- select CUSTOMER
- if rec_lock(15) // Lock the current record
- replace CUSTOMER->balance with ;
- CUSTOMER->balance - chk_amount
- unlock
- else
- break
- endif
- select INVOICE
- if rec_lock(15) // Lock the current record
- replace INVOICE->paid with ;
- INVOICE->paid + chk_amount
- unlock
- else
- break
- endif
- select PAYMENT
- if rec_lock(15) // Lock the current record
- replace PAYMENT->posted with .T.
- unlock
- else
- break
- endif
- ok :=.T.
- end sequence
- if ! ok
- ? "ERROR: Transaction not completely applied..."
- endif
- return
-
- // end of file CHP1602.PRG
-