880 Grocery Products Invoice

NetSuite to EDI 880 Grocery Products Invoice Mapping

This document outlines the mapping between NetSuite objects and the EDI 880 Grocery Products Invoice format. The mapping is organized by EDI segments.


Invoice Identification

EDI Source PropertyNetSuite Target PropertyDescription
invoiceIdentification.dateinvoices[0].trandateInvoice date, formatted from M/d/yyyy to yyyyMMdd
invoiceIdentification.invoiceNumberinvoices[0].tranidInvoice number
invoiceIdentification.date1invoices[0].custbody_orderful_edi_po_datePO date, formatted from M/d/yyyy to yyyyMMdd
invoiceIdentification.purchaseOrderNumberinvoices[0].otherrefnumPurchase order reference number
invoiceIdentification.vendorOrderNumbersalesorders[0].tranidSales order transaction ID

Extended Reference Information

EDI Source PropertyNetSuite Target PropertyDescription
extendedReferenceInformation.referenceIdentificationQualifier"IA"Fixed value qualifier code
extendedReferenceInformation.referenceIdentificationinvoices[0].custbody_orderful_n9_notesNotes from the invoice

Date and Shipping Information

EDI Source PropertyNetSuite Target PropertyDescription
dateTime.dateQualifier"11"Fixed date qualifier code
dateTime.dateinvoices[0].shipdateShip date, formatted from M/d/yyyy to yyyyMMdd
carrierDetails.transportationMethodTypeCode"ZZ"Fixed transportation method code
carrierDetails.routinginvoices[0].shipcarrierShipping carrier information

Terms of Sale

EDI Source PropertyNetSuite Target PropertyDescription
termsOfSale.termsTypeCode"01"Fixed terms type code
termsOfSale.termsBasisDateCode"3"Fixed terms basis date code
termsOfSale.termsNetDueDateinvoices[0].duedatePayment due date, formatted from M/d/yyyy to yyyyMMdd
termsOfSale.termsNetDaysinvoices[0].terms.daysuntilnetdueNumber of days until payment is due
termsOfSale.amountSubjectToTermsDiscountinvoices[0].totalaftertaxesTotal amount after taxes
termsOfSale.freeFormMessageinvoices[0].terms.namePayment terms description

Address Information

Ship-To (ST) Address

EDI Source PropertyNetSuite Target PropertyDescription
N1_loop[0].partyIdentification.entityIdentifierCode"ST"Fixed entity identifier for Ship-To
N1_loop[0].partyIdentification.nameinvoices[0].shippingaddress.addresseeShip-to address contact name
N1_loop[0].partyIdentification.identificationCodeQualifier"92"Fixed identification code qualifier
N1_loop[0].partyIdentification.identificationCodeinvoices[0].custbody_orderful_ship_dc_numberShip-to distribution center number
N1_loop[0].partyLocation.addressInformationinvoices[0].shippingaddress.addr1Ship-to address line 1
N1_loop[0].geographicLocation.cityNameinvoices[0].shippingaddress.cityShip-to city
N1_loop[0].geographicLocation.stateOrProvinceCodeinvoices[0].shippingaddress.stateShip-to state
N1_loop[0].geographicLocation.postalCodeinvoices[0].shippingaddress.zipShip-to postal code
N1_loop[0].geographicLocation.countryCodeinvoices[0].shippingaddress.countryShip-to country code

Bill-To (BT) Address

EDI Source PropertyNetSuite Target PropertyDescription
N1_loop[1].partyIdentification.entityIdentifierCode"BT"Fixed entity identifier for Bill-To
N1_loop[1].partyIdentification.nameinvoices[0].billingaddress.addressee or invoices[0].shippingaddress.addresseeBill-to address contact name (falls back to shipping address if billing not available)
N1_loop[1].partyIdentification.identificationCodeinvoices[0].custbody_orderful_bill_dc_numberBill-to distribution center number
N1_loop[1].partyLocation.addressInformationinvoices[0].billingaddress.addr1 or invoices[0].shippingaddress.addr1Bill-to address line 1 (falls back to shipping address if billing not available)

Ship-From (SF) Address

EDI Source PropertyNetSuite Target PropertyDescription
N1_loop[2].partyIdentification.entityIdentifierCode"SF"Fixed entity identifier for Ship-From
N1_loop[2].partyIdentification.namecustomer.companyNameCompany name

Discount Information (G72 Loop)

EDI Source PropertyNetSuite Target PropertyDescription
G72_loop.allowanceOrCharge.allowanceOrChargeCodeLookup from $authorizedDiscountsAllowance or charge code for discounts
G72_loop.allowanceOrCharge.allowanceOrChargeMethodOfHandlingCode"02"Fixed handling code
G72_loop.allowanceOrCharge.allowanceOrChargeTotalAmount$abs($number(foreignamount))Absolute value of the discount amount (from lines with accountinglinetype="DISCOUNT")

Line Items (G17 Loop)

EDI Source PropertyNetSuite Target PropertyDescription
G17_loop.itemDetail.quantityInvoiced$abs($number(quantity))Absolute value of the quantity for non-discount line items
G17_loop.itemDetail.unitOrBasisForMeasurementCodecustcol_orderful_unitsUnits of measurement for the item
G17_loop.itemDetail.itemListCostcustcol_orderful_ordered_rateRate/price for the item
G17_loop.itemDetail.number and G17_loop.itemDetail.productServiceID$eval(custcol_orderful_item_identification).UPCCaseCodeUPC code for the item
G17_loop.itemDetail.productServiceIDQualifier"UP"Fixed qualifier for UPC
G17_loop.itemDetail.monetaryAmount$abs($number(foreignamount))Absolute value of the line amount
G17_loop.lineItemDetail.freeFormDescriptionmemoLine item description

Summary Information

EDI Source PropertyNetSuite Target PropertyDescription
totalInvoiceQuantity.numberOfUnitsShipped$sum(invoices[0].lines.($abs($number(quantity))))Sum of all line quantities
totalInvoiceQuantity.unitOrBasisForMeasurementCodeinvoices[0].lines[0].custcol_orderful_unitsUnit of measurement from the first line item
totalDollarsSummary.amountinvoices[0].totalaftertaxesTotal invoice amount after taxes

Logic Notes

  1. The bill-to address has conditional logic:

    • Uses billing address if available
    • Falls back to shipping address with bill DC number if billing address is unavailable but DC number exists
    • Omits the bill-to section entirely if neither condition is met
  2. Discount lines are filtered using accountinglinetype="DISCOUNT" and mapped to the G72 loop

  3. Regular line items (non-discounts) are mapped to the G17 loop

  4. Date formatting converts from M/d/yyyy format to yyyyMMdd format for EDI requirements