project QadFinancials > class BCInvoice > method CreateCIPostingControl
Description
CreateCIPosting needed to be split.
Parameters
| icCInvoiceType | input | character | |
| idInvoiceAmountTC | input | decimal | |
| idInvoiceAmountLC | input | decimal | |
| idInvoiceAmountCC | input | decimal | |
| icPostingType | input | character | |
| icGLCode | input | character | |
| icRowId | input | character | |
| icDivisionCode | input | character | |
| icBusinessRelationIntercoCode | input | character | |
| icCurrencyCode | input | character | |
| icCIText | input | character | |
| iiCreditorId | input | integer | |
| iiCInvoiceId | input | integer | |
| idExchangeRate | input | decimal | |
| idExchangeRateScale | input | decimal | |
| icControlCostCentreCode | input | character | |
| icControlProjectCode | input | character | |
| ilHandleCommunicationWithJE | input | logical | do you want that this method handles the communication with the journal entry component. Pass false if instance was already started |
| idCCExchangeRate | input | decimal | |
| idCCExchangeRateScale | input | decimal | |
| oiControlPostingLineId | output | integer | |
| itInvoiceDate | input | date | |
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bcinvoice.p)
<M-1 run CreateCIPostingCalculateAmounts
(input yes (ilIsCreditorControlAccount),
input icCInvoiceType (icCInvoiceType),
input idInvoiceAmountTC (idInvoiceAmountTC),
input idInvoiceAmountLC (idInvoiceAmountLC),
input idInvoiceAmountCC (idInvoiceAmountCC),
input icPostingType (icPostingType),
output vdDebitTC (odDebitTC),
output vdDebitLC (odDebitLC),
output vdDebitCC (odDebitCC),
output vdCreditTC (odCreditTC),
output vdCreditLC (odCreditLC),
output vdCreditCC (odCreditCC),
output viFcReturnSuper (oiReturnStatus)) in BCInvoice>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then do:
if ilHandleCommunicationWithJE = true
then do:
<I-2 {bFcCloseInstance
&CLASS = "BJournalEntry"}>
end. /* end ilHandleCommunicationWithJE */
return.
end. /* end oiReturnStatus < 0 */
if vlCompanyPropertyIsAPUseInvDate = true
then
assign vtExchangeRateDate = itInvoiceDate.
else
assign vtExchangeRateDate = ?.
<M-3 run AddControlPosting
(input icRowId (icPostingtcRowid),
input icGLCode (icGLCode),
input icDivisionCode (icDivisionCode),
input icBusinessRelationInterCoCode (icIntercoBusinessRelationCode),
input icCurrencyCode (icCurrencyCode),
input vdDebitTC (idDebitTC),
input vdDebitLC (idDebitLC),
input vdDebitCC (idDebitCC),
input vdCreditTC (idCreditTC),
input vdCreditLC (idCreditLC),
input vdCreditCC (idCreditCC),
input icCIText (icText),
input iiCreditorId (iiMasterId),
input iiCInvoiceId (iiTransactionId),
input idExchangeRate (idExchangeRate),
input idExchangeRateScale (idExchangeRateScale),
input idCCExchangeRate (idPostingLineCCRate),
input idCCExchangeRateScale (idPostingLineCCScale),
input '':U (icAllocationKey),
input icControlCostCentreCode (icCostCentreCode),
input icControlProjectCode (icProjectCode),
input tDefaultSafsCI (tDefaultSafs),
input vtExchangeRateDate (itExchangeRateDate),
output oiControlPostingLineId (oiPostingLineId),
input false (ilLinkedCrCyDaemonReqExists),
output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then do:
if ilHandleCommunicationWithJE = true
then do:
<I-4 {bFcCloseInstance
&CLASS = "BJournalEntry"}>
end. /* end ilHandleCommunicationWithJE */
return.
end. /* end oiReturnStatus < 0 */