project QadFinancials > class BCInvoice > method CreateCInvoicesDayBookSetCode

Description

submethod of createcinvoices where the cinvoicedaybooksetcode is defaulted


Parameters


blStartSupplierForDaybookSetinput-outputlogicalIs query tqSupplierForDaybookSet already started or not ?
blStartPOAccountingControlinput-outputlogicalIs query POAccountingControlByDomain already started or not ?
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.CreateCInvoices


program code (program3/bcinvoice.p)

if not blStartSupplierForDaybookSet
then do:
    <Q-68 run SupplierForDaybookSetSite  (Start) in BMfgSupplier >    
    assign blStartSupplierForDaybookSet = true.
end. /* not blStartSupplierForDaybookSet */
   
<Q-44 run SupplierForDaybookSetSite (all) (Read) (Cache)
   (input vcDomainCode, (DomainCode)
    input tOpenBalanceCI.tcCreditorCode, (SupplierCode)
    output dataset tqSupplierForDaybookSetSite) in BMfgSupplier>    
find first tqSupplierForDaybookSetSite where 
           tqSupplierForDaybookSetSite.tcvd_addr   = tOpenBalanceCI.tcCreditorCode and   
           tqSupplierForDaybookSetSite.tcvd_domain = vcDomainCode 
           no-error.
if available tqSupplierForDaybookSetSite 
then do:
    assign tCInvoice.CInvoiceSiteCode = tqSupplierForDaybookSetSite.tcvd_site. 
 if tCInvoice.CInvoiceDayBookSetCode = "":U or
    tCInvoice.CInvoiceDayBookSetCode = ?
 then do:            
     if tqSupplierForDaybookSetSite.tcvd_daybookset <> "":U or
        tqSupplierForDaybookSetSite.tcvd_daybookset <> ? 
    then assign tCInvoice.CInvoiceDayBookSetCode = tqSupplierForDaybookSetSite.tcvd_daybookset. 
    else assign tCInvoice.CInvoiceDayBookSetCode = vcPOCDefaultDaybookSet.
 end.
end.