project QadFinancials > class BBillReport > method GetBillReportTitleInfo

Description

Return the title information of current bill such as Bank, Debtor contact info, bill year.


Parameters


iiBill_IDinputinteger
iiEmployee_IDinputinteger
ocBusinessRelationNameoutputcharacter
ocBusinessRelationIDoutputcharacter
ocBusinessRelationAddr1outputcharacter
ocBusinessRelationAddr2outputcharacter
ocPaymentConditionCodeoutputcharacter
otBillDateoutputdate
oiBillYearoutputinteger
oiCurHighWaterMarkoutputinteger
ocCurBillStatusoutputcharacter
ocBankAccountCodeoutputcharacter
ocBankAccountTypeoutputcharacter
ocBankNumberoutputcharacter
ocBankNumberBranchoutputcharacter
ocBankNumberSwiftCodeoutputcharacter
ocBankNameoutputcharacter
ocBillCollectoroutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBillReport.BillReportDInvoice


program code (program1/bbillreport.p)

/* Get Debtor Address and other info */
<Q-29 run GetDebtorInfoForBill (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input iiBill_ID, (Bill_ID)
    output dataset tqGetDebtorInfoForBill) in BBillReport>

find first tqGetDebtorInfoForBill no-lock no-error.
if available tqGetDebtorInfoForBill then 
do:
    assign ocBusinessRelationName  = tqGetDebtorInfoForBill.tcBusinessRelationName1
           ocBusinessRelationID    = tqGetDebtorInfoForBill.tcBusinessRelationCode
           ocBusinessRelationAddr1 = tqGetDebtorInfoForBill.tcAddressStreet1
           ocBusinessRelationAddr2 = tqGetDebtorInfoForBill.tcAddressStreet2
           ocPaymentConditionCode  = tqGetDebtorInfoForBill.tcPaymentConditionCode
           otBillDate              = tqGetDebtorInfoForBill.ttBillDate
           oiBillYear              = tqGetDebtorInfoForBill.tiBillYear
           oiCurHighWaterMark      = tqGetDebtorInfoForBill.tiDInvoiceMovement_ID
           ocCurBillStatus         = tqGetDebtorInfoForBill.tcBillStatus
           viDebtorId = tqGetDebtorInfoForBill.tiDebtor_ID.
    
    /* Address format: Street,City,State,County,Country */
    if tqGetDebtorInfoForBill.tcAddressCity <> ? and tqGetDebtorInfoForBill.tcAddressCity <> "" then 
        ocBusinessRelationAddr1 = ocBusinessRelationAddr1 + ", " + tqGetDebtorInfoForBill.tcAddressCity.
    if tqGetDebtorInfoForBill.tcStateDescription <> ? and tqGetDebtorInfoForBill.tcStateDescription <> "" then 
        ocBusinessRelationAddr1 = ocBusinessRelationAddr1 + ", " + tqGetDebtorInfoForBill.tcStateDescription .
    if tqGetDebtorInfoForBill.tcCountyDescription <> ? and tqGetDebtorInfoForBill.tcCountyDescription <> "" then 
        ocBusinessRelationAddr1 = ocBusinessRelationAddr1 + ", " + tqGetDebtorInfoForBill.tcCountyDescription. 
    if tqGetDebtorInfoForBill.tcCountryDescription <> ? and tqGetDebtorInfoForBill.tcCountryDescription <> "" then 
        ocBusinessRelationAddr1 = ocBusinessRelationAddr1 + ", " + tqGetDebtorInfoForBill.tcCountryDescription.
end.

/* Get Bank info */
<Q-68 run BankNumberByParentID (all) (Read) (NoCache)
   (input viDebtorId, (ParentObjectId)
    input 'DEBTOR':U, (BankNumberParentType)
    input ?, (BankNumberIsDefault)
    input viCompanyId, (CompanyId)
    output dataset tqBankNumberByParentID) in BBankNumber>

for each tqBankNumberByParentID:
    <Q-58 run BankPayFormatByID (all) (Read) (NoCache)
       (input tqBankNumberByParentID.tiBankPayFormat_ID, (BankPayFormatId)
        input viCompanyId, (CompanyId)
        output dataset tqBankPayFormatByID) in BBankPayFormat>

    for each tqBankPayFormatByID:
        <Q-20 run BankNumberByIDAllInfo (all) (Read) (NoCache)
           (input tqBankPayFormatByID.tiBankNumber_ID, (BankNumber_ID)
            input ?, (BankNumberIsDefault)
            output dataset tqBankNumberByIDAllInfo) in BBankNumber>

        find first tqBankNumberByIDALLInfo no-lock no-error.
        if available tqBankNumberByIDAllInfo 
        then do:
            assign  ocBankAccountCode       = tqBankNumberByIDAllInfo.tcBankNumberFormatted
                    ocBankAccountType       = tqBankNumberByIDAllInfo.tcBankNumberParentType
                    ocbanknumber            = tqBankNumberByIDAllInfo.tcBankNumber
                    ocbanknumberbranch      = tqBankNumberByParentID.tcBankNumberBranch
                    ocbanknumberswiftcode   = tqBankNumberByParentID.tcBankNumberSwiftCode
                    ocbankname              = tqBankNumberByParentID.tcBankBusinessRelationCode.
         end.     
    end.                          
end. 
                           
/* Get Employee info */
if iiEmployee_ID <> 0 then
do:
    <Q-92 run GetEmployeeInfoForBill (all) (Read) (NoCache)
       (input viCompanyId, (CompanyId)
        input iiEmployee_ID, (Employee_ID)
        output dataset tqGetEmployeeInfoForBill) in BBillReport>

    find first tqGetEmployeeInfoForBill no-lock no-error.
    if available tqGetEmployeeInfoForBill then
    assign ocBillCollector = tqGetEmployeeInfoForBill.tcBusinessRelationName1.
end.