From: <ex...@us...> - 2017-06-19 04:21:30
|
Revision: 7783 http://sourceforge.net/p/web-erp/reponame/7783 Author: exsonqu Date: 2017-06-19 04:21:27 +0000 (Mon, 19 Jun 2017) Log Message: ----------- 19/06/17 Exson: Make these classes defined php 7 compliant and keep php4 backwards compatibility. Modified Paths: -------------- trunk/includes/DefineCartClass.php trunk/includes/DefineContractClass.php trunk/includes/DefineCustAllocsClass.php trunk/includes/DefineImportBankTransClass.php trunk/includes/DefineJournalClass.php trunk/includes/DefineOfferClass.php trunk/includes/DefinePOClass.php trunk/includes/DefinePaymentClass.php trunk/includes/DefineReceiptClass.php trunk/includes/DefineSerialItems.php trunk/includes/DefineShiptClass.php trunk/includes/DefineSpecialOrderClass.php trunk/includes/DefineStockAdjustment.php trunk/includes/DefineStockRequestClass.php trunk/includes/DefineStockTransfers.php trunk/includes/DefineSuppAllocsClass.php trunk/includes/DefineSuppTransClass.php trunk/includes/DefineTenderClass.php Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineCartClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -62,7 +62,7 @@ var $BuyerName; var $SpecialInstructions; - function Cart(){ + function __construct(){ /*Constructor function initialises a new shopping cart */ $this->LineItems = array(); $this->total=0; @@ -74,6 +74,10 @@ $this->CurrDecimalPlaces=2; //default } + function cart() { + self::__construct(); + } + function add_to_cart($StockID, $Qty, $Descr, @@ -445,7 +449,7 @@ Var $NextSerialNo; Var $GPPercent; - function LineDetails ($LineNumber, + function __construct ($LineNumber, $StockItem, $Descr, $LongDescr, @@ -518,6 +522,60 @@ } } //end constructor function for LineDetails + function LineDetails($LineNumber, + $StockItem, + $Descr, + $LongDescr, + $Qty, + $Prc, + $DiscPercent, + $UOM, + $Volume, + $Weight, + $QOHatLoc, + $MBflag, + $ActDispatchDate, + $QtyInvoiced, + $DiscCat, + $Controlled, + $Serialised, + $DecimalPlaces, + $Narrative, + $TaxCategory, + $ItemDue, + $POLine, + $StandardCost, + $EOQ, + $NextSerialNo, + $ExRate ) { + self::__construct($LineNumber, + $StockItem, + $Descr, + $LongDescr, + $Qty, + $Prc, + $DiscPercent, + $UOM, + $Volume, + $Weight, + $QOHatLoc, + $MBflag, + $ActDispatchDate, + $QtyInvoiced, + $DiscCat, + $Controlled, + $Serialised, + $DecimalPlaces, + $Narrative, + $TaxCategory, + $ItemDue, + $POLine, + $StandardCost, + $EOQ, + $NextSerialNo, + $ExRate ); + } + } Class Tax { @@ -528,7 +586,7 @@ Var $TaxOnTax; var $TaxGLCode; - function Tax ($TaxCalculationOrder, + function __construct ($TaxCalculationOrder, $TaxAuthID, $TaxAuthDescription, $TaxRate, @@ -542,6 +600,20 @@ $this->TaxOnTax = $TaxOnTax; $this->TaxGLCode = $TaxGLCode; } + function Tax ($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode) { + + self::__construct($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineContractClass.php =================================================================== --- trunk/includes/DefineContractClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineContractClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -28,7 +28,7 @@ var $ContractBOM; /*array of stockid components required for the contract */ var $ContractReqts; /*array of other items required for the contract */ - function Contract(){ + function __construct(){ /*Constructor function initialises a new Payment batch */ $this->ContractBOM = array(); $this->ContractReqts = array(); @@ -36,6 +36,10 @@ $this->RequirementsCounter=0; $this->Status = 0; } + + function Contract() { + self::__construct; + } function Add_To_ContractBOM($StockID, $ItemDescription, @@ -102,7 +106,7 @@ var $UOM; var $DecimalPlaces; - function ContractComponent ($ComponentID, + function __construct ($ComponentID, $StockID, $ItemDescription, $WorkCentre, @@ -121,6 +125,24 @@ $this->UOM = $UOM; $this->DecimalPlaces = $DecimalPlaces; } + function ContractComponent($ComponentID, + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0){ + + self::__construct($ComponentID, + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0); + } } Class ContractRequirement { @@ -130,7 +152,7 @@ var $Quantity; var $CostPerUnit; - function ContractRequirement ($Requirement, + function __construct ($Requirement, $Quantity, $CostPerUnit, $ContractReqID=0){ @@ -141,5 +163,14 @@ $this->CostPerUnit = $CostPerUnit; $this->ContractReqID = $ContractReqID; } + function ContractRequirement ($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0){ + self::__construct ($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineCustAllocsClass.php =================================================================== --- trunk/includes/DefineCustAllocsClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineCustAllocsClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -17,11 +17,15 @@ var $PrevDiffOnExch; /*The difference on exchange before this allocation */ var $CurrDecimalPlaces; - function Allocation(){ + function __construct(){ /*Constructor function initialises a new debtor allocation*/ $this->Allocs = array(); } + function Allocation(){ + self::__construct; + } + function add_to_AllocsAllocn ($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ // if ($AllocAmt <= ($TransAmount - $PrevAlloc)){ @@ -56,7 +60,7 @@ THERE CAN BE ONLY ONE ... allocation record for each receipt/inovice combination */ - function Allocn ($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + function __construct ($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ /* Constructor function to add a new Allocn object with passed params */ $this->ID =$ID; @@ -72,6 +76,10 @@ $this->PrevAlloc = $PrevAlloc; $this->PrevAllocRecordID= $PrevAllocRecordID; } + function Allocn($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + self::__construct($ID, $TransType, $TypeNo, $TransDate, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID); + } + } ?> Modified: trunk/includes/DefineImportBankTransClass.php =================================================================== --- trunk/includes/DefineImportBankTransClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineImportBankTransClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -18,7 +18,7 @@ var $ExchangeRate; var $Trans; - function BankStatement () { + function __construct () { $this->ReportCreated = ''; $this->AccountNumber = ''; $this->AccountName = ''; @@ -32,6 +32,9 @@ $this->CurrDecimalPlaces = 2; $this->ExchangeRate = 1; } + function BankStatement() { + self::__construct(); + } } class BankTrans { @@ -46,7 +49,7 @@ var $GLItemID; var $GLTotal; - function BankTrans ($ValueDate, $Amount) { + function __construct ($ValueDate, $Amount) { $this->ValueDate = $ValueDate; $this->Amount = $Amount; $this->GLEntries = array(); @@ -56,6 +59,9 @@ $this->GLTotal = 0; $this->BankTransID = 0; } + function BankTrans($ValueDate, $Amount) { + self::__construct(($ValueDate, $Amount); + } function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, $GLAccountName, $Tag){ if (isset($GLCode) AND $Amount!=0){ @@ -85,7 +91,7 @@ Var $ID; var $Tag; - function GLAnalysis ($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){ + function __construct ($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){ /* Constructor function to add a new JournalGLAnalysis object with passed params */ $this->Amount =$Amount; @@ -95,6 +101,9 @@ $this->ID = $ID; $this->Tag = $Tag; } + function GLAnalysis($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){ + self::__construct($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag); + } } ?> Modified: trunk/includes/DefineJournalClass.php =================================================================== --- trunk/includes/DefineJournalClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineJournalClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -13,7 +13,7 @@ var $BankAccounts; /*Array of bank account GLCodes that must be posted to by a bank payment or receipt to ensure integrity for matching off vs bank stmts */ - function Journal(){ + function __construct(){ /*Constructor function initialises a new journal */ $this->GLEntries = array(); $this->GLItemCounter=0; @@ -21,6 +21,9 @@ $this->GLItemID=0; $this->BankAccounts = array(); } + function Journal() { + self::__construct(); + } function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, $GLActName, $tag, $assetid=1){ if (isset($GLCode) AND $Amount!=0){ @@ -52,7 +55,7 @@ var $tag; var $assetid; - function JournalGLAnalysis ($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid){ + function __construct ($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid){ /* Constructor function to add a new JournalGLAnalysis object with passed params */ $this->Amount =$Amt; @@ -63,6 +66,10 @@ $this->tag = $tag; $this->assetid = $assetid; } + function JournalGLAnalysis($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid){ + self::__construct($Amt, $Narr, $id, $GLCode, $GLActName, $tag, $assetid); + + } } ?> Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineOfferClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -17,7 +17,7 @@ var $version; var $OfferMailText; - function Offer($Supplier){ + function __construct($Supplier){ /*Constructor function initialises a new purchase offer object */ global $db; $this->LineItems = array(); @@ -35,6 +35,9 @@ $this->EmailAddress = $myrow['email']; $this->CurrCode = $myrow['currcode']; } + function Offer ($Supplier) { + self::__construct($Supplier); + } function add_to_offer( $LineNo, $StockID, @@ -198,7 +201,7 @@ var $Deleted; var $ExpiryDate; - function LineDetails ($LineNo, + function __construct ($LineNo, $StockItem, $Qty, $ItemDescr, @@ -218,6 +221,23 @@ $this->ExpiryDate = $ExpiryDate; $this->Deleted = False; } + function LineDetails($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate) { + self::__construct($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate); + } } ?> Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefinePOClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -50,7 +50,7 @@ var $Contact; var $Port; - function PurchOrder(){ + function __construct(){ /*Constructor function initialises a new purchase order object */ $this->LineItems = array(); $this->total=0; @@ -57,6 +57,10 @@ $this->LinesOnOrder=0; } + function PurchOrder() { + self::__construct(); + } + function add_to_order($LineNo, $StockID, $Serialised, @@ -234,7 +238,7 @@ Var $SerialItems; /*An array holding the batch/serial numbers and quantities in each batch*/ Var $AssetID; - function LineDetails ( $LineNo, + function __construct ( $LineNo, $StockItem, $Serialised, $Controlled, @@ -291,5 +295,50 @@ $this->AssetID = $AssetID; } + function LineDetails($LineNo, + $StockItem, + $Serialised, + $Controlled, + $Qty, + $ItemDescr, + $Price, + $UOM, + $GLCode, + $ReqDelDate, + $ShiptRef =0, + $Completed, + $JobRef, + $QtyInv, + $QtyRecd, + $GLActName, + $DecimalPlaces, + $SuppliersUnit, + $ConversionFactor, + $LeadTime, + $Suppliers_PartNo, + $AssetID) { + self::__construct($LineNo, + $StockItem, + $Serialised, + $Controlled, + $Qty, + $ItemDescr, + $Price, + $UOM, + $GLCode, + $ReqDelDate, + $ShiptRef =0, + $Completed, + $JobRef, + $QtyInv, + $QtyRecd, + $GLActName, + $DecimalPlaces, + $SuppliersUnit, + $ConversionFactor, + $LeadTime, + $Suppliers_PartNo, + $AssetID); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefinePaymentClass.php =================================================================== --- trunk/includes/DefinePaymentClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefinePaymentClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -26,7 +26,7 @@ var $Narrative; var $GLItemCounter; /*Counter for the number of GL accounts being posted to by the Payment */ - function Payment(){ + function __construct(){ /*Constructor function initialises a new Payment batch */ $this->GLItems = array(); $this->GLItemCounter=0; @@ -41,6 +41,10 @@ } + function Payment() { + self::__construct; + } + function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, @@ -79,7 +83,7 @@ var $Tag; var $Cheque; - function PaymentGLAnalysis ($Amt, + function __construct ($Amt, $Narr, $id, $GLCode, @@ -96,6 +100,21 @@ $this->Tag = $Tag; $this->Cheque = $Cheque; } + function PaymentGLAnalysis($Amt, + $Narr, + $id, + $GLCode, + $GLActName, + $Tag, + $Cheque){ + self::__construct($Amt, + $Narr, + $id, + $GLCode, + $GLActName, + $Tag, + $Cheque); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineReceiptClass.php =================================================================== --- trunk/includes/DefineReceiptClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineReceiptClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -20,7 +20,7 @@ var $total; /*Total of the batch of receipts in the currency of the company*/ var $ItemCounter; /*Counter for the number of customer receipts in the batch */ - function Receipt_Batch(){ + function __construct(){ /*Constructor function initialises a new receipt batch */ $this->Items = array(); $this->ItemCounter=0; @@ -27,6 +27,10 @@ $this->total=0; } + function Receipt_Batch() { + self::__construct(); + } + function add_to_batch($Amount, $Customer, $Discount, $Narrative, $GLCode, $PayeeBankDetail, $CustomerName, $tag){ if ((isset($Customer) OR isset($GLCode)) AND ($Amount + $Discount) !=0){ $this->Items[$this->ItemCounter] = new Receipt($Amount, $Customer, $Discount, $Narrative, $this->ItemCounter, $GLCode, $PayeeBankDetail, $CustomerName, $tag); @@ -58,7 +62,7 @@ var $tag; var $TagName; - function Receipt ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ + function __construct ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ global $db; /* Constructor function to add a new Receipt object with passed params */ $this->Amount =$Amt; @@ -76,6 +80,9 @@ $this->TagName = $TagRow['tagdescription']; } } + function Receipt($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ + self::__construct($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag); + } } ?> Modified: trunk/includes/DefineSerialItems.php =================================================================== --- trunk/includes/DefineSerialItems.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSerialItems.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -40,11 +40,17 @@ var $ExpiryDate; //Constructor - function SerialItem($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'){ + function __construct($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'){ $this->BundleRef = $BundleRef; $this->BundleQty = $BundleQty; $this->ExpiryDate = $ExpiryDate; } + + function SerialItem($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'){ + self::__construct($BundleRef, $BundleQty, $ExpiryDate='0000-00-00'); + } + + }//class SerialItem -?> \ No newline at end of file +?> Modified: trunk/includes/DefineShiptClass.php =================================================================== --- trunk/includes/DefineShiptClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineShiptClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -16,7 +16,7 @@ var $Closed; var $CurrDecimalPlaces; - function Shipment(){ + function __construct(){ /*Constructor function initialises a new Shipment object */ $this->LineItems = array(); $this->AccumValue =0; @@ -23,6 +23,10 @@ $this->Closed =0; } + function Shipment() { + self::__construct(); + } + function Add_To_Shipment($PODetailItem, $OrderNo, $StockID, @@ -89,7 +93,7 @@ var $DecimalPlaces; - function LineDetails ($PODetailItem, + function __construct ($PODetailItem, $OrderNo, $StockID, $ItemDescr, @@ -116,6 +120,32 @@ $this->StdCostUnit = $StdCostUnit; $this->DecimalPlaces = $DecimalPlaces; } + + function LineDetails($PODetailItem, + $OrderNo, + $StockID, + $ItemDescr, + $QtyInvoiced, + $UnitPrice, + $UOM, + $DelDate, + $QuantityOrd, + $QuantityRecd, + $StdCostUnit, + $DecimalPlaces=2) { + self::__construct($PODetailItem, + $OrderNo, + $StockID, + $ItemDescr, + $QtyInvoiced, + $UnitPrice, + $UOM, + $DelDate, + $QuantityOrd, + $QuantityRecd, + $StdCostUnit, + $DecimalPlaces=2); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineSpecialOrderClass.php =================================================================== --- trunk/includes/DefineSpecialOrderClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSpecialOrderClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -28,7 +28,7 @@ var $Status; var $AllowPrintPO; - function SpecialOrder(){ + function __construct(){ /*Constructor function initialises a new special order object */ $this->LineItems = array(); $this->total=0; @@ -36,6 +36,10 @@ $this->AllowPrintPO=0; } + function SpecialOrder() { + self::__construct(); + } + function add_to_order($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ if ($Qty!=0 AND isset($Qty)){ $this->LineItems[$LineNo] = new LineDetails($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate); @@ -71,7 +75,7 @@ var $ReqDelDate; var $PartCode; - function LineDetails ($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ + function __construct ($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ /* Constructor function to add a new LineDetail object with passed params */ $this->LineNo = $LineNo; @@ -82,6 +86,11 @@ $this->Cost = $Cost; $this->StkCat = $StkCat; } + + function LineDetails ($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate){ + self::__construct($LineNo, $Qty, $ItemDescr, $Price, $Cost, $StkCat, $ReqDelDate); + } + } ?> Modified: trunk/includes/DefineStockAdjustment.php =================================================================== --- trunk/includes/DefineStockAdjustment.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineStockAdjustment.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -15,7 +15,7 @@ var $SerialItems; /*array to hold controlled items*/ //Constructor - function StockAdjustment(){ + function __construct(){ $this->StockID = ''; $this->StockLocation = ''; $this->Controlled = ''; @@ -28,5 +28,9 @@ $this->Quantity = 0; $this->tag=0; } + + function StockAdjustment() { + self::__construct(); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineStockRequestClass.php =================================================================== --- trunk/includes/DefineStockRequestClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineStockRequestClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -9,12 +9,16 @@ var $Narrative; var $LineCounter=0; - function StockRequest(){ + function __construct(){ /*Constructor function initialises a new shopping cart */ $this->DispatchDate = date($_SESSION['DefaultDateFormat']); $this->LineItems=array(); } + function StockRequest(){ + self::__construct(); + } + function AddLine($StockID, $ItemDescription, $Quantity, @@ -42,7 +46,7 @@ var $UOM; var $LineNumber; - function LineDetails($StockID, + function __construct($StockID, $ItemDescription, $Quantity, $UOM, @@ -57,6 +61,20 @@ $this->UOM=$UOM; } + function LineDetails($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber) { + self::__construct($StockID, + $ItemDescription, + $Quantity, + $UOM, + $DecimalPlaces, + $LineNumber); + } + } -?> \ No newline at end of file +?> Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineStockTransfers.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -15,7 +15,7 @@ Var $TranDate; Var $TransferItem; /*Array of LineItems */ - function StockTransfer($TrfID, + function __construct($TrfID, $StockLocationFrom, $StockLocationFromName, $StockLocationFromAccount, @@ -34,6 +34,23 @@ $this->TranDate = $TranDate; $this->TransferItem=array(); /*Array of LineItem s */ } + function StockTransfer($TrfID, + $StockLocationFrom, + $StockLocationFromName, + $StockLocationFromAccount, + $StockLocationTo, + $StockLocationToName, + $StockLocationToAccount, + $TranDate ) { + self::__construct($TrfID, + $StockLocationFrom, + $StockLocationFromName, + $StockLocationFromAccount, + $StockLocationTo, + $StockLocationToName, + $StockLocationToAccount, + $TranDate ); + } } class LineItem { @@ -49,7 +66,7 @@ var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor - function LineItem($StockID, + function __construct($StockID, $ItemDescription, $Quantity, $PartUnit, @@ -73,5 +90,23 @@ } $this->SerialItems = array(); } + + function LineItem($StockID, + $ItemDescription, + $Quantity, + $PartUnit, + $Controlled, + $Serialised, + $Perishable, + $DecimalPlaces) { + self::__construct($StockID, + $ItemDescription, + $Quantity, + $PartUnit, + $Controlled, + $Serialised, + $Perishable, + $DecimalPlaces); + } } ?> Modified: trunk/includes/DefineSuppAllocsClass.php =================================================================== --- trunk/includes/DefineSuppAllocsClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSuppAllocsClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -18,11 +18,15 @@ var $PrevDiffOnExch; /*The difference on exchange before this allocation */ var $CurrDecimalPlaces; /*The number of decimal places to display for the currency being allocated */ - function Allocation(){ + function __construct(){ /*Constructor function initialises a new supplier allocation*/ $this->Allocs = array(); } + function Allocation(){ + self::__construct(); + } + function add_to_AllocsAllocn ($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ if ($TransAmount >0){ @@ -59,7 +63,7 @@ THERE CAN BE ONLY ONE ... allocation record for each payment/inovice combination */ - function Allocn ($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + function __construct ($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ /* Constructor function to add a new Allocn object with passed params */ $this->ID = $ID; @@ -76,6 +80,12 @@ $this->PrevAlloc = $PrevAlloc; $this->PrevAllocRecordID= $PrevAllocRecordID; } + + function Allocn($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID){ + + self::__construct($ID, $TransType, $TypeNo, $TransDate, $SuppRef, $AllocAmt, $TransAmount, $ExRate, $DiffOnExch, $PrevDiffOnExch, $PrevAlloc, $PrevAllocRecordID); + + } } ?> Modified: trunk/includes/DefineSuppTransClass.php =================================================================== --- trunk/includes/DefineSuppTransClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineSuppTransClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -38,7 +38,7 @@ var $Hold; var $SupplierRef=''; - function SuppTrans(){ + function __construct(){ /*Constructor function initialises a new Supplier Transaction object */ $this->GRNs = array(); $this->GLCodes = array(); @@ -48,6 +48,10 @@ $this->Taxes = array(); } + function SuppTrans() { + self::__construct(); + } + function GetTaxes () { global $db; @@ -333,7 +337,7 @@ var $GRNBatchNo; var $SupplierRef; - function GRNs ($GRNNo, + function __construct ($GRNNo, $PODetailItem, $ItemCode, $ItemDescription, @@ -379,6 +383,48 @@ $this->SupplierRef = $SupplierRef; } + function GRNs($GRNNo, + $PODetailItem, + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit=0, + $ShiptRef, + $JobRef, + $GLCode, + $PONo, + $AssetID, + $Hold=0, + $DecimalPlaces=2, + $GRNBatchNo, + $SupplierRef=''){ + self::__construct($GRNNo, + $PODetailItem, + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit=0, + $ShiptRef, + $JobRef, + $GLCode, + $PONo, + $AssetID, + $Hold=0, + $DecimalPlaces=2, + $GRNBatchNo, + $SupplierRef=''); + } + function Modify ($PODetailItem, $ItemCode, $ItemDescription, @@ -424,7 +470,7 @@ Var $Tag; Var $TagName; - function GLCodes ($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''){ + function __construct($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''){ global $db; /* Constructor function to add a new GLCodes object with passed params */ @@ -443,6 +489,12 @@ $this->TagName=$TagMyrow['tagdescription']; } } + + function GLCodes($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''){ + self::__construct($Counter, $GLCode, $GLActName, $Amount, $Narrative, $Tag=0, $TagName=''); + } + + } Class Shipment { @@ -450,12 +502,16 @@ Var $Counter; Var $ShiptRef; Var $Amount; - - function Shipment ($Counter, $ShiptRef, $Amount){ + + function __construct($Counter, $ShiptRef, $Amount){ $this->Counter = $Counter; $this->ShiptRef = $ShiptRef; $this->Amount = $Amount; } + + function Shipment ($Counter, $ShiptRef, $Amount){ + self::__construct($Counter, $ShiptRef, $Amount); + } } Class Asset { @@ -466,7 +522,7 @@ Var $CostAct; Var $Amount; - function Asset ($Counter, $AssetID, $Amount){ + function __construct($Counter, $AssetID, $Amount){ global $db; $this->Counter = $Counter; $this->AssetID = $AssetID; @@ -481,6 +537,10 @@ $this->Description = $AssetRow['description']; $this->CostAct = $AssetRow['costact']; } + + function Asset ($Counter, $AssetID, $Amount){ + self::__construct($Counter, $AssetID, $Amount); + } } Class Contract { @@ -491,7 +551,7 @@ Var $Narrative; Var $AniticipatedCost; - function Contract ($Counter, $ContractRef, $Amount,$Narrative,$AnticipatedCost){ + function __construct($Counter, $ContractRef, $Amount,$Narrative,$AnticipatedCost){ $this->Counter = $Counter; $this->ContractRef = $ContractRef; $this->Amount = $Amount; @@ -498,6 +558,10 @@ $this->Narrative = $Narrative; $this->AnticipatedCost = $AnticipatedCost; } + + function Contract ($Counter, $ContractRef, $Amount,$Narrative,$AnticipatedCost){ + self::__construct($Counter, $AssetID, $Amount,$Narrative,$AnticipatedCost); + } } @@ -510,7 +574,7 @@ Var $TaxGLCode; Var $TaxOvAmount; - function Tax ($TaxCalculationOrder, + function __construct ($TaxCalculationOrder, $TaxAuthID, $TaxAuthDescription, $TaxRate, @@ -524,5 +588,20 @@ $this->TaxOnTax = $TaxOnTax; $this->TaxGLCode = $TaxGLCode; } + + function Tax ($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode){ + self::__construct($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, + $TaxGLCode); + } + } ?> Modified: trunk/includes/DefineTenderClass.php =================================================================== --- trunk/includes/DefineTenderClass.php 2017-06-19 02:12:21 UTC (rev 7782) +++ trunk/includes/DefineTenderClass.php 2017-06-19 04:21:27 UTC (rev 7783) @@ -30,7 +30,7 @@ var $contact; var $Suppliers; - function tender(){ + function __construct(){ /*Constructor function initialises a new purchase tender object */ $this->LineItems = array(); $this->Suppliers = array(); @@ -38,6 +38,10 @@ $this->SuppliersOnTender=0; } + function Tender(){ + self::__construct(); + } + function EmailSuppliers() { $EmailText= _('This email has been automatically generated by webERP') . "\n"; $EmailText.= _('You are invited to Tender for the following products to be delivered to') . ' ' . $_SESSION['CompanyRecord']['coyname'] . "\n"; @@ -235,7 +239,7 @@ var $Deleted; var $ExpiryDate; - function LineDetails ($LineNo, + function __construct ($LineNo, $StockItem, $Qty, $ItemDescr, @@ -253,6 +257,23 @@ $this->ExpiryDate = $ExpiryDate; $this->Deleted = False; } + + function LineDetails($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $UOM, + $DecimalPlaces, + $ExpiryDate) { + self::__construct($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $UOM, + $DecimalPlaces, + $ExpiryDate); + } + } Class Supplier { @@ -262,7 +283,7 @@ var $EmailAddress; var $Responded; - function Supplier ($SupplierCode, + function __construct ($SupplierCode, $SupplierName, $EmailAddress) { $this->SupplierCode = $SupplierCode; @@ -270,6 +291,16 @@ $this->EmailAddress = $EmailAddress; $this->Responded = 0; } + + function Supplier ($SupplierCode, + $SupplierName, + $EmailAddress) { + self::__construct($SupplierCode, + $SupplierName, + $EmailAddress); + } + + } ?> |