PHP код:
ledgerVoucherObject = ledgerVoucher.findLedgerVoucherObject();
LedgerVoucherTransObject =
LedgerVoucherTransObject::newCreateTrans(
ledgerVoucherObject,
LedgerPostingType::PurchUpdTransCharg,
account,
CustInvoiceTrans.dimension,
correctJour.currencyCode,
AmountTrans,
CustInvoiceTrans.recId,
0
);
if (AmountTrans < 0)
LedgerVoucherTransObject.parmCorrect(NoYes::Yes);
ledgerVoucher.addTrans(LedgerVoucherTransObject);
ledgerVoucherObject.parmTransDate(CustInvoiceJour.InvoiceDate); //уточнить
ledgerVoucher.lastTransDate(ledgerVoucherObject.parmTransDate());
bound_LedgerVoucherTransObject =
LedgerVoucherTransObject::newCreateTrans(
ledgerVoucherObject,
LedgerPostingType::PurchReceipt,
accountCorrect,
CustInvoiceTrans.dimension,
correctJour.currencyCode,
-1*AmountTrans,
CustInvoiceTrans.recId,
0
);
if (AmountTrans < 0)
bound_LedgerVoucherTransObject.parmCorrect(NoYes::Yes);
ledgerVoucher.addTrans(bound_LedgerVoucherTransObject);
// EVGL, Correspondence II -->
if (ledgerBondClient && AmountTrans)
{
ledgerBondClient.bondVRef2VRef(ledgerBondClient.lastVrefId(),
ledgerBondClient.lastVrefId(-1));
}
// EVGL, Correspondence II -->
ledgerVoucherObject.parmTransDate(CustInvoiceJour.InvoiceDate);
ledgerVoucher.lastTransDate(ledgerVoucherObject.parmTransDate());