This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ex...@us...> - 2015-04-01 10:32:26
|
Revision: 7255 http://sourceforge.net/p/web-erp/reponame/7255 Author: exsonqu Date: 2015-04-01 10:32:19 +0000 (Wed, 01 Apr 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-01 10:31:38 UTC (rev 7254) +++ trunk/doc/Change.log 2015-04-01 10:32:19 UTC (rev 7255) @@ -1,5 +1,6 @@ webERP Change Log +01/04/15 Exson: Fixed comma bug due to locale issue of POReport.php csv file. And add ordered/received quantity field in the report. 01/04/15 Exson: Fixed the bug that when delete one gl item from the payment details, the bank account related setting will disappeared in Payments.php. Reported by Steven. 01/04/15 Thumb: Add a Z_ImportCustbranch.php script to import customer branches. 30/3/15 Vitaly: Get all taxes for the tax group, even if calculationorder is left at default value 0. |
From: <ex...@us...> - 2015-04-01 10:31:40
|
Revision: 7254 http://sourceforge.net/p/web-erp/reponame/7254 Author: exsonqu Date: 2015-04-01 10:31:38 +0000 (Wed, 01 Apr 2015) Log Message: ----------- 01/04/15 Exson: Fixed comma bug due to locale issue of POReport.php csv file. And add ordered/received quantity field in the report. Modified Paths: -------------- trunk/POReport.php Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2015-04-01 09:51:04 UTC (rev 7253) +++ trunk/POReport.php 2015-04-01 10:31:38 UTC (rev 7254) @@ -166,6 +166,7 @@ purchorders.supplierno, purchorders.orddate, purchorderdetails.quantityord, + purchorderdetails.quantityrecd, purchorderdetails.qtyinvoiced, (purchorderdetails.quantityord * purchorderdetails.unitprice) as extprice, (purchorderdetails.quantityord * purchorderdetails.stdcostunit) as extcost, @@ -194,6 +195,7 @@ grns.deliverydate, purchorders.supplierno, purchorders.orddate, + purchorderdetails.quantityord as quantityrecd, grns.qtyrecd as quantityord, grns.quantityinv as qtyinvoiced, (grns.qtyrecd * purchorderdetails.unitprice) as extprice, @@ -541,6 +543,7 @@ <th>' . _('Supplier No') . '</th> <th>' . _('Supplier Name') . '</th> <th>' . _('Order Qty') . '</th> + <th>' . _('Qty Received') . '</th> <th>' . _('Extended Cost') . '</th> <th>' . _('Extended Price') . '</th> <th>' . _('Invoiced Qty') . '</th> @@ -566,6 +569,7 @@ <td>%s</td> <td>%s</td> <td>%s</td> + <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> @@ -581,6 +585,7 @@ $myrow['supplierno'], $myrow['suppname'], locale_number_format($myrow['quantityord'],$myrow['decimalplaces']), + locale_number_format($myrow['quantityrecd'],$myrow['decimalplaces']), locale_number_format($myrow['extcost'],2), locale_number_format($myrow['extprice'],2), locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), @@ -626,6 +631,7 @@ <th>' . _('Order Date') . '</th> <th>' . _('Supplier No') . '</th> <th>' . _('Supplier Name') . '</th> + <th>' . _('Order Qty') . '</th> <th>' . _('Received') . '</th> <th>' . _('Extended Cost') . '</th> <th>' . _('Extended Price') . '</th> @@ -657,6 +663,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> + <td class="number">%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -666,6 +673,7 @@ ConvertSQLDate($myrow['orddate']), $myrow['supplierno'], $myrow['suppname'], + locale_number_format($myrow['quantityrecd'],$myrow['decimalplaces']), locale_number_format($myrow['quantityord'],$myrow['decimalplaces']), locale_number_format($myrow['extcost'],2), locale_number_format($myrow['extprice'],2), @@ -940,6 +948,7 @@ purchorderdetails.deliverydate, purchorders.supplierno, purchorders.orddate, + purchorderdetails.quantityrecd, purchorderdetails.quantityord, purchorderdetails.qtyinvoiced, (purchorderdetails.quantityord * purchorderdetails.unitprice) as extprice, @@ -969,6 +978,7 @@ grns.deliverydate, purchorders.supplierno, purchorders.orddate, + purchorderdetails.quantityord as quantityrecd, grns.qtyrecd as quantityord, grns.quantityinv as qtyinvoiced, (grns.qtyrecd * purchorderdetails.unitprice) as extprice, @@ -1300,13 +1310,14 @@ if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { - fprintf($FileHandle, '"%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s"'."\n", + fprintf($FileHandle, '"%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s"'."\n", _('Order No'), _('Part Number'), _('Order Date'), _('Supplier No'), _('Supplier Name'), _('Order Qty'), + _('Qty Received'), _('Extended Cost'), _('Extended Price'), _('Invoiced Qty'), @@ -1317,13 +1328,14 @@ while ($myrow = DB_fetch_array($result)) { $linectr++; // Detail for both DateType of Order - fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s","%s"'."\n", + fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,%s,"%s","%s","%s"'."\n", $myrow['orderno'], $myrow['itemcode'], ConvertSQLDate($myrow['orddate']), $myrow['supplierno'], $myrow['suppname'], locale_number_format($myrow['quantityord'],$myrow['decimalplaces']), + locale_number_format($myrow['quantityrecd'],$myrow['decimalplaces']), locale_number_format($myrow['extcost'],2), locale_number_format($myrow['extprice'],2), locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), @@ -1343,20 +1355,21 @@ ' ', ' ', ' ', - locale_number_format($TotalQty,2), - locale_number_format($TotalExtCost,2), - locale_number_format($TotalExtPrice,2), - locale_number_format($TotalInvQty,2), + round($TotalQty,2), + round($TotalExtCost,2), + round($TotalExtPrice,2), + round($TotalInvQty,2), ' ', ' '); } else { // Header for Date Type of Delivery Date - fprintf($FileHandle, '"%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s"'."\n", - _('Order No'), - _('Part Number'), + fprintf($FileHandle, '"%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s"'."\n", + _('Order No'), + _('Part Number'), _('Order Date'), _('Supplier No'), _('Supplier Name'), + _('Order Qty'), _('Received'), _('Extended Cost'), _('Extended Price'), @@ -1369,16 +1382,17 @@ $linectr++; // Detail for both DateType of Ship // In sql, had to alias grns.qtyrecd as quantityord so could use same name here - fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s","%s"'."\n", + fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,%s,"%s","%s","%s"'."\n", $myrow['orderno'], $myrow['itemcode'], ConvertSQLDate($myrow['orddate']), $myrow['supplierno'], $myrow['suppname'], - locale_number_format($myrow['quantityord'],$myrow['decimalplaces']), - locale_number_format($myrow['extcost'],2), - locale_number_format($myrow['extprice'],2), - locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), + round($myrow['quantityrecd'],$myrow['decimalplaces']), + round($myrow['quantityord'],$myrow['decimalplaces']), + round($myrow['extcost'],2), + round($myrow['extprice'],2), + round($myrow['qtyinvoiced'],$myrow['decimalplaces']), $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); @@ -1395,10 +1409,10 @@ ' ', ' ', ' ', - locale_number_format($TotalQty,$LastDecimalPlaces), - locale_number_format($TotalExtCost,2), - locale_number_format($TotalExtPrice,2), - locale_number_format($TotalInvQty,$LastDecimalPlaces), + round($TotalQty,$LastDecimalPlaces), + round($TotalExtCost,2), + round($TotalExtPrice,2), + round($TotalInvQty,$LastDecimalPlaces), " ", " "); } @@ -1461,10 +1475,10 @@ fprintf($FileHandle, '"%s","%s",%s,%s,%s,%s,"%s"'."\n", $myrow[$summarytype], $myrow[$description], - locale_number_format($myrow['quantityord'],$myrow['decimalplaces']), - locale_number_format($myrow['extcost'],2), - locale_number_format($myrow['extprice'],2), - locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), + round($myrow['quantityord'],$myrow['decimalplaces']), + round($myrow['extcost'],2), + round($myrow['extprice'],2), + round($myrow['qtyinvoiced'],$myrow['decimalplaces']), $suppname); print '<br/>'; $LastDecimalPlaces = $myrow['decimalplaces']; @@ -1477,10 +1491,10 @@ fprintf($FileHandle, '"%s","%s",%s,%s,%s,%s,"%s"'."\n", 'Totals', _('Lines - ') . $linectr, - locale_number_format($TotalQty,$LastDecimalPlaces), - locale_number_format($TotalExtCost,2), - locale_number_format($TotalExtPrice,2), - locale_number_format($TotalInvQty,$LastDecimalPlaces), + round($TotalQty,$LastDecimalPlaces), + round($TotalExtCost,2), + round($TotalExtPrice,2), + round($TotalInvQty,$LastDecimalPlaces), ' '); } // End of if ($_POST['ReportType'] fclose($FileHandle); |
From: <ex...@us...> - 2015-04-01 09:51:07
|
Revision: 7253 http://sourceforge.net/p/web-erp/reponame/7253 Author: exsonqu Date: 2015-04-01 09:51:04 +0000 (Wed, 01 Apr 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-01 09:50:32 UTC (rev 7252) +++ trunk/doc/Change.log 2015-04-01 09:51:04 UTC (rev 7253) @@ -1,4 +1,6 @@ webERP Change Log + +01/04/15 Exson: Fixed the bug that when delete one gl item from the payment details, the bank account related setting will disappeared in Payments.php. Reported by Steven. 01/04/15 Thumb: Add a Z_ImportCustbranch.php script to import customer branches. 30/3/15 Vitaly: Get all taxes for the tax group, even if calculationorder is left at default value 0. 29/3/15 Phil: Allow dummy/service items to be propogated to CounterLogic POS installs through the api |
From: <ex...@us...> - 2015-04-01 09:50:34
|
Revision: 7252 http://sourceforge.net/p/web-erp/reponame/7252 Author: exsonqu Date: 2015-04-01 09:50:32 +0000 (Wed, 01 Apr 2015) Log Message: ----------- 01/04/15 Exson: Fixed the bug that when delete one gl item from the payment details, the bank account related setting will disappeared in Payments.php. Reported by Steven. Modified Paths: -------------- trunk/Payments.php Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2015-04-01 01:39:31 UTC (rev 7251) +++ trunk/Payments.php 2015-04-01 09:50:32 UTC (rev 7252) @@ -627,6 +627,15 @@ } elseif (isset($_GET['Delete'])){ /* User hit delete the receipt entry from the batch */ $_SESSION['PaymentDetail' . $identifier]->Remove_GLItem($_GET['Delete']); + //recover the bank account relative setting + $_POST['BankAccount'] = $_SESSION['PaymentDetail'.$identifier]->Account; + $_POST['DatePaid'] = $_SESSION['PaymentDetail'.$identifier]->DatePaid; + $_POST['Currency'] = $_SESSION['PaymentDetail'.$identifier]->Currency; + $_POST['ExRate'] = $_SESSION['PaymentDetail'.$identifier]->ExRate; + $_POST['FunctionalExRate'] = $_SESSION['PaymentDetail'.$identifier]->FunctionalExRate; + $_POST['PaymentType'] = $_SESSION['PaymentDetail'.$identifier]->Paymenttype; + $_POST['BankTransRef'] = $_SESSION['PaymentDetail'.$identifier]->BankTransRef; + $_POST['Narrative'] = $_SESSION['PaymentDetail'.$identifier]->Narrative; } elseif (isset($_POST['Process']) AND !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment |
From: <ex...@us...> - 2015-04-01 01:39:38
|
Revision: 7251 http://sourceforge.net/p/web-erp/reponame/7251 Author: exsonqu Date: 2015-04-01 01:39:31 +0000 (Wed, 01 Apr 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-01 01:38:38 UTC (rev 7250) +++ trunk/doc/Change.log 2015-04-01 01:39:31 UTC (rev 7251) @@ -1,5 +1,5 @@ webERP Change Log - +01/04/15 Thumb: Add a Z_ImportCustbranch.php script to import customer branches. 30/3/15 Vitaly: Get all taxes for the tax group, even if calculationorder is left at default value 0. 29/3/15 Phil: Allow dummy/service items to be propogated to CounterLogic POS installs through the api 27/03/15 Exson: Remove redundant code from PrintCustTrans.php. |
From: <ex...@us...> - 2015-04-01 01:38:40
|
Revision: 7250 http://sourceforge.net/p/web-erp/reponame/7250 Author: exsonqu Date: 2015-04-01 01:38:38 +0000 (Wed, 01 Apr 2015) Log Message: ----------- 01/04/15 Thumb: Add a Z_ImportCustbranch.php script to import customer branches. Added Paths: ----------- trunk/Z_ImportCustbranch.php Added: trunk/Z_ImportCustbranch.php =================================================================== --- trunk/Z_ImportCustbranch.php (rev 0) +++ trunk/Z_ImportCustbranch.php 2015-04-01 01:38:38 UTC (rev 7250) @@ -0,0 +1,558 @@ +<?php +/* $Id: Z_ImportCustbranch.php 6068 2015-03-26 16:04:22Z exson $*/ + +include('includes/session.inc'); +$Title = _('Import Debtors And branches'); +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); + +if(!isset($_POST['UpdateIfExists'])) { + $_POST['UpdateIfExists']=0; +}else{ + $_POST['UpdateIfExists']=1; +} + +// If this script is called with a file object, then the file contents are imported +// If this script is called with the gettemplate flag, then a template file is served +// Otherwise, a file upload form is displayed +$FieldHeadings = array( + 'branchcode',//0 + 'debtorno',//1 + 'brname',//2 + 'braddress1',//3 + 'braddress2',//4 + 'braddress3',//5 + 'braddress4',//6 + 'braddress5',//7 + 'braddress6',//8 + 'lat',//9 + 'lng',//10 + 'estdeliverydays',//11 + 'area',//12 + 'salesman',//13 + 'fwddate',//14 + 'phoneno',//15 + 'faxno',//16 + 'contactname',//17 + 'email',//18 + 'defaultlocation',//19 + 'taxgroupid',//20 + 'defaultshipvia',//21 + 'deliverblind',//22 + 'disabletrans',//23 + 'brpostaddr1',//24 + 'brpostaddr2',//25 + 'brpostaddr3',//26 + 'brpostaddr4',//27 + 'brpostaddr5',//28 + 'specialinstructions',//29 + 'custbranchcode',//30 +); + +if (isset($_FILES['userfile']) and $_FILES['userfile']['name']) { //start file processing + + //initialize + $FieldTarget = count($FieldHeadings); + $InputError = 0; + + //check file info + $FileName = $_FILES['userfile']['name']; + $TempName = $_FILES['userfile']['tmp_name']; + $FileSize = $_FILES['userfile']['size']; + //get file handle + $FileHandle = fopen($TempName, 'r'); + //get the header row + $headRow = fgetcsv($FileHandle, 10000, ","); + //check for correct number of fields + if ( count($headRow) != count($FieldHeadings)) { + prnMsg (_('File contains '. count($headRow). ' columns, expected '. count($FieldHeadings). '. Try downloading a new template.'),'error'); + fclose($FileHandle); + include('includes/footer.inc'); + exit; + } + $Salesmen=array(); + $sql = "SELECT salesmancode + FROM salesman"; + $result=DB_query($sql); + while ($myrow = DB_fetch_array($result)) { + $Salesmen[]=$myrow['salesmancode']; + } + $Areas=array(); + $sql = "SELECT areacode + FROM areas"; + $result=DB_query($sql); + while ($myrow = DB_fetch_array($result)) { + $Areas[]=$myrow['areacode']; + } + $Locations=array(); + $sql = "SELECT loccode + FROM locations"; + $result=DB_query($sql); + while ($myrow = DB_fetch_array($result)) { + $Locations[]=$myrow['loccode']; + } + $Shippers=array(); + $sql = "SELECT shipper_id + FROM shippers"; + $result=DB_query($sql); + while ($myrow = DB_fetch_array($result)) { + $Shippers[]=$myrow['shipper_id']; + } + $Taxgroups=array(); + $sql = "SELECT taxgroupid + FROM taxgroups"; + $result=DB_query($sql); + while ($myrow = DB_fetch_array($result)) { + $Taxgroups[]=$myrow['taxgroupid']; + } + + //test header row field name and sequence + $head = 0; + foreach ($headRow as $headField) { + if ( mb_strtoupper($headField) != mb_strtoupper($FieldHeadings[$head])) { + prnMsg (_('File contains incorrect headers ('. mb_strtoupper($headField). ' != '. mb_strtoupper($header[$head]). '. Try downloading a new template.'),'error'); + fclose($FileHandle); + include('includes/footer.inc'); + exit; + } + $head++; + } + + //start database transaction + DB_Txn_Begin(); + + //loop through file rows + $row = 1; + $UpdatedNum=0; + $InsertNum=0; + $ExistDebtorNos=array(); + $NotExistDebtorNos=array(); + $ExistedBranches = array(); + while ( ($filerow = fgetcsv($FileHandle, 10000, ",")) !== FALSE ) { + + //check for correct number of fields + $fieldCount = count($filerow); + if ($fieldCount != $FieldTarget) { + prnMsg (_($FieldTarget. ' fields required, '. $fieldCount. ' fields received'),'error'); + fclose($FileHandle); + include('includes/footer.inc'); + exit; + } + + // cleanup the data (csv files often import with empty strings and such) + foreach ($filerow as &$value) { + $value = trim($value); + } + $_POST['BranchCode']=$filerow[0]; + $_POST['DebtorNo']=$filerow[1]; + $_POST['BrName']=$filerow[2]; + $_POST['BrAddress1']=$filerow[3]; + $_POST['BrAddress2']=$filerow[4]; + $_POST['BrAddress3']=$filerow[5]; + $_POST['BrAddress4']=$filerow[6]; + $_POST['BrAddress5']=$filerow[7]; + $_POST['BrAddress6']=$filerow[8]; + $Latitude=$filerow[9]; + $Longitude=$filerow[10]; + $_POST['SpecialInstructions']=$filerow[29]; + $_POST['EstDeliveryDays']=$filerow[11]; + $_POST['FwdDate']=$filerow[14]; + $_POST['Salesman']=$filerow[13]; + $_POST['PhoneNo']=$filerow[15]; + $_POST['FaxNo']=$filerow[16]; + $_POST['ContactName']=$filerow[17]; + $_POST['Area']=$filerow[12]; + $_POST['Email']=$filerow[18]; + $_POST['TaxGroup']=$filerow[20]; + $_POST['DefaultLocation']=$filerow[19]; + $_POST['BrPostAddr1']=$filerow[24]; + $_POST['BrPostAddr2']=$filerow[25]; + $_POST['BrPostAddr3']=$filerow[26]; + $_POST['BrPostAddr4']=$filerow[27]; + $_POST['BrPostAddr5']=$filerow[28]; + $_POST['DisableTrans']=$filerow[23]; + $_POST['DefaultShipVia']=$filerow[21]; + $_POST['CustBranchCode']=$filerow[30]; + $_POST['DeliverBlind']=$filerow[22]; + + $i=0; + + if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ') OR mb_strstr($_POST['BranchCode'],'-')) { + $InputError = 1; + prnMsg(_('The Branch code cannot contain any of the following characters')." - & \' < >",'error'); + $Errors[$i] = 'BranchCode'; + $i++; + } + if (ContainsIllegalCharacters($_POST['DebtorNo'])) { + $InputError = 1; + prnMsg(_('The Debtor No cannot contain any of the following characters')." - & \' < >",'error'); + $Errors[$i] = 'Debtor No'; + $i++; + } + if (mb_strlen($_POST['BranchCode'])==0 OR mb_strlen($_POST['BranchCode'])>10) { + $InputError = 1; + prnMsg(_('The Branch code must be at least one character long and cannot be more than 10 characters'),'error'); + $Errors[$i] = 'BranchCode'; + $i++; + } + for ($c=1;$c<7;$c++) { //Branch address validataion + $Lenth = 40; + if($c == 4) { + $Lenth = 50; + } + if($c == 5) { + $Lenth = 20; + } + if (isset($_POST['BrAddress'.$c]) AND mb_strlen($_POST['BrAddress'.$c])>$Lenth) { + $InputError = 1; + prnMsg(_('The Branch address1 must be no more than') . ' ' . $Lenth . ' '. _('characters'),'error'); + $Errors[$i] = 'BrAddress'.$c; + $i++; + } } + if($Latitude !== null AND !is_numeric($Latitude)) { + $InputError = 1; + prnMsg(_('The latitude is expected to be a numeric'),'error'); + $Errors[$i] = 'Latitude'; + $i++; + } + if($Longitude !== null AND !is_numeric($Longitude)) { + $InputError = 1; + prnMsg(_('The longitude is expected to be a numeric'),'error'); + $Errors[$i] = 'Longitued'; + $i++; + } + if (!is_numeric($_POST['FwdDate'])) { + $InputError = 1; + prnMsg(_('The date after which invoices are charged to the following month is expected to be a number and a recognised number has not been entered'),'error'); + $Errors[$i] = 'FwdDate'; + $i++; + } + if ($_POST['FwdDate'] >30) { + $InputError = 1; + prnMsg(_('The date (in the month) after which invoices are charged to the following month should be a number less than 31'),'error'); + $Errors[$i] = 'FwdDate'; + $i++; + } + if (!is_numeric(filter_number_format($_POST['EstDeliveryDays']))) { + $InputError = 1; + prnMsg(_('The estimated delivery days is expected to be a number and a recognised number has not been entered'),'error'); + $Errors[$i] = 'EstDeliveryDays'; + $i++; + } + if (filter_number_format($_POST['EstDeliveryDays']) >60) { + $InputError = 1; + prnMsg(_('The estimated delivery days should be a number of days less than 60') . '. ' . _('A package can be delivered by seafreight anywhere in the world normally in less than 60 days'),'error'); + $Errors[$i] = 'EstDeliveryDays'; + $i++; + } + if(empty($_POST['Salesman']) OR !in_array($_POST['Salesman'],$Salesmen,true)) { + $InputError = 1; + prnMsg(_('The salesman not empty and must exist.'),'error'); + $Errors[$i] = 'Salesman'; + $i++; + } + if($_POST['PhoneNo'] !== null AND preg_match('/[^\d+()\s-]/',$_POST['PhoneNo'])) { + $InputError = 1; + prnMsg(_('The phone no should not contains characters other than digital,parenthese,space,minus and plus sign'),'error'); + $Errors[$i] = 'Phone No'; + $i++; + } + if($_POST['FaxNo'] !== null AND preg_match('/[^\d+()\s-]/',$_POST['FaxNo'])) { + $InputError = 1; + prnMsg(_('The fax no should not contains characters other than digital,parenthese,space,minus and plus sign'),'error'); + $Errors[$i] = 'FaxNo'; + $i++; + } + if($_POST['ContactName'] !== null AND mb_strlen($_POST['ContactName']) > 30) { + $InputError = 1; + prnMsg(_('The contact name must not be over 30 characters'),'error'); + $Errors[$i] = 'ContactName'; + $i++; + } + if($_POST['Email'] !== null AND !filter_var($_POST['Email'],FILTER_VALIDATE_EMAIL)) { + $InputError = 1; + prnMsg(_('The email address is not valid'),'error'); + $Errors[$i] = 'Email'; + $i++; + } + + if(ContainsIllegalCharacters($_POST['BrName']) OR mb_strlen($_POST['BrName']) >40) { + $InputError = 1; + prnMsg(_('The Branch code cannot contain any of the following characters')." - & \' < >" .' ' . _('Or length is over 40'),'error'); + $Errors[$i] = 'BrName'; + $i++; + } + if(empty($_POST['Area']) OR !in_array($_POST['Area'],$Areas,true)) { + $InputError = 1; + prnMsg(_('The sales area not empty and must exist.'),'error'); + $Errors[$i] = 'Area'; + $i++; + } + if(empty($_POST['DefaultLocation']) OR !in_array($_POST['DefaultLocation'],$Locations,true)) { + $InputError = 1; + prnMsg(_('The default location not empty and must exist.'),'error'); + $Errors[$i] = 'DefaultLocation'; + $i++; + } + if(empty($_POST['DefaultShipVia']) OR !in_array($_POST['DefaultShipVia'],$Shippers,true)) { + $InputError = 1; + prnMsg(_('The default shipper not empty and must exist.'),'error'); + $Errors[$i] = 'DefaultShipVia'; + $i++; + } + if(empty($_POST['TaxGroup']) OR !in_array($_POST['TaxGroup'],$Taxgroups,true)) { + $InputError = 1; + prnMsg(_('The taxgroup not empty and must exist.'),'error'); + $Errors[$i] = 'TaxGroup'; + $i++; + } + if(!isset($_POST['DeliverBlind']) OR ($_POST['DeliverBlind'] !=1 AND $_POST['DeliverBlind'] != 2)) { + $InputError = 1; + prnMsg(_('The Deliver Blind must be set as 2 or 1'),'error'); + $Errors[$i] = 'DeliverBlind'; + $i++; + } + if(!isset($_POST['DisableTrans']) OR ($_POST['DisableTrans'] != 0 AND $_POST['DisableTrans'] != 1)) { + $InputError = 1; + prnMsg(_('The Disable Trans status should be 0 or 1'),'error'); + $Errors[$i] = 'DisableTrans'; + $i++; + } + for($c=1;$c<6;$c++) { + $Lenth = 40; + if($c == 4) { + $Lenth = 50; + } + if($c == 5) { + $Lenth = 20; + } + if (isset($_POST['BrPostAddr'.$c]) AND mb_strlen($_POST['BrPostAddr'.$c])>$Lenth) { + $InputError = 1; + prnMsg(_('The Branch Post Address') . ' ' . $c . ' ' . _('must be no more than') . ' ' . $Lenth . ' '. _('characters'),'error'); + $Errors[$i] = 'BrPostAddr'.$c; + $i++; + } + + } + if(isset($_POST['CustBranchCode']) AND mb_strlen($_POST['CustBranchCode']) > 30) { + $InputError = 1; + prnMsg(_('The Cust branch code for EDI must be less than 30 characters'),'error'); + $Errors[$i] = 'CustBranchCode'; + $i++; + } + + if ($InputError !=1) { + if (DB_error_no() ==0) { + + if(in_array($_POST['DebtorNo'],$NotExistDebtorNos,true)) { + continue; + }else{ + $sql = "SELECT 1 + FROM debtorsmaster + WHERE debtorno='".$_POST['DebtorNo']."' LIMIT 1"; + $result=DB_query($sql); + $DebtorExists=(DB_num_rows($result)>0); + if ($DebtorExists) { + $ExistDebtorNos[]=$_POST['DebtorNo']; + }else{ + $NotExistDebtorNos[]=$_POST['DebtorNo']; + prnMsg(_('The Debtor No') . $_POST['DebtorNo'] . ' ' . _('has not existed, and its branches data cannot be imported'),'error'); + include('includes/footer.inc'); + exit; + } + } + $sql = "SELECT 1 + FROM custbranch + WHERE debtorno='".$_POST['DebtorNo']."' AND + branchcode='".$_POST['BranchCode']."' LIMIT 1"; + $result=DB_query($sql); + $BranchExists=(DB_num_rows($result)>0); + if ($BranchExists AND $_POST['UpdateIfExists']!=1) { + $ExistedBranches[] = array('debtor'=>$_POST['DebtorNo'], + 'branch'=>$_POST['BranchCode']); + $UpdatedNum++; + }else{ + + if (!isset($_POST['EstDeliveryDays'])) { + $_POST['EstDeliveryDays']=1; + } + if (!isset($Latitude)) { + $Latitude=0.0; + $Longitude=0.0; + } + if ($BranchExists) { + $UpdatedNum++; + $sql = "UPDATE custbranch SET brname = '" . $_POST['BrName'] . "', + braddress1 = '" . $_POST['BrAddress1'] . "', + braddress2 = '" . $_POST['BrAddress2'] . "', + braddress3 = '" . $_POST['BrAddress3'] . "', + braddress4 = '" . $_POST['BrAddress4'] . "', + braddress5 = '" . $_POST['BrAddress5'] . "', + braddress6 = '" . $_POST['BrAddress6'] . "', + lat = '" . $Latitude . "', + lng = '" . $Longitude . "', + specialinstructions = '" . $_POST['SpecialInstructions'] . "', + phoneno='" . $_POST['PhoneNo'] . "', + faxno='" . $_POST['FaxNo'] . "', + fwddate= '" . $_POST['FwdDate'] . "', + contactname='" . $_POST['ContactName'] . "', + salesman= '" . $_POST['Salesman'] . "', + area='" . $_POST['Area'] . "', + estdeliverydays ='" . filter_number_format($_POST['EstDeliveryDays']) . "', + email='" . $_POST['Email'] . "', + taxgroupid='" . $_POST['TaxGroup'] . "', + defaultlocation='" . $_POST['DefaultLocation'] . "', + brpostaddr1 = '" . $_POST['BrPostAddr1'] . "', + brpostaddr2 = '" . $_POST['BrPostAddr2'] . "', + brpostaddr3 = '" . $_POST['BrPostAddr3'] . "', + brpostaddr4 = '" . $_POST['BrPostAddr4'] . "', + brpostaddr5 = '" . $_POST['BrPostAddr5'] . "', + disabletrans='" . $_POST['DisableTrans'] . "', + defaultshipvia='" . $_POST['DefaultShipVia'] . "', + custbranchcode='" . $_POST['CustBranchCode'] ."', + deliverblind='" . $_POST['DeliverBlind'] . "' + WHERE branchcode = '".$_POST['BranchCode']."' AND debtorno='".$_POST['DebtorNo']."'"; + + } else { + $InsertNum++; + $sql = "INSERT INTO custbranch (branchcode, + debtorno, + brname, + braddress1, + braddress2, + braddress3, + braddress4, + braddress5, + braddress6, + lat, + lng, + specialinstructions, + estdeliverydays, + fwddate, + salesman, + phoneno, + faxno, + contactname, + area, + email, + taxgroupid, + defaultlocation, + brpostaddr1, + brpostaddr2, + brpostaddr3, + brpostaddr4, + brpostaddr5, + disabletrans, + defaultshipvia, + custbranchcode, + deliverblind) + VALUES ('" . $_POST['BranchCode'] . "', + '" . $_POST['DebtorNo'] . "', + '" . $_POST['BrName'] . "', + '" . $_POST['BrAddress1'] . "', + '" . $_POST['BrAddress2'] . "', + '" . $_POST['BrAddress3'] . "', + '" . $_POST['BrAddress4'] . "', + '" . $_POST['BrAddress5'] . "', + '" . $_POST['BrAddress6'] . "', + '" . $Latitude . "', + '" . $Longitude . "', + '" . $_POST['SpecialInstructions'] . "', + '" . filter_number_format($_POST['EstDeliveryDays']) . "', + '" . $_POST['FwdDate'] . "', + '" . $_POST['Salesman'] . "', + '" . $_POST['PhoneNo'] . "', + '" . $_POST['FaxNo'] . "', + '" . $_POST['ContactName'] . "', + '" . $_POST['Area'] . "', + '" . $_POST['Email'] . "', + '" . $_POST['TaxGroup'] . "', + '" . $_POST['DefaultLocation'] . "', + '" . $_POST['BrPostAddr1'] . "', + '" . $_POST['BrPostAddr2'] . "', + '" . $_POST['BrPostAddr3'] . "', + '" . $_POST['BrPostAddr4'] . "', + '" . $_POST['BrPostAddr5'] . "', + '" . $_POST['DisableTrans'] . "', + '" . $_POST['DefaultShipVia'] . "', + '" . $_POST['CustBranchCode'] ."', + '" . $_POST['DeliverBlind'] . "')"; + } + + //run the SQL from either of the above possibilites + $ErrMsg = _('The branch record could not be inserted or updated because'); + $result = DB_query($sql, $ErrMsg); + + if (DB_error_no() ==0) { + prnMsg( _('New branch of debtor') .' ' .$_POST['DebtorNo'] . ' ' ._('with branch code') .' ' . $_POST['BranchCode'] . ' ' . $_POST['BrName'] . ' '. _('has been passed validation'),'info'); + } else { //location insert failed so set some useful error info + $InputError = 1; + prnMsg(_($result),'error'); + } + } + } else { //item insert failed so set some useful error info + $InputError = 1; + prnMsg(_($result),'error'); + } + + } + + if ($InputError == 1) { //this row failed so exit loop + break; + } + + $row++; + } + + if ($InputError == 1) { //exited loop with errors so rollback + prnMsg(_('Failed on row '. $row. '. Batch import has been rolled back.'),'error'); + DB_Txn_Rollback(); + } else { //all good so commit data transaction + DB_Txn_Commit(); + if($_POST['UpdateIfExists']==1) { + prnMsg( _('Updated brances total:') .' ' . $UpdatedNum .' '._('Insert branches total:'). $InsertNum,'success' ); + }else{ + prnMsg( _('Exist branches total:') .' ' . $UpdatedNum .' '._('Inserted branches total:'). $InsertNum,'info'); + if($UpdatedNum){ + echo ' <p>' . _('Branches not updated').'</p> + <table class="selection"> + <tr><th>'._('Debtor No').'</th><th>' . _('Branch Code').'</th></tr>'; + foreach($ExistedBranches as $key=>$value){ + echo '<tr><td>'.$value['debtor'].'</td><td>'.$value['branch'].'</td></tr>'; + } + echo '</table>'; + } + } + } + + fclose($FileHandle); + +} elseif ( isset($_POST['gettemplate']) OR isset($_GET['gettemplate'])) { //download an import template + + echo '<br /><br /><br />"'. implode('","',$FieldHeadings). '"<br /><br /><br />'; + +} else { //show file upload form + + prnMsg(_('Please ensure that your csv file is encoded in UTF-8, otherwise the input data will not store correctly in database'),'warn'); + + echo ' + <br /> + <a href="Z_ImportCustbranch.php?gettemplate=1">Get Import Template</a> + <br /> + <br />'; + echo '<form action="Z_ImportCustbranch.php" method="post" enctype="multipart/form-data">'; + echo '<div class="centre">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />' . + _('Upload file') . ': <input name="userfile" type="file" /> + <input type="submit" value="' . _('Send File') . '" />'; + echo '<br/>',_('Update if Customer Branch exists'),':<input type="checkbox" name="UpdateIfExists">'; + echo'</div> + </form>'; + +} + + +include('includes/footer.inc'); +?> |
From: <vv...@us...> - 2015-03-31 18:28:54
|
Revision: 7249 http://sourceforge.net/p/web-erp/reponame/7249 Author: vvs2012 Date: 2015-03-31 18:28:52 +0000 (Tue, 31 Mar 2015) Log Message: ----------- Fix for the case when tax calculation order is not set or has duplicates Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2015-03-31 09:14:50 UTC (rev 7248) +++ trunk/ConfirmDispatch_Invoice.php 2015-03-31 18:28:52 UTC (rev 7249) @@ -233,10 +233,12 @@ if (isset($_POST['ChargeFreightCost'])){ $_SESSION['Items'.$identifier]->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } + $i=1; foreach ($_SESSION['Items'.$identifier]->FreightTaxes as $FreightTaxLine) { - if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['Items'.$identifier]->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; + if (isset($_POST['FreightTaxRate' . $i])){ + $_SESSION['Items'.$identifier]->FreightTaxes[$i]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $i])/100; } + $i++; } foreach ($_SESSION['Items'.$identifier]->LineItems as $Itm) { @@ -258,10 +260,12 @@ $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched = round(filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']),$Itm->DecimalPlaces); } } + $i=1; foreach ($Itm->Taxes as $TaxLine) { - if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100; + if (isset($_POST[$Itm->LineNumber . $i . '_TaxRate'])){ + $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Taxes[$i]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $i . '_TaxRate'])/100; } + $i++; } } //end foreach lineitem @@ -377,7 +381,7 @@ echo '</td>'; echo '<td class="number">'; - $i=0; // initialise the number of taxes iterated through + $i=1; // initialise the number of taxes iterated through $TaxLineTotal =0; //initialise tax total for the line @@ -385,13 +389,13 @@ if (empty($TaxTotals[$Tax->TaxAuthID])) { $TaxTotals[$Tax->TaxAuthID]=0; } - if ($i>0){ + if ($i>1){ echo '<br />'; } if (isset($_POST['ProcessInvoice'])) { echo $Tax->TaxRate*100; } else { - echo '<input type="text" class="number" required="required" title="' . _('Enter the tax rate applicable as a number') . '" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength="4" size="4" value="' . $Tax->TaxRate*100 . '" />'; + echo '<input type="text" class="number" required="required" title="' . _('Enter the tax rate applicable as a number') . '" name="' . $LnItm->LineNumber . $i . '_TaxRate" maxlength="4" size="4" value="' . $Tax->TaxRate*100 . '" />'; } $i++; if ($Tax->TaxOnTax ==1){ |
From: <te...@us...> - 2015-03-31 09:14:52
|
Revision: 7248 http://sourceforge.net/p/web-erp/reponame/7248 Author: tehonu Date: 2015-03-31 09:14:50 +0000 (Tue, 31 Mar 2015) Log Message: ----------- Modified Paths: -------------- trunk/sql/mysql/upgrade4.12.2-4.13.sql Modified: trunk/sql/mysql/upgrade4.12.2-4.13.sql =================================================================== --- trunk/sql/mysql/upgrade4.12.2-4.13.sql 2015-03-31 09:13:24 UTC (rev 7247) +++ trunk/sql/mysql/upgrade4.12.2-4.13.sql 2015-03-31 09:14:50 UTC (rev 7248) @@ -1,5 +1,6 @@ INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('CustomerAccount.php', '1', 'Shows customer account/statement on screen rather than PDF'); INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('StockCategorySalesInquiry.php', '2', 'Sales inquiry by stock category showing top items'); +INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('PcAnalysis.php', '15', 'Creates an Excel with details of PC expnese for 24 months'); -- Update version number: |
From: <te...@us...> - 2015-03-31 09:13:28
|
Revision: 7247 http://sourceforge.net/p/web-erp/reponame/7247 Author: tehonu Date: 2015-03-31 09:13:24 +0000 (Tue, 31 Mar 2015) Log Message: ----------- Added PHPExcel and one script PcAnalysis.php, for further analysis of petty cash expenses, downloading an excel File Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php Added Paths: ----------- trunk/Classes/ trunk/Classes/PHPExcel/ trunk/Classes/PHPExcel/Autoloader.php trunk/Classes/PHPExcel/CachedObjectStorage/ trunk/Classes/PHPExcel/CachedObjectStorage/APC.php trunk/Classes/PHPExcel/CachedObjectStorage/CacheBase.php trunk/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php trunk/Classes/PHPExcel/CachedObjectStorage/ICache.php trunk/Classes/PHPExcel/CachedObjectStorage/Igbinary.php trunk/Classes/PHPExcel/CachedObjectStorage/Memcache.php trunk/Classes/PHPExcel/CachedObjectStorage/Memory.php trunk/Classes/PHPExcel/CachedObjectStorage/MemoryGZip.php trunk/Classes/PHPExcel/CachedObjectStorage/MemorySerialized.php trunk/Classes/PHPExcel/CachedObjectStorage/PHPTemp.php trunk/Classes/PHPExcel/CachedObjectStorage/SQLite.php trunk/Classes/PHPExcel/CachedObjectStorage/SQLite3.php trunk/Classes/PHPExcel/CachedObjectStorage/Wincache.php trunk/Classes/PHPExcel/CachedObjectStorageFactory.php trunk/Classes/PHPExcel/CalcEngine/ trunk/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php trunk/Classes/PHPExcel/CalcEngine/Logger.php trunk/Classes/PHPExcel/Calculation/ trunk/Classes/PHPExcel/Calculation/Database.php trunk/Classes/PHPExcel/Calculation/DateTime.php trunk/Classes/PHPExcel/Calculation/Engineering.php trunk/Classes/PHPExcel/Calculation/Exception.php trunk/Classes/PHPExcel/Calculation/ExceptionHandler.php trunk/Classes/PHPExcel/Calculation/Financial.php trunk/Classes/PHPExcel/Calculation/FormulaParser.php trunk/Classes/PHPExcel/Calculation/FormulaToken.php trunk/Classes/PHPExcel/Calculation/Function.php trunk/Classes/PHPExcel/Calculation/Functions.php trunk/Classes/PHPExcel/Calculation/Logical.php trunk/Classes/PHPExcel/Calculation/LookupRef.php trunk/Classes/PHPExcel/Calculation/MathTrig.php trunk/Classes/PHPExcel/Calculation/Statistical.php trunk/Classes/PHPExcel/Calculation/TextData.php trunk/Classes/PHPExcel/Calculation/Token/ trunk/Classes/PHPExcel/Calculation/Token/Stack.php trunk/Classes/PHPExcel/Calculation/functionlist.txt trunk/Classes/PHPExcel/Calculation.php trunk/Classes/PHPExcel/Cell/ trunk/Classes/PHPExcel/Cell/AdvancedValueBinder.php trunk/Classes/PHPExcel/Cell/DataType.php trunk/Classes/PHPExcel/Cell/DataValidation.php trunk/Classes/PHPExcel/Cell/DefaultValueBinder.php trunk/Classes/PHPExcel/Cell/Hyperlink.php trunk/Classes/PHPExcel/Cell/IValueBinder.php trunk/Classes/PHPExcel/Cell.php trunk/Classes/PHPExcel/Chart/ trunk/Classes/PHPExcel/Chart/Axis.php trunk/Classes/PHPExcel/Chart/DataSeries.php trunk/Classes/PHPExcel/Chart/DataSeriesValues.php trunk/Classes/PHPExcel/Chart/Exception.php trunk/Classes/PHPExcel/Chart/GridLines.php trunk/Classes/PHPExcel/Chart/Layout.php trunk/Classes/PHPExcel/Chart/Legend.php trunk/Classes/PHPExcel/Chart/PlotArea.php trunk/Classes/PHPExcel/Chart/Properties.php trunk/Classes/PHPExcel/Chart/Renderer/ trunk/Classes/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt trunk/Classes/PHPExcel/Chart/Renderer/jpgraph.php trunk/Classes/PHPExcel/Chart/Title.php trunk/Classes/PHPExcel/Chart.php trunk/Classes/PHPExcel/Comment.php trunk/Classes/PHPExcel/DocumentProperties.php trunk/Classes/PHPExcel/DocumentSecurity.php trunk/Classes/PHPExcel/Exception.php trunk/Classes/PHPExcel/HashTable.php trunk/Classes/PHPExcel/IComparable.php trunk/Classes/PHPExcel/IOFactory.php trunk/Classes/PHPExcel/NamedRange.php trunk/Classes/PHPExcel/Reader/ trunk/Classes/PHPExcel/Reader/Abstract.php trunk/Classes/PHPExcel/Reader/CSV.php trunk/Classes/PHPExcel/Reader/DefaultReadFilter.php trunk/Classes/PHPExcel/Reader/Excel2003XML.php trunk/Classes/PHPExcel/Reader/Excel2007/ trunk/Classes/PHPExcel/Reader/Excel2007/Chart.php trunk/Classes/PHPExcel/Reader/Excel2007/Theme.php trunk/Classes/PHPExcel/Reader/Excel2007.php trunk/Classes/PHPExcel/Reader/Excel5/ trunk/Classes/PHPExcel/Reader/Excel5/Escher.php trunk/Classes/PHPExcel/Reader/Excel5/MD5.php trunk/Classes/PHPExcel/Reader/Excel5/RC4.php trunk/Classes/PHPExcel/Reader/Excel5.php trunk/Classes/PHPExcel/Reader/Exception.php trunk/Classes/PHPExcel/Reader/Gnumeric.php trunk/Classes/PHPExcel/Reader/HTML.php trunk/Classes/PHPExcel/Reader/IReadFilter.php trunk/Classes/PHPExcel/Reader/IReader.php trunk/Classes/PHPExcel/Reader/OOCalc.php trunk/Classes/PHPExcel/Reader/SYLK.php trunk/Classes/PHPExcel/ReferenceHelper.php trunk/Classes/PHPExcel/RichText/ trunk/Classes/PHPExcel/RichText/ITextElement.php trunk/Classes/PHPExcel/RichText/Run.php trunk/Classes/PHPExcel/RichText/TextElement.php trunk/Classes/PHPExcel/RichText.php trunk/Classes/PHPExcel/Settings.php trunk/Classes/PHPExcel/Shared/ trunk/Classes/PHPExcel/Shared/CodePage.php trunk/Classes/PHPExcel/Shared/Date.php trunk/Classes/PHPExcel/Shared/Drawing.php trunk/Classes/PHPExcel/Shared/Escher/ trunk/Classes/PHPExcel/Shared/Escher/DgContainer/ trunk/Classes/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/ trunk/Classes/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php trunk/Classes/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php trunk/Classes/PHPExcel/Shared/Escher/DgContainer.php trunk/Classes/PHPExcel/Shared/Escher/DggContainer/ trunk/Classes/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/ trunk/Classes/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/ trunk/Classes/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php trunk/Classes/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php trunk/Classes/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php trunk/Classes/PHPExcel/Shared/Escher/DggContainer.php trunk/Classes/PHPExcel/Shared/Escher.php trunk/Classes/PHPExcel/Shared/Excel5.php trunk/Classes/PHPExcel/Shared/File.php trunk/Classes/PHPExcel/Shared/Font.php trunk/Classes/PHPExcel/Shared/JAMA/ trunk/Classes/PHPExcel/Shared/JAMA/CHANGELOG.TXT trunk/Classes/PHPExcel/Shared/JAMA/CholeskyDecomposition.php trunk/Classes/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php trunk/Classes/PHPExcel/Shared/JAMA/LUDecomposition.php trunk/Classes/PHPExcel/Shared/JAMA/Matrix.php trunk/Classes/PHPExcel/Shared/JAMA/QRDecomposition.php trunk/Classes/PHPExcel/Shared/JAMA/SingularValueDecomposition.php trunk/Classes/PHPExcel/Shared/JAMA/utils/ trunk/Classes/PHPExcel/Shared/JAMA/utils/Error.php trunk/Classes/PHPExcel/Shared/JAMA/utils/Maths.php trunk/Classes/PHPExcel/Shared/OLE/ trunk/Classes/PHPExcel/Shared/OLE/ChainedBlockStream.php trunk/Classes/PHPExcel/Shared/OLE/PPS/ trunk/Classes/PHPExcel/Shared/OLE/PPS/File.php trunk/Classes/PHPExcel/Shared/OLE/PPS/Root.php trunk/Classes/PHPExcel/Shared/OLE/PPS.php trunk/Classes/PHPExcel/Shared/OLE.php trunk/Classes/PHPExcel/Shared/OLERead.php trunk/Classes/PHPExcel/Shared/PCLZip/ trunk/Classes/PHPExcel/Shared/PCLZip/gnu-lgpl.txt trunk/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php trunk/Classes/PHPExcel/Shared/PCLZip/readme.txt trunk/Classes/PHPExcel/Shared/PasswordHasher.php trunk/Classes/PHPExcel/Shared/String.php trunk/Classes/PHPExcel/Shared/TimeZone.php trunk/Classes/PHPExcel/Shared/XMLWriter.php trunk/Classes/PHPExcel/Shared/ZipArchive.php trunk/Classes/PHPExcel/Shared/ZipStreamWrapper.php trunk/Classes/PHPExcel/Shared/trend/ trunk/Classes/PHPExcel/Shared/trend/bestFitClass.php trunk/Classes/PHPExcel/Shared/trend/exponentialBestFitClass.php trunk/Classes/PHPExcel/Shared/trend/linearBestFitClass.php trunk/Classes/PHPExcel/Shared/trend/logarithmicBestFitClass.php trunk/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php trunk/Classes/PHPExcel/Shared/trend/powerBestFitClass.php trunk/Classes/PHPExcel/Shared/trend/trendClass.php trunk/Classes/PHPExcel/Style/ trunk/Classes/PHPExcel/Style/Alignment.php trunk/Classes/PHPExcel/Style/Border.php trunk/Classes/PHPExcel/Style/Borders.php trunk/Classes/PHPExcel/Style/Color.php trunk/Classes/PHPExcel/Style/Conditional.php trunk/Classes/PHPExcel/Style/Fill.php trunk/Classes/PHPExcel/Style/Font.php trunk/Classes/PHPExcel/Style/NumberFormat.php trunk/Classes/PHPExcel/Style/Protection.php trunk/Classes/PHPExcel/Style/Supervisor.php trunk/Classes/PHPExcel/Style.php trunk/Classes/PHPExcel/Worksheet/ trunk/Classes/PHPExcel/Worksheet/AutoFilter/ trunk/Classes/PHPExcel/Worksheet/AutoFilter/Column/ trunk/Classes/PHPExcel/Worksheet/AutoFilter/Column/Rule.php trunk/Classes/PHPExcel/Worksheet/AutoFilter/Column.php trunk/Classes/PHPExcel/Worksheet/AutoFilter.php trunk/Classes/PHPExcel/Worksheet/BaseDrawing.php trunk/Classes/PHPExcel/Worksheet/CellIterator.php trunk/Classes/PHPExcel/Worksheet/ColumnDimension.php trunk/Classes/PHPExcel/Worksheet/Drawing/ trunk/Classes/PHPExcel/Worksheet/Drawing/Shadow.php trunk/Classes/PHPExcel/Worksheet/Drawing.php trunk/Classes/PHPExcel/Worksheet/HeaderFooter.php trunk/Classes/PHPExcel/Worksheet/HeaderFooterDrawing.php trunk/Classes/PHPExcel/Worksheet/MemoryDrawing.php trunk/Classes/PHPExcel/Worksheet/PageMargins.php trunk/Classes/PHPExcel/Worksheet/PageSetup.php trunk/Classes/PHPExcel/Worksheet/Protection.php trunk/Classes/PHPExcel/Worksheet/Row.php trunk/Classes/PHPExcel/Worksheet/RowDimension.php trunk/Classes/PHPExcel/Worksheet/RowIterator.php trunk/Classes/PHPExcel/Worksheet/SheetView.php trunk/Classes/PHPExcel/Worksheet.php trunk/Classes/PHPExcel/WorksheetIterator.php trunk/Classes/PHPExcel/Writer/ trunk/Classes/PHPExcel/Writer/Abstract.php trunk/Classes/PHPExcel/Writer/CSV.php trunk/Classes/PHPExcel/Writer/Excel2007/ trunk/Classes/PHPExcel/Writer/Excel2007/Chart.php trunk/Classes/PHPExcel/Writer/Excel2007/Comments.php trunk/Classes/PHPExcel/Writer/Excel2007/ContentTypes.php trunk/Classes/PHPExcel/Writer/Excel2007/DocProps.php trunk/Classes/PHPExcel/Writer/Excel2007/Drawing.php trunk/Classes/PHPExcel/Writer/Excel2007/Rels.php trunk/Classes/PHPExcel/Writer/Excel2007/RelsRibbon.php trunk/Classes/PHPExcel/Writer/Excel2007/RelsVBA.php trunk/Classes/PHPExcel/Writer/Excel2007/StringTable.php trunk/Classes/PHPExcel/Writer/Excel2007/Style.php trunk/Classes/PHPExcel/Writer/Excel2007/Theme.php trunk/Classes/PHPExcel/Writer/Excel2007/Workbook.php trunk/Classes/PHPExcel/Writer/Excel2007/Worksheet.php trunk/Classes/PHPExcel/Writer/Excel2007/WriterPart.php trunk/Classes/PHPExcel/Writer/Excel2007.php trunk/Classes/PHPExcel/Writer/Excel5/ trunk/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php trunk/Classes/PHPExcel/Writer/Excel5/Escher.php trunk/Classes/PHPExcel/Writer/Excel5/Font.php trunk/Classes/PHPExcel/Writer/Excel5/Parser.php trunk/Classes/PHPExcel/Writer/Excel5/Workbook.php trunk/Classes/PHPExcel/Writer/Excel5/Worksheet.php trunk/Classes/PHPExcel/Writer/Excel5/Xf.php trunk/Classes/PHPExcel/Writer/Excel5.php trunk/Classes/PHPExcel/Writer/Exception.php trunk/Classes/PHPExcel/Writer/HTML.php trunk/Classes/PHPExcel/Writer/IWriter.php trunk/Classes/PHPExcel/Writer/OpenDocument/ trunk/Classes/PHPExcel/Writer/OpenDocument/Cell/ trunk/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php trunk/Classes/PHPExcel/Writer/OpenDocument/Content.php trunk/Classes/PHPExcel/Writer/OpenDocument/Meta.php trunk/Classes/PHPExcel/Writer/OpenDocument/MetaInf.php trunk/Classes/PHPExcel/Writer/OpenDocument/Mimetype.php trunk/Classes/PHPExcel/Writer/OpenDocument/Settings.php trunk/Classes/PHPExcel/Writer/OpenDocument/Styles.php trunk/Classes/PHPExcel/Writer/OpenDocument/Thumbnails.php trunk/Classes/PHPExcel/Writer/OpenDocument/WriterPart.php trunk/Classes/PHPExcel/Writer/OpenDocument.php trunk/Classes/PHPExcel/Writer/PDF/ trunk/Classes/PHPExcel/Writer/PDF/Core.php trunk/Classes/PHPExcel/Writer/PDF/DomPDF.php trunk/Classes/PHPExcel/Writer/PDF/mPDF.php trunk/Classes/PHPExcel/Writer/PDF/tcPDF.php trunk/Classes/PHPExcel/Writer/PDF.php trunk/Classes/PHPExcel/locale/ trunk/Classes/PHPExcel/locale/bg/ trunk/Classes/PHPExcel/locale/bg/config trunk/Classes/PHPExcel/locale/cs/ trunk/Classes/PHPExcel/locale/cs/config trunk/Classes/PHPExcel/locale/cs/functions trunk/Classes/PHPExcel/locale/da/ trunk/Classes/PHPExcel/locale/da/config trunk/Classes/PHPExcel/locale/da/functions trunk/Classes/PHPExcel/locale/de/ trunk/Classes/PHPExcel/locale/de/config trunk/Classes/PHPExcel/locale/de/functions trunk/Classes/PHPExcel/locale/en/ trunk/Classes/PHPExcel/locale/en/uk/ trunk/Classes/PHPExcel/locale/en/uk/config trunk/Classes/PHPExcel/locale/es/ trunk/Classes/PHPExcel/locale/es/config trunk/Classes/PHPExcel/locale/es/functions trunk/Classes/PHPExcel/locale/fi/ trunk/Classes/PHPExcel/locale/fi/config trunk/Classes/PHPExcel/locale/fi/functions trunk/Classes/PHPExcel/locale/fr/ trunk/Classes/PHPExcel/locale/fr/config trunk/Classes/PHPExcel/locale/fr/functions trunk/Classes/PHPExcel/locale/hu/ trunk/Classes/PHPExcel/locale/hu/config trunk/Classes/PHPExcel/locale/hu/functions trunk/Classes/PHPExcel/locale/it/ trunk/Classes/PHPExcel/locale/it/config trunk/Classes/PHPExcel/locale/it/functions trunk/Classes/PHPExcel/locale/nl/ trunk/Classes/PHPExcel/locale/nl/config trunk/Classes/PHPExcel/locale/nl/functions trunk/Classes/PHPExcel/locale/no/ trunk/Classes/PHPExcel/locale/no/config trunk/Classes/PHPExcel/locale/no/functions trunk/Classes/PHPExcel/locale/pl/ trunk/Classes/PHPExcel/locale/pl/config trunk/Classes/PHPExcel/locale/pl/functions trunk/Classes/PHPExcel/locale/pt/ trunk/Classes/PHPExcel/locale/pt/br/ trunk/Classes/PHPExcel/locale/pt/br/config trunk/Classes/PHPExcel/locale/pt/br/functions trunk/Classes/PHPExcel/locale/pt/config trunk/Classes/PHPExcel/locale/pt/functions trunk/Classes/PHPExcel/locale/ru/ trunk/Classes/PHPExcel/locale/ru/config trunk/Classes/PHPExcel/locale/ru/functions trunk/Classes/PHPExcel/locale/sv/ trunk/Classes/PHPExcel/locale/sv/config trunk/Classes/PHPExcel/locale/sv/functions trunk/Classes/PHPExcel/locale/tr/ trunk/Classes/PHPExcel/locale/tr/config trunk/Classes/PHPExcel/locale/tr/functions trunk/Classes/PHPExcel.php trunk/PcAnalysis.php Added: trunk/Classes/PHPExcel/Autoloader.php =================================================================== --- trunk/Classes/PHPExcel/Autoloader.php (rev 0) +++ trunk/Classes/PHPExcel/Autoloader.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,89 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + +PHPExcel_Autoloader::Register(); +// As we always try to run the autoloader before anything else, we can use it to do a few +// simple checks and initialisations +//PHPExcel_Shared_ZipStreamWrapper::register(); +// check mbstring.func_overload +if (ini_get('mbstring.func_overload') & 2) { + throw new PHPExcel_Exception('Multibyte function overloading in PHP must be disabled for string functions (2).'); +} +PHPExcel_Shared_String::buildCharacterSets(); + + +/** + * PHPExcel_Autoloader + * + * @category PHPExcel + * @package PHPExcel + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_Autoloader +{ + /** + * Register the Autoloader with SPL + * + */ + public static function Register() { + if (function_exists('__autoload')) { + // Register any existing autoloader function with SPL, so we don't get any clashes + spl_autoload_register('__autoload'); + } + // Register ourselves with SPL + if (version_compare(PHP_VERSION, '5.3.0') >= 0) { + return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'), true, true); + } else { + return spl_autoload_register(array('PHPExcel_Autoloader', 'Load')); + } + } // function Register() + + + /** + * Autoload a class identified by name + * + * @param string $pClassName Name of the object to load + */ + public static function Load($pClassName){ + if ((class_exists($pClassName,FALSE)) || (strpos($pClassName, 'PHPExcel') !== 0)) { + // Either already loaded, or not a PHPExcel class request + return FALSE; + } + + $pClassFilePath = PHPEXCEL_ROOT . + str_replace('_',DIRECTORY_SEPARATOR,$pClassName) . + '.php'; + + if ((file_exists($pClassFilePath) === FALSE) || (is_readable($pClassFilePath) === FALSE)) { + // Can't load + return FALSE; + } + + require($pClassFilePath); + } // function Load() + +} Added: trunk/Classes/PHPExcel/CachedObjectStorage/APC.php =================================================================== --- trunk/Classes/PHPExcel/CachedObjectStorage/APC.php (rev 0) +++ trunk/Classes/PHPExcel/CachedObjectStorage/APC.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,295 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_CachedObjectStorage_APC + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { + + /** + * Prefix used to uniquely identify cache data for this worksheet + * + * @access private + * @var string + */ + private $_cachePrefix = null; + + /** + * Cache timeout + * + * @access private + * @var integer + */ + private $_cacheTime = 600; + + + /** + * Store cell data in cache for the current cell object if it's "dirty", + * and the 'nullify' the current cell object + * + * @access private + * @return void + * @throws PHPExcel_Exception + */ + protected function _storeData() { + if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) { + $this->_currentObject->detach(); + + if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in APC'); + } + $this->_currentCellIsDirty = false; + } + $this->_currentObjectID = $this->_currentObject = null; + } // function _storeData() + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @access public + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) { + if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { + $this->_storeData(); + } + $this->_cellCache[$pCoord] = true; + + $this->_currentObjectID = $pCoord; + $this->_currentObject = $cell; + $this->_currentCellIsDirty = true; + + return $cell; + } // function addCacheData() + + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @access public + * @param string $pCoord Coordinate address of the cell to check + * @throws PHPExcel_Exception + * @return boolean + */ + public function isDataSet($pCoord) { + // Check if the requested entry is the current object, or exists in the cache + if (parent::isDataSet($pCoord)) { + if ($this->_currentObjectID == $pCoord) { + return true; + } + // Check if the requested entry still exists in apc + $success = apc_fetch($this->_cachePrefix.$pCoord.'.cache'); + if ($success === FALSE) { + // Entry no longer exists in APC, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); + } + return true; + } + return false; + } // function isDataSet() + + + /** + * Get cell at a specific coordinate + * + * @access public + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) { + if ($pCoord === $this->_currentObjectID) { + return $this->_currentObject; + } + $this->_storeData(); + + // Check if the entry that has been requested actually exists + if (parent::isDataSet($pCoord)) { + $obj = apc_fetch($this->_cachePrefix.$pCoord.'.cache'); + if ($obj === FALSE) { + // Entry no longer exists in APC, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); + } + } else { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->_currentObjectID = $pCoord; + $this->_currentObject = unserialize($obj); + // Re-attach this as the cell's parent + $this->_currentObject->attach($this); + + // Return requested entry + return $this->_currentObject; + } // function getCacheData() + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() { + if ($this->_currentObjectID !== null) { + $this->_storeData(); + } + + return parent::getCellList(); + } + + + /** + * Delete a cell in cache identified by coordinate address + * + * @access public + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) { + // Delete the entry from APC + apc_delete($this->_cachePrefix.$pCoord.'.cache'); + + // Delete the entry from our cell address array + parent::deleteCacheData($pCoord); + } // function deleteCacheData() + + + /** + * Clone the cell collection + * + * @access public + * @param PHPExcel_Worksheet $parent The new worksheet + * @throws PHPExcel_Exception + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) { + parent::copyCellCollection($parent); + // Get a new id for the new file name + $baseUnique = $this->_getUniqueID(); + $newCachePrefix = substr(md5($baseUnique),0,8).'.'; + $cacheList = $this->getCellList(); + foreach($cacheList as $cellID) { + if ($cellID != $this->_currentObjectID) { + $obj = apc_fetch($this->_cachePrefix.$cellID.'.cache'); + if ($obj === FALSE) { + // Entry no longer exists in APC, so clear it from the cache array + parent::deleteCacheData($cellID); + throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in APC'); + } + if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in APC'); + } + } + } + $this->_cachePrefix = $newCachePrefix; + } // function copyCellCollection() + + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() { + if ($this->_currentObject !== NULL) { + $this->_currentObject->detach(); + $this->_currentObject = $this->_currentObjectID = null; + } + + // Flush the APC cache + $this->__destruct(); + + $this->_cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->_parent = null; + } // function unsetWorksheetCells() + + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) { + $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; + + if ($this->_cachePrefix === NULL) { + $baseUnique = $this->_getUniqueID(); + $this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; + $this->_cacheTime = $cacheTime; + + parent::__construct($parent); + } + } // function __construct() + + + /** + * Destroy this cell collection + */ + public function __destruct() { + $cacheList = $this->getCellList(); + foreach($cacheList as $cellID) { + apc_delete($this->_cachePrefix.$cellID.'.cache'); + } + } // function __destruct() + + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() { + if (!function_exists('apc_store')) { + return FALSE; + } + if (apc_sma_info() === FALSE) { + return FALSE; + } + + return TRUE; + } + +} Added: trunk/Classes/PHPExcel/CachedObjectStorage/CacheBase.php =================================================================== --- trunk/Classes/PHPExcel/CachedObjectStorage/CacheBase.php (rev 0) +++ trunk/Classes/PHPExcel/CachedObjectStorage/CacheBase.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,347 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_CachedObjectStorage_CacheBase + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +abstract class PHPExcel_CachedObjectStorage_CacheBase { + + /** + * Parent worksheet + * + * @var PHPExcel_Worksheet + */ + protected $_parent; + + /** + * The currently active Cell + * + * @var PHPExcel_Cell + */ + protected $_currentObject = null; + + /** + * Coordinate address of the currently active Cell + * + * @var string + */ + protected $_currentObjectID = null; + + + /** + * Flag indicating whether the currently active Cell requires saving + * + * @var boolean + */ + protected $_currentCellIsDirty = true; + + /** + * An array of cells or cell pointers for the worksheet cells held in this cache, + * and indexed by their coordinate address within the worksheet + * + * @var array of mixed + */ + protected $_cellCache = array(); + + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + */ + public function __construct(PHPExcel_Worksheet $parent) { + // Set our parent worksheet. + // This is maintained within the cache controller to facilitate re-attaching it to PHPExcel_Cell objects when + // they are woken from a serialized state + $this->_parent = $parent; + } // function __construct() + + + /** + * Return the parent worksheet for this cell collection + * + * @return PHPExcel_Worksheet + */ + public function getParent() + { + return $this->_parent; + } + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + */ + public function isDataSet($pCoord) { + if ($pCoord === $this->_currentObjectID) { + return true; + } + // Check if the requested entry exists in the cache + return isset($this->_cellCache[$pCoord]); + } // function isDataSet() + + + /** + * Move a cell object from one address to another + * + * @param string $fromAddress Current address of the cell to move + * @param string $toAddress Destination address of the cell to move + * @return boolean + */ + public function moveCell($fromAddress, $toAddress) { + if ($fromAddress === $this->_currentObjectID) { + $this->_currentObjectID = $toAddress; + } + $this->_currentCellIsDirty = true; + if (isset($this->_cellCache[$fromAddress])) { + $this->_cellCache[$toAddress] = &$this->_cellCache[$fromAddress]; + unset($this->_cellCache[$fromAddress]); + } + + return TRUE; + } // function moveCell() + + + /** + * Add or Update a cell in cache + * + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function updateCacheData(PHPExcel_Cell $cell) { + return $this->addCacheData($cell->getCoordinate(),$cell); + } // function updateCacheData() + + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord) { + if ($pCoord === $this->_currentObjectID) { + $this->_currentObject->detach(); + $this->_currentObjectID = $this->_currentObject = null; + } + + if (is_object($this->_cellCache[$pCoord])) { + $this->_cellCache[$pCoord]->detach(); + unset($this->_cellCache[$pCoord]); + } + $this->_currentCellIsDirty = false; + } // function deleteCacheData() + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() { + return array_keys($this->_cellCache); + } // function getCellList() + + + /** + * Sort the list of all cell addresses currently held in cache by row and column + * + * @return string[] + */ + public function getSortedCellList() { + $sortKeys = array(); + foreach ($this->getCellList() as $coord) { + sscanf($coord,'%[A-Z]%d', $column, $row); + $sortKeys[sprintf('%09d%3s',$row,$column)] = $coord; + } + ksort($sortKeys); + + return array_values($sortKeys); + } // function sortCellList() + + + + /** + * Get highest worksheet column and highest row that have cell records + * + * @return array Highest column name and highest row number + */ + public function getHighestRowAndColumn() + { + // Lookup highest column and highest row + $col = array('A' => '1A'); + $row = array(1); + foreach ($this->getCellList() as $coord) { + sscanf($coord,'%[A-Z]%d', $c, $r); + $row[$r] = $r; + $col[$c] = strlen($c).$c; + } + if (!empty($row)) { + // Determine highest column and row + $highestRow = max($row); + $highestColumn = substr(max($col),1); + } + + return array( 'row' => $highestRow, + 'column' => $highestColumn + ); + } + + + /** + * Return the cell address of the currently active cell object + * + * @return string + */ + public function getCurrentAddress() + { + return $this->_currentObjectID; + } + + /** + * Return the column address of the currently active cell object + * + * @return string + */ + public function getCurrentColumn() + { + sscanf($this->_currentObjectID, '%[A-Z]%d', $column, $row); + return $column; + } + + /** + * Return the row address of the currently active cell object + * + * @return integer + */ + public function getCurrentRow() + { + sscanf($this->_currentObjectID, '%[A-Z]%d', $column, $row); + return (integer) $row; + } + + /** + * Get highest worksheet column + * + * @param string $row Return the highest column for the specified row, + * or the highest column of any row if no row number is passed + * @return string Highest column name + */ + public function getHighestColumn($row = null) + { + if ($row == null) { + $colRow = $this->getHighestRowAndColumn(); + return $colRow['column']; + } + + $columnList = array(1); + foreach ($this->getCellList() as $coord) { + sscanf($coord,'%[A-Z]%d', $c, $r); + if ($r != $row) { + continue; + } + $columnList[] = PHPExcel_Cell::columnIndexFromString($c); + } + return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1); + } + + /** + * Get highest worksheet row + * + * @param string $column Return the highest row for the specified column, + * or the highest row of any column if no column letter is passed + * @return int Highest row number + */ + public function getHighestRow($column = null) + { + if ($column == null) { + $colRow = $this->getHighestRowAndColumn(); + return $colRow['row']; + } + + $rowList = array(0); + foreach ($this->getCellList() as $coord) { + sscanf($coord,'%[A-Z]%d', $c, $r); + if ($c != $column) { + continue; + } + $rowList[] = $r; + } + + return max($rowList); + } + + + /** + * Generate a unique ID for cache referencing + * + * @return string Unique Reference + */ + protected function _getUniqueID() { + if (function_exists('posix_getpid')) { + $baseUnique = posix_getpid(); + } else { + $baseUnique = mt_rand(); + } + return uniqid($baseUnique,true); + } + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) { + $this->_currentCellIsDirty; + $this->_storeData(); + + $this->_parent = $parent; + if (($this->_currentObject !== NULL) && (is_object($this->_currentObject))) { + $this->_currentObject->attach($this); + } + } // function copyCellCollection() + + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() { + return true; + } + +} Added: trunk/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php =================================================================== --- trunk/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php (rev 0) +++ trunk/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,219 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_CachedObjectStorage_DiscISAM + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { + + /** + * Name of the file for this cache + * + * @var string + */ + private $_fileName = NULL; + + /** + * File handle for this cache file + * + * @var resource + */ + private $_fileHandle = NULL; + + /** + * Directory/Folder where the cache file is located + * + * @var string + */ + private $_cacheDirectory = NULL; + + + /** + * Store cell data in cache for the current cell object if it's "dirty", + * and the 'nullify' the current cell object + * + * @return void + * @throws PHPExcel_Exception + */ + protected function _storeData() { + if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) { + $this->_currentObject->detach(); + + fseek($this->_fileHandle,0,SEEK_END); + $offset = ftell($this->_fileHandle); + fwrite($this->_fileHandle, serialize($this->_currentObject)); + $this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset, + 'sz' => ftell($this->_fileHandle) - $offset + ); + $this->_currentCellIsDirty = false; + } + $this->_currentObjectID = $this->_currentObject = null; + } // function _storeData() + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) { + if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { + $this->_storeData(); + } + + $this->_currentObjectID = $pCoord; + $this->_currentObject = $cell; + $this->_currentCellIsDirty = true; + + return $cell; + } // function addCacheData() + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) { + if ($pCoord === $this->_currentObjectID) { + return $this->_currentObject; + } + $this->_storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->_cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->_currentObjectID = $pCoord; + fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']); + $this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz'])); + // Re-attach this as the cell's parent + $this->_currentObject->attach($this); + + // Return requested entry + return $this->_currentObject; + } // function getCacheData() + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() { + if ($this->_currentObjectID !== null) { + $this->_storeData(); + } + + return parent::getCellList(); + } + + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent) { + parent::copyCellCollection($parent); + // Get a new id for the new file name + $baseUnique = $this->_getUniqueID(); + $newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; + // Copy the existing cell cache file + copy ($this->_fileName,$newFileName); + $this->_fileName = $newFileName; + // Open the copied cell cache file + $this->_fileHandle = fopen($this->_fileName,'a+'); + } // function copyCellCollection() + + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() { + if(!is_null($this->_currentObject)) { + $this->_currentObject->detach(); + $this->_currentObject = $this->_currentObjectID = null; + } + $this->_cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->_parent = null; + + // Close down the temporary cache file + $this->__destruct(); + } // function unsetWorksheetCells() + + + /** + * Initialise this new cell collection + * + * @param PHPExcel_Worksheet $parent The worksheet for this cell collection + * @param array of mixed $arguments Additional initialisation arguments + */ + public function __construct(PHPExcel_Worksheet $parent, $arguments) { + $this->_cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== NULL)) + ? $arguments['dir'] + : PHPExcel_Shared_File::sys_get_temp_dir(); + + parent::__construct($parent); + if (is_null($this->_fileHandle)) { + $baseUnique = $this->_getUniqueID(); + $this->_fileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; + $this->_fileHandle = fopen($this->_fileName,'a+'); + } + } // function __construct() + + + /** + * Destroy this cell collection + */ + public function __destruct() { + if (!is_null($this->_fileHandle)) { + fclose($this->_fileHandle); + unlink($this->_fileName); + } + $this->_fileHandle = null; + } // function __destruct() + +} Added: trunk/Classes/PHPExcel/CachedObjectStorage/ICache.php =================================================================== --- trunk/Classes/PHPExcel/CachedObjectStorage/ICache.php (rev 0) +++ trunk/Classes/PHPExcel/CachedObjectStorage/ICache.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,112 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_CachedObjectStorage_ICache + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +interface PHPExcel_CachedObjectStorage_ICache +{ + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell); + + /** + * Add or Update a cell in cache + * + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function updateCacheData(PHPExcel_Cell $cell); + + /** + * Fetch a cell from cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to retrieve + * @return PHPExcel_Cell Cell that was found, or null if not found + * @throws PHPExcel_Exception + */ + public function getCacheData($pCoord); + + /** + * Delete a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to delete + * @throws PHPExcel_Exception + */ + public function deleteCacheData($pCoord); + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + */ + public function isDataSet($pCoord); + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList(); + + /** + * Get the list of all cell addresses currently held in cache sorted by column and row + * + * @return string[] + */ + public function getSortedCellList(); + + /** + * Clone the cell collection + * + * @param PHPExcel_Worksheet $parent The new worksheet + * @return void + */ + public function copyCellCollection(PHPExcel_Worksheet $parent); + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable(); + +} Added: trunk/Classes/PHPExcel/CachedObjectStorage/Igbinary.php =================================================================== --- trunk/Classes/PHPExcel/CachedObjectStorage/Igbinary.php (rev 0) +++ trunk/Classes/PHPExcel/CachedObjectStorage/Igbinary.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,152 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_CachedObjectStorage_Igbinary + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { + + /** + * Store cell data in cache for the current cell object if it's "dirty", + * and the 'nullify' the current cell object + * + * @return void + * @throws PHPExcel_Exception + */ + protected function _storeData() { + if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) { + $this->_currentObject->detach(); + + $this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject); + $this->_currentCellIsDirty = false; + } + $this->_currentObjectID = $this->_currentObject = null; + } // function _storeData() + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) { + if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { + $this->_storeData(); + } + + $this->_currentObjectID = $pCoord; + $this->_currentObject = $cell; + $this->_currentCellIsDirty = true; + + return $cell; + } // function addCacheData() + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) { + if ($pCoord === $this->_currentObjectID) { + return $this->_currentObject; + } + $this->_storeData(); + + // Check if the entry that has been requested actually exists + if (!isset($this->_cellCache[$pCoord])) { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->_currentObjectID = $pCoord; + $this->_currentObject = igbinary_unserialize($this->_cellCache[$pCoord]); + // Re-attach this as the cell's parent + $this->_currentObject->attach($this); + + // Return requested entry + return $this->_currentObject; + } // function getCacheData() + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + public function getCellList() { + if ($this->_currentObjectID !== null) { + $this->_storeData(); + } + + return parent::getCellList(); + } + + + /** + * Clear the cell collection and disconnect from our parent + * + * @return void + */ + public function unsetWorksheetCells() { + if(!is_null($this->_currentObject)) { + $this->_currentObject->detach(); + $this->_currentObject = $this->_currentObjectID = null; + } + $this->_cellCache = array(); + + // detach ourself from the worksheet, so that it can then delete this object successfully + $this->_parent = null; + } // function unsetWorksheetCells() + + + /** + * Identify whether the caching method is currently available + * Some methods are dependent on the availability of certain extensions being enabled in the PHP build + * + * @return boolean + */ + public static function cacheMethodIsAvailable() { + if (!function_exists('igbinary_serialize')) { + return false; + } + + return true; + } + +} Added: trunk/Classes/PHPExcel/CachedObjectStorage/Memcache.php =================================================================== --- trunk/Classes/PHPExcel/CachedObjectStorage/Memcache.php (rev 0) +++ trunk/Classes/PHPExcel/CachedObjectStorage/Memcache.php 2015-03-31 09:13:24 UTC (rev 7247) @@ -0,0 +1,312 @@ +<?php +/** + * PHPExcel + * + * Copyright (c) 2006 - 2014 PHPExcel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL + * @version ##VERSION##, ##DATE## + */ + + +/** + * PHPExcel_CachedObjectStorage_Memcache + * + * @category PHPExcel + * @package PHPExcel_CachedObjectStorage + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) + */ +class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { + + /** + * Prefix used to uniquely identify cache data for this worksheet + * + * @var string + */ + private $_cachePrefix = null; + + /** + * Cache timeout + * + * @var integer + */ + private $_cacheTime = 600; + + /** + * Memcache interface + * + * @var resource + */ + private $_memcache = null; + + + /** + * Store cell data in cache for the current cell object if it's "dirty", + * and the 'nullify' the current cell object + * + * @return void + * @throws PHPExcel_Exception + */ + protected function _storeData() { + if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) { + $this->_currentObject->detach(); + + $obj = serialize($this->_currentObject); + if (!$this->_memcache->replace($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) { + if (!$this->_memcache->add($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) { + $this->__destruct(); + throw new PHPExcel_Exception('Failed to store cell '.$this->_currentObjectID.' in MemCache'); + } + } + $this->_currentCellIsDirty = false; + } + $this->_currentObjectID = $this->_currentObject = null; + } // function _storeData() + + + /** + * Add or Update a cell in cache identified by coordinate address + * + * @param string $pCoord Coordinate address of the cell to update + * @param PHPExcel_Cell $cell Cell to update + * @return PHPExcel_Cell + * @throws PHPExcel_Exception + */ + public function addCacheData($pCoord, PHPExcel_Cell $cell) { + if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { + $this->_storeData(); + } + $this->_cellCache[$pCoord] = true; + + $this->_currentObjectID = $pCoord; + $this->_currentObject = $cell; + $this->_currentCellIsDirty = true; + + return $cell; + } // function addCacheData() + + + /** + * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * + * @param string $pCoord Coordinate address of the cell to check + * @return boolean + * @return boolean + */ + public function isDataSet($pCoord) { + // Check if the requested entry is the current object, or exists in the cache + if (parent::isDataSet($pCoord)) { + if ($this->_currentObjectID == $pCoord) { + return true; + } + // Check if the requested entry still exists in Memcache + $success = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache'); + if ($success === false) { + // Entry no longer exists in Memcache, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); + } + return true; + } + return false; + } // function isDataSet() + + + /** + * Get cell at a specific coordinate + * + * @param string $pCoord Coordinate of the cell + * @throws PHPExcel_Exception + * @return PHPExcel_Cell Cell that was found, or null if not found + */ + public function getCacheData($pCoord) { + if ($pCoord === $this->_currentObjectID) { + return $this->_currentObject; + } + $this->_storeData(); + + // Check if the entry that has been requested actually exists + if (parent::isDataSet($pCoord)) { + $obj = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache'); + if ($obj === false) { + // Entry no longer exists in Memcache, so clear it from the cache array + parent::deleteCacheData($pCoord); + throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); + } + } else { + // Return null if requested entry doesn't exist in cache + return null; + } + + // Set current entry to the requested entry + $this->_currentObjectID = $pCoord; + $this->_currentObject = unserialize($obj); + // Re-attach this as the cell's parent + $this->_currentObject->attach($this); + + // Return requested entry + return $this->_currentObject; + } // function getCacheData() + + + /** + * Get a list of all cell addresses currently held in cache + * + * @return string[] + */ + publi... [truncated message content] |
From: <rc...@us...> - 2015-03-31 01:57:09
|
Revision: 7246 http://sourceforge.net/p/web-erp/reponame/7246 Author: rchacon Date: 2015-03-31 01:57:01 +0000 (Tue, 31 Mar 2015) Log Message: ----------- Spanish translation improvements. Modified Paths: -------------- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2015-03-30 21:46:47 UTC (rev 7245) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2015-03-31 01:57:01 UTC (rev 7246) @@ -8,7 +8,7 @@ "Project-Id-Version: webERP 4.12.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-02-24 17:34-0600\n" -"PO-Revision-Date: 2015-03-09 16:56-0600\n" +"PO-Revision-Date: 2015-03-23 18:29-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -6221,7 +6221,7 @@ #: Contracts.php:868 msgid "Add or Modify Contract Categories" -msgstr "Agregar o modificar las Categorías de Contrato" +msgstr "Añadir o modificar categorías de contrato" #: Contracts.php:871 msgid "The stock locations could not be retrieved because" @@ -10447,7 +10447,7 @@ #: Customers.php:677 Customers.php:1187 msgid "Add New Customer" -msgstr "Agregar nuevo cliente" +msgstr "Añadir cliente nuevo" #: Customers.php:767 msgid "" @@ -13078,7 +13078,7 @@ #: FixedAssetItems.php:529 msgid "Add or Modify Asset Categories" -msgstr "Agregar o modificar categorías de activos" +msgstr "Añadir o modificar categorías de activos" #: FixedAssetItems.php:542 msgid "The asset locations could not be retrieved because" @@ -13096,7 +13096,7 @@ #: FixedAssetItems.php:558 msgid "Add Asset Location" -msgstr "Agregar ubicación de activo" +msgstr "Añadir ubicación de activo" #: FixedAssetItems.php:561 StockClone.php:964 StockCounts.php:166 #: Stocks.php:1298 includes/DefineLabelClass.php:50 @@ -14304,7 +14304,7 @@ #: GLJournal.php:8 includes/MainMenuLinksArray.php:355 msgid "Journal Entry" -msgstr "Ingreso del Diario" +msgstr "Entrada en libro diario" #: GLJournal.php:46 msgid "" @@ -14332,7 +14332,7 @@ #: GLJournal.php:119 msgid "Journal" -msgstr "Diario" +msgstr "Libro diario" #: GLJournal.php:128 msgid "Enter Another General Ledger Journal" @@ -14398,7 +14398,7 @@ #: GLJournal.php:288 msgid "Journal Line Entry" -msgstr "Ingreso de Línea del Diario" +msgstr "Entrada de línea de libro diario" #: GLJournal.php:294 GLJournal.php:387 msgid "GL Tag" @@ -14426,7 +14426,7 @@ #: GLJournal.php:384 msgid "Journal Summary" -msgstr "Resumen Diario" +msgstr "Resumen de libro diario" #: GLJournal.php:440 msgid "Required to balance" @@ -14448,7 +14448,7 @@ #: GLJournalInquiry.php:26 msgid "Journal Number Range" -msgstr "Rango del número de Diario" +msgstr "Rango de números en libro diario" #: GLJournalInquiry.php:43 msgid "Journals Dated Between" @@ -14456,7 +14456,7 @@ #: GLJournalInquiry.php:81 msgid "Journal Number" -msgstr "Número de Diario" +msgstr "Número en libro diario" #: GLJournalInquiry.php:83 PcExpenses.php:192 #: includes/PDFGLJournalHeader.inc:20 @@ -18212,7 +18212,7 @@ #: Manufacturers.php:154 msgid "items with this manufacturer code" -msgstr "" +msgstr "artículos con este código de fabricante" #: Manufacturers.php:163 msgid "Manufacturer" @@ -19180,7 +19180,7 @@ #: PDFFGLabel.php:214 msgid "Label Error" -msgstr "" +msgstr "Error de etiqueta" #: PDFFGLabel.php:216 msgid "There were no labels to print" @@ -21609,7 +21609,7 @@ #: PO_SelectOSPurchOrder.php:144 PO_SelectOSPurchOrder.php:146 msgid "Add Purchase Order" -msgstr "Agregar orden de compra" +msgstr "Añadir orden de compra" #: PO_SelectOSPurchOrder.php:151 PO_SelectPurchOrder.php:118 #: Shipt_Select.php:109 @@ -24315,7 +24315,7 @@ #: ProductSpecs.php:667 TestPlanResults.php:972 msgid "Add More Tests" -msgstr "Agregar más pruebas" +msgstr "Añadir más pruebas" #: ProductSpecs.php:668 msgid "Copy This Specification" @@ -27735,7 +27735,7 @@ #: SelectCustomer.php:666 msgid "Add New Note" -msgstr "Añadir una Nueva nota" +msgstr "Añadir una nota nueva" #: SelectCustomer.php:690 msgid "Add New Note for this Customer" @@ -27751,7 +27751,7 @@ #: SelectCustomer.php:708 SelectCustomer.php:731 msgid "Add New Group Note" -msgstr "Añadir una Nueva nota de Grupo" +msgstr "Añadir una nota de grupo nueva" #: SelectGLAccount.php:6 msgid "Search GL Accounts" @@ -28110,7 +28110,7 @@ #: SelectOrderItems.php:1800 msgid "Add Asset To Order" -msgstr "Agregar un activo a una orden" +msgstr "Añadir un activo a una orden" #: SelectOrderItems.php:1814 msgid "Cancel Whole Order" @@ -30942,7 +30942,7 @@ #: StockClone.php:766 Stocks.php:1100 msgid "Add or Modify Stock Categories" -msgstr "Añadir ó Modificar Categorías de Existencias" +msgstr "Añadir o modificar categorías de inventario" #: StockClone.php:806 Stocks.php:1140 msgid "Economic Order Quantity" @@ -38127,7 +38127,7 @@ #: WOSerialNos.php:256 msgid "Add A Number of New Serial Numbers" -msgstr "Agregar Un Número de Nuevos Números de Serie" +msgstr "Añadir un número de números de serie nuevos" #: WOSerialNos.php:258 msgid "The input must be in number format" @@ -38149,7 +38149,7 @@ #: WOSerialNos.php:267 msgid "Add a single serial number" -msgstr "Agregar un sólo número de serie" +msgstr "Añadir un sólo número de serie" #: WOSerialNos.php:271 msgid "Batch/Lot Ref" @@ -45957,11 +45957,11 @@ #: includes/PDFGLJournalHeader.inc:11 msgid "Journal number " -msgstr "Número de diario" +msgstr "Número en libro diario" #: includes/PDFGLJournalHeader.inc:12 msgid "Journal Date " -msgstr "Fecha de diario" +msgstr "Fecha en libro diario" #: includes/PDFGLJournalHeader.inc:23 msgid "Tag Details" @@ -48275,7 +48275,7 @@ #: includes/DatabaseTranslations.php:22 msgid "Journal - GL" -msgstr "Diario contable" +msgstr "Libro diario" #: includes/DatabaseTranslations.php:23 msgid "Payment - GL" @@ -48291,7 +48291,7 @@ #: includes/DatabaseTranslations.php:29 msgid "Journal - Debtors" -msgstr "" +msgstr "Libro diario - Deudores" #: includes/DatabaseTranslations.php:34 msgid "Purchase Invoice" @@ -48964,7 +48964,7 @@ #: includes/MainMenuLinksArray.php:163 msgid "Add Supplier" -msgstr "Agregar proveedor" +msgstr "Añadir proveedor" #: includes/MainMenuLinksArray.php:165 msgid "Maintain Factor Companies" @@ -49113,7 +49113,7 @@ #: includes/MainMenuLinksArray.php:276 msgid "Add or Update Prices Based On Costs" -msgstr "Añadir ó Actualizar Precios Basados en Costos" +msgstr "Añadir o actualizar precios basados en costos" #: includes/MainMenuLinksArray.php:277 msgid "View or Update Prices Based On Costs" |
From: <vv...@us...> - 2015-03-30 21:46:49
|
Revision: 7245 http://sourceforge.net/p/web-erp/reponame/7245 Author: vvs2012 Date: 2015-03-30 21:46:47 +0000 (Mon, 30 Mar 2015) Log Message: ----------- $RootPath was not set in EmailCustTrans.php Modified Paths: -------------- trunk/EmailCustTrans.php Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2015-03-30 21:32:49 UTC (rev 7244) +++ trunk/EmailCustTrans.php 2015-03-30 21:46:47 UTC (rev 7245) @@ -2,8 +2,9 @@ /* $Id$*/ -include ('includes/session.inc'); -include ('includes/SQL_CommonFunctions.inc'); +include('includes/session.inc'); +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); if ($_GET['InvOrCredit']=='Invoice'){ $TransactionType = _('Invoice'); |
From: <vv...@us...> - 2015-03-30 21:32:52
|
Revision: 7244 http://sourceforge.net/p/web-erp/reponame/7244 Author: vvs2012 Date: 2015-03-30 21:32:49 +0000 (Mon, 30 Mar 2015) Log Message: ----------- Update Order did not work in Firefox. Error in pattern attribute. Modified Paths: -------------- trunk/TaxGroups.php Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2015-03-30 21:12:13 UTC (rev 7243) +++ trunk/TaxGroups.php 2015-03-30 21:32:49 UTC (rev 7244) @@ -93,7 +93,7 @@ while($myrow=DB_fetch_row($Result)) { - if(is_numeric($_POST['CalcOrder_' . $myrow[0]]) AND $_POST['CalcOrder_' . $myrow[0]] <5) { + if(is_numeric($_POST['CalcOrder_' . $myrow[0]]) AND $_POST['CalcOrder_' . $myrow[0]] < 10) { $sql = "UPDATE taxgrouptaxes SET calculationorder='" . $_POST['CalcOrder_' . $myrow[0]] . "', @@ -304,7 +304,7 @@ $j++; } echo '<td>' . $TaxAuthRow[$i]['taxname'] . '</td> - <td><input type="text" class="integer" pattern="[1-4] {1}" title="'._('The input must be positive integer and less than 5').'" name="CalcOrder_' . $TaxAuthRow[$i]['taxauthid'] . '" value="' . $TaxAuthRow[$i]['calculationorder'] . '" size="2" maxlength="2" style="width: 100%" /></td> + <td><input type="text" class="integer" pattern="(?!^0*$)(\d+)" title="'._('The input must be positive integer and less than 10').'" name="CalcOrder_' . $TaxAuthRow[$i]['taxauthid'] . '" value="' . $TaxAuthRow[$i]['calculationorder'] . '" size="1" maxlength="1" style="width: 90%" /></td> <td><select name="TaxOnTax_' . $TaxAuthRow[$i]['taxauthid'] . '" style="width: 100%">'; if($TaxAuthRow[$i]['taxontax']==1) { echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; |
From: <vv...@us...> - 2015-03-30 21:12:20
|
Revision: 7243 http://sourceforge.net/p/web-erp/reponame/7243 Author: vvs2012 Date: 2015-03-30 21:12:13 +0000 (Mon, 30 Mar 2015) Log Message: ----------- Get all taxes for the tax group, even if calculationorder is left at default value 0. Modified Paths: -------------- trunk/doc/Change.log trunk/includes/DefineCartClass.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-30 09:54:16 UTC (rev 7242) +++ trunk/doc/Change.log 2015-03-30 21:12:13 UTC (rev 7243) @@ -1,5 +1,6 @@ webERP Change Log +30/3/15 Vitaly: Get all taxes for the tax group, even if calculationorder is left at default value 0. 29/3/15 Phil: Allow dummy/service items to be propogated to CounterLogic POS installs through the api 27/03/15 Exson: Remove redundant code from PrintCustTrans.php. 27/03/15 Exson: Make credit not for freight only is printable in PrintCustTrans.php. Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2015-03-30 09:54:16 UTC (rev 7242) +++ trunk/includes/DefineCartClass.php 2015-03-30 21:12:13 UTC (rev 7243) @@ -310,15 +310,16 @@ $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($sql,$ErrMsg); - + $i=1; while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - $this->LineItems[$LineNumber]->Taxes[$myrow['taxcalculationorder']] = new Tax($myrow['taxcalculationorder'], + $this->LineItems[$LineNumber]->Taxes[$i] = new Tax($myrow['taxcalculationorder'], $myrow['taxauthid'], $myrow['description'], $myrow['taxrate'], $myrow['taxontax'], $myrow['taxglcode']); + $i++; } } //end method GetExistingTaxes @@ -350,15 +351,16 @@ if (DB_num_rows($GetTaxRatesResult)==0){ prnMsg(_('It appears that taxes are not defined correctly for this customer tax group') ,'error'); } else { - + $i=1; while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], + $this->LineItems[$LineNumber]->Taxes[$i] = new Tax($myrow['calculationorder'], $myrow['taxauthid'], $myrow['description'], $myrow['taxrate'], $myrow['taxontax'], $myrow['taxglcode']); + $i++; } //end loop around different taxes } //end if there are some taxes defined } //end method GetTaxes @@ -397,15 +399,16 @@ $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($SQL,$ErrMsg); - + $i=1; while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - $this->FreightTaxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], + $this->FreightTaxes[$i] = new Tax($myrow['calculationorder'], $myrow['taxauthid'], $myrow['description'], $myrow['taxrate'], $myrow['taxontax'], $myrow['taxglcode']); + $i++; } } //end method GetFreightTaxes() |
From: <te...@us...> - 2015-03-30 09:54:18
|
Revision: 7242 http://sourceforge.net/p/web-erp/reponame/7242 Author: tehonu Date: 2015-03-30 09:54:16 +0000 (Mon, 30 Mar 2015) Log Message: ----------- Bug fix on gross profit calculation Modified Paths: -------------- trunk/GLTagProfit_Loss.php Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2015-03-30 00:04:01 UTC (rev 7241) +++ trunk/GLTagProfit_Loss.php 2015-03-30 09:54:16 UTC (rev 7242) @@ -526,7 +526,7 @@ echo '<tr> <th colspan="9"> <div class="centre"> - <h2><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></h2> + <h2><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]. ' ' . _('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></h2> </div> </th> </tr>'; @@ -553,11 +553,9 @@ $SectionPrdBudget= 0; $PeriodProfitLoss = 0; - $PeriodProfitLoss = 0; $PeriodLYProfitLoss = 0; $PeriodBudgetProfitLoss = 0; - $ActGrp =''; $ParentGroups = array(); $Level = 0; @@ -687,10 +685,10 @@ <td></td> <td class="number">%s</td> </tr>', - locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); + locale_number_format($TotalIncome + $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); if ($TotalIncome !=0){ - $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; + $PrdGPPercent = 100*($TotalIncome + $SectionPrdActual)/$TotalIncome; } else { $PrdGPPercent =0; } |
From: <te...@us...> - 2015-03-30 00:04:03
|
Revision: 7241 http://sourceforge.net/p/web-erp/reponame/7241 Author: tehonu Date: 2015-03-30 00:04:01 +0000 (Mon, 30 Mar 2015) Log Message: ----------- Moved 2 sales reports from Receivables to Sales module Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2015-03-29 06:47:12 UTC (rev 7240) +++ trunk/includes/MainMenuLinksArray.php 2015-03-30 00:04:01 UTC (rev 7241) @@ -57,6 +57,8 @@ _('Sales By Sales Type Inquiry'), _('Sales By Category Inquiry'), _('Sales By Category By Item Inquiry'), + _('Sales Analysis Reports'), + _('Sales Graphs'), _('Top Sellers Inquiry'), _('Order Delivery Differences Report'), _('Delivery In Full On Time (DIFOT) Report'), @@ -75,6 +77,8 @@ '/SalesByTypePeriodInquiry.php', '/SalesCategoryPeriodInquiry.php', '/StockCategorySalesInquiry.php', + '/SalesAnalRepts.php', + '/SalesGraph.php', '/SalesTopItemsInquiry.php', '/PDFDeliveryDifferences.php', '/PDFDIFOT.php', @@ -105,12 +109,10 @@ $MenuItems['AR']['Reports']['Caption'] = array( _('Where Allocated Inquiry'), _('Print Invoices or Credit Notes'), _('Print Statements'), - _('Sales Analysis Reports'), _('Aged Customer Balances/Overdues Report'), _('Re-Print A Deposit Listing'), _('Debtor Balances At A Prior Month End'), _('Customer Listing By Area/Salesperson'), - _('Sales Graphs'), _('List Daily Transactions'), _('Customer Transaction Inquiries'), _('Customer Activity and Balances')); @@ -124,12 +126,10 @@ $MenuItems['AR']['Reports']['URL'] = array( '/CustWhereAlloc.php', $PrintInvoicesOrCreditNotesScript, '/PrintCustStatements.php', - '/SalesAnalRepts.php', '/AgedDebtors.php', '/PDFBankingSummary.php', '/DebtorsAtPeriodEnd.php', '/PDFCustomerList.php', - '/SalesGraph.php', '/PDFCustTransListing.php', '/CustomerTransInquiry.php', '/CustomerBalancesMovement.php' ); |
From: <dai...@us...> - 2015-03-29 06:47:19
|
Revision: 7240 http://sourceforge.net/p/web-erp/reponame/7240 Author: daintree Date: 2015-03-29 06:47:12 +0000 (Sun, 29 Mar 2015) Log Message: ----------- allow dummy/service items to be downloaded with the data refresh to the POS Modified Paths: -------------- trunk/doc/Change.log trunk/includes/Z_POSDataCreation.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-27 13:57:20 UTC (rev 7239) +++ trunk/doc/Change.log 2015-03-29 06:47:12 UTC (rev 7240) @@ -1,9 +1,10 @@ webERP Change Log +29/3/15 Phil: Allow dummy/service items to be propogated to CounterLogic POS installs through the api 27/03/15 Exson: Remove redundant code from PrintCustTrans.php. 27/03/15 Exson: Make credit not for freight only is printable in PrintCustTrans.php. 26/03/15 Exson: Fixed disabletrans status bug in CustomerBranches.php and fix index undefined noise. -25/03/15 Exson: Add planned accumulation in MRP report. +25/03/15 Exson: Add planned accumulation in MRP report. 14/03/15 Exson: Fixed undefined index noise in Credit_Invoice.php. 13/03/15 Exson: fixed the undefined index noise in WorkOrderReceive.php. 13/03/15 Exson: Fixed the undefined index noise in SelectWorkOrder.php. @@ -13,7 +14,7 @@ 11/3/15 Exson: Fixed wrong handling for dummy parts receiving from PO in GoodsReceived.php. 09/03/15 Vitaly: Page refresh when credit type changes in Credit_Invoce.php 09/03/15 RChacon: In DailyBankTransactions.php: Improves page_title_text. Orders by banktrans.transdate ascending and banktrans.banktransid ascending. Adds division to identify the report block. Groups table-header cells inside thead tags. Groups table-data cells inside tbody tags. Adds th.text class to left align. Adds "Print This" and "Return" buttons with icon. -09/03/15 Exson: Fixed undefined index noise of $_POST['SupplierContact'] in PO_Header.php. +09/03/15 Exson: Fixed undefined index noise of $_POST['SupplierContact'] in PO_Header.php. 08/03/15 Vitaly: Fit HTML view of invoices to one screen 08/03/15 Exson: Fixed undefined index noise in PO_Items.php. 07/03/15 RChacon: Deletes class="invoice" (it does not exist in css). Creates division id="Report" to identify the report block. Moves full width style to print.css (thanks Tim Schofield). Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2015-03-27 13:57:20 UTC (rev 7239) +++ trunk/includes/Z_POSDataCreation.php 2015-03-29 06:47:12 UTC (rev 7240) @@ -122,7 +122,7 @@ fwrite($FileHandle,"DELETE FROM stockmaster;\n"); - $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces, discountcategory FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0"); + $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces, discountcategory FROM stockmaster WHERE (mbflag='B' OR mbflag='M' OR mbflag='D') AND discontinued=0 AND controlled=0"); while ($myrow = DB_fetch_array($result)) { |
From: <ex...@us...> - 2015-03-27 13:57:27
|
Revision: 7239 http://sourceforge.net/p/web-erp/reponame/7239 Author: exsonqu Date: 2015-03-27 13:57:20 +0000 (Fri, 27 Mar 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-27 13:56:35 UTC (rev 7238) +++ trunk/doc/Change.log 2015-03-27 13:57:20 UTC (rev 7239) @@ -1,4 +1,6 @@ webERP Change Log + +27/03/15 Exson: Remove redundant code from PrintCustTrans.php. 27/03/15 Exson: Make credit not for freight only is printable in PrintCustTrans.php. 26/03/15 Exson: Fixed disabletrans status bug in CustomerBranches.php and fix index undefined noise. 25/03/15 Exson: Add planned accumulation in MRP report. |
From: <ex...@us...> - 2015-03-27 13:56:43
|
Revision: 7238 http://sourceforge.net/p/web-erp/reponame/7238 Author: exsonqu Date: 2015-03-27 13:56:35 +0000 (Fri, 27 Mar 2015) Log Message: ----------- 27/03/15 Exson: Remove redundant code from PrintCustTrans.php. Modified Paths: -------------- trunk/PrintCustTrans.php Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2015-03-27 09:37:29 UTC (rev 7237) +++ trunk/PrintCustTrans.php 2015-03-27 13:56:35 UTC (rev 7238) @@ -11,8 +11,6 @@ $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { $FromTransNo = filter_number_format($_POST['FromTransNo']); -} else { - $FromTransNo = ''; } if (isset($_GET['InvOrCredit'])) { @@ -36,11 +34,7 @@ $FirstTrans = $FromTransNo; /* Need to start a new page only on subsequent transactions */ -if (isset($PrintPDF) OR isset($_GET['PrintPDF']) - AND $PrintPDF - AND isset($FromTransNo) - AND isset($InvOrCredit) - AND $FromTransNo!=''){ +if (isset($PrintPDF) AND isset($FromTransNo) AND isset($InvOrCredit)){ include ('includes/class.pdf.php'); @@ -59,7 +53,7 @@ $pdf->addInfo('Author', 'webERP ' . $Version); if ($InvOrCredit=='Invoice') { - $pdf->addInfo('Title',_('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); + $pdf->addInfo('Title',_('Sales Invoice') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); $pdf->addInfo('Subject',_('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } else { $pdf->addInfo('Title',_('Sales Credit Note') ); |
From: <ex...@us...> - 2015-03-27 09:37:36
|
Revision: 7237 http://sourceforge.net/p/web-erp/reponame/7237 Author: exsonqu Date: 2015-03-27 09:37:29 +0000 (Fri, 27 Mar 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-27 09:36:57 UTC (rev 7236) +++ trunk/doc/Change.log 2015-03-27 09:37:29 UTC (rev 7237) @@ -1,5 +1,5 @@ webERP Change Log - +27/03/15 Exson: Make credit not for freight only is printable in PrintCustTrans.php. 26/03/15 Exson: Fixed disabletrans status bug in CustomerBranches.php and fix index undefined noise. 25/03/15 Exson: Add planned accumulation in MRP report. 14/03/15 Exson: Fixed undefined index noise in Credit_Invoice.php. |
From: <ex...@us...> - 2015-03-27 09:37:00
|
Revision: 7236 http://sourceforge.net/p/web-erp/reponame/7236 Author: exsonqu Date: 2015-03-27 09:36:57 +0000 (Fri, 27 Mar 2015) Log Message: ----------- 27/03/15 Exson: Make credit not for freight only is printable in PrintCustTrans.php. Modified Paths: -------------- trunk/PrintCustTrans.php Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2015-03-26 08:47:47 UTC (rev 7235) +++ trunk/PrintCustTrans.php 2015-03-27 09:36:57 UTC (rev 7236) @@ -273,8 +273,8 @@ } // end else $result=DB_query($sql); - if (DB_error_no()!=0 OR DB_num_rows($result)==0) { - + if (DB_error_no()!=0 OR (DB_num_rows($result)==0 AND $InvOrCredit == 'Invoice')) { + $Title = _('Transaction Print Error Report'); include ('includes/header.inc'); echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); @@ -698,7 +698,7 @@ } $result=DB_query($sql); - if (DB_num_rows($result)==0 OR DB_error_no()!=0) { + if ((DB_num_rows($result)==0 AND $InvOrCredit == 'Invoice') OR (DB_error_no()!=0)) { echo '<p>' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'); if ($debug==1) { echo _('The SQL used to get this information that failed was') . '<br />' . $sql; |
From: <ex...@us...> - 2015-03-26 08:47:50
|
Revision: 7235 http://sourceforge.net/p/web-erp/reponame/7235 Author: exsonqu Date: 2015-03-26 08:47:47 +0000 (Thu, 26 Mar 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-26 08:46:59 UTC (rev 7234) +++ trunk/doc/Change.log 2015-03-26 08:47:47 UTC (rev 7235) @@ -1,5 +1,6 @@ webERP Change Log +26/03/15 Exson: Fixed disabletrans status bug in CustomerBranches.php and fix index undefined noise. 25/03/15 Exson: Add planned accumulation in MRP report. 14/03/15 Exson: Fixed undefined index noise in Credit_Invoice.php. 13/03/15 Exson: fixed the undefined index noise in WorkOrderReceive.php. |
From: <ex...@us...> - 2015-03-26 08:47:01
|
Revision: 7234 http://sourceforge.net/p/web-erp/reponame/7234 Author: exsonqu Date: 2015-03-26 08:46:59 +0000 (Thu, 26 Mar 2015) Log Message: ----------- 26/03/15 Exson: Fixed disabletrans status bug in CustomerBranches.php and fix index undefined noise. Modified Paths: -------------- trunk/CustomerBranches.php Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2015-03-25 05:26:45 UTC (rev 7233) +++ trunk/CustomerBranches.php 2015-03-26 08:46:59 UTC (rev 7234) @@ -458,7 +458,7 @@ urlencode($myrow[1]), _('Delete Branch')); - if ($myrow[11]){ + if ($myrow[10]){ $TotalDisable++; }else { $TotalEnable++; @@ -881,7 +881,7 @@ <tr> <td>' . _('Transactions on this branch') . ':</td> <td><select tabindex="20" name="DisableTrans">'; - if ($_POST['DisableTrans']==0){ + if (isset($_POST['DisableTrans']) AND $_POST['DisableTrans']==0){ echo '<option selected="selected" value="0">' . _('Enabled') . '</option> <option value="1">' . _('Disabled') . '</option>'; } else { @@ -991,4 +991,4 @@ } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2015-03-25 05:26:53
|
Revision: 7233 http://sourceforge.net/p/web-erp/reponame/7233 Author: exsonqu Date: 2015-03-25 05:26:45 +0000 (Wed, 25 Mar 2015) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-25 05:25:28 UTC (rev 7232) +++ trunk/doc/Change.log 2015-03-25 05:26:45 UTC (rev 7233) @@ -1,5 +1,6 @@ webERP Change Log +25/03/15 Exson: Add planned accumulation in MRP report. 14/03/15 Exson: Fixed undefined index noise in Credit_Invoice.php. 13/03/15 Exson: fixed the undefined index noise in WorkOrderReceive.php. 13/03/15 Exson: Fixed the undefined index noise in SelectWorkOrder.php. |
From: <ex...@us...> - 2015-03-25 05:25:35
|
Revision: 7232 http://sourceforge.net/p/web-erp/reponame/7232 Author: exsonqu Date: 2015-03-25 05:25:28 +0000 (Wed, 25 Mar 2015) Log Message: ----------- 25/03/15 Exson: Add planned accumulation in MRP report. Modified Paths: -------------- trunk/MRPReport.php Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2015-03-24 14:09:01 UTC (rev 7231) +++ trunk/MRPReport.php 2015-03-25 05:25:28 UTC (rev 7232) @@ -204,13 +204,17 @@ $YPos -= (2*$line_height); // Calculate fields for prjected available weekly buckets + $plannedaccum = array(); $pastdueavail = ($qoh + $PastDueSup + $pastdueplan) - $PastDueReq; $weeklyavail = array(); $weeklyavail[0] = ($pastdueavail + $WeeklySup[0] + $weeklyplan[0]) - $WeeklyReq[0]; + $plannedaccum[0] = $pastdueplan + $weeklyplan[0]; for ($i = 1; $i < 28; $i++) { $weeklyavail[$i] = ($weeklyavail[$i - 1] + $WeeklySup[$i] + $weeklyplan[$i]) - $WeeklyReq[$i]; + $plannedaccum[$i] = $plannedaccum[$i-1] + $weeklyplan[$i]; } $futureavail = ($weeklyavail[27] + $FutureSup + $futureplan) - $FutureReq; + $futureplannedaccum = $plannedaccum[27] + $futureplan; // Headers for Weekly Buckets $FontSize =7; @@ -275,6 +279,14 @@ $pdf->addTextWrap(400,$YPos,45,$FontSize,locale_number_format($weeklyavail[6],0),'right'); $pdf->addTextWrap(445,$YPos,45,$FontSize,locale_number_format($weeklyavail[7],0),'right'); $pdf->addTextWrap(490,$YPos,45,$FontSize,locale_number_format($weeklyavail[8],0),'right'); + $YPos -=$line_height; + $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Planned Acc')); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,locale_number_format($pastdueplan,0),'right'); + $InitialPoint = 130; + for($c=0;$c<9;$c++){ + $pdf->addTextWrap($InitialPoint,$YPos,45,$FontSize,locale_number_format($plannedaccum[$c],0),'right'); + $InitialPoint += 45; + } $YPos -= 2 * $line_height; // Second Group of Weeks @@ -337,6 +349,14 @@ $pdf->addTextWrap(400,$YPos,45,$FontSize,locale_number_format($weeklyavail[16],0),'right'); $pdf->addTextWrap(445,$YPos,45,$FontSize,locale_number_format($weeklyavail[17],0),'right'); $pdf->addTextWrap(490,$YPos,45,$FontSize,locale_number_format($weeklyavail[18],0),'right'); + $YPos -=$line_height; + $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Planned Acc')); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,locale_number_format($plannedaccum[9],0),right); + $InitialPoint = 130; + for($c=10;$c<19;$c++){ + $pdf->addTextWrap($InitialPoint,$YPos,45,$FontSize,locale_number_format($plannedaccum[$c],0),'right'); + $InitialPoint += 45; + } $YPos -= 2 * $line_height; // Third Group of Weeks @@ -400,6 +420,14 @@ $pdf->addTextWrap(445,$YPos,45,$FontSize,locale_number_format($weeklyavail[27],0),'right'); $pdf->addTextWrap(490,$YPos,45,$FontSize,locale_number_format($futureavail,0),'right'); $YPos -=$line_height; + $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Planned Acc')); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,locale_number_format($plannedaccum[19],0),'right'); + $InitialPoint = 130; + for($c=20;$c<28;$c++){ + $pdf->addTextWrap($InitialPoint,$YPos,45,$FontSize,locale_number_format($plannedaccum[$c],0),'right'); + $InitialPoint += 45; + } + $pdf->addTextWrap(490,$YPos,45,$FontSize,locale_number_format($futureplannedaccum,0),'right'); // Headers for Demand/Supply Sections $YPos -= (2*$line_height); @@ -828,4 +856,4 @@ } // End of PrintHeader function -?> \ No newline at end of file +?> |
From: <aga...@us...> - 2015-03-24 14:09:08
|
Revision: 7231 http://sourceforge.net/p/web-erp/reponame/7231 Author: agaluski Date: 2015-03-24 14:09:01 +0000 (Tue, 24 Mar 2015) Log Message: ----------- Change HTML input fields to match database tables. Lot/Serial to 25 from 15, Identifier to 10 from 15. Modified Paths: -------------- trunk/SelectQASamples.php Modified: trunk/SelectQASamples.php =================================================================== --- trunk/SelectQASamples.php 2015-03-21 22:04:27 UTC (rev 7230) +++ trunk/SelectQASamples.php 2015-03-24 14:09:01 UTC (rev 7231) @@ -278,7 +278,7 @@ <tr> <td></td> <td><b>' . _('OR') . ' </b>' . _('Enter extract of the') . '<b> ' . _('Stock Code') . '</b>:</td> - <td><input type="text" name="StockCode" size="15" maxlength="18" /></td> + <td><input type="text" name="StockCode" size="20" maxlength="25" /></td> </tr> <tr> <td colspan="3"> @@ -501,7 +501,7 @@ </tr> <tr> <td>' . _('Identifier') . ':</td> - <td><input type="text" name="Identifier" size="15" maxlength="15" value="' . $_POST['Identifier']. '" /></td> + <td><input type="text" name="Identifier" size="10" maxlength="10" value="' . $_POST['Identifier']. '" /></td> </tr> <tr> <td>' . _('Comments') . ':</td> @@ -557,11 +557,11 @@ </tr> <tr> <td>' . _('Lot') . ':</td> - <td><input type="text" required="required" name="LotKey" size="15" maxlength="15" value="' . (isset($_POST['LotKey'])? $_POST['LotKey']:'') . '" /></td> + <td><input type="text" required="required" name="LotKey" size="25" maxlength="25" value="' . (isset($_POST['LotKey'])? $_POST['LotKey']:'') . '" /></td> </tr> <tr> <td>' . _('Identifier') . ':</td> - <td><input type="text" name="Identifier" size="15" maxlength="15" value="' . (isset($_POST['Identifier'])? $_POST['Identifier']:'') . '" /></td> + <td><input type="text" name="Identifier" size="10" maxlength="10" value="' . (isset($_POST['Identifier'])? $_POST['Identifier']:'') . '" /></td> </tr> <tr> <td>' . _('Comments') . ':</td> |