Conversion Mapping

INFlow determines whether account is One World and Non-One World. If it’s the latter, all subsidiary parameters are ignored.

Vendor

Vendor Field

Field Value Taken From

{expenseaccount}

[STA] EFlow preferences → {custrecord_sta_einv_pref_vendorexpacc}

{companyname}

Invoice|AccountingSupplierParty|Party|PartyName|Name à

InvoicerName1

{currency}

Invoice|DocumentCurrencyCode à

CurrencyUnit

{vatregno}

Invoice|AccountingSupplierParty|Party|PartyIdentification>VAT|ID à

InvoicerVATNumber

{terms}

Keep it blank if there are no matching payment terms in NetSuite list

Invoice|PaymentTerms|Note à

TermsOfPaymentFreeText

 

{custentity_sta_einv_businessid}

 

Invoice|AccountingSupplierParty|Party|PartyIdentification|ID à

InvoicerTIN

{custentity_sta_einv_networkid}

 

Invoice|AccountingSupplierParty|Party|EndpointID

SenderPeppolIdentifier

{custrecord_psg_ei_inbound_vendor}

If this value is blank upon creating the bill, set the default E-document package value to REST – Staria Integration on the Vendor record.

 

 

custentity_edoc_ws_id

 

Vendor Web-Service ID – VAT ID or Business ID

custentity_edoc_ws_sender

 

Set the employee which is assigned

Vendor Address fields

Default Billing

Yes (hardcoded)

Label

Billing (hardcoded)

{addr1}

Invoice|AccountingSupplierParty|Party|PostalAddress|StreetName à

InvoicerLocalAddress1

 

{addr2}

Invoice|AccountingSupplierParty|Party|PostalAddress|AdditionalStreetName à

InvoicerLocalAddress2

{city}

Invoice|AccountingSupplierParty|Party|PostalAddress|CityName à

InvoicerPostOffice

{zip}

Invoice|AccountingSupplierParty|Party|PostalAddress|PostalZone à

InvoicerPostalCode

{state}

Invoice|AccountingSupplierParty|Party|PostalAddress|CountrySubentity à

InvoicerCountryArea

{country}

Invoice|AccountingSupplierParty|Party|PostalAddress|Country|IdentificationCode à

InvoicerCountry

Vendor Contact fields

{entityid}

Invoice|AccountingSupplierParty|Party|Contact|Name à

InvoicerContactPersonName

{phone}

Invoice|AccountingSupplierParty|Party|Contact|Telephone à

InvoicerContactPersonTelephoneNumber

{email}

Invoice|AccountingSupplierParty|Party|Contact|ElectronicMail à

InvoicerContactPersonEmailAddress

Bank Payment Details fields

Create a new record Entity Bank Details {customrecord_2663_entity_bank_details}.

NOTE:

  • if both the LocalAccountNumber and IBANAccountNumber are present in xml, then Entity Bank Details with IBANAccountNumber will be of Secondary (ID=2) Entity Bank Details type

  • Before creating an Entity Bank Details record, check for existing entity bank details, according to IBAN and BBAN:

    • Check whether PayeeFinancialAccount for IBAN in XML is already existing on any of the Entity Bank Payment Details against that Vendor, in {custrecord_2663_entity_iban} fields.

    • Check whether PayeeFinancialAccount for BBAN in XML is already existing on any of the Entity Bank Payment Details against that Vendor, in {custrecord_2663_entity_bban} fields. If yes, then skip creating the record.

 NOTE:

  • If “Do not create new vendor bank details if does not match current” {custrecord_sta_einv_pref_newbankacc} is checked in INFlow Preferences record, do not create new entity bank details if the current set of bank details do not match those in the incoming file.

    • In this case, set “Vendor Details do not match” {custbody_sta_inflow_bankacc_nomatch} field value with the following details:

      • WARNING: Existing vendor bank details do not match those in the incoming file:

      • NEW BANK ACCOUNT: XXX

      • NEW SWIFT/BIC: YYY

      • The new details were NOT created

 

  • If “Do not create new vendor bank details if does not match current” {custrecord_sta_einv_pref_newbankacc} is NOT checked in INFlow Preferences record, then create new entity bank details if the current set of bank details do not match those in the incoming file and set “Vendor Details do not match” {custbody_sta_inflow_bankacc_nomatch} field value with the following details:

    • WARNING: NEW BANK ACCOUNT DETAILS WERE CREATED, as existing vendor bank details did not match those in the incoming file:

    • NEW BANK ACCOUNT: XXX

    • NEW SWIFT/BIC: YYY

 

  • If “Do not create new vendor bank details if do not match current” {custrecord_sta_einv_pref_newbankacc} in INFlow Preferences is marked to YES, AND, the entity bank payment details in the incoming file are not found among the existing set of entity bank details, then:

    • DO NOT create a new set entity bank account details

    • On the bill, in “Vendor Bank Details do not match” {custbody_sta_inflow_bankacc_nomatch} field set the following values with hardcoded labels:

      • NEW ACCOUNT NO: xxxxxxx

      • NEW BIC/SWIFT: yyyyyy

For the below set of fields coming from UBL message:

 

If PaymentChannelCode = BBAN, as per example below:

 

<cac:PaymentMeans>

<cbc:PaymentMeansCode>31</cbc:PaymentMeansCode>

<cbc:PaymentDueDate>2013-07-20</cbc:PaymentDueDate>

<cbc:PaymentChannelCode>BBAN</cbc:PaymentChannelCode>

<cbc:PaymentID>0003434323213231</cbc:PaymentID>

<cac:PayeeFinancialAccount>

<cbc:ID>011117947</cbc:ID>

<cac:FinancialInstitutionBranch>

<cac:FinancialInstitution>

<cbc:ID>DNBANOKK</cbc:ID>

</cac:FinancialInstitution>

</cac:FinancialInstitutionBranch>

</cac:PayeeFinancialAccount>

</cac:PaymentMeans>

 

Then domestic payment template has to be fetched, as listed below

{name}

[Subsidiary VAT ID] [BBAN]

{custrecord_2663_entity_bank_type}

Primary (ID=1)

{custpage_2663_entity_file_format}

[STA] INFlow preferences → {custrecord_sta_einv_pref_paymdom}

{custrecord_2663_entity_bban}

 

Invoice|PaymentMeans|PayeeFinancialAccount|ID à

LocalAccountNumber

{custrecord_2663_entity_bic}

 

Invoice|PaymentMeans|PayeeFinancialAccount|FinancialInstitutionBranch|FinancialInstitution|ID|@schemeURI à

SWIFTCode

For the below set of fields coming from UBL message:

 

If PaymentChannelCode = IBAN, as per example below:

 

<cac:PaymentMeans>

<cbc:PaymentMeansCode>31</cbc:PaymentMeansCode>

<cbc:PaymentDueDate>2013-07-20</cbc:PaymentDueDate>

<cbc:PaymentChannelCode>IBAN</cbc:PaymentChannelCode>

<cbc:PaymentID>0003434323213231</cbc:PaymentID>

<cac:PayeeFinancialAccount>

<cbc:ID>NO098011117947</cbc:ID>

<cac:FinancialInstitutionBranch>

<cac:FinancialInstitution>

<cbc:ID>DNBANOKK</cbc:ID>

</cac:FinancialInstitution>

</cac:FinancialInstitutionBranch>

</cac:PayeeFinancialAccount>

</cac:PaymentMeans>

 

Then foreign payment template has to be fetched, as listed below

{name}

[Subsidiary VAT ID] [IBAN]

{custrecord_2663_entity_bank_type}

Primary (ID=1)

{custpage_2663_entity_file_format}

[STA] eFlow preferences → {custrecord_sta_einv_pref_paymfor}

{custrecord_2663_entity_iban}

Invoice|PaymentMeans|PayeeFinancialAccount|ID à

IBANAccountNumber

{custrecord_2663_customer_code}

When subsidiary’s country is DK, and the Vendor’s country is DK, then PaymentID should consist of the following characters:

<cac:PaymentMeans>

<cbc:PaymentMeansCode/>

<cbc:PaymentDueDate>2019-01-29</cbc:PaymentDueDate>

<cbc:PaymentChannelCode>IBAN</cbc:PaymentChannelCode>

<cbc:PaymentID>+71<000000001590108+87700836<</cbc:PaymentID>

 

+71<000000030341903+83473657<

Take the value between + and < signs (last numeric part) and set it in the {custrecord_2663_customer_code} field, on the same Entity Bank Details record created for IBAN/BBAN

{custrecord_2663_entity_bic}

 

Invoice|PaymentMeans|PayeeFinancialAccount|FinancialInstitutionBranch|FinancialInstitution|ID à

SWIFTCode

Transaction

Vendor Bill Field

Field Value Taken From

{subsidiary}

Subsidiary is taken from the Vendor record.

Vendor is determined based on the reference and subsidiary.

 

Reference:

  1. CustomerReference tag matched against:

    1. Web Service ID {custentity_edoc_ws_id}, or

    2. Business ID, or

    3. VAT ID

  2. If there is no match, in addition, check the following tag:

 <cac:AccountingSupplierParty>

         <cac:Party>

             <cac:PartyIdentification>

                           <cbc:ID>32322654</cbc:ID>

 And match it against:

  1. Business ID, or

  2. VAT ID

 

Subsidiary:

There could be multiple subsidiaries added to the Vendor if Shared Vendor feature is used. Determine Vendor’s subsidiary based on the following parameters:

  1. <cac:PartyIdentification> {federalidnumber}, or:

  2. <cbc:EndpointID> {custrecord_sta_einvoicing_payee_edi}

 <cac:AccountingCustomerParty>

<cac:Party>

<cbc:EndpointID>9908:913514874</cbc:EndpointID

<cac:PartyIdentification>

<cbc:ID schemeID="GLN">3456789012098</cbc:ID>

</cac:PartyIdentification>

<cac:PartyIdentification>

                    <cbc:ID schemeID="VAT">NO913514874MVA</cbc:ID>

                       </cac:PartyIdentification>

 

 Sometimes the EDI value is placed in the following tag:

 

<cac:AccountingCustomerParty>

<cac:Party>

<cac:PartyIdentification>

<cbc:ID schemeID="ISO6523">003725645307</cbc:ID>

</cac:PartyIdentification>

 

Which is checked by script in addition to <cbc:EndpointID>9908:913514874</cbc:EndpointID

{tranid}

Invoice|ID →

MessageInvoiceNumber

{custbody_sta_nord_trandate} → Document Date

Invoice|IssueDate →

MessageDate

{trandate}

Current Date

{custbody_sta_origpostingdate}

The same as {trandate}

{memo}

Invoice|Note →

MessageAdditionalInfo1

{currency}

Invoice|DocumentCurrencyCode →

CurrencyUnit

 

If currency is not valid, e.g. <cbc:DocumentCurrencyCode>NIL</cbc:DocumentCurrencyCode>, then source the currency from the Vendor record.

If the required currency is not a part of the Vendor record, add the currency first to the sublist of the Vendor record

{entity}

Invoice|OrderReference|CustomerReference → Identified through this field

{duedate}

Invoice|PaymentMeans|PaymentDueDate →

DueDate

{exchangerate}

Invoice|TaxExchangeRate|CalculationRate →

ExchangeRate

{custbody_sta_eflow_ourref}

Look for a contact record for the respective Vendor, using the below entity ID:

<cac:AccountingSupplierParty>

   <cac:Party>

      <cac:Contact>

                    <cbc:ID>Our ref.</cbc:ID>

                    <cbc:Name>Antonio Salemacher</cbc:Name> (Invoice|AccountingSupplierParty|Party|Contact|Name)

                    <cbc:Telephone>46211230</cbc:Telephone> (Invoice|AccountingSupplierParty|Party|Contact|Telephone)

                 <cbc:ElectronicMail>antonio@salescompany.no</cbc:ElectronicMail>           (Invoice|AccountingSupplierParty|Party|Contact|ElectronicMail)

      </cac:Contact>

 

If Contact exists, set it in Our Reference field. If contact does not exist, create a new contact with the following values:

entityid = <cbc:Name>xxx</cbc:Name> → the only mandatory value

phone = <cbc:Telephone>46211230</cbc:Telephone>

email = <cbc:ElectronicMail>yyy@xxx.zz</cbc:ElectronicMail>

 

Then, set the contact in Our Reference field

{custbody_sta_eflow_yourref}

Look for an employee record with the below email address:

 

<cac:AccountingCustomerParty>

   <cac:Party>

      <cac:Contact>

                    <cbc:ID>3150bdn</cbc:ID>

                    <cbc:Name>John Doe</cbc:Name>

                    <cbc:Telephone>5121230</cbc:Telephone>

                    <cbc:ElectronicMail>john@buyercompany.no</cbc:ElectronicMail>

 

If there is no employee found as per above email, then Your Reference field is not populated.

{custbody_2663_reference_num}

Invoice|PaymentMeans|PaymentID

 

<cac:PaymentMeans>

<cbc:PaymentMeansCode>31</cbc:PaymentMeansCode>

<cbc:PaymentDueDate>2019-01-27</cbc:PaymentDueDate>

<cbc:PaymentChannelCode>BBAN</cbc:PaymentChannelCode>

<cbc:PaymentID>10063101298</cbc:PaymentID>

 

When subsidiary’s country is DK, and the Vendor’s country is DK, then PaymentID should consist of the following characters:

<cac:PaymentMeans>

<cbc:PaymentMeansCode/>

<cbc:PaymentDueDate>2019-01-29</cbc:PaymentDueDate>

<cbc:PaymentChannelCode>IBAN</cbc:PaymentChannelCode>

<cbc:PaymentID>+71<000000001590108+87700836<</cbc:PaymentID>

 

+71<000000030341903+83473657<

Take the value between < and + signs (middle numeric part) and set it in {custbody_2663_reference_num}

{custbody_sta_inflow_entitybankdetails}

Set the related Entity Bank Details record:

  1. If it was created from the incoming file, set the one of Primary type

  2. If the details were already existing, set the one which matches the IBAN/BBAN from the incoming file

Item Line Fields

{Item}

Look for Vendor’s item code in the system to set the item/Items:

 <cac:Item>

          <cbc:Description>Processor: Intel Core 2 Duo SU9400 LV (1.4GHz). RAM: 3MB. Screen 1440x900</cbc:Description>

                                                <cbc:Name>Laptop computer</cbc:Name>

                                                <cac:SellersItemIdentification>

                                                                <cbc:ID>JB007</cbc:ID>

                                                </cac:SellersItemIdentification>

                                                <cac:StandardItemIdentification>

                                                                <cbc:ID schemeID="GTIN">1234567890124</cbc:ID>

                                                </cac:StandardItemIdentification>

                                                <cac:OriginCountry>

                                                                <cbc:IdentificationCode>DE</cbc:IdentificationCode>

                                                </cac:OriginCountry>

                                                <cac:CommodityClassification>

                                                                <cbc:ItemClassificationCode>12344321</cbc:ItemClassificationCode>

 

Linked Bills:

To match the items between Bill and IR/PO, <cac:SellersItemIdentification> value is used:

  • First, compare the Vendor specific item codes in the Vendor list in the item record.

  • If not matching, then compare it with {vendorname}

  • If not matching, compare it with {itemid}

  • If not matching, bill errors

 

NOTE: Direct Bills may not have item codes. It could also be so that there is just a description (free text in Invoice Line tag). In this case, the line has to be posted as expense line, using {account} posting spec one row below.

 <cac:InvoiceLine>

                                        <cbc:ID>1</cbc:ID>

                                        <cbc:Note>Freetext note</cbc:Note>

                                        <cbc:InvoicedQuantity unitCode="NAR">1.0</cbc:InvoicedQuantity>

                                        <cbc:LineExtensionAmount currencyID="NOK">1272.0</cbc:LineExtensionAmount>

                                        <cbc:AccountingCost>BookingCode001</cbc:AccountingCost>

                                        <cac:OrderLineReference>

                                                            <cbc:LineID>1</cbc:LineID>

 Mapping:

<cbc:Note>Freetext note</cbc:Note> = Memo

<cbc:LineExtensionAmount currencyID="NOK">1272.0</cbc:LineExtensionAmount> = Line Amount

 

However, some direct bills may still have <cac:SellersItemIdentification> referenced, that mostly likely will not exist in the system. In this case, to avoid too many errored transactions, such lines will be created as expense lines, using the specification above.

In case of linked bills, check for the following preference by subsidiary {custrecord_sta_einv_pref_item_expline} – if this is checked, created unidentified (items not found in NetSuite) as expense lines as well.

{account}

Look up {customrecord_sta_einv_pref} record, filtered by Subsidiary. Check {custrecord_sta_einv_pref_billexpacc} field:

·        Vendor’s default expense account (ID=1) → Take the value from Vendor record record, {expenseaccount}.

o   If no value is found, look up the account used on the latest bill created for that vendor.

o   If there is no Vendor default account set, take the value from {custrecord_sta_einv_pref_expacc}

·        Based on last posting (ID=2) → look up the account used on the latest bill created for that vendor.

o   If there is no Bill found, check the default expense account on the Vendor record in {expenseaccount}

o   If there is no Bill found for that Vendor, take the value from {custrecord_sta_einv_pref_expacc}

 

If the are no lines captured in XML, then script adds a single line with the following value:

 

<cac:LegalMonetaryTotal>

<cbc:LineExtensionAmount currencyID="NOK">1422.32</cbc:LineExtensionAmount>

<cbc:TaxExclusiveAmount currencyID="NOK">1422.32</cbc:TaxExclusiveAmount>

<cbc:PayableRoundingAmount currencyID="">0.1</cbc:PayableRoundingAmount>

<cbc:PayableAmount currencyID="NOK">1778.0</cbc:PayableAmount>

</cac:LegalMonetaryTotal>

 NOTE: If INFlow Preferences for the respective subsidiary has a check-box “Use Items on Vendors/Stand-Alone Bills” {custrecord_sta_einv_pref_useitems} checked, then bill lines will be posted as items. Default Item {custentity_sta_inflow_defitem} on Vendor record will be used instead of a default Vendor expense account.

 

If there is no Vendor Default Item identified, then use default value from INflow Preferences – ”Default Vendor Expense Item” {custrecord_sta_einv_pref_vendorexpitem}.

In case there is no bill created for a vendor yet (no last posting) or in case there is no default vendor expense item defined, then script uses Default Expense Item in INFlow Preferences {custrecord_sta_einv_pref_defitem}.

”Post unidentified Items as default items on linked Bills” {custrecord_sta_einv_pref_defitemposting} – if this checkbox is checked, then items, not identified on the Bill, will be posted as default items fetched from the Vendor record/INFlow Preferences.

Tax Code

Look for the percent as defined in (for every item)

Invoice|InvoiceLine|Item|ClassifiedTaxCategory|Percent

 

  1. Look into the Vendor master first (tax codes are specified by subsidiary; pick the one for the identified subsidiary). NOTE: for non-OneWorld accounts, take it from the body field (financial tab).

  2. If the vendor specific tax code is defined, compare the % of the Vendor code to that specified in the xml.

    1. If % matches, pick the vendor specific code.

    2. If % does not match, and xml’s % is > 0, go to the Tax Code list, filter it by subsidiary’s country and xml’s %. If there are multiple tax codes returned for the specified %, take the one with the lowest internal ID. NOTE: if the script cannot find the tax code with the xml’s %, then put undefined tax code (the first one in the tax code list, i.e. the lowest internal ID).

    3. If % does not match, and xml’s % is = 0, determine the origin of the bill:

 

  • Domestic (vendor’s billing country matches subsidiary’s country)take it from INFlow preferences, { custrecord_sta_einv_pref_domestictaxzero}

  • EC - this determination is required only if subsidiary’s country is EU country. If yes, then check whether vendor’s billing country

    • does not match subsidiary’s country, and

    • is one of the determined EU countries – look up the {customrecord_sta_eu_country} record and find the country from {custrecord_sta_eu_country_name} field.

    • If the above 2 conditions are true (if not true, then follow Import condition), then determine, whether the item is:

      • Service/charge item or it is account - take the tax code from eFlow preferences {custrecord_sta_einv_pref_ectaxservice}

      • non-service item – take tax code rom eFlow preferences {custrecord_sta_einv_pref_ectaxnonservice}

  • Import – if subsidiary’s country is non-EU, then all foreign bills are considered to be import. In this case, fetch the tax code from eFlow preferences (filtered by subsidiary):

    • Tax Code for Imports: Service (for service, charge type of items, accounts) – { custrecord_sta_einv_pref_taximportser}

    • Tax Code for Imports: Non-Service Items (inventory, assembly) – { custrecord_sta_einv_pref_taximportnonser}

 

3. If the vendor specific code is not defined, follow b and c from above (same scenarios as if the percentages do not match).

 

If the line tax value is blank → Invoice|InvoiceLine|Item|ClassifiedTaxCategory|Percent, then look up the percentage in the following tag:

 <cac:TaxCategory>

<cbc:ID>S</cbc:ID>

<cbc:Percent>25.0</cbc:Percent>

<cac:TaxScheme/>

</cac:TaxCategory>

{amount}

Line item amount/rate is taken from the following tag:

 

<cac:InvoiceLine>

<cbc:ID>1</cbc:ID>

<cbc:InvoicedQuantity>1.0</cbc:InvoicedQuantity>

<cbc:LineExtensionAmount currencyID="DKK">54166.67</cbc:LineExtensionAmount>

<cac:Item>

<cbc:Name>Husleje</cbc:Name>

</cac:Item>

<cac:Price>

<cbc:PriceAmount currencyID="DKK">54166.67</cbc:PriceAmount>

</cac:Price>

</cac:InvoiceLine>

 

If it is zero, then the value is taken from <cbc:PriceAmount currencyID="DKK">54166.67</cbc:PriceAmount>

If PriceAmount is zero, then value is taken from the AdditonalItemProperty element:

 <cac:InvoiceLine>

            <cbc:ID>2</cbc:ID>

            <cbc:InvoicedQuantity>1.0</cbc:InvoicedQuantity>

            <cbc:LineExtensionAmount currencyID="NOK">0.0</cbc:LineExtensionAmount>

            <cac:Item>

                         <cbc:Name>Kantineservice, Sekkebekksletta 8, LILLESAND. 1.Februar. 2019 -</cbc:Name>

                         <cac:SellersItemIdentification>

                                     <cbc:ID>954595-2</cbc:ID>

                         </cac:SellersItemIdentification>

                         <cac:AdditionalItemProperty>

                                     <cbc:Name>LineTotalIncludingTax</cbc:Name>

                                     <cbc:Value>14752.82</cbc:Value>

                         </cac:AdditionalItemProperty>

            </cac:Item>

            <cac:Price>

                         <cbc:PriceAmount currencyID="NOK">14752.82</cbc:PriceAmount>

            </cac:Price>

</cac:InvoiceLine>

 

In case of <cbc:InvoiceTypeCode>381</cbc:InvoiceTypeCode>, treat the amount value as absolute value (so it is never negative)

{memo}

Invoice|InvoiceLine|Note →

AdditionalLineInformation

{custcol_so_deliverydate}

Invoice|InvoiceLine|Delivery|ActualDeliveryDate →

DateOfDelivery

Rounding

<cac:LegalMonetaryTotal>

<cbc:LineExtensionAmountcurrencyID="NOK">1019.1</cbc:LineExtensionAmount>

<cbc:TaxExclusiveAmountcurrencyID="NOK">1019.1</cbc:TaxExclusiveAmount>

<cbc:PayableRoundingAmountcurrencyID="">-0.01</cbc:PayableRoundingAmount>put this value against the account found in corresponding INFlow Preferences record, {custrecord_sta_einv_pref_roundingacc} field, with the defined plus/minus sign

 <cbc:PayableAmount currencyID="NOK">1169.58</cbc:PayableAmount>

</cac:LegalMonetaryTotal>

Allowance charges

<cac:AllowanceCharge>

<cbc:ChargeIndicator>true</cbc:ChargeIndicator>

<cbc:AllowanceChargeReason>Postage fee</cbc:AllowanceChargeReason> → Memo field

<cbc:Amount currencyID="NOK">89.0</cbc:Amount> → Line amount, put this value against the account found in corresponding INFlow Preferences record:

{custrecord_sta_einv_pref_discountacc}, if value is negative (value should be set with negative sign) or if ChargeIndicator=false

{custrecord_sta_einv_pref_chargeacc}, if value is positive or if ChargeIndicator=true

 

<cac:TaxCategory>

<cbc:Percent>25.0</cbc:Percent> → Line tax code

<cac:TaxScheme/>

</cac:TaxCategory>

</cac:AllowanceCharge>