-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added and updated document classes to support version 1.2 of the Ecom…
…merce Standards Documents library
- Loading branch information
Rowan Drew
committed
Nov 26, 2017
1 parent
f6bbfb1
commit 4cf207b
Showing
40 changed files
with
5,531 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
src/EcommerceStandardsDocuments/ESDRecordAccountPaymentSurcharge.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2018 Squizz PTY LTD | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
namespace EcommerceStandardsDocuments; | ||
use EcommerceStandardsDocuments\ESDocumentConstants; | ||
|
||
/** | ||
* Details of a surcharge assigned to an customer/supplier account payment record within a Ecommerce Standards Document | ||
*/ | ||
class ESDRecordAccountPaymentSurcharge | ||
{ | ||
/** | ||
* @var ESDRecordAccountPaymentSurchargeTax[] List of tax records applied to the surcharge. | ||
*/ | ||
public $taxes = array(); | ||
|
||
/** | ||
* @var string Key of the surcharge record that the payment surcharge record is linked to. | ||
*/ | ||
public $keySurchargeID = ""; | ||
|
||
/** | ||
* @var string Code of the surcharge. May or may not be a unique identifier | ||
*/ | ||
public $surchargeCode = ""; | ||
|
||
/** | ||
* @var string Label of the surcharge | ||
*/ | ||
public $surchargeLabel = ""; | ||
|
||
/** | ||
* @var string Text description of the surcharge | ||
*/ | ||
public $surchargeDescription = ""; | ||
|
||
/** | ||
* @var string Language that the descriptive text of the line is set in. Set it to a constant prefixed with LANG_ in the ESDocumentConstants class | ||
*/ | ||
public $language = ""; | ||
|
||
/** | ||
* @var double Monetary price of the surcharge, excluding tax. | ||
*/ | ||
public $priceExTax = 0.0; | ||
|
||
/** | ||
* @var double Monetary price of the surcharge, including tax. | ||
*/ | ||
public $priceIncTax = 0.0; | ||
|
||
/** | ||
* @var double Monetary price of the tax applied to the surcharge | ||
*/ | ||
public $priceTax = 0.0; | ||
|
||
/** | ||
* @var double Monetary price of the surcharge before any discounting was applied, exclusive of tax. | ||
*/ | ||
public $priceUndiscountedExTax = 0.0; | ||
|
||
/** | ||
* @var double Monetary price of the surcharge before any discounting was applied, inclusive of tax. | ||
*/ | ||
public $priceUndiscountedIncTax = 0.0; | ||
|
||
/** | ||
* @var double Monetary price of tax applied the surcharge before any discounting was applied. | ||
*/ | ||
public $priceUndiscountedTax = 0.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. | ||
*/ | ||
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 = ""; | ||
|
||
/** | ||
* sets default values for members that have no values | ||
*/ | ||
public function setDefaultValuesForNullMembers() | ||
{ | ||
if ($this->values== null) | ||
{ | ||
$this->values = array(); | ||
} | ||
else | ||
{ | ||
foreach($this->taxes as &$tax) | ||
{ | ||
$tax->setDefaultValuesForNullMembers(); | ||
} | ||
} | ||
|
||
if ($this->keySurchargeID == null) | ||
{ | ||
$this->keySurchargeID = ""; | ||
} | ||
|
||
if ($this->surchargeCode == null) | ||
{ | ||
$this->surchargeCode = ""; | ||
} | ||
|
||
if ($this->surchargeLabel == null) | ||
{ | ||
$this->surchargeLabel = ""; | ||
} | ||
|
||
if ($this->surchargeDescription == null) | ||
{ | ||
$this->surchargeDescription = ""; | ||
} | ||
|
||
if ($this->surchargeDescription == null) | ||
{ | ||
$this->surchargeDescription = ""; | ||
} | ||
|
||
if ($this->language == null) | ||
{ | ||
$this->language = ""; | ||
} | ||
|
||
if ($this->internalID == null) | ||
{ | ||
$this->internalID = ""; | ||
} | ||
} | ||
} | ||
?> |
98 changes: 98 additions & 0 deletions
98
src/EcommerceStandardsDocuments/ESDRecordAccountPaymentSurchargeTax.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2018 Squizz PTY LTD | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
namespace EcommerceStandardsDocuments; | ||
use EcommerceStandardsDocuments\ESDocumentConstants; | ||
|
||
/** | ||
* Details of a tax assigned to a customer/supplier payment surcharge within a Ecommerce Standards Document | ||
*/ | ||
class ESDRecordAccountPaymentSurchargeTax | ||
{ | ||
/** | ||
* @var string Key of the taxcode record that the payment surcharge tax record is linked to. | ||
*/ | ||
public $keyTaxcodeID = ""; | ||
|
||
/** | ||
* @var string Taxcode. May or may not be a unique identifier | ||
*/ | ||
public $taxcode = ""; | ||
|
||
/** | ||
* @var string Label of the taxcode | ||
*/ | ||
public $taxcodeLabel = ""; | ||
|
||
/** | ||
* @var double Numeric amount as a percentage rate that the taxcode applies to. Eg. if set to 10, then a 10% tax will be applied on top of the account payment surcharge price. | ||
*/ | ||
public $taxRate = 0.0; | ||
|
||
/** | ||
* @var string Language that the descriptive text of the line is set in. Set it to a constant prefixed with LANG_ in the ESDocumentConstants class | ||
*/ | ||
public $language = ""; | ||
|
||
/** | ||
* @var double Number of units that the tax applies to | ||
*/ | ||
public $quantity = 0.0; | ||
|
||
/** | ||
* @var double Monetary amount of tax priced for each unit | ||
*/ | ||
public $priceTax = 0.0; | ||
|
||
/** | ||
* @var double Monetary amount of tax priced for the total quantity of units | ||
*/ | ||
public $priceTotalTax = 0.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. | ||
*/ | ||
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 = ""; | ||
|
||
/** | ||
* sets default values for members that have no values | ||
*/ | ||
public function setDefaultValuesForNullMembers() | ||
{ | ||
if ($this->taxcodeLabel == null) | ||
{ | ||
$this->taxcodeLabel = ""; | ||
} | ||
|
||
if ($this->keyTaxcodeID == null) | ||
{ | ||
$this->keyTaxcodeID = ""; | ||
} | ||
|
||
if ($this->taxcode == null) | ||
{ | ||
$this->taxcode = ""; | ||
} | ||
|
||
if ($this->language == null) | ||
{ | ||
$this->language = ""; | ||
} | ||
|
||
if ($this->internalID == null) | ||
{ | ||
$this->internalID = ""; | ||
} | ||
} | ||
} | ||
?> |
Oops, something went wrong.