project QadFinancials > class BCInvoiceAPMatching > method ApiEDICInvoiceAPMatchingDSHandle

Description

Get handle to dataset where all incomming data from EDI are stored in.
This method is used by Incomming EDI interface to import Supplier invoices and Receiver matchings. Because EDI tool have to know dataset, where all data from EDI are stored in, this method have to be executed prior real data transfer from EDI to QAD 2008 EE Finance (ApiEDICInvoiceAPMatchingImport).


Parameters


ozCInvoiceAPMatchingoutputdataset-handleHandle to valid dataset where EDI stores all data to be processed.

Structure of dataset
Table: tEDICInvoice - this table contains all details needed for creation of supplier invoices
tcAddressName Not used - for compatibility only
tcAddressStreet1 Not used - for compatibility only
tcAddressStreet2 Not used - for compatibility only
tcAddressStreet3 Not used - for compatibility only
tcAddressCity Not used - for compatibility only
tcAddressStateCode Not used - for compatibility only
tcAddressZip Not used - for compatibility only
tcAddressFormat Not used - for compatibility only
tcAddressCountryCode Not used - for compatibility only
tcAddressCounty Not used - for compatibility only
ttCInvoicePostingDate Posting date, if not supplied value is taken from tcCInvoiceDate (CInvoice.CInvoicePostingdate)
tcCInvoiceCurrencyCode Supplier invoice currency. If not supplied, values is taken from purchase order (CInvoice.Currency_ID)
tcCInvoiceOwnBankNumber Own bank number from which the payment will go out
tcDInvoiceNumber Invoice number (CInvoice.CInvoiceReference)
ttCInvoiceDate Supplier invoice date (CInvoice.CInvoiceDate)
tcCInvoicePaymentCondCode Normal payment condition (CInvoicePaymentCondCode)
tcCInvoiceDiscountDueDate Due date for application of discount (CInvoiceDiscountDueDate)
ttCInvoiceDueDate Payment due date (CInvoiceDueDate)
tcCInvoiceControlGLCode Not used - for compatibility only
tcCInvoiceCostCentreCode Cost centre (CInvoiceCostCentreCode)
tcCInvoiceDiscountGLCode Not used - for compatibility only
tcCInvoiceDiscountCostCentre Not used - for compatibility only
tcCompanyCode Company where supplier invoice is created (CInvoice.Company_ID)
tcCInvoiceRemark Not used - for compatibility only
tcCInvoiceBankNumber Supplier's bank number (CInvoiceBankNumber)
tcCInvoiceCheckForm Not used - for compatibility only
tcCInvoiceIsHoldAmount Does invoice contain any hold amount (CInvoiceIsHoldAmount)
tcCInvoiceHoldAmountTC Supplier invoice hold amount (CInvoiceHoldAmountTC)
tcCInvoiceIsStatusFinal Create supplier invoice in final status (it means including all financial updates)?
tcCInvoiceDivisionCode Division (CInvoiceDivisionCode)
tcCInvoiceDiscountDivision Not used - for compatibility only
tc_Rowid Unique identification of record (used for relationship with tEDIAPMatching)
tiPurchaseOrderNumber Purchase order number (CInvoicePO)
tcReceiverNumber Receiver number
tlIsCreateCInvoice Create supplier invoices?
tcCInvoiceReference Not used - for compatibility only
tcCreditorCode Supplier code (CInvoice.Creditor_ID)
tcRemittanceAddressName Not used - for compatibility only
tcSite If company is not supplied, this field and domain are used to get correct entity, where suppliler invoices should be created.
tcDomainCode Domain code. Complementary field to tcSite


Table: tEDIAPMatching - this table contains details for creation of matching linked to supplier invoice
tiPurchaseOrderLineNumber Purchase order line number (APMatchingLn.APMatchingLnPvodOrderLnNbr)
tdMatchUnitPrice Unit price of purchase order line (APMatchingLn.APMatchingLnMatchPrice)
tdMatchQty Matched quantity (APMatchingLn.APMatchingLnMatchQty)
tc_Rowid Unique record identification
tc_ParentRowid Relation filed for linking with parent record tEDICInvoices
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program3/bcinvoiceapmatching.p)

/* =================================================================================================== */
/* Method      : ApiEDICInvoiceAPMatchingDSHandle                                                      */
/* Desc        : This method provides handle to DataSet, where all data comming from EDI are stored in */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (O)  CInvoiceAPMatching Dataset handle used by EDI to store data in it                   */
/* =================================================================================================== */

assign oiReturnStatus = -98
       viLocalReturn  = 0.

/* =================================================================================================== */
/* Create dataset                                                                                      */
/* =================================================================================================== */
vhozBuffer1 = temp-table tEDIAPMatching:handle.
create buffer vhozBuffer2 for table vhozBuffer1 in widget-pool "non-persistent".
ozCInvoiceAPMatching:add-buffer(vhozBuffer2).

vhozBuffer1 = temp-table tEDIAPMatchingLcCharge:handle.
create buffer vhozBuffer2 for table vhozBuffer1 in widget-pool "non-persistent".
ozCInvoiceAPMatching:add-buffer(vhozBuffer2).

vhozBuffer1 = temp-table tEDICInvoice:handle.
create buffer vhozBuffer2 for table vhozBuffer1 in widget-pool "non-persistent".
ozCInvoiceAPMatching:add-buffer(vhozBuffer2).

if not valid-handle(ozCInvoiceAPMatching)
then do:
    assign vcMessage = "Cannot create handle of dataset for EDI integration":U.
    <M-1 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'S':U (icType), 
        input  '':U (iiSeverity), 
        input  '':U (icRowid), 
        input  'QadFin-8615':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BCInvoiceAPMatching>
    assign oiReturnStatus = -1.
    return.
end.

/* =================================================================================================== */
/* Return                                                                                              */
/* =================================================================================================== */
assign oiReturnStatus = viLocalReturn.