project QadFinancials > class BJournalEntry > method UpdateCinvoiceVatPostingVatID


Parameters


iiReversePostingidinputinteger
icTaxClassinputcharacter
icTaxTypeinputcharacter
ictaxUsageinputcharacter
icTaxEnvinputcharacter
oiPostingVatidoutputinteger
iiVatidinputinteger
icvatcodeinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.ReplaceCInvoicePosting
method BCInvoice.ReverseCInvoicePosting


program code (program9/bjournalentry.p)

assign oiReturnStatus = -98.

if iiReversePostingid = 0 or iiReversePostingid = ?
then
    return. 

find first tPostingvat where tPostingVat.Posting_ID= iiReversePostingid and
                             tPostingVat.TxclTaxCls = icTaxClass        and
                             tPostingVat.TxenvTaxEnv = icTaxEnv         and
                             tPostingVat.TxtyTaxType = icTaxType        and
                             tPostingVat.TxuTaxUsage = ictaxUsage       and
                             tPostingVat.Vat_ID      = iiVatid          and
                             tPostingVat.tcVatCode   = icvatcode        and
                             tPostingVat.tc_Status   <> "D":U no-error.
                             
    if Available tPostingVat
    then
        oiPostingVatid = tPostingVat.PostingVat_ID .

    if oiReturnStatus = -98 
    then
        assign oiReturnStatus = 0.