From c65f77a3fbd1812e6d86b834f08b7ec6de96a49d Mon Sep 17 00:00:00 2001 From: Rowan Drew Date: Sat, 19 Oct 2024 23:46:14 +1100 Subject: [PATCH] Fixes #8 --- README.md | 2 +- .../ESDRecordAlternateCode.php | 12 +- .../ESDRecordAsset.php | 178 ++++++++++++++++++ .../ESDRecordAssetComponent.php | 43 +++++ .../ESDRecordAttributeValue.php | 8 +- .../ESDRecordCategory.php | 6 + .../ESDRecordCategoryTree.php | 5 + .../ESDRecordContact.php | 132 +++++++++++++ ...DRecordCustomerAccountEnquiryBackOrder.php | 5 + ...ordCustomerAccountEnquiryBackOrderLine.php | 5 + .../ESDRecordCustomerAccountEnquiryCredit.php | 5 + ...ESDRecordCustomerAccountEnquiryInvoice.php | 5 + ...DRecordCustomerAccountEnquiryOrderSale.php | 4 + .../ESDRecordCustomerAccountEnquiryQuote.php | 4 + .../ESDRecordCustomerInvoice.php | 10 + .../ESDRecordCustomerInvoiceLine.php | 78 ++++++++ .../ESDRecordImage.php | 8 +- .../ESDRecordItemRelation.php | 70 +++++++ .../ESDRecordMakerModelMapping.php | 10 +- .../ESDRecordOrderPurchase.php | 6 + .../ESDRecordOrderPurchaseLine.php | 56 ++++++ .../ESDRecordOrderSale.php | 10 + .../ESDRecordOrderSaleLine.php | 56 ++++++ .../ESDRecordPrice.php | 6 + .../ESDRecordProduct.php | 26 ++- .../ESDRecordProductCombination.php | 2 +- .../ESDRecordStockQuantity.php | 44 ++++- ...ordSupplierAccountEnquiryOrderPurchase.php | 5 + .../ESDRecordSupplierInvoice.php | 10 + .../ESDRecordSupplierInvoiceLine.php | 76 ++++++++ .../ESDRecordType.php | 1 + .../ESDocumentAlternateCode.php | 2 +- .../ESDocumentAsset.php | 119 ++++++++++++ .../ESDocumentAssetComponent.php | 93 +++++++++ .../ESDocumentAttachment.php | 2 +- .../ESDocumentAttribute.php | 2 +- .../ESDocumentCategory.php | 2 +- .../ESDocumentConstants.php | 89 ++++++++- .../ESDocumentCurrencyExchangeRate.php | 2 +- .../ESDocumentCustomerAccount.php | 2 +- .../ESDocumentCustomerAccountAddress.php | 2 +- .../ESDocumentCustomerAccountContact.php | 94 +++++++++ .../ESDocumentCustomerAccountContract.php | 2 +- .../ESDocumentCustomerAccountEnquiry.php | 26 +-- .../ESDocumentCustomerAccountEnquiryLine.php | 10 +- .../ESDocumentCustomerAccountPayment.php | 2 +- .../ESDocumentCustomerInvoice.php | 2 +- .../ESDocumentDeliveryNotice.php | 2 +- .../ESDocumentFlag.php | 2 +- .../ESDocumentGeneralLedgerAccount.php | 2 +- .../ESDocumentImage.php | 2 +- .../ESDocumentItemRelation.php | 91 +++++++++ .../ESDocumentLocation.php | 2 +- .../ESDocumentLocationContact.php | 94 +++++++++ .../ESDocumentMaker.php | 2 +- .../ESDocumentOrderSale.php | 2 +- .../ESDocumentPaymentType.php | 2 +- .../ESDocumentPrice.php | 2 +- .../ESDocumentPriceLevel.php | 2 +- .../ESDocumentProduct.php | 2 +- .../ESDocumentProductCombination.php | 2 +- .../ESDocumentPurchaser.php | 2 +- .../ESDocumentSalesRep.php | 2 +- .../ESDocumentSellUnit.php | 2 +- .../ESDocumentStockQuantity.php | 2 +- .../ESDocumentSupplierAccount.php | 2 +- .../ESDocumentSupplierAccountAddress.php | 2 +- .../ESDocumentSupplierAccountContact.php | 94 +++++++++ .../ESDocumentSupplierAccountEnquiry.php | 2 +- .../ESDocumentSupplierInvoice.php | 2 +- .../ESDocumentSurcharge.php | 2 +- .../ESDocumentTaxcode.php | 2 +- .../ESDocumentType.php | 9 + 73 files changed, 1599 insertions(+), 72 deletions(-) create mode 100644 src/EcommerceStandardsDocuments/ESDRecordAsset.php create mode 100644 src/EcommerceStandardsDocuments/ESDRecordAssetComponent.php create mode 100644 src/EcommerceStandardsDocuments/ESDRecordContact.php create mode 100644 src/EcommerceStandardsDocuments/ESDRecordItemRelation.php create mode 100644 src/EcommerceStandardsDocuments/ESDocumentAsset.php create mode 100644 src/EcommerceStandardsDocuments/ESDocumentAssetComponent.php create mode 100644 src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContact.php create mode 100644 src/EcommerceStandardsDocuments/ESDocumentItemRelation.php create mode 100644 src/EcommerceStandardsDocuments/ESDocumentLocationContact.php create mode 100644 src/EcommerceStandardsDocuments/ESDocumentSupplierAccountContact.php diff --git a/README.md b/README.md index 4c0cdea..2cba408 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ Note that currently this PHP libary only contains a smaller subset of the classe - [Documentation](https://www.squizz.com/esd/index.html) - [License](LICENSE) -- Current Library Version 1.4 \ No newline at end of file +- Current Library Version 1.5 \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDRecordAlternateCode.php b/src/EcommerceStandardsDocuments/ESDRecordAlternateCode.php index 520940a..82a08fd 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordAlternateCode.php +++ b/src/EcommerceStandardsDocuments/ESDRecordAlternateCode.php @@ -19,7 +19,7 @@ class ESDRecordAlternateCode public $keyProductID = ""; /** - * @var string Key of the download record that the alternate code is assigned to. + * @var string Deprecated, use keyAssetID instead. Key of the download record that the alternate code is assigned to. */ public $keyDownloadID = ""; @@ -28,11 +28,21 @@ class ESDRecordAlternateCode */ public $keyLabourID = ""; + /** + * @var string Key of the asset record that the alternate code is assigned to. + */ + public $keyAssetID = ""; + /** * @var string Alternate code. May or may not be a unique identifier */ public $alternateCode = ""; + /** + * @var string Indicates what type of code the alternate code is. see ALTERNATE_CODE_TYPE constants in the ESDocumentConstants class that contains type of code that can be set + */ + public $codeType = ""; + /** * @var string Either 'N'-No or 'Y'-Yes. If 'Y' then indicates that the alternate code may be used to directly link to the product, download, or labour. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordAsset.php b/src/EcommerceStandardsDocuments/ESDRecordAsset.php new file mode 100644 index 0000000..0ac98bf --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDRecordAsset.php @@ -0,0 +1,178 @@ + \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDRecordAssetComponent.php b/src/EcommerceStandardsDocuments/ESDRecordAssetComponent.php new file mode 100644 index 0000000..b4d3999 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDRecordAssetComponent.php @@ -0,0 +1,43 @@ + + */ + public $keyChildAssetID = ""; + + /** + * @var ESDRecordAttributeValue[] list of attributes and values associated to the child asset for the particular category. + */ + public $attributes = array(); + + /** + * @var int Data Record OPeration. Denotes an operation that may need to be performed on the record when it is being processed. Set null, or set it to one of the ESD_RECORD_OPERATION constants in the ESDocumentConstants class to allow the record to be inserted, updated, deleted, or ignored. + */ + public $drop = ESDocumentConstants::ESD_RECORD_OPERATION_NA; + /** + * @var string Stores an identifier that is relevant only to the system referencing and storing the record for its own needs. + */ + public $internalID = ""; + } +?> \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDRecordAttributeValue.php b/src/EcommerceStandardsDocuments/ESDRecordAttributeValue.php index 817101c..696cd48 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordAttributeValue.php +++ b/src/EcommerceStandardsDocuments/ESDRecordAttributeValue.php @@ -19,7 +19,8 @@ class ESDRecordAttributeValue public $keyProductID = ""; /** - * @var string Key of the download record that the attribute value is set for. + * @deprecated use keyAssetID instead + * @var string Deprecated, use keyAssetID instead. Key of the download record that the attribute value is set for. */ public $keyDownloadID = ""; @@ -28,6 +29,11 @@ class ESDRecordAttributeValue */ public $keyLabourID = ""; + /** + * @var string Key of the asset record that the attribute value is set for. + */ + public $keyAssetID = ""; + /** * @var string Key of the location record that the attribute value is set for. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordCategory.php b/src/EcommerceStandardsDocuments/ESDRecordCategory.php index ebd5dbd..0cc1414 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCategory.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCategory.php @@ -95,10 +95,16 @@ class ESDRecordCategory public $keyProductIDs = array(); /** + * @deprecated use keyAssetIDs instead * @var string[] List of Key Download IDs, that link any number of Download records to the category. */ public $keyDownloadIDs = array(); + /** + * @var string[] List of Key Asset IDs, that link any number of Asset records to the category. + */ + public $keyAssetIDs = array(); + /** * @var string[] List of Key Labour IDs, that link any number of Labour records to the category. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordCategoryTree.php b/src/EcommerceStandardsDocuments/ESDRecordCategoryTree.php index 3a56f9c..3156d49 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCategoryTree.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCategoryTree.php @@ -38,6 +38,11 @@ class ESDRecordCategoryTree */ public $ordering = 0; + /** + * @var string Either 'N'-No or 'Y'-Yes. If 'Y' then indicates that the category tree is used for navigation of maker/model data, and grouping of products assigned to each model through the tree's catgories. + */ + public $isMakerModelCategoryTree = ""; + /** * @var int Data Record OPeration. Denotes an operation that may need to be performed on the record when it is being processed. * Set null, or set it to one of the ESD_RECORD_OPERATION constants in the ESDocumentConstants class to allow the record to be inserted, updated, deleted, or ignored. diff --git a/src/EcommerceStandardsDocuments/ESDRecordContact.php b/src/EcommerceStandardsDocuments/ESDRecordContact.php new file mode 100644 index 0000000..c05ab8f --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDRecordContact.php @@ -0,0 +1,132 @@ + \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrder.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrder.php index c208b75..56322aa 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrder.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrder.php @@ -152,6 +152,11 @@ class ESDRecordCustomerAccountEnquiryBackOrder * @var string Post code of the address that the ordered goods are being delivered to */ public $deliveryPostcode = ""; + + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; /** * @var string Name of the contact person associated to the billing address set for the order. diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrderLine.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrderLine.php index b38a343..3fc6254 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrderLine.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryBackOrderLine.php @@ -67,6 +67,11 @@ class ESDRecordCustomerAccountEnquiryBackOrderLine * @var double Quantity back ordered for the line. */ public $quantityBackordered = 0.0; + + /** + * @var double Quantity available to fulfill on the quantity ordered line. This may be used to calculate a percentage of the line ordered in the line that is now available since the back order was first raised. + */ + public $quantityAvailable = 0.0; /** * @var double monetary price for a single unit excluding tax amount. diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryCredit.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryCredit.php index a06c602..3b7fb51 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryCredit.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryCredit.php @@ -152,6 +152,11 @@ class ESDRecordCustomerAccountEnquiryCredit * @var string Post code at the delivery address. */ public $deliveryPostcode = ""; + + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; /** * @var string Name of the contact person at the address associated with the billing of the credit. diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryInvoice.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryInvoice.php index e6637ce..f886056 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryInvoice.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryInvoice.php @@ -162,6 +162,11 @@ class ESDRecordCustomerAccountEnquiryInvoice * @var string Post code of the address that the invoiced goods are being delivered to */ public $deliveryPostcode = ""; + + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; /** * @var string Name of the contact person at the address associated with the billing of the invoice. diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryOrderSale.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryOrderSale.php index f8b47de..f0ec842 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryOrderSale.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryOrderSale.php @@ -134,6 +134,10 @@ class ESDRecordCustomerAccountEnquiryOrderSale */ public $deliveryPostcode = ""; /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; + /** * @var string Name of the contact person at the address associated with the billing of the order. */ public $billingContact = ""; diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryQuote.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryQuote.php index cbb6e7b..56f1055 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryQuote.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerAccountEnquiryQuote.php @@ -130,6 +130,10 @@ class ESDRecordCustomerAccountEnquiryPayment */ public $deliveryPostcode = ""; /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; + /** * @var string Name of the contact person at the address associated with the billing of the quote. */ public $billingContact = ""; diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoice.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoice.php index a0dd239..3dc6fd5 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoice.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoice.php @@ -323,6 +323,11 @@ class ESDRecordCustomerInvoice */ public $deliveryCountryCodeISO3 = ""; + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; + /** * @var string Description of the address associated with the billing of the invoice. */ @@ -951,6 +956,11 @@ public function setDefaultValuesForNullMembers() { $this->deliveryCountryCodeISO3 = ""; } + + if ($deliveryPurchaseOrderCode == null) + { + $this->deliveryPurchaseOrderCode = ""; + } if ($billingDescription == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoiceLine.php b/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoiceLine.php index 43e4835..865a1e3 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoiceLine.php +++ b/src/EcommerceStandardsDocuments/ESDRecordCustomerInvoiceLine.php @@ -325,40 +325,83 @@ class ESDRecordCustomerInvoiceLine public $weightUnitMeasureCode = ""; /** + * @deprecated * @var string Key of the download record associated to the line. Only relevent when the lineType has been to download */ public $keyDownloadID = ""; /** + * @deprecated * @var string Code the download in the line. */ public $downloadCode = ""; /** + * @deprecated * @var string name the download in the line. */ public $downloadName = ""; /** + * @deprecated * @var string description the download in the line. */ public $downloadDescription = ""; /** + * @deprecated * @var string code of the download in the customer's supplier invoice, that stores the code of the customer's download */ public $supplierInvoiceDownloadCode = ""; /** + * @deprecated * @var string code of the download in the supplier's sales order, that stores the code of the supplier's download originally ordered */ public $salesOrderDownloadCode = ""; /** + * @deprecated * @var string code of the download in the customer's purchase order, that stores the code of the customer's download originally ordered */ public $purchaseOrderDownloadCode = ""; + // asset fields + /** + * @var string Key of the asset record associated to the line. Only relevent when the lineType has been set to asset + */ + public $keyAssetID = ""; + + /** + * @var string Code the asset in the line. + */ + public $assetCode = ""; + + /** + * @var string name the asset in the line. + */ + public $assetName = ""; + + /** + * @var string description the asset in the line. + */ + public $assetDescription = ""; + + /** + * @var string code of the asset in the customer's supplier invoice, that stores the code of the customer's asset + */ + public $supplierInvoiceAssetCode = ""; + + /** + * @var string code of the asset in the purchase order associated to the sales order + */ + public $salesOrderAssetCode = ""; + + /** + * @var string code of the asset in the customer's purchase order, that stores the code of the customer's asset originally ordered + */ + public $purchaseOrderAssetCode = ""; + /** * @var string Key of the labour record associated to the line. Only relevent when the lineType has been to labour */ @@ -636,6 +679,41 @@ public function setDefaultValuesForNullMembers() { $this->purchaseOrderDownloadCode = ""; } + + if ($assetCode == null) + { + $this->assetCode = ""; + } + + if ($keyAssetID == null) + { + $this->keyAssetID = ""; + } + + if ($assetName == null) + { + $this->assetName = ""; + } + + if ($assetDescription == null) + { + $this->assetDescription = ""; + } + + if ($supplierInvoiceAssetCode == null) + { + $this->supplierInvoiceAssetCode = ""; + } + + if ($salesOrderAssetCode == null) + { + $this->salesOrderAssetCode = ""; + } + + if ($purchaseOrderAssetCode == null) + { + $this->purchaseOrderAssetCode = ""; + } if ($labourCode == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordImage.php b/src/EcommerceStandardsDocuments/ESDRecordImage.php index 44294a4..69b1054 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordImage.php +++ b/src/EcommerceStandardsDocuments/ESDRecordImage.php @@ -24,10 +24,16 @@ class ESDRecordImage public $keyProductID = ""; /** + * @deprecated use keyAssetID instead * @var string Key of the download record that the image is set for. */ public $keyDownloadID = ""; + /** + * @var string Key of the asset record + */ + public $keyAssetID = ""; + /** * @var string Key of the labour record that the image is set for. */ @@ -46,8 +52,8 @@ class ESDRecordImage /** * @var string Key of the maker/manufacturer model record that the image is set for. */ - public $keyMakerModelID = ""; + /** * @var string Key of the maker/manufacturer that creates or assembles models and products that the image is set for. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordItemRelation.php b/src/EcommerceStandardsDocuments/ESDRecordItemRelation.php new file mode 100644 index 0000000..3c83899 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDRecordItemRelation.php @@ -0,0 +1,70 @@ + \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDRecordMakerModelMapping.php b/src/EcommerceStandardsDocuments/ESDRecordMakerModelMapping.php index ca0d5cc..bc43afd 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordMakerModelMapping.php +++ b/src/EcommerceStandardsDocuments/ESDRecordMakerModelMapping.php @@ -29,14 +29,20 @@ class ESDRecordMakerModelMapping public $keyProductID = ""; /** - * @var string Key of the Labour record that the flag is assigned to. + * @var string Key of the Labour record that the maker model mapping is assigned to. */ public $keyLabourID = ""; /** - * @var string Key of the Download record that the flag is assigned to. + * @deprecated use keyAssetID instead + * @var string Key of the Download record that the maker model mapping is assigned to. */ public $keyDownloadID = ""; + + /** + * @var string Key of the Asset record that the maker model mapping is assigned to. + */ + public $keyAssetID = ""; /** * @var double Quantity of the product assigned to the model for the given category. The default is 1 if the quantity has not been set. diff --git a/src/EcommerceStandardsDocuments/ESDRecordOrderPurchase.php b/src/EcommerceStandardsDocuments/ESDRecordOrderPurchase.php index baeac5c..09cbcda 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordOrderPurchase.php +++ b/src/EcommerceStandardsDocuments/ESDRecordOrderPurchase.php @@ -360,6 +360,11 @@ class ESDRecordOrderPurchase extends ESDocument implements \JsonSerializable * @var string Code of the country at the address that the ordered goods are being delivered to as a 3 digit code by ISO standards. */ public $deliveryCountryCodeISO3 = ""; + + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; /** * @var string Description of the address associated with the billing of the order. @@ -698,6 +703,7 @@ public function jsonSerialize() 'deliveryCountryName' => $this->deliveryCountryName, 'deliveryCountryCodeISO2' => $this->deliveryCountryCodeISO2, 'deliveryCountryCodeISO3' => $this->deliveryCountryCodeISO3, + 'deliveryPurchaseOrderCode' => $this->deliveryPurchaseOrderCode, 'billingDescription' => $this->billingDescription, 'billingContact' => $this->billingContact, 'billingOrgName' => $this->billingOrgName, diff --git a/src/EcommerceStandardsDocuments/ESDRecordOrderPurchaseLine.php b/src/EcommerceStandardsDocuments/ESDRecordOrderPurchaseLine.php index f0bd908..6968ae8 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordOrderPurchaseLine.php +++ b/src/EcommerceStandardsDocuments/ESDRecordOrderPurchaseLine.php @@ -279,29 +279,60 @@ class ESDRecordOrderPurchaseLine implements \JsonSerializable public $weightUnitMeasureCode = ""; /** + * @deprecated * @var string Key of the download record associated to the line. Only relevent when the lineType has been to download */ public $keyDownloadID = ""; /** + * @deprecated * @var string Code the download in the line. */ public $downloadCode = ""; /** + * @deprecated * @var string name the download in the line. */ public $downloadName = ""; /** + * @deprecated * @var string description the download in the line. */ public $downloadDescription = ""; /** + * @deprecated * @var string code of the download in the purchase order associated to the sales order */ public $salesOrderDownloadCode = ""; + + // asset fields + /** + * @var string Key of the asset record associated to the line. Only relevent when the lineType has been set to asset + */ + public $keyAssetID = ""; + + /** + * @var string Code the asset in the line. + */ + public $assetCode = ""; + + /** + * @var string name the asset in the line. + */ + public $assetName = ""; + + /** + * @var string the asset in the line. + */ + public $assetDescription = ""; + + /** + * @var string code of the asset in the purchase order associated to the sales order + */ + public $salesOrderAssetCode = ""; /** * @var string Key of the labour record associated to the line. Only relevent when the lineType has been to labour @@ -630,6 +661,31 @@ public function defaultValuesForNullMembers() { $this->salesOrderDownloadCode = ""; } + + if ($assetCode == null) + { + $this->assetCode = ""; + } + + if ($keyAssetID == null) + { + $this->keyAssetID = ""; + } + + if ($assetName == null) + { + $this->assetName = ""; + } + + if ($assetDescription == null) + { + $this->assetDescription = ""; + } + + if ($salesOrderAssetCode == null) + { + $this->salesOrderAssetCode = ""; + } if ($this->labourCode == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordOrderSale.php b/src/EcommerceStandardsDocuments/ESDRecordOrderSale.php index 24aef40..7f13a52 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordOrderSale.php +++ b/src/EcommerceStandardsDocuments/ESDRecordOrderSale.php @@ -326,6 +326,11 @@ class ESDRecordOrderSale */ public $deliveryAddress3 = ""; + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; + /** * @var string Post code of the address that the ordered goods are being delivered to */ @@ -798,6 +803,11 @@ public function defaultValuesForNullMembers() { $this->deliveryCountryCodeISO3 = ""; } + + if ($deliveryPurchaseOrderCode == null) + { + $this->deliveryPurchaseOrderCode = ""; + } if ($salesOrderCode == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordOrderSaleLine.php b/src/EcommerceStandardsDocuments/ESDRecordOrderSaleLine.php index 6fa3476..b6bad24 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordOrderSaleLine.php +++ b/src/EcommerceStandardsDocuments/ESDRecordOrderSaleLine.php @@ -280,30 +280,61 @@ class ESDRecordOrderSaleLine public $weightUnitMeasureCode = ""; /** + * @deprecated * @var string Key of the download record associated to the line. Only relevent when the lineType has been to download */ public $keyDownloadID = ""; /** + * @deprecated * @var string Code the download in the line. */ public $downloadCode = ""; /** + * @deprecated * @var string name the download in the line. */ public $downloadName = ""; /** + * @deprecated * @var string description the download in the line. */ public $downloadDescription = ""; /** + * @deprecated * @var string code of the download in the purchase order associated to the sales order */ public $purchaseOrderDownloadCode = ""; + // asset fields + /** + * @var string Key of the asset record associated to the line. Only relevent when the lineType has been set to asset + */ + public $keyAssetID = ""; + + /** + * @var string Code the asset in the line. + */ + public $assetCode = ""; + + /** + * @var string name the asset in the line. + */ + public $assetName = ""; + + /** + * @var string the asset in the line. + */ + public $assetDescription = ""; + + /** + * @var string code of the asset in the purchase order associated to the sales order + */ + public $purchaseOrderAssetCode = ""; + /** * @var string Key of the labour record associated to the line. Only relevent when the lineType has been to labour */ @@ -584,6 +615,31 @@ public function setDefaultValuesForNullMembers() { $this->purchaseOrderDownloadCode = ""; } + + if ($assetCode == null) + { + $this->assetCode = ""; + } + + if ($keyAssetID == null) + { + $this->keyAssetID = ""; + } + + if ($assetName == null) + { + $this->assetName = ""; + } + + if ($assetDescription == null) + { + $this->assetDescription = ""; + } + + if ($purchaseOrderAssetCode == null) + { + $this->purchaseOrderAssetCode = ""; + } if ($this->keyLabourID == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordPrice.php b/src/EcommerceStandardsDocuments/ESDRecordPrice.php index cbeec1f..9b138ac 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordPrice.php +++ b/src/EcommerceStandardsDocuments/ESDRecordPrice.php @@ -35,10 +35,16 @@ class ESDRecordPrice public $keyProductID = ""; /** + * @deprecated use keyAssetID instead * @var string Key of the download record that links the price to a download */ public $keyDownloadID = ""; + /** + * @var string Key of the asset record that links the price to the asset + */ + public $keyAssetID = ""; + /** * @var string Key of the labour record that links the price to labour */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordProduct.php b/src/EcommerceStandardsDocuments/ESDRecordProduct.php index 807c7e1..c8e6aab 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordProduct.php +++ b/src/EcommerceStandardsDocuments/ESDRecordProduct.php @@ -74,6 +74,21 @@ class ESDRecordProduct */ public $description4 = ""; + /** + * @var string Meta title of the product. This would typically be used in the meta data of a web page or user interface that may be hidden from being viewed, but contains a label of the product that systems could utilise or be displayed in an application's header. The data in this field is typically targeted for online search engines. + */ + public $metaTitle = ""; + + /** + * @var string A list of words that describe the product. This would typically be used in the meta data of a web page or user interface that may be hidden from being viewed, but contains a space delimited list of keywords used by systems to index and allow for searching on the product. The data in this field is typically targeted for online search engines. + */ + public $metaKeywords = ""; + + /** + * @var string Meta description the product. This would typically be used in the meta data of a web page or user interface that may be hidden from being viewed, but contains a paragraph of text describing the details of a product that may be used to index, or display in search listings. The data in this field is typically targeted for online search engines. + */ + public $metaDescription = ""; + /** * @var string Class of the product. A class may contain any text that can be set for multiple products as a classifier of the type of product. */ @@ -170,20 +185,25 @@ class ESDRecordProduct public $deliveryTimeInStock = ""; /** - * @var double The amount of product units that are in stock and available for purchase. + * @var double The amount of base product units that are in stock and available for purchase. */ public $stockQuantity = 0.0; /** - * @var double The amount of product units that indicate when the product is no longer in stock. + * @var double The amount of base product units that indicate when the product is no longer in stock. */ public $stockNoneQuantity = 0.0; /** - * @var double The amount of product units that indicate when the product is low in stock. + * @var double The amount of base product units that indicate when the product is low in stock. */ public $stockLowQuantity = 0.0; + /** + * @var int Date time that indicates when the product's stock units has been available or in-stock since. If the product currently has no stock available then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockAvailableSinceDate = 0; + /** * @var string Either 'N'-No or 'Y'-Yes. If 'Y' then indicates that any pricing set for the product is inclusive of tax applied to the price, based the rate of taxcode assigned to the product. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordProductCombination.php b/src/EcommerceStandardsDocuments/ESDRecordProductCombination.php index 0763593..7e8d47a 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordProductCombination.php +++ b/src/EcommerceStandardsDocuments/ESDRecordProductCombination.php @@ -39,7 +39,7 @@ class ESDRecordProductCombination public $drop = ESDocumentConstants::ESD_RECORD_OPERATION_NA; /** - * @var string[][] List of combination field and values that maps the product to the combination. Each record in the array, contains a 2 dimensional array containing pairs of keyComboProfileFieldID, and keyComboProfileFieldValueID + * @var string[][] List of combination field and values that maps the product to the combination. Each inner array must be 2 items in size, with the first item storing the keyComboProfileFieldID, and the 2nd the fieldValueID. It's the collection of different fields and values assigned to the child product that allows it to be separately be found, from other child products assigned to the same parent product. */ public $fieldValueCombinations = array(); } diff --git a/src/EcommerceStandardsDocuments/ESDRecordStockQuantity.php b/src/EcommerceStandardsDocuments/ESDRecordStockQuantity.php index 326da49..adbf663 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordStockQuantity.php +++ b/src/EcommerceStandardsDocuments/ESDRecordStockQuantity.php @@ -29,40 +29,70 @@ class ESDRecordStockQuantity public $keyLabourID = ""; /** - * @var double Unit quantity of stock available to be purchased + * @var double Base unit quantity of stock available to be purchased */ public $qtyAvailable = 0.0; /** - * @var double Unit quantity of stock on hand at its location + * @var double Base unit quantity of stock on hand at its location */ public $qtyOnHand = 0.0; /** - * @var double Unit quantity of stock that has been ordered by a purchaser + * @var double Base unit quantity of stock that has been ordered by a purchaser */ public $qtyOrdered = 0.0; /** - * @var double Unit quantity of stock that is the maximum amount that can be ordered by a purchaser + * @var double Base unit quantity of stock that is the maximum amount that can be ordered by a purchaser */ public $qtyOrderable = 0.0; /** - * @var double Unit quantity of stock that has been back ordered from a supplier + * @var double Base unit quantity of stock that has been back ordered from a supplier */ public $qtyBackordered = 0.0; /** - * @var double Unit quantity of stock that has been reserved for given purchasers + * @var double Base unit quantity of stock that has been reserved for given purchasers */ public $qtyReserved = 0.0; /** - * @var double Unit quantity of stock that has been placed at an external location (consigned) + * @var double Base unit quantity of stock that has been placed at an external location (consigned) */ public $qtyConsigned = 0.0; + /** + * @var int Date time that indicates when the product's stock has been available or in-stock since. If the product currently has no stock available then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockAvailableSinceDate = 0; + + /** + * @var int Date time that indicates when the product's stock has been on hand at its location since. If the product currently has no stock on hand then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockOnHandSinceDate = 0; + + /** + * @var int Date time that indicates when the product's stock has been on order by purchaser(s) since. If the product currently has no stock on order then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockOrderedSinceDate = 0; + + /** + * @var int Date time that indicates when the product's stock has been on back order from supplier(s). If the product currently has no stock on back order then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockBackorderedSinceDate = 0; + + /** + * @var int Date time that indicates when the product's stock has been reserved by purchaser(s). If the product currently has no stock reserved then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockReservedSinceDate = 0; + + /** + * @var int Date time that indicates when the product's stock has been on consignment for. If the product currently has no stock consigned then ignore setting. Date is in the form of a number in milliseconds since the 01-01-1970 12:00am Epoch in UTC time-zone + */ + public $stockConsignedSinceDate = 0; + /** * @var int Data Record OPeration. Denotes an operation that may need to be performed on the record when it is being processed. Set null, or set it to one of the ESD_RECORD_OPERATION constants in the ESDocumentConstants class to allow the record to be inserted, updated, deleted, or ignored. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordSupplierAccountEnquiryOrderPurchase.php b/src/EcommerceStandardsDocuments/ESDRecordSupplierAccountEnquiryOrderPurchase.php index 4fcae7e..7d89bcf 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordSupplierAccountEnquiryOrderPurchase.php +++ b/src/EcommerceStandardsDocuments/ESDRecordSupplierAccountEnquiryOrderPurchase.php @@ -158,6 +158,11 @@ class ESDRecordSupplierAccountEnquiryOrderPurchase */ public $deliveryPostcode = ""; + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; + /** * @var string Name of the contact person at the address associated with the billing of the purchase order. */ diff --git a/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoice.php b/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoice.php index 217bdb9..80c667a 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoice.php +++ b/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoice.php @@ -333,6 +333,11 @@ class ESDRecordSupplierInvoice */ public $deliveryCountryCodeISO3 = ""; + /** + * @var string Code of the purchase order to include in the delivery information, that is contains the code of the purchase order associated to the delivery of the goods + */ + public $deliveryPurchaseOrderCode = ""; + /** * @var string Description of the address associated with the billing of the invoice. */ @@ -975,6 +980,11 @@ public function setDefaultValuesForNullMembers() { $this->deliveryCountryCodeISO3 = ""; } + + if ($deliveryPurchaseOrderCode == null) + { + $this->deliveryPurchaseOrderCode = ""; + } if ($billingDescription == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoiceLine.php b/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoiceLine.php index 6c521e6..526179c 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoiceLine.php +++ b/src/EcommerceStandardsDocuments/ESDRecordSupplierInvoiceLine.php @@ -327,16 +327,19 @@ class ESDRecordSupplierInvoiceLine public $keyDownloadID = ""; /** + * @deprecated * @var string Code the download in the line. */ public $downloadCode = ""; /** + * @deprecated * @var string name the download in the line. */ public $downloadName = ""; /** + * @deprecated * @var string description the download in the line. */ public $downloadDescription = ""; @@ -347,15 +350,53 @@ class ESDRecordSupplierInvoiceLine public $customerInvoiceDownloadCode = ""; /** + * @deprecated * @var string code of the download in the supplier's sales order, that stores the code of the supplier's download originally ordered */ public $salesOrderDownloadCode = ""; /** + * @deprecated * @var string code of the download in the customer's purchase order, that stores the code of the customer's download originally ordered */ public $purchaseOrderDownloadCode = ""; + // asset fields + /** + * @var string Key of the asset record associated to the line. Only relevent when the lineType has been set to asset + */ + public $keyAssetID = ""; + + /** + * @var string Code the asset in the line. + */ + public $assetCode = ""; + + /** + * @var string name the asset in the line. + */ + public $assetName = ""; + + /** + * @var string the asset in the line. + */ + public $assetDescription = ""; + + /** + * @var string code of the asset in the supplier's customer invoice, that stores the code of the customer's asset + */ + public $customerInvoiceAssetCode = ""; + + /** + * @var string code of the asset in the purchase order associated to the sales order + */ + public $salesOrderAssetCode = ""; + + /** + * @var string code of the asset in the customer's purchase order, that stores the code of the customer's asset originally ordered + */ + public $purchaseOrderAssetCode = ""; + /** * @var string Key of the labour record associated to the line. Only relevent when the lineType has been to labour */ @@ -633,6 +674,41 @@ public function setDefaultValuesForNullMembers() { $this->purchaseOrderDownloadCode = ""; } + + if ($assetCode == null) + { + $this->assetCode = ""; + } + + if ($keyAssetID == null) + { + $this->keyAssetID = ""; + } + + if ($assetName == null) + { + $this->assetName = ""; + } + + if ($assetDescription == null) + { + $this->assetDescription = ""; + } + + if ($customerInvoiceAssetCode == null) + { + $this->customerInvoiceAssetCode = ""; + } + + if ($salesOrderAssetCode == null) + { + $this->salesOrderAssetCode = ""; + } + + if ($purchaseOrderAssetCode == null) + { + $this->purchaseOrderAssetCode = ""; + } if ($labourCode == null) { diff --git a/src/EcommerceStandardsDocuments/ESDRecordType.php b/src/EcommerceStandardsDocuments/ESDRecordType.php index ab7489a..933c2c8 100644 --- a/src/EcommerceStandardsDocuments/ESDRecordType.php +++ b/src/EcommerceStandardsDocuments/ESDRecordType.php @@ -14,6 +14,7 @@ class ESDRecordType { const ALTERNATE_CODE = 1; + const ASSET = 80; const ATTACHMENT = 2; const ATTRIBUTE = 3; const ATTRIBUTE_PROFILE = 4; diff --git a/src/EcommerceStandardsDocuments/ESDocumentAlternateCode.php b/src/EcommerceStandardsDocuments/ESDocumentAlternateCode.php index 1015d7f..5dd07fe 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentAlternateCode.php +++ b/src/EcommerceStandardsDocuments/ESDocumentAlternateCode.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The product alternate code data has been successfully obtained.", * "configs":{"dataFields":"keyProductID,alternateCode,isUseCode,isSupplierCode"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentAsset.php b/src/EcommerceStandardsDocuments/ESDocumentAsset.php new file mode 100644 index 0000000..c3bbe32 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDocumentAsset.php @@ -0,0 +1,119 @@ +resultStatus = $resultStatus; + $this->message = $message; + $this->dataRecords = $assetRecords; + $this->configs = $configs; + if ($assetRecords != null) + { + $this->totalDataRecords = count($assetRecords); + } + } + + /** + * serializes the class's properties into JSON, orders properties and filters properties with default values from being returned. + */ + public function jsonSerialize() + { + return array_filter([ + 'version' => $this->version, + 'resultStatus' => $this->resultStatus, + 'message' => $this->message, + 'dataTransferMode' => $this->dataTransferMode, + 'totalDataRecords' => $this->totalDataRecords, + 'configs' => $this->configs, + 'dataRecords' => array_filter($this->dataRecords) + ]); + } + } +?> diff --git a/src/EcommerceStandardsDocuments/ESDocumentAssetComponent.php b/src/EcommerceStandardsDocuments/ESDocumentAssetComponent.php new file mode 100644 index 0000000..ddaa894 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDocumentAssetComponent.php @@ -0,0 +1,93 @@ +resultStatus = $resultStatus; + $this->message = $message; + $this->dataRecords = $assetRecords; + $this->configs = $configs; + if ($assetRecords != null) + { + $this->totalDataRecords = count($assetRecords); + } + } + + /** + * serializes the class's properties into JSON, orders properties and filters properties with default values from being returned. + */ + public function jsonSerialize() + { + return array_filter([ + 'version' => $this->version, + 'resultStatus' => $this->resultStatus, + 'message' => $this->message, + 'dataTransferMode' => $this->dataTransferMode, + 'totalDataRecords' => $this->totalDataRecords, + 'configs' => $this->configs, + 'dataRecords' => array_filter($this->dataRecords) + ]); + } + } +?> diff --git a/src/EcommerceStandardsDocuments/ESDocumentAttachment.php b/src/EcommerceStandardsDocuments/ESDocumentAttachment.php index b67b7f1..6fa9006 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentAttachment.php +++ b/src/EcommerceStandardsDocuments/ESDocumentAttachment.php @@ -14,7 +14,7 @@ * * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The product attachment data has been successfully obtained.", * "configs":{"dataFields":"keyProductAttachmentID,keyProductID,fileName,fileExtension,fullFilePath"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentAttribute.php b/src/EcommerceStandardsDocuments/ESDocumentAttribute.php index 567fed6..6464f67 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentAttribute.php +++ b/src/EcommerceStandardsDocuments/ESDocumentAttribute.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "dataTransferMode": "COMPLETE", * "totalDataRecords": 4, diff --git a/src/EcommerceStandardsDocuments/ESDocumentCategory.php b/src/EcommerceStandardsDocuments/ESDocumentCategory.php index a5402c6..7c143cb 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCategory.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCategory.php @@ -13,7 +13,7 @@ * An example of the Category Ecommerce Standards document in its JSON serialised form * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The category data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentConstants.php b/src/EcommerceStandardsDocuments/ESDocumentConstants.php index b189c2d..8fc97a9 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentConstants.php +++ b/src/EcommerceStandardsDocuments/ESDocumentConstants.php @@ -21,7 +21,7 @@ class ESDocumentConstants */ const RESULT_ERROR = 2; /** - * result status denoting that an unknown error occurred when trying to obtain/process data + * result status denoting that an unknown or unspecified type of error occurred when trying to obtain/process data */ const RESULT_ERROR_UNKNOWN = 3; /** @@ -119,7 +119,7 @@ class ESDocumentConstants /** * Contains the version that the Ecommerce Standards Documents library is currently at. */ - const ESD_DOCUMENT_VERSION = 1.4; + const ESD_DOCUMENT_VERSION = 1.5; /** * Denotes that the location is a warehouse */ @@ -189,10 +189,15 @@ class ESDocumentConstants */ const ORDER_LINE_TYPE_PRODUCT = "PRODUCT"; /** - * Order Line Type - Download + * @deprecated + * Order Line Type - Download - deprecated, please use ORDER_LINE_TYPE_ASSET instead. */ const ORDER_LINE_TYPE_DOWNLOAD = "DOWNLOAD"; /** + * Order Line Type - Asset + */ + const ORDER_LINE_TYPE_ASSET = "ASSET"; + /** * Order Line Type - Labour */ const ORDER_LINE_TYPE_LABOUR = "LABOUR"; @@ -205,10 +210,15 @@ class ESDocumentConstants */ const INVOICE_LINE_TYPE_PRODUCT = "PRODUCT"; /** - * Invoice Line Type - Download + * @deprecated + * Invoice Line Type - Download - deprecated, please use INVOICE_LINE_TYPE_ASSET instead. */ const INVOICE_LINE_TYPE_DOWNLOAD = "DOWNLOAD"; /** + * Invoice Line Type - Asset - indicates that a asset has been sold or purchased within an invoice line. + */ + const INVOICE_LINE_TYPE_ASSET = "ASSET"; + /** * Invoice Line Type - Labour */ const INVOICE_LINE_TYPE_LABOUR = "LABOUR"; @@ -257,10 +267,14 @@ class ESDocumentConstants */ const PAYMENT_METHOD_UNPAID = "UNPAID"; /** - * Payment method - CREDIT - A payment was made with a credit card + * Deprecated. Payment method - CREDIT - A payment was made with a credit card. Use PAYMENT_METHOD_CREDITCARD variable instead. */ const PAYMENT_METHOD_CREDIT = "CREDITCARD"; /** + * Payment method - CREDITCARD - A payment was made with a credit card + */ + const PAYMENT_METHOD_CREDITCARD = "CREDITCARD"; + /** * Payment method - COD - Payment will be made with cash when the goods are delivered to the delivery location */ const PAYMENT_METHOD_CASHONDELIVERY = "COD"; @@ -730,5 +744,70 @@ class ESDocumentConstants * Unit Of Measure - Volume - Gallon. United States liquid unit. */ const UNIT_MEASURE_VOLUME_LIQUID_US_GALLON = "USGAL"; + + /** + * Alternate Code Type - GTIN-14 - Global Trade Item Number 14 digits long, may also be known as a barcode in the EAN/UCC-14, SCC-14, DUN-14,[3] UPC Case Code, UPC Shipping Container Code standards + */ + const ALTERNATE_CODE_TYPE_GTIN_14 = "GTIN_14"; + /** + * Alternate Code Type - GTIN-13 - Global Trade Item Number 13 digits long, may also be known as a barcode in the EAN, EAN·UCC-13, JAN standards + */ + const ALTERNATE_CODE_TYPE_GTIN_13 = "GTIN_13"; + /** + * Alternate Code Type - GTIN-12 - Global Trade Item Number 12 digits long, may also be known as a barcode in the EAN·UCC-12, UCC-12 standards + */ + const ALTERNATE_CODE_TYPE_GTIN_12 = "GTIN_12"; + /** + * Alternate Code Type - GTIN-8 - Global Trade Item Number 8 digits long, may also be known as a barcode in the EAN/UCC-8 standards + */ + const ALTERNATE_CODE_TYPE_GTIN_8 = "GTIN_8"; + /** + * Alternate Code Type - GS1-128 - GS1-128 barcode standard up to 48 characters long + */ + const ALTERNATE_CODE_TYPE_GS1_128 = "GS1_128"; + /** + * Alternate Code Type - MPM - Manufacturer Part Number + */ + const ALTERNATE_CODE_TYPE_MPN = "MPN"; + /** + * Alternate Code Type - UPC-A - Universal Product Code - version A - 12 digit barcode + */ + const ALTERNATE_CODE_TYPE_UPC_A = "UPC_A"; + /** + * Alternate Code Type - UPC-E - Universal Product Code - version E - 8 digit barcode + */ + const ALTERNATE_CODE_TYPE_UPC_E = "UPC_E"; + /** + * Alternate Code Type - ISBN - International Standard Book Number, a 9, 10 (ISO 2108) or 14 digit code issued by the International ISBN Agency + */ + const ALTERNATE_CODE_TYPE_ISBN = "ISBN"; + /** + * Alternate Code Type - ISMN - International Standard Music Number, 13 digit number defined by the ISO 10957 standard + */ + const ALTERNATE_CODE_TYPE_ISMN = "ISMN"; + /** + * Alternate Code Type - EAN-13 - Europlean Artical Number, 13 digit number derived by GS1 + */ + const ALTERNATE_CODE_TYPE_EAN_13 = "EAN_13"; + /** + * Alternate Code Type - EAN-8 - Europlean Artical Number, 8 digit number derived by GS1 + */ + const ALTERNATE_CODE_TYPE_EAN_8 = "EAN_8"; + /** + * Alternate Code Type - EAN-5 - Europlean Artical Number, 5 digit number derived by GS1 + */ + const ALTERNATE_CODE_TYPE_EAN_5 = "EAN_5"; + /** + * Alternate Code Type - EAN-2 - Europlean Artical Number, 2 digit number derived by GS1 + */ + const ALTERNATE_CODE_TYPE_EAN_2 = "EAN_2"; + /** + * Alternate Code Type - SUPC - Supplier Product Code - code of a supplier's product + */ + const ALTERNATE_CODE_SUPPLIER_PRODUCT_CDOE = "SUPC"; + /** + * Alternate Code Type - CUPC - Customer Product Code - code of a customer's product + */ + const ALTERNATE_CODE_CUSTOMER_PRODUCT_CDOE = "CUPC"; } ?> \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDocumentCurrencyExchangeRate.php b/src/EcommerceStandardsDocuments/ESDocumentCurrencyExchangeRate.php index 53150cc..3cf0a6d 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCurrencyExchangeRate.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCurrencyExchangeRate.php @@ -14,7 +14,7 @@ * * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The currency exchange rate data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccount.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccount.php index 1ac686e..e7378ae 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccount.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccount.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The customer account data has been successfully obtained.", * "configs":{"dataFields":"keyCustomerAccountID,keyPriceLevelID,customerAccountCode,accountName,contactName,orgName,authorityNumbers,authorityNumberLabels,authorityNumberTypes,email,accountClass,paymentTypes,territory,discount,shippingMethod,isOnHold,isOutsideBalance,isOutsideTerms,onHoldAction,outTermsAction,outCreditAction,balance,limit,termsType,termsDescription,termsValue1,termsValue2"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountAddress.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountAddress.php index 2475eb3..6bc1d31 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountAddress.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountAddress.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The customer account address data has been successfully obtained.", * "configs":{"dataFields":"keyAddressID,keyCustomerAccountID,description,orgName,contact,phone,fax,address1,address2,address3,region,country,postcode,freightCode,isPrimary,isDelivery"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContact.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContact.php new file mode 100644 index 0000000..c8e1fa4 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContact.php @@ -0,0 +1,94 @@ +resultStatus = $resultStatus; + $this->message = $message; + $this->dataRecords = $contactRecords; + $this->configs = $configs; + if ($contactRecords != null) + { + $this->totalDataRecords = count($contactRecords); + } + } + + /** + * serializes the class's properties into JSON, orders properties and filters properties with default values from being returned. + */ + public function jsonSerialize() + { + return array_filter([ + 'version' => $this->version, + 'resultStatus' => $this->resultStatus, + 'message' => $this->message, + 'dataTransferMode' => $this->dataTransferMode, + 'totalDataRecords' => $this->totalDataRecords, + 'configs' => $this->configs, + 'dataRecords' => array_filter($this->dataRecords) + ]); + } + } +?> \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContract.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContract.php index c14113b..507bce4 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContract.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountContract.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The customer account contract data has been successfully obtained.", * "configs":{"dataFields":"keyContractID,contractCode,description,forceContractPrice,type,expireDate"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiry.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiry.php index b54136f..39b304f 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiry.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiry.php @@ -14,7 +14,7 @@ * *@code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry transaction data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -109,7 +109,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, displaying a list of invoices for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry invoice data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -204,7 +204,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, containing the detail of a single invoice for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry invoice detail data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -323,7 +323,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, displaying a list of sales orders for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry sales order data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -418,7 +418,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, containing the detail of a single sales order for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry sales order detail data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -537,7 +537,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, displaying a list of credits for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry credit data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -602,7 +602,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, containing the detail of a single credit for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry credit detail data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -684,7 +684,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, displaying a list of payments for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry payment data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -724,7 +724,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, containing the detail of a single payment for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry payment detail data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -776,7 +776,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, displaying a list of back orders for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry back order data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -861,7 +861,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, containing the detail of a single back order for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry back order detail data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -971,7 +971,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, displaying a list of quotes for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry quote data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -1065,7 +1065,7 @@ * An example of the Customer Account Enqury Standards document in its JSON serialised form, containing the detail of a single quote for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry quote detail data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiryLine.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiryLine.php index 97c2972..489c33d 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiryLine.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountEnquiryLine.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry invoice line data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -61,7 +61,7 @@ * An example of the Customer Account Enqury Line Standards document in its JSON serialised form, displaying a list of sales order lines for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The customer account enquiry sales order line data has been successfully obtained.", * "configs":{}, @@ -107,7 +107,7 @@ * An example of the Customer Account Enqury Line Standards document in its JSON serialised form, displaying a list of credit lines for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry credit line data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -144,7 +144,7 @@ * * An example of the Customer Account Enqury Line Standards document in its JSON serialised form, displaying a list of payment lines for a customer account * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry payment line data has been successfully obtained.", * "dataTransferMode": "COMPLETE", @@ -174,7 +174,7 @@ * An example of the Customer Account Enqury Line Standards document in its JSON serialised form, displaying a list of back order lines for a customer account * * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account enquiry back order line data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountPayment.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountPayment.php index faafdc2..a5b6981 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountPayment.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerAccountPayment.php @@ -14,7 +14,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account payment data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentCustomerInvoice.php b/src/EcommerceStandardsDocuments/ESDocumentCustomerInvoice.php index 2ae367e..0497cbb 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentCustomerInvoice.php +++ b/src/EcommerceStandardsDocuments/ESDocumentCustomerInvoice.php @@ -20,7 +20,7 @@ * "message": "The customer invoice data has been successfully obtained.", * "configs": {}, * "dataTransferMode": "COMPLETE", - * "version": 1.4, + * "version": 1.5, * "totalDataRecords": 2, * "dataRecords": [{ * "keyCustomerInvoiceID": "123" diff --git a/src/EcommerceStandardsDocuments/ESDocumentDeliveryNotice.php b/src/EcommerceStandardsDocuments/ESDocumentDeliveryNotice.php index 904350d..54a1a1d 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentDeliveryNotice.php +++ b/src/EcommerceStandardsDocuments/ESDocumentDeliveryNotice.php @@ -18,7 +18,7 @@ * "message": "The delivery notice data has been successfully obtained.", * "configs": {}, * "dataTransferMode": "COMPLETE", - * "version": 1.4, + * "version": 1.5, * "totalDataRecords": 2, * "dataRecords": [{ * "keyDeliveryNoticeID": "123" diff --git a/src/EcommerceStandardsDocuments/ESDocumentFlag.php b/src/EcommerceStandardsDocuments/ESDocumentFlag.php index 39c6a5d..caf9733 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentFlag.php +++ b/src/EcommerceStandardsDocuments/ESDocumentFlag.php @@ -15,7 +15,7 @@ * * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The flag data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentGeneralLedgerAccount.php b/src/EcommerceStandardsDocuments/ESDocumentGeneralLedgerAccount.php index e781cb4..e2c2b6d 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentGeneralLedgerAccount.php +++ b/src/EcommerceStandardsDocuments/ESDocumentGeneralLedgerAccount.php @@ -15,7 +15,7 @@ * * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The general ledger account data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentImage.php b/src/EcommerceStandardsDocuments/ESDocumentImage.php index d8665cd..fb0fda2 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentImage.php +++ b/src/EcommerceStandardsDocuments/ESDocumentImage.php @@ -14,7 +14,7 @@ * *@code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The product image data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentItemRelation.php b/src/EcommerceStandardsDocuments/ESDocumentItemRelation.php new file mode 100644 index 0000000..b81291c --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDocumentItemRelation.php @@ -0,0 +1,91 @@ +resultStatus = $resultStatus; + $this->message = $message; + $this->dataRecords = $itemRelationRecords; + $this->configs = $configs; + if ($itemRelationRecords != null) + { + $this->totalDataRecords = count($itemRelationRecords); + } + } + + /** + * serializes the class's properties into JSON, orders properties and filters properties with default values from being returned. + */ + public function jsonSerialize() + { + return array_filter([ + 'version' => $this->version, + 'resultStatus' => $this->resultStatus, + 'message' => $this->message, + 'dataTransferMode' => $this->dataTransferMode, + 'totalDataRecords' => $this->totalDataRecords, + 'configs' => $this->configs, + 'dataRecords' => array_filter($this->dataRecords) + ]); + } + } +?> \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDocumentLocation.php b/src/EcommerceStandardsDocuments/ESDocumentLocation.php index 0619667..4256e57 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentLocation.php +++ b/src/EcommerceStandardsDocuments/ESDocumentLocation.php @@ -10,7 +10,7 @@ /** *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The location data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentLocationContact.php b/src/EcommerceStandardsDocuments/ESDocumentLocationContact.php new file mode 100644 index 0000000..3c72728 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDocumentLocationContact.php @@ -0,0 +1,94 @@ +resultStatus = $resultStatus; + $this->message = $message; + $this->dataRecords = $contactRecords; + $this->configs = $configs; + if ($contactRecords != null) + { + $this->totalDataRecords = count($contactRecords); + } + } + + /** + * serializes the class's properties into JSON, orders properties and filters properties with default values from being returned. + */ + public function jsonSerialize() + { + return array_filter([ + 'version' => $this->version, + 'resultStatus' => $this->resultStatus, + 'message' => $this->message, + 'dataTransferMode' => $this->dataTransferMode, + 'totalDataRecords' => $this->totalDataRecords, + 'configs' => $this->configs, + 'dataRecords' => array_filter($this->dataRecords) + ]); + } + } +?> \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDocumentMaker.php b/src/EcommerceStandardsDocuments/ESDocumentMaker.php index 2bfe926..fee7634 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentMaker.php +++ b/src/EcommerceStandardsDocuments/ESDocumentMaker.php @@ -14,7 +14,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The maker data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentOrderSale.php b/src/EcommerceStandardsDocuments/ESDocumentOrderSale.php index bf26dc3..4eab02c 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentOrderSale.php +++ b/src/EcommerceStandardsDocuments/ESDocumentOrderSale.php @@ -16,7 +16,7 @@ * * @code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The sales order data has been successfully obtained.", * "configs":{}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentPaymentType.php b/src/EcommerceStandardsDocuments/ESDocumentPaymentType.php index 532a344..bf43865 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentPaymentType.php +++ b/src/EcommerceStandardsDocuments/ESDocumentPaymentType.php @@ -14,7 +14,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The payment type data has been successfully obtained.", * "configs":{"dataFields":"keyPaymentTypeID,paymentTypeCode,paymentTypeLabel,description,paymentMethod"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentPrice.php b/src/EcommerceStandardsDocuments/ESDocumentPrice.php index 4d88ed7..e524a77 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentPrice.php +++ b/src/EcommerceStandardsDocuments/ESDocumentPrice.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The product price-level pricing data has been successfully obtained.", * "configs":{"dataFields":"keyProductID,keyPriceLevelID,keySellUnitID,price"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentPriceLevel.php b/src/EcommerceStandardsDocuments/ESDocumentPriceLevel.php index 4cf4db3..1adb8b5 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentPriceLevel.php +++ b/src/EcommerceStandardsDocuments/ESDocumentPriceLevel.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The price level data has been successfully obtained.", * "configs":{"dataFields":"keyPriceLevelID,label"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentProduct.php b/src/EcommerceStandardsDocuments/ESDocumentProduct.php index c2c930e..3b0f1f0 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentProduct.php +++ b/src/EcommerceStandardsDocuments/ESDocumentProduct.php @@ -14,7 +14,7 @@ * An example of the Product Ecommerce Standards document in its JSON serialised form * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The product data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentProductCombination.php b/src/EcommerceStandardsDocuments/ESDocumentProductCombination.php index 29bf592..54fc7f9 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentProductCombination.php +++ b/src/EcommerceStandardsDocuments/ESDocumentProductCombination.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The product combination data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentPurchaser.php b/src/EcommerceStandardsDocuments/ESDocumentPurchaser.php index 6765bfa..d152161 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentPurchaser.php +++ b/src/EcommerceStandardsDocuments/ESDocumentPurchaser.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The purchaser data has been successfully obtained.", * "configs":{"dataFields":"keyPurchaserID,purchaserCode,contact,isIndividual"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentSalesRep.php b/src/EcommerceStandardsDocuments/ESDocumentSalesRep.php index 8aa20c6..8dc7211 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSalesRep.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSalesRep.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The sales representative data has been successfully obtained.", * "configs":{"dataFields":"keySalesRepID,name,salesRepCode,contact,isIndividual"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentSellUnit.php b/src/EcommerceStandardsDocuments/ESDocumentSellUnit.php index c18e4fa..79f5680 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSellUnit.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSellUnit.php @@ -16,7 +16,7 @@ * * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The sell unit data has been successfully obtained.", * "configs":{"dataFields":"keySellUnitID,sellUnitCode,sellUnitLabel,isBaseUnit,baseQuantity,parentQuantity,keySellUnitParentID"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentStockQuantity.php b/src/EcommerceStandardsDocuments/ESDocumentStockQuantity.php index 9eb5b69..91866b7 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentStockQuantity.php +++ b/src/EcommerceStandardsDocuments/ESDocumentStockQuantity.php @@ -14,7 +14,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The product stock quantity data has been successfully obtained.", * "configs":{"dataFields":"keyProductID,qtyAvailable,qtyOnHand,qtyOrdered,qtyOrdered,qtyBackordered,qtyReserved,qtyConsigned"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccount.php b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccount.php index ef45998..d1a607a 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccount.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccount.php @@ -15,7 +15,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The supplier account data has been successfully obtained.", * "configs":{"dataFields":"keySupplierAccountID,keyPriceLevelID,supplierAccountCode,accountName,contactName,orgName,authorityNumbers,authorityNumberLabels,authorityNumberTypes,email,accountClass,paymentTypes,territory,shippingMethod,isOnHold,isOutsideBalance,isOutsideTerms,balance,limit,termsType,termsDescription,termsValue1,termsValue2"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountAddress.php b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountAddress.php index 89b1ddd..46f8fcd 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountAddress.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountAddress.php @@ -14,7 +14,7 @@ * * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The customer account address data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountContact.php b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountContact.php new file mode 100644 index 0000000..76a7b26 --- /dev/null +++ b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountContact.php @@ -0,0 +1,94 @@ +resultStatus = $resultStatus; + $this->message = $message; + $this->dataRecords = $contactRecords; + $this->configs = $configs; + if ($contactRecords != null) + { + $this->totalDataRecords = count($contactRecords); + } + } + + /** + * serializes the class's properties into JSON, orders properties and filters properties with default values from being returned. + */ + public function jsonSerialize() + { + return array_filter([ + 'version' => $this->version, + 'resultStatus' => $this->resultStatus, + 'message' => $this->message, + 'dataTransferMode' => $this->dataTransferMode, + 'totalDataRecords' => $this->totalDataRecords, + 'configs' => $this->configs, + 'dataRecords' => array_filter($this->dataRecords) + ]); + } + } +?> \ No newline at end of file diff --git a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountEnquiry.php b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountEnquiry.php index 825f750..d75bc04 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountEnquiry.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSupplierAccountEnquiry.php @@ -13,7 +13,7 @@ * An example of the Supplier Account Enqury Standards document in its JSON serialised form, displaying a list of purchase orders for a supplier account * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": 1, * "message":"The supplier account enquiry purchase order data has been successfully obtained.", * "dataTransferMode": "COMPLETE", diff --git a/src/EcommerceStandardsDocuments/ESDocumentSupplierInvoice.php b/src/EcommerceStandardsDocuments/ESDocumentSupplierInvoice.php index 585f75c..f89b7a1 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSupplierInvoice.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSupplierInvoice.php @@ -14,7 +14,7 @@ * An example of the Supplier Invoice Ecommerce Standards document in its JSON serialised form * @code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus": "1", * "message": "The supplier invoice data has been successfully obtained.", * "configs": {}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentSurcharge.php b/src/EcommerceStandardsDocuments/ESDocumentSurcharge.php index e16c84f..1395cbd 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentSurcharge.php +++ b/src/EcommerceStandardsDocuments/ESDocumentSurcharge.php @@ -14,7 +14,7 @@ * *@code *{ - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The surcharge data has been successfully obtained.", * "configs":{"dataFields":"keySurchargeID,surchargeCode,surchargeLabel,description,surchargeType"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentTaxcode.php b/src/EcommerceStandardsDocuments/ESDocumentTaxcode.php index f187de1..a9de54e 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentTaxcode.php +++ b/src/EcommerceStandardsDocuments/ESDocumentTaxcode.php @@ -14,7 +14,7 @@ * *@code * { - * "version": 1.4, + * "version": 1.5, * "resultStatus":"1", * "message":"The taxcode data has been successfully obtained.", * "configs":{"dataFields":"keyTaxcodeID,taxcode,taxcodeLabel,description,taxcodePercentageRate"}, diff --git a/src/EcommerceStandardsDocuments/ESDocumentType.php b/src/EcommerceStandardsDocuments/ESDocumentType.php index 2b14670..9a4aa74 100644 --- a/src/EcommerceStandardsDocuments/ESDocumentType.php +++ b/src/EcommerceStandardsDocuments/ESDocumentType.php @@ -14,12 +14,15 @@ class ESDocumentType { const ALTERNATE_CODE = 9; + const ASSET = 50; + const ASSET_COMPONENT = 51; const ATTACHMENT = 13; const ATTRIBUTE = 11; const CATEGORY = 8; const CURRENCY_EXCHANGE_RATE = 43; const CUSTOMER_ACCOUNT = 17; const CUSTOMER_ACCOUNT_ADDRESS = 20; + const CUSTOMER_ACCOUNT_CONTACT = 47; const CUSTOMER_ACCOUNT_CONTRACT = 19; const CUSTOMER_ACCOUNT_ENQUIRY = 29; const CUSTOMER_ACCOUNT_ENQUIRY_LINE = 30; @@ -29,12 +32,17 @@ class ESDocumentType const DELIVERY_NOTICE = 42; const DOWNLOAD = 33; const FLAG = 21; + const GENERAL_LEDGER_ACCOUNT = 43; const IMAGE = 12; const ITEM_GROUP = 34; const ITEM_RELATION = 14; const KIT = 22; const LABOUR = 35; const LOCATION = 23; + const LOCATION_CONTACT = 49; + const MAKER = 44; + const MAKER_MODEL = 45; + const MAKER_MODEL_MAPPING = 46; const ORDER_PURCHASE = 24; const ORDER_SALE = 36; const PAYMENT_TYPE = 27; @@ -48,6 +56,7 @@ class ESDocumentType const STOCK_QUANTITY = 10; const SUPPLIER_ACCOUNT = 18; const SUPPLIER_ACCOUNT_ADDRESS = 38; + const SUPPLIER_ACCOUNT_CONTACT = 48; const SUPPLIER_ACCOUNT_ENQUIRY = 39; const SUPPLIER_INVOICE = 40; const SURCHARGE = 26;