Fin-Integration Using APIs
Fin-Integration Using APIs
Table of contents:
Prerequisites
Before going through this document that covers the integration with Open Item Adjustments, it is mandatory to first go over the general document on integrating with the
Financials titled: "Enterprise Financials Integration: General Information"
Adjustment Header
When creating the header for an open item adjustment, the system needs data for:
Entity (tcCompanyCode) - the entity in which the adjustment is being created. Defaults to the current entity (as defined by vcProxyCompanyCode, or from env.p) when
not provided
Year/Period (OIAdjustPostingYear/OIAdjustPostingPeriod)- automatically determined from the posting date when not provided
Posting Date (OIAdjustPostingDate)- defaults to current date when not provided
Daybook (OIAdjustPostingJournalCode) - must be of type "Customer Adjustment" or "Supplier Adjustment"
Description (OIAdjustDescription)- this value is optional and is only used in Open Item Adjustment View. The description has a maximum length of 255 chars. Note: this
is not used for the posting description, which is automatically set to the string Year + "/" + Period + "/" + Daybook = "/" + "Open Item Adjustment"
Adjustment Lines
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 1 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
The following key parameters are used in the creation of open item adjustment detail records:
1: Entity (OIAdjustLnInvCompanyCode):
This is the entity of the customer or supplier invoice record that is being adjusted. If not provided, the system will use the current entity (as defined
by vcProxyCompanyCode, or from env.p). Note: manual journal entry lines can only be processed in the current entity, and the ability to adjust invoice documents
from other entities is dependent on security permissions and the setting of the Open Item Cross Entity Allowed field of the current entity
2: Type (OIAdjustLnType):
The following types of adjustment line are supported by the API:
Supplier Invoice Movement (Field value - CIMOVEMENT, preprocessor value - OIADJUSTLNTYPE-CIMOV)
Customer Invoice Movement (Field value - DIMOVEMENT, preprocessor value - OIADJUSTLNTYPE-DIMOV)
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 2 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
General description
The integration point for the Open Item Adjustment component - BOIAJE - is the method APIMaintainByDatasetWithOutput.
This open item adjustment API integration allows for the creation of new open item adjustments that can include the following features:
1. Netting supplier invoices with supplier credit notes and other supplier invoice document types
2. Netting customer invoices with customer credit notes and other customer invoice document types
3. Netting customer invoice documents with supplier invoice documents
4. Writing off customer and supplier invoices
5. Reopening already closed customer and supplier invoices
6. Allocating differences to selected GL accounts
7. Adjustments to invoice documents from the same entity or across multiple entities
Limitations
1. The API cannot be used to create new open items of type "prepayment" or "adjustment". These can be created using other existing customer and supplier invoice APIs.
2. The API cannot be used to update supplier invoice hold amounts.
3. The API cannot be used to update withholding tax amounts.
4. Through the API, you cannot identify invoices using either invoice reference or shipper details.
Parameters
See the general section on the usage of the parameters of the API method. All classes have the method APIMaintainByDatasetWithOutput and all have the same input
parameters.
The only difference is the dataset to be passed to the method. In the case of BOIAJE , it is the BOIAJE dataset that should be passed in order to the the method
APIMaintainByDatasetWithOutput.
Dataset information
The API method uses a dataset to pass the actual open item adjustment information to the API. This dataset is called BOIAJE and it consists of the following tables:
tApiOIAdjustOIAJE This is the main table which contains data needed for Open item -
adjustment creation
OIAdjustPostingYear Accounting year, in which the posting is created. Optional and if not passed,
value is retrieved by the posting date.
OIAdjustPostingPeriod Accounting period, in which the posting is created. Optional and if not passed,
value is retrieved by the posting date.
OIAdjustPostingJournalCode Daybook used for the creation of the open item adjustment. Value is
mandatory and needs to be one of the Supplier or Customer open item types
daybook.
OIAdjustPostingDate Posting date of the created Open item adjustment. Value is optional, and, if
not passed, is set to current date.
tcCompanyCode Entity of the open item adjustment. Value is optional. If entered, current value
is expected only.
tApiOIAdjustLnOIAJE This table contains all lines of the open item adjustment tApiOIAdjustOIAJE
OIAdjustLnInvCompanyCode Invoice identification. Value is mandatory. Only entity code is optional and if
OIAdjustLnInvYear not passed, current entity is assumed.
OIAdjustLnInvJournalCode
OIAdjustLnInvVoucher
OIAdjustLnPaidAmtTC Payment amount in the currency of the invoice of the movement. Value is
optional.
OIAdjustLnPaymentDiscTC Discount amount in the currency of the invoice of the movement. Value is
optional.
OIAdjustLnNewBalanceAmtTC New balance of the invoice in the currency of the invoice. Value is optional.
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 3 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
tc_ParentRowid Relation field between open item adjustment line and header
(tAPIOIAdjustLnOIAJE.tc_ParentRowid → tAPIOIAdjustOIAJE.tc_Rowid)
tApiPostingLineOIAJE This table contains journal entry line(s) of open item adjustment tApiOIAdjustOIAJE
Description of the field content, allowed values and defaulting is described for
Journal entry integration point (BPosting.ApiStdMaintainTT) as it is re-using
the same integration functionality at the end.
Value of tApiPostingLineOIAJE.tc_ParentRowId has to be the same as
tc_RowId record value of parent Open item adjustment
(tApiPostingLineOIAJE.tc_ParentRowId = tApiOIAdjustOIAJE.tc_Rowid)
tcCurrencyCode Currency of the transaction. Value is optional. If not supplied, base currency is
used.
tcDivisionCode Sub-account code. Value is optional. If not passed but required by GL account
analysis, default value from the GL account definition is taken.
tcProjectCode Project code. Value is optional. If not passed but required by GL account
analysis, default value from the GL account definition is taken.
tcCostCentreCode Cost center code. Value is optional. If not passed but required by GL account
analysis, default value from the GL account definition is taken.
PostingLineCreditTC Credit amounts of the transaction. Value is optional. Base and statutory
PostingLineCreditCC amounts are calculated from the transaction currency if blank value is passed
PostingLineCreditLC (=?).
PostingLineDebitTC Debit amounts of the transaction. Value is optional. Base and statutory
PostingLineDebitCC amounts are calculated from the transaction currency if blank value is passed
PostingLineDebitLC (=?).
PostingLineExchangeRate Exchange rate between transaction and base currency. Value is optional
PostingLineRateScale
PostingLineCCRate Exchange rate between transaction and statutory currency.. Value is optional.
PostingLineCCScale
tcAllocationType Allocation type of the transaction. Mandatory for GL accounts of type Open
item.
Allowed values
{&ALLOCATIONTYPE-NEW} = "N" - New open
{&ALLOCATIONTYPE-LATER} = "A" - Allocate later
{&ALLOCATIONTYPE-LINK} = "L" - Link to Open Item
tcAllocationKey Allocation key of open item. Mandatory for creation of new open item or for
linking to existing open item.
tc_ParentRowid Relation field between journal entry line and open item header
(tApiPostingLineOIAJE.tc_ParentRowid → tAPIOIAdjustOIAJE.tc_Rowid)
tApiPostingSafOIAJE This table contains SAF details of the journal entry line. Records in this tApiPostingLineOIAJE
table are optional, even the created journal entry line is created with
SAFs. In this case, system defaults theirs values from GL account
definition.
tcSafCode SAF code. Must be defined for SAF concept tcSafConcept. Value is
mandatory.
tc_ParentRowid Relation field between SAF value and journal entry line
(tApiPostingSafOIAJE.tc_ParentRowid → tApiPostingLineOIAJE.tc_Rowid)
tApiPostingVatOIAJE This table contains tax details of the journal entry line tApiPostingLineOIAJE
PostingVatOwnTaxIDFeder Company tax id(s). These can optionally be provided, depending on the tax
PostingVatOwnTaxIDState jurisdiction concerned, if you need the transactions to be included in tax
reporting.
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 4 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
PostingVatOwnTaxIDMisc1
PostingVatOwnTaxIDMisc2
PostingVatOwnTaxIDMisc3
PostingVatTaxDebitTC Tax amount. If not supplied, value is overtaken from the parent journal entry
PostingVatTaxDebitCC line.
PostingVatTaxDebitLC
PostingVatTaxCreditTC
PostingVatTaxCreditCC
PostingVatTaxCreditLC
PostingVatIsAbsRet Absorbed/Retained
tc_ParentRowid Relation field between tax record and journal entry line
(tApiPostingVatOIAJE.tc_ParentRowid → tApiPostingLineOIAJE.tc_Rowid)
tApiPositngVatDelayOIAJE This table contains delayed tax details of the journal entry line. tApiPostingLineOIAJE
For a full description of the tables in the dataset, refer to the html documentation supplied with the software:
Reference
Project: QADFinancials
Class: BOIAJE
Method: ApiMaintainByDatasetWithOutput
Dataset: BOIAJE
The HTML documentation is installed with the QAD EE software. Instructions for finding and using the HTML documentation are also available in the non-intrusive
customization training.
The HTML documentation will also provide information on values to be used for certain fields. For example, the open item adjustment line type field - OIAdjustLnType - can be
set to {&OIADJUSTLNTYPE-CIMOV} which is for supplier invoice movements. However, there are other values for customer invoice movements and manual journal entry line
and these are documented in the HTML documentation.
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 5 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
Processing Notes
Validations
Parameters validation
Open item adjustment can be created only in entity, user is logged in.
Open item adjustment daybook is mandatory, it must exist in the system, be of type customer or supplier adjustment and must be active.
If Year and Period are supplied in the header as well as the posting date, then the system checks that the posting date correctly belongs to the supplied period.
Supplier/Customer invoice have to determined by accounting year, day book and voucher. These parameters are mandatory.
Open item adjustment line type is mandatory and can be set to {&OIADJUSTLNTYPE-CIMOV}, {&OIADJUSTLNTYPE-DIMOV} and {&OIADJUSTLNTYPE-JE}.
On the open item adjustment lines you must supply the payment and discount amount, the movement amount, or the new balance amount. Combinations of these
options are not supported.
The supplier invoice must exist in the entity specified.
Open item adjustments can only be created for supplier invoices with an allocation status different to no allocation.
During execution of the API, multiple open item adjustments can be passed. These adjustments are processed one by one. Therefore, it can happen that some of them are
successfully saved where others not. Processing of any one open item adjustment is stopped immediately when the first error is detected.
Defaulting
The open item adjustment API integration has built in field defaulting functionality, that checks the temp-table records that are passed to the API and makes sure that all
important fields in the records have correct values and consistent values.
Open item adjustment entity is defaulted to current entity (where the API is logged in).
Open item adjustment date is defaulted to today when not passed.
Accounting period is defaulted to the accounting period to which posting date belongs.
When entity is not passed for the invoice lookup, then current entity is assumed.
When the paid amount is entered but the discount amount is not, the discount amount is set to 0.
If the paid amount, discount amount, movement amount and new balance amount are not passed in the API, the new balance amount is set to 0.
If the new balance or the movement amount is set, the payment and discount amounts will be calculated.
Code samples
/* ============================================================================= *
* As a Financial Controller, I want to be able to create open item adjustments *
* that net AP documents in the same entity automatically via an API, to improve *
* processing time and accuracy. *
* ----------------------------------------------------------------------------- *
* Scenario : Matching a supplier prepayment to supplier invoice(s). *
* *
* Input data: Entity: 22UKCO *
* : Supplier Invoice with a balance of 50 *
* : Supplier Invoice with a balance of 20 *
* : Prepayment with open balance of 200 *
* ============================================================================= */
routine-level on error undo, throw.
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 6 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
output to "API_Result_Exception.txt".
put unformatted vcReturnedInfo.
output close.
end catch.
finally:
assign vcReturnedInfo = "Return status: " + string(oiReturnStatus) + chr(10).
for each tFcMessages:
assign viErrCount = viErrCount + 1
vcReturnedInfo = vcReturnedInfo + chr(10)
+ string(viErrCount) + ": ":U + tFcMessages.tcFcMessage + chr(10)
+ " tcFcFieldName = " + (IF tFcMessages.tcFcFieldName = ? THEN "?" ELSE tFcMessages.tcFcFiel
+ " tcFcRowid = " + (IF tFcMessages.tcFcRowid = ? THEN "?":U ELSE tFcMessages.tcFcRowid) + c
+ " tcFcType = " + (IF tFcMessages.tcFcType = ? THEN "?":U ELSE tFcMessages.tcFcType) + chr(
+ " tcFcFieldValue = " + (IF tFcMessages.tcFcFieldValue = ? THEN "?":U ELSE tFcMessages.tcFc
+ " tcFcBusMethod = " + (IF tFcMessages.tcFcBusMethod = ? Then "?":U else tFcMessages.tcFcBu
+ " tcFcMsgNumber = " + (IF tFcMessages.tcFcMsgNumber = ? THEN "?":U ELSE tFcMessages.tcFcMs
+ " tcFcContext = " + (IF tFcMessages.tcFcContext = ? THEN "?":U ELSE tFcMessages.tcFcContex
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 7 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
message vcReturnedInfo
view-as alert-box.
output to "API_Result.txt".
put unformatted vcReturnedInfo.
output close.
vhOIAdjustQry:query-close().
delete object vhOIAdjustQry.
message vcReturnedInfo
view-as alert-box.
output to "API_Result.txt".
put unformatted vcReturnedInfo.
output close.
/* =============================================================================== *
* As a Financial Controller, I want to be able to create open item adjustments *
* that net AP documents in the same entity automatically via an API, to improve *
* processing time and accuracy. *
* ------------------------------------------------------------------------------- *
* Scenario : Matching supplier prepayment to supplier invoice(s) with discounts. *
* *
* Input data: Entity: 22UKCO *
* : Supplier Invoice with a balance of 40, Credit Terms with a Discount *
* : Supplier Invoice with a balance of 60, Credit Terms with a Discount *
* : Prepayment with open balance of 98 *
* =============================================================================== */
routine-level on error undo, throw.
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 8 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
/* ============================================================================= *
* As a Financial Controller, I want to be able to create open item adjustments *
* that net AP documents in the same entity automatically via an API, to improve *
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 9 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
/* ============================================================================= *
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 10 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 11 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
tApiOIAdjustLnOIAJE.tc_Rowid = "oia-3".
output to "API_Result_Exception.txt".
put unformatted vcReturnedInfo.
output close.
end catch.
finally:
assign vcReturnedInfo = "Return status: " + string(oiReturnStatus) + chr(10).
for each tFcMessages:
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 12 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
message vcReturnedInfo
view-as alert-box.
output to "API_Result.txt".
put unformatted vcReturnedInfo.
output close.
vhOIAdjustQry:query-close().
delete object vhOIAdjustQry.
message vcReturnedInfo
view-as alert-box.
output to "API_Result.txt".
put unformatted vcReturnedInfo.
output close.
/* ============================================================================= *
* As a Financial Controller, I want to be able to create open item adjustments *
* to reopen closed AR documents and posting the adjusted amount to multiple *
* GL Accounts. *
* ----------------------------------------------------------------------------- *
* Scenario : Reopening of closed customer invoice against journal entry lines *
* *
* Input data: Entity: 10USACO *
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 13 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
/* Allocate part of the reopening invoice amount against GL account with SAFs */
create tApiPostingLineOIAJE.
assign tApiPostingLineOIAJE.tcGLCode = "6830" /* GL account */
tApiPostingLineOIAJE.PostingLineCreditTC = 52.77
tApiPostingLineOIAJE.PostingLineDebitTC = 0
tApiPostingLineOIAJE.tcDivisionCode = "Elec" /* Sub-account */
tApiPostingLineOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiPostingLineOIAJE.tc_Rowid = "oia-3".
create tApiPostingSafOIAJE.
assign tApiPostingSafOIAJE.tcSafConceptCode = "Site" /* SAF concept */
tApiPostingSafOIAJE.tcSafCode = "UK-01" /* SAF code */
tApiPostingSafOIAJE.tc_ParentRowid = tApiPostingLineOIAJE.tc_Rowid
tApiPostingSafOIAJE.tc_Rowid = "oia-4".
create tApiPostingSafOIAJE.
assign tApiPostingSafOIAJE.tcSafConceptCode = "Product Line" /* SAF concept */
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 14 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
/* Allocate part of the reopening invoice amount against GL account of Open account type */
create tApiPostingLineOIAJE.
assign tApiPostingLineOIAJE.tcGLCode = "1390" /* Tax GL account */
tApiPostingLineOIAJE.PostingLineDebitTC = 2.77
tApiPostingLineOIAJE.PostingLineCreditTC = 0
tApiPostingLineOIAJE.tcAllocationType = {&ALLOCATIONTYPE-LINK} /* Allocation type */
/* {&ALLOCATIONTYPE-NEW} = "N" - New open */
/* {&ALLOCATIONTYPE-LATER} = "A" - Allocate later */
/* {&ALLOCATIONTYPE-LINK} = "L" - Link to Open Item */
tApiPostingLineOIAJE.tcAllocationKey = "OIA netting difference"
tApiPostingLineOIAJE.tcAllocationPostingLine = "2018/CUSTADJ/74"
tApiPostingLineOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiPostingLineOIAJE.tc_Rowid = "oia-6".
/* ============================================================================= *
* As a Financial Controller, I want to be able to create open item adjustments *
* that re-open closed AP documents and post entries to bank, bank charge and tax*
* accounts *
* ----------------------------------------------------------------------------- *
* Scenario : Reopening of closed supplier invoices against journal entry lines *
* *
* Input data: Supplier Invoice with a balance of 0 *
* : Journal entry lines (GL allocation) *
* ============================================================================= */
routine-level on error undo, throw.
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 15 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
/* ================================================================================ */
/* Specify closed supplier invoice to be re-opened */
/* ================================================================================ */
create tApiOIAdjustLnOIAJE.
assign tApiOIAdjustLnOIAJE.OIAdjustLnType = {&OIADJUSTLNTYPE-CIMOV} /* Supplier Invoice Movement */
tApiOIAdjustLnOIAJE.OIAdjustLnInvYear = 2018 /* Year */
tApiOIAdjustLnOIAJE.OIAdjustLnInvJournalCode = "SINV" /* Daybook Code */
tApiOIAdjustLnOIAJE.OIAdjustLnInvVoucher = 38 /* Voucher */
tApiOIAdjustLnOIAJE.OIAdjustLnNewBalanceAmtTC = -100 /* New Balance Amount */
tApiOIAdjustLnOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiOIAdjustLnOIAJE.tc_Rowid = "oia-2".
/* ================================================================================ */
/* Use GL allocation to balance the transaction */
/* ================================================================================ */
/* Bank GL account */
create tApiPostingLineOIAJE.
assign tApiPostingLineOIAJE.tcGLCode = "1100" /* GL account */
tApiPostingLineOIAJE.PostingLineCreditTC = 0
tApiPostingLineOIAJE.PostingLineDebitTC = 80
tApiPostingLineOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiPostingLineOIAJE.tc_Rowid = "oia-3".
/* Bank charge (GL account that contains both sub-account and SAF analysis */
create tApiPostingLineOIAJE.
assign tApiPostingLineOIAJE.tcGLCode = "6830" /* GL account */
tApiPostingLineOIAJE.tcDivisionCode = "Elec" /* Sub-account */
tApiPostingLineOIAJE.PostingLineCreditTC = 0
tApiPostingLineOIAJE.PostingLineDebitTC = 13.02
tApiPostingLineOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiPostingLineOIAJE.tc_Rowid = "oia-4".
create tApiPostingSafOIAJE.
assign tApiPostingSafOIAJE.tcSafConceptCode = "Supplier Type" /* SAF concept */
tApiPostingSafOIAJE.tcSafCode = "PROD" /* SAF code */
tApiPostingSafOIAJE.tc_ParentRowid = tApiPostingLineOIAJE.tc_Rowid
tApiPostingSafOIAJE.tc_Rowid = "oia-5".
create tApiPostingSafOIAJE.
assign tApiPostingSafOIAJE.tcSafConceptCode = "Product Line" /* SAF concept */
tApiPostingSafOIAJE.tcSafCode = "ACE" /* SAF code */
tApiPostingSafOIAJE.tc_ParentRowid = tApiPostingLineOIAJE.tc_Rowid
tApiPostingSafOIAJE.tc_Rowid = "oia-6".
/* Tax account */
create tApiPostingLineOIAJE.
assign tApiPostingLineOIAJE.tcGLCode = "1400"
tApiPostingLineOIAJE.PostingLineCreditTC = 0
tApiPostingLineOIAJE.PostingLineDebitTC = 6.98
tApiPostingLineOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiPostingLineOIAJE.tc_Rowid = "oia-7".
create tApiPostingVatOIAJE.
assign tApiPostingVatOIAJE.PostingVatBaseDebitTC = 23.81
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 16 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
tApiPostingVatOIAJE.PostingVatInOut = {&VATINOUT-INPUT}
tApiPostingVatOIAJE.PostingVatTaxTransType = "55"
tApiPostingVatOIAJE.PostingVatTransType = "PURCHASE"
tApiPostingVatOIAJE.PostingVatOwnTaxIDFeder = "1111111111"
tApiPostingVatOIAJE.PostingVatIsReverseCharge = no
tApiPostingVatOIAJE.PostingVatIsAbsRet = no
tApiPostingVatOIAJE.PostingVatIsSuspDel = no
tApiPostingVatOIAJE.TxtyTaxType = "US-ST"
tApiPostingVatOIAJE.TxenvTaxEnv = "USA"
tApiPostingVatOIAJE.FromTxzTaxZone = ""
tApiPostingVatOIAJE.ToTxzTaxZone = ""
tApiPostingVatOIAJE.tcVatCode = "15"
tApiPostingVatOIAJE.tc_ParentRowid = tApiPostingLineOIAJE.tc_Rowid
tApiPostingVatOIAJE.tc_Rowid = "oia-8".
/* ============================================================================= *
* As a Financial Controller, I want to be able to write off *
* supplier/customer invoices from different entities and post the balance *
* against a GL expense account *
* ----------------------------------------------------------------------------- *
* Scenario : Close supplier invoice *
* Close customer invoice *
* Post the difference against GL account *
* ============================================================================= */
routine-level on error undo, throw.
/* Required definitions */
{ proxy/QadFinancialsConstants.i }
{ proxy/datasets/boiaje.i }
{ proxy/boiaje/apimaintainbydatasetwithoutputdef.i }
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 17 de 18
Fin-Integration using APIs: OIA-JE - BOIAJE - R&D Financials Group - Confluence - QAD Inc 03/12/2019 17)32
tApiOIAdjustOIAJE.OIAdjustPostingDate = today
tApiOIAdjustOIAJE.OIAdjustDescription = "CI SI Write Off + GL Alloc"
tApiOIAdjustOIAJE.tc_Rowid = "oia-1".
/* ================================================================================ */
/* Specify customer invoice to be closed */
/* ================================================================================ */
create tApiOIAdjustLnOIAJE.
assign tApiOIAdjustLnOIAJE.OIAdjustLnType = {&OIADJUSTLNTYPE-DIMOV} /* Customer Invoice Movement */
tApiOIAdjustLnOIAJE.OIAdjustLnInvYear = 2018 /* Year */
tApiOIAdjustLnOIAJE.OIAdjustLnInvJournalCode = "CIM" /* Daybook Code */
tApiOIAdjustLnOIAJE.OIAdjustLnInvVoucher = 40 /* Voucher */
tApiOIAdjustLnOIAJE.OIAdjustLnNewBalanceAmtTC = 0 /* New Balance Amount */
tApiOIAdjustLnOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiOIAdjustLnOIAJE.tc_Rowid = "oia-2".
/* ================================================================================ */
/* Specify supplier invoice to be closed */
/* ================================================================================ */
create tApiOIAdjustLnOIAJE.
assign tApiOIAdjustLnOIAJE.OIAdjustLnType = {&OIADJUSTLNTYPE-CIMOV} /* Supplier Invoice Movement */
tApiOIAdjustLnOIAJE.OIAdjustLnInvCompanyCode = "22UKCO"
tApiOIAdjustLnOIAJE.OIAdjustLnInvYear = 2018 /* Year */
tApiOIAdjustLnOIAJE.OIAdjustLnInvJournalCode = "SINV" /* Daybook Code */
tApiOIAdjustLnOIAJE.OIAdjustLnInvVoucher = 34 /* Voucher */
tApiOIAdjustLnOIAJE.OIAdjustLnNewBalanceAmtTC = 0 /* New Balance Amount */
tApiOIAdjustLnOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiOIAdjustLnOIAJE.tc_Rowid = "oia-3".
/* =================================================================================== */
/* Use GL allocation to balance the transaction and post it against expense GL account */
/* =================================================================================== */
create tApiPostingLineOIAJE.
assign tApiPostingLineOIAJE.tcGLCode = "7825" /* GL account */
tApiPostingLineOIAJE.tcCurrencyCode = "USD" /* Currency */
tApiPostingLineOIAJE.PostingLineDebitTC = 9
tApiPostingLineOIAJE.PostingLineDebitLC = 9
tApiPostingLineOIAJE.PostingLineDebitCC = 9
tApiPostingLineOIAJE.tc_ParentRowid = tApiOIAdjustOIAJE.tc_Rowid
tApiPostingLineOIAJE.tc_Rowid = "oia-4".
Sem rótulos
https://team.qad.com/pages/viewpage.action?spaceKey=FIN&title=Fin-Integration+using+APIs%3A+OIA-JE+-+BOIAJE Página 18 de 18