project QadFinancials > class BCInvoice > method UpdateCInvoicePosting
Description
Create or modify the cinvoiceposting record
Parameters
icCInvoiceRowId | input | character | Row ID of the CInvoice |
iiCInvoiceId | input | integer | CInvoice ID |
iiPostingId | input | integer | Posting ID |
iiCIRECPostingLineId | input | integer | CIREC Posting Line ID |
icCInvoicePostingType | input | character | Posting Type |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bcinvoice.p)
/* replace unknown values */
if icCInvoiceRowId = ? then assign icCInvoiceRowId = "":U.
if iiCInvoiceId = ? then assign iiCInvoiceId = 0.
if iiPostingId = ? then assign iiPostingId = 0.
if iiCIRECPostingLineId = ? then assign iiCIRECPostingLineId = 0.
/* create CInvoicePosting */
if not can-find(first tCInvoicePosting where
tCInvoicePosting.tc_ParentRowid = icCInvoiceRowId and
tCInvoicePosting.Posting_ID = iiPostingId)
then do:
<M-1 run AddDetailLine (input 'CInvoicePosting':U (icTable),
input icCInvoiceRowId (icParentRowid),
output viFcReturnSuper (oiReturnStatus)) in BCInvoice>
if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
then assign oiReturnStatus = viFcReturnSuper.
assign tCInvoicePosting.CInvoice_ID = iiCInvoiceId
tCInvoicePosting.Posting_ID = iiPostingId.
end.
else do:
find first tCInvoicePosting where
tCInvoicePosting.tc_ParentRowid = icCInvoiceRowId and
tCInvoicePosting.Posting_ID = iiPostingId
no-error.
if not available tCInvoicePosting
then return.
end.
assign tCInvoicePosting.CIRECPostingLine_ID = iiCIRECPostingLineId
tCInvoicePosting.CInvoicePostingType = icCInvoicePostingType.