From: <vv...@us...> - 2015-03-05 01:28:17
|
Revision: 7187 http://sourceforge.net/p/web-erp/reponame/7187 Author: vvs2012 Date: 2015-03-05 01:28:14 +0000 (Thu, 05 Mar 2015) Log Message: ----------- Added missing comma to SQL statement in Credit_Invoice.php Modified Paths: -------------- trunk/Credit_Invoice.php trunk/doc/Change.log Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2015-03-04 13:12:03 UTC (rev 7186) +++ trunk/Credit_Invoice.php 2015-03-05 01:28:14 UTC (rev 7187) @@ -922,7 +922,7 @@ '" . $CreditNo . "', '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['UserID'] . "' + '" . $_SESSION['UserID'] . "', '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $LocalCurrencyPrice . "', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-04 13:12:03 UTC (rev 7186) +++ trunk/doc/Change.log 2015-03-05 01:28:14 UTC (rev 7187) @@ -1,5 +1,6 @@ webERP Change Log +3/4/15 Vitaly: Added missing comma to SQL statement in Credit_Invoice.php 3/3/15 RChacon: Adds cross.png to all css images for use in Reset or Cancel buttons as needed. 2/3/15 RChacon: Completes table-row colums, regroups price, cost and gross profit in one table-row, uses company decimal places for gross profit in SelectProduct.php. 25/2/15 TurboPT: Fix Z_ImportSupplier bug reported in forum by: Bill Schlaerth. |
From: <vv...@us...> - 2015-03-05 01:57:26
|
Revision: 7188 http://sourceforge.net/p/web-erp/reponame/7188 Author: vvs2012 Date: 2015-03-05 01:57:24 +0000 (Thu, 05 Mar 2015) Log Message: ----------- Display Phantom assembly type correctly in SelectProduct.php Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2015-03-05 01:28:14 UTC (rev 7187) +++ trunk/SelectProduct.php 2015-03-05 01:57:24 UTC (rev 7188) @@ -101,6 +101,11 @@ echo _('Assembly Item'); $Its_A_Kitset_Assembly_Or_Dummy = True; break; + case 'G': + echo _('Phantom Assembly Item'); + $Its_A_Kitset_Assembly_Or_Dummy = True; + $Its_A_Kitset = True; + break; case 'K': echo _('Kitset Item'); $Its_A_Kitset_Assembly_Or_Dummy = True; @@ -147,7 +152,7 @@ AND branchcode='' AND startdate <= '". Date('Y-m-d') ."' AND ( enddate >= '" . Date('Y-m-d') . "' OR enddate = '0000-00-00') AND stockid='" . $StockID . "'"); - if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { + if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A' OR $myrow['mbflag'] == 'G') { $CostResult = DB_query("SELECT SUM(bom.quantity * (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost FROM bom INNER JOIN stockmaster ON bom.component=stockmaster.stockid Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-05 01:28:14 UTC (rev 7187) +++ trunk/doc/Change.log 2015-03-05 01:57:24 UTC (rev 7188) @@ -1,5 +1,6 @@ webERP Change Log +3/4/15 Vitaly: Display Phantom assembly type correctly in SelectProduct.php 3/4/15 Vitaly: Added missing comma to SQL statement in Credit_Invoice.php 3/3/15 RChacon: Adds cross.png to all css images for use in Reset or Cancel buttons as needed. 2/3/15 RChacon: Completes table-row colums, regroups price, cost and gross profit in one table-row, uses company decimal places for gross profit in SelectProduct.php. |
From: <rc...@us...> - 2015-03-05 23:49:09
|
Revision: 7189 http://sourceforge.net/p/web-erp/reponame/7189 Author: rchacon Date: 2015-03-05 23:49:01 +0000 (Thu, 05 Mar 2015) Log Message: ----------- Format improvement: makes the body of the report use the entire width of the page. Modified Paths: -------------- trunk/GLBalanceSheet.php trunk/GLProfit_Loss.php Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2015-03-05 01:57:24 UTC (rev 7188) +++ trunk/GLBalanceSheet.php 2015-03-05 23:49:01 UTC (rev 7189) @@ -400,7 +400,7 @@ _('All amounts stated in').': '. _($CurrencyName[$_SESSION['CompanyRecord']['currencydefault']]).'</p>';// Page title, reporting presentation currency and level of rounding used. echo '<div class="invoice"> - <table class="selection">'; + <table class="selection" width="100%">'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> @@ -416,8 +416,8 @@ <th colspan="2">' ._('Last Year') . '</th> </tr>'; } +/* echo '<thead>' . $TableHeader . '<thead><tbody>';// thead used in conjunction with tbody enable scrolling of the table body independently of the header and footer. Also, when printing a large table that spans multiple pages, these elements can enable the table header to be printed at the top of each page. */ - $k=0; //row colour counter $Section=''; $SectionBalance = 0; @@ -704,20 +704,18 @@ <td></td> <td><hr /></td> </tr>'; - +/* echo '</tbody>';// See comment at the begin of the table.*/ echo '</table>'; echo '</div>'; - echo '<br />'; -/* <div class="centre noprint"><input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Balance Date').'" /></div>';*/ - -echo '<div class="centre noprint">'. + echo '<br /> + <div class="centre noprint">'. '<button onclick="javascript:window.print()" type="button"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/printer.png" /> ' . _('Print This') . '</button>'.// "Print This" button. '<button name="SelectADifferentPeriod" type="submit" value="'. _('Select A Different Period') .'"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" /> ' . _('Select A Different Balance Date') . '</button>'.// "Select A Different Period" button. '<button formaction="index.php" type="submit"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/previous.png" /> ' . _('Return') . '</button>'.// "Return" button. - '</div>'; + '</div>'; echo '</div></form>'; } Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2015-03-05 01:57:24 UTC (rev 7188) +++ trunk/GLProfit_Loss.php 2015-03-05 23:49:01 UTC (rev 7189) @@ -625,7 +625,7 @@ /*show a table of the accounts info returned by the SQL Account Code , Account Name , Month Actual, Month Budget, Period Actual, Period Budget */ - echo '<table class="selection">'; + echo '<table class="selection" width="100%">'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> @@ -643,8 +643,8 @@ <th colspan="2">' . _('Last Year') . '</th> </tr>'; } +/* echo '<thead>' . $TableHeader . '<thead><tbody>';// thead used in conjunction with tbody enable scrolling of the table body independently of the header and footer. Also, when printing a large table that spans multiple pages, these elements can enable the table header to be printed at the top of each page. */ - $j = 1; $k=0; //row colour counter $Section=''; @@ -1301,6 +1301,7 @@ <td colspan="2"></td> <td colspan="6"><hr /></td> </tr>'; +/* echo '</tbody>';// See comment at the begin of the table.*/ echo '</table>'; echo '<br /> <div class="centre noprint">'. |
From: <rc...@us...> - 2015-03-07 17:44:44
|
Revision: 7206 http://sourceforge.net/p/web-erp/reponame/7206 Author: rchacon Date: 2015-03-07 17:44:35 +0000 (Sat, 07 Mar 2015) Log Message: ----------- 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 Paths: -------------- trunk/GLBalanceSheet.php trunk/GLProfit_Loss.php trunk/css/aguapop/default.css trunk/css/default/default.css trunk/css/fluid/default.css trunk/css/fresh/default.css trunk/css/gel/default.css trunk/css/print.css trunk/css/professional/default.css trunk/css/professional-rtl/default.css trunk/css/silverwolf/default.css trunk/css/wood/default.css trunk/css/xenos/default.css trunk/doc/Change.log Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/GLBalanceSheet.php 2015-03-07 17:44:35 UTC (rev 7206) @@ -29,7 +29,7 @@ . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; + echo '<div>';// div class=? echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"> <tr> @@ -76,7 +76,8 @@ <div class="centre"> <input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'" /> </div>'; - echo '</div></form>'; + echo '</div>';// div class=? + echo '</form>'; /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -340,7 +341,7 @@ } else { include('includes/header.inc'); echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; + echo '<div>';// div class=? echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="BalancePeriodEnd" value="' . $_POST['BalancePeriodEnd'] . '" />'; @@ -390,6 +391,7 @@ // Page title as IAS1 numerals 10 and 51: include_once('includes/CurrenciesArray.php');// Array to retrieve currency name. + echo '<div id="Report">';// Division to identify the report block. echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" title="' .// Icon image. _('Statement of Financial Position') . '" /> ' .// Icon title. @@ -399,8 +401,7 @@ _('as at') . ' ' . $BalanceDate . '<br />' .// Page title, reporting period. _('All amounts stated in').': '. _($CurrencyName[$_SESSION['CompanyRecord']['currencydefault']]).'</p>';// Page title, reporting presentation currency and level of rounding used. - echo '<div class="invoice"> - <table class="selection" width="100%">'; + echo '<table class="selection">'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> @@ -706,18 +707,19 @@ </tr>'; /* echo '</tbody>';// See comment at the begin of the table.*/ echo '</table>'; - echo '</div>'; + echo '</div>';// div id="Report". echo '<br /> <div class="centre noprint">'. '<button onclick="javascript:window.print()" type="button"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/printer.png" /> ' . _('Print This') . '</button>'.// "Print This" button. '<button name="SelectADifferentPeriod" type="submit" value="'. _('Select A Different Period') .'"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" /> ' . _('Select A Different Balance Date') . '</button>'.// "Select A Different Period" button. - '<button formaction="index.php" type="submit"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '<button formaction="index.php?Application=GL" type="submit"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/previous.png" /> ' . _('Return') . '</button>'.// "Return" button. '</div>'; - echo '</div></form>'; + echo '</div>';// div class=? + echo '</form>'; } include('includes/footer.inc'); Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/GLProfit_Loss.php 2015-03-07 17:44:35 UTC (rev 7206) @@ -33,7 +33,7 @@ . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; + echo '<div>';// div class=? echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (Date('m') > $_SESSION['YearEnd']){ @@ -564,7 +564,7 @@ include('includes/header.inc'); echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; + echo '<div>';// div class=? echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> <input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; @@ -612,6 +612,7 @@ // Page title as IAS1 numerals 10 and 51: include_once('includes/CurrenciesArray.php');// Array to retrieve currency name. + echo '<div id="Report">';// Division to identify the report block. echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" title="' .// Icon image. _('Statement of Comprehensive Income') . '" /> ' .// Icon title. @@ -619,13 +620,13 @@ // _('Statement of Comprehensive Income') . '<br />' .// Page title, reporting statement. stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' .// Page title, reporting entity. _('For') . ' ' . $NumberOfMonths . ' ' . _('months to') . ' ' . $PeriodToDate . '<br />' .// Page title, reporting period. -// _('From') . ' ' . $PeriodFromDate? . ' ' . _('to') . ' ' . $PeriodToDate . '<br />' .// Page title, reporting period. ?????????? +// _('From') . ' ' . $PeriodFromDate? . ' ' . _('to') . ' ' . $PeriodToDate . '<br />' .// Page title, reporting period. ??? _('All amounts stated in').': '. _($CurrencyName[$_SESSION['CompanyRecord']['currencydefault']]).'</p>';// Page title, reporting presentation currency and level of rounding used. /*show a table of the accounts info returned by the SQL Account Code , Account Name , Month Actual, Month Budget, Period Actual, Period Budget */ - echo '<table class="selection" width="100%">'; + echo '<table class="selection">'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> @@ -1303,17 +1304,18 @@ </tr>'; /* echo '</tbody>';// See comment at the begin of the table.*/ echo '</table>'; + echo '</div>';// div id="Report". echo '<br /> <div class="centre noprint">'. '<button onclick="javascript:window.print()" type="button"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/printer.png" /> ' . _('Print This') . '</button>'.// "Print This" button. '<button name="SelectADifferentPeriod" type="submit" value="'. _('Select A Different Period') .'"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" /> ' . _('Select A Different Period') . '</button>'.// "Select A Different Period" button. - '<button formaction="index.php" type="submit"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '<button formaction="index.php?Application=GL" type="submit"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/previous.png" /> ' . _('Return') . '</button>'.// "Return" button. '</div>'; } -echo '</div>'; +echo '</div>';// div class=? echo '</form>'; include('includes/footer.inc'); Modified: trunk/css/aguapop/default.css =================================================================== --- trunk/css/aguapop/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/aguapop/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -481,7 +481,12 @@ #FooterTimeDiv{ float:right; margin-top:15px; -} +} +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/default/default.css =================================================================== --- trunk/css/default/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/default/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -275,7 +275,7 @@ /*** CANVAS ***/ #CanvasDiv{ - background:#588BB6; + background:#588BB6; } /*** HEADER ***/ @@ -344,11 +344,11 @@ white-space:nowrap; } #MainMenuDiv ul{ - margin:0; + margin:0; padding:0; } #MainMenuDiv li{ - list-style:none; + list-style:none; } #MainMenuDiv li a{ @@ -449,7 +449,12 @@ float:right; margin-top:15px; } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ -} +} \ No newline at end of file Modified: trunk/css/fluid/default.css =================================================================== --- trunk/css/fluid/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/fluid/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,5 +1,5 @@ /* $Id: default.css 7166 2015-02-21 21:18:59Z Joshua $*/ -/* +/* "Fluid Tabs" theme for webERP by Hindra Joshua @@ -390,6 +390,11 @@ } #FooterVersionDiv{} #FooterTimeDiv{} +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/fresh/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,5 +1,5 @@ /* $Id$*/ -/*** +/*** New "Fresh" Theme for WebERP @@ -10,10 +10,10 @@ Based from the previous theme "SilverWolf" Credits to the original authors. -NOTE: +NOTE: This CSS is not yet optimized. Some styles maybe 'redundant' or 'unused', but for the obvious one it will be cleaned up. -To optimized the rest we should examined the whole codes! That would be for +To optimized the rest we should examined the whole codes! That would be for the next project. :) ***/ @@ -330,14 +330,14 @@ display:inline; /* items are inline */ } -/*** links as buttons!!! clicking anywhere in the button will activate +/*** links as buttons!!! clicking anywhere in the button will activate the link!!! ***HJ***/ - + #QuickMenuDiv li a{ background:#B4BB86; border:thin outset #5A5F00; color:#5A5F00; - padding:8px; + padding:8px; } #QuickMenuDiv li a:hover{ background:#B4BB86; @@ -377,7 +377,7 @@ #MainMenuDiv{ float:left; /* REQUIRED: to the left side */ white-space:nowrap; /* don't break text */ - text-align:center; + text-align:center; width:11%; background:#617C4F; } @@ -400,12 +400,12 @@ text-decoration:none; padding:3px; border:thin inset #617C4F; - background:#5A5F00; + background:#5A5F00; } #MainMenuDiv .main_menu_selected a{ /* the selected button */ - border:thin inset #5A5F00; + border:thin inset #5A5F00; background:#5A5F00; - color:white; + color:white; } /*** BODY - SUB MENU ***/ @@ -435,7 +435,7 @@ #SubMenuDiv li{ /*list-style:none;*/ /* REQUIRED: hide the bullets */ padding:2px; - background:#E0F3B1; + background:#E0F3B1; } #SubMenuDiv li img{ vertical-align:middle; /* verticall align icon with the text */ @@ -468,7 +468,7 @@ /* float:left;*/ /* width:32.5%; border:thin solid black;*/ - + } .menu_group_item p { color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ @@ -480,14 +480,14 @@ #FooterDiv{ clear:both; /* REQUIRED */ - overflow:hidden; + overflow:hidden; background:#C9D392; } #FooterWrapDiv{ overflow:hidden; padding:3px; } -#FooterLogoDiv{ +#FooterLogoDiv{ float:right; /* right side */ background:white; border-radius:8px; @@ -503,6 +503,11 @@ #FooterTimeDiv{ clear:left; /* below */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/gel/default.css =================================================================== --- trunk/css/gel/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/gel/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,5 +1,5 @@ /* $Id$*/ -/*** +/*** New "Gel" Theme for WebERP @@ -8,10 +8,10 @@ Based from the previous theme "Gel" Credits to the original authors. -NOTE: +NOTE: This CSS is not yet optimized. Some styles maybe 'redundant' or 'unused', but for the obvious one it will be cleaned up. -To optimized the rest we should examined the whole codes! That would be for +To optimized the rest we should examined the whole codes! That would be for the next project. :) ***/ @@ -168,11 +168,11 @@ div.error { /*** is this used??? ***/ background-color:red; color: white; - font-style: italic; + font-style: italic; font-weight:bold; border: 3px solid red; } -div.warn { +div.warn { background-color:#fa0; color: black; border: 1px solid black; @@ -358,9 +358,9 @@ display:inline; /* items are inline */ } -/*** links as buttons!!! clicking anywhere in the button will activate +/*** links as buttons!!! clicking anywhere in the button will activate the link!!! ***HJ***/ - + #QuickMenuDiv li a{ padding:5px; /* links as button */ border:2px outset transparent; /* un-pressed state */ @@ -373,7 +373,7 @@ border:2px inset steelblue; /* pressed state */ text-decoration:none; /* no underline */ color:whie; - border-radius:15px; + border-radius:15px; } /*** BODY ***/ @@ -400,7 +400,7 @@ #MainMenuDiv{ float:left; /* REQUIRED: to the left side */ white-space:nowrap; /* don't break text */ - text-align:center; + text-align:center; width:11%; background:url(images/gelbluev.png) repeat-y blue; background-size:contain; @@ -408,7 +408,7 @@ border-radius:20px; margin-top:5px; padding:3px; - + } #MainMenuDiv ul{ list-style:none; /* REQUIRED: hide bullets */ @@ -431,14 +431,14 @@ text-decoration:none; padding:3px; border:2px inset steelblue; - background:none; + background:none; border-radius:15px; } #MainMenuDiv .main_menu_selected a{ /* the selected button */ text-decoration:none; padding:3px; border:2px inset steelblue; - background:none; + background:none; border-radius:15px; } @@ -455,7 +455,7 @@ #SubMenuDiv ul{ list-style-type:none; /* REQUIRED: hide bullets */ padding:0; /* REQUIRED: remove extra gaps (ex-bullets) */ - margin:0; + margin:0; border:thin solid black; margin-left:3px; } @@ -495,10 +495,10 @@ background:#bfd8ff; } #TransactionsDiv{ - display:table-cell; + display:table-cell; } #InquiriesDiv{ - display:table-cell; + display:table-cell; } #InquiriesDiv div{ /* default div, used for custom report header */ background:#dddddd; @@ -507,14 +507,14 @@ /* border:thin outset silver;*/ } #MaintenanceDiv{ - display:table-cell; + display:table-cell; } /*** FOOTER ***/ #FooterDiv{ clear:both; /* REQUIRED */ - overflow:hidden; + overflow:hidden; color:gray; background:url(images/bar.png) repeat-x lightgray; border:thin solid lightgray; @@ -540,6 +540,11 @@ line-height:2.8em; /* Center the text vertically. [vertical-align has no effect on text alone] */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/print.css =================================================================== --- trunk/css/print.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/print.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -100,4 +100,11 @@ padding:0; } +#Report { + /* Division id for reports. */} +#Report table { + width:100%; + /* Expands the body of the report to use the full width of the page. */ } + +} Modified: trunk/css/professional/default.css =================================================================== --- trunk/css/professional/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/professional/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,5 +1,5 @@ /* $Id$*/ -/*** +/*** New "Professional" Theme for WebERP @@ -10,10 +10,10 @@ Based from the previous theme "SilverWolf" Credits to the original authors. -NOTE: +NOTE: This CSS is not yet optimized. Some styles maybe 'redundant' or 'unused', but for the obvious one it will be cleaned up. -To optimized the rest we should examined the whole codes! That would be for +To optimized the rest we should examined the whole codes! That would be for the next project. :) ***/ @@ -150,7 +150,7 @@ /* input as button or text */ /* NOTE: input for button should have different class, one for 'normal' and one for 'input button inside a table, -which should have the same width as the column where it is located +which should have the same width as the column where it is located e.g.: class input_button, input_column_button, input_text */ input { } @@ -374,9 +374,9 @@ display:inline; /* items are inline */ } -/*** links as buttons!!! clicking anywhere in the button will activate +/*** links as buttons!!! clicking anywhere in the button will activate the link!!! ***HJ***/ - + #QuickMenuDiv li a{ padding:3px; /* links as button */ border:thin outset #ddd; /* un-pressed state */ @@ -418,7 +418,7 @@ #MainMenuDiv{ float:left; /* REQUIRED: to the left side */ white-space:nowrap; /* don't break text */ - text-align:center; + text-align:center; width:11%; background:#ddd; } @@ -441,12 +441,12 @@ text-decoration:none; padding:3px; border:thin inset #ddd; - background:#ddd; + background:#ddd; } #MainMenuDiv .main_menu_selected a{ /* the selected button */ - border:thin inset #ccc; + border:thin inset #ccc; background:#ccc; - color:blue; + color:blue; text-decoration:none; } @@ -460,7 +460,7 @@ #SubMenuDiv ul{ list-style-type:none; /* REQUIRED: hide bullets */ padding:0; /* REQUIRED: remove extra gaps (ex-bullets) */ - margin-top:0px; + margin-top:0px; margin-left:3px; border:thin outset #ddd; } @@ -500,7 +500,7 @@ /* float:left;*/ /* width:32.5%; border:thin solid black;*/ - + } .menu_group_item p { color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ @@ -512,14 +512,14 @@ #FooterDiv{ clear:both; /* REQUIRED */ - overflow:hidden; + overflow:hidden; color:gray; } #FooterWrapDiv{ overflow:hidden; padding:3px; } -#FooterLogoDiv{ +#FooterLogoDiv{ float:right; /* right side */ } #FooterVersionDiv{ @@ -528,6 +528,11 @@ #FooterTimeDiv{ clear:left; /* below */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/professional-rtl/default.css =================================================================== --- trunk/css/professional-rtl/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/professional-rtl/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,5 +1,5 @@ /* $Id$*/ -/*** +/*** New "Professional RTL" Theme for WebERP For Right-To-Left Languages @@ -11,10 +11,10 @@ Based from the previous theme "SilverWolf" Credits to the original authors. -NOTE: +NOTE: This CSS is not yet optimized. Some styles maybe 'redundant' or 'unused', but for the obvious one it will be cleaned up. -To optimized the rest we should examined the whole codes! That would be for +To optimized the rest we should examined the whole codes! That would be for the next project. :) ***/ @@ -155,7 +155,7 @@ /* input as button or text */ /* NOTE: input for button should have different class, one for 'normal' and one for 'input button inside a table, -which should have the same width as the column where it is located +which should have the same width as the column where it is located e.g.: class input_button, input_column_button, input_text */ input { font-family: Arial, Verdana, Helvetica; @@ -394,9 +394,9 @@ float:right; /* right to left */ } -/*** links as buttons!!! clicking anywhere in the button will activate +/*** links as buttons!!! clicking anywhere in the button will activate the link!!! ***HJ***/ - + #QuickMenuDiv li a{ padding:3px; /* links as button */ border:thin outset #ddd; /* un-pressed state */ @@ -438,7 +438,7 @@ #MainMenuDiv{ float:right; /* REQUIRED: to the RIGHT side */ white-space:nowrap; /* don't break text */ - text-align:center; + text-align:center; width:11%; background:#ddd; } @@ -461,12 +461,12 @@ text-decoration:none; padding:3px; border:thin inset #ddd; - background:#ddd; + background:#ddd; } #MainMenuDiv .main_menu_selected a{ /* the selected button */ - border:thin inset #ccc; + border:thin inset #ccc; background:#ccc; - color:blue; + color:blue; text-decoration:none; } @@ -480,7 +480,7 @@ #SubMenuDiv ul{ list-style-type:none; /* REQUIRED: hide bullets */ padding:0; /* REQUIRED: remove extra gaps (ex-bullets) */ - margin-top:0px; + margin-top:0px; margin-left:3px; border:thin outset #ddd; } @@ -520,7 +520,7 @@ /* float:left;*/ /* width:32.5%; border:thin solid black;*/ - + } .menu_group_item p { color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ @@ -532,14 +532,14 @@ #FooterDiv{ clear:both; /* REQUIRED */ - overflow:hidden; + overflow:hidden; color:gray; } #FooterWrapDiv{ overflow:hidden; padding:3px; } -#FooterLogoDiv{ +#FooterLogoDiv{ float:left; /* right side */ } #FooterVersionDiv{ @@ -548,6 +548,11 @@ #FooterTimeDiv{ clear:right; /* below */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/silverwolf/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,5 +1,5 @@ /* $Id$*/ -/*** +/*** New "SilverWolf" Theme for WebERP @@ -11,7 +11,7 @@ NOTE: This CSS is not yet optimized. Some styles maybe 'redundant' or 'unused', but for the obvious one it will be cleaned up. -To optimized the rest we should examined the whole codes! That would be for +To optimized the rest we should examined the whole codes! That would be for the next project. :) ***/ @@ -363,9 +363,9 @@ display:inline; /* items are inline */ } -/*** links as buttons!!! clicking anywhere in the button will activate +/*** links as buttons!!! clicking anywhere in the button will activate the link!!! ***HJ***/ - + #QuickMenuDiv li a{ padding:9px; /* links as button */ border:thin outset lightgray; /* un-pressed state */ @@ -394,7 +394,7 @@ #MainMenuDiv{ float:left; /* REQUIRED:to the left side */ white-space:nowrap; /* don't break text */ - text-align:center; + text-align:center; width:12%; margin-top:3px; } @@ -501,6 +501,11 @@ line-height:2.8em; /* Center the text vertically. [vertical-align has no effect on text alone] */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/wood/default.css =================================================================== --- trunk/css/wood/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/wood/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -571,10 +571,15 @@ #FooterTimeDiv{ float:right; margin-top:17px; +} +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} +.centre { + text-align:center; + /* centre class (general). */ } -.centre { - text-align:center; - /* centre class (general). */ -} /* END */ Modified: trunk/css/xenos/default.css =================================================================== --- trunk/css/xenos/default.css 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/css/xenos/default.css 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,12 +1,12 @@ /* $Id: default.css 7166 2015-02-21 21:18:59Z Khwunchai $*/ -/*** +/*** Xenos Theme by Khwunchai J. Xenos is a very clean and classy looking theme design for WebERP. -NOTE: +NOTE: This CSS is not yet fully optimized. Some styles maybe redundant and not supported by some browser. ***/ @@ -56,7 +56,7 @@ width:100%; /*border-collapse: collapse;*/ border:thin outset #B3B3B3; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -173,7 +173,7 @@ input[type='text'], input[type='tel'], input[type='password'], input[type='email'] { border:thin solid #C3C3C3; padding:4px 8px; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -184,7 +184,7 @@ input[type='text']:focus, input[type='tel']:focus, input[type='password']:focus, input[type='email']:focus, input[type='submit'], textarea:focus, select:focus, button:focus { outline:none; border-color:#2380CD; - + -moz-box-shadow: 0px 0px 5px #55B1EA; -webkit-box-shadow: 0px 0px 5px #55B1EA; box-shadow: 0px 0px 5px #55B1EA; @@ -197,7 +197,7 @@ font-weight:bold; color:#FFFFFF; cursor: pointer; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -211,7 +211,7 @@ textarea{ border:thin solid #C3C3C3; padding:4px 8px; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -411,9 +411,9 @@ height:38px; } -/*** links as buttons!!! clicking anywhere in the button will activate +/*** links as buttons!!! clicking anywhere in the button will activate the link!!! ***HJ***/ - + #QuickMenuDiv li a{ color:white; font-weight:bold; @@ -455,7 +455,7 @@ width:auto; /* automatic width */ margin:0 auto; margin-bottom:10px; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -469,7 +469,7 @@ background-color:white; border:thin outset #D2D2D2; padding:5px; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -491,7 +491,7 @@ width:14%; border:thin inset #5D5D5D; background:#686868; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -528,7 +528,7 @@ border-bottom:thin solid #444444; } #MainMenuDiv .main_menu_selected a{ /* the selected button */ - /*border:thin inset #191919;*/ + /*border:thin inset #191919;*/ background:#2A2A2A; border-bottom:thin solid #191919; } @@ -545,7 +545,7 @@ border:thin outset #D2D2D2; background-color:white; /* for custom reports */ min-height:400px; - + -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; @@ -609,7 +609,7 @@ #FooterDiv{ clear:both; /* REQUIRED */ - overflow:hidden; + overflow:hidden; color:#999999; width: 98.6%; margin: auto; @@ -622,7 +622,7 @@ overflow:hidden; padding:3px; } -#FooterLogoDiv{ +#FooterLogoDiv{ float:right; /* right side */ padding:2px; } @@ -636,6 +636,11 @@ #FooterTimeDiv{ clear:left; /* below */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-07 16:13:57 UTC (rev 7205) +++ trunk/doc/Change.log 2015-03-07 17:44:35 UTC (rev 7206) @@ -1,4 +1,6 @@ webERP Change Log + +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). 07/03/15 Exson: Fixed undefined index noise in ShipmentCosting.php. 07/03/15 Exson: Fixed property ShiptCounter non defined bug in DefineSuppTransClass.php. 07/03/15 Exson: Fixed the undefine index OpenOrClose noise in Shipt_Select.php. |
From: <vv...@us...> - 2015-03-08 22:44:55
|
Revision: 7209 http://sourceforge.net/p/web-erp/reponame/7209 Author: vvs2012 Date: 2015-03-08 22:44:47 +0000 (Sun, 08 Mar 2015) Log Message: ----------- Fit HTML view of invoices to one screen Modified Paths: -------------- trunk/PrintCustTrans.php trunk/doc/Change.log Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2015-03-08 04:45:50 UTC (rev 7208) +++ trunk/PrintCustTrans.php 2015-03-08 22:44:47 UTC (rev 7209) @@ -566,8 +566,10 @@ echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> <td><input type="text" class="number" maxlength="6" size="7" name="ToTransNo" /></td></tr> </table>'; - echo '<div class="centre"><input type="submit" name="Print" value="' . _('Print') . '" /><br />'; - echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /></div>'; + echo '<div class="centre">'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /><br /><br /></div>'; + echo '</div> + </form>'; $sql = "SELECT typeno FROM systypes WHERE typeid=10"; @@ -584,8 +586,6 @@ echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b> <br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</div>'; - echo '</div> - </form>'; } else { @@ -721,106 +721,90 @@ $ExchRate = $myrow['rate']; $PageNumber = 1; - echo '<table class="table1"> - <tr><td valign="top" style="width:10%"><img src="' . $_SESSION['LogoFile'] . '" alt="" /></td> - <td style="background-color:#BBBBBB">'; + /* Now print out the logo and company name and address */ + echo '<table style="width:100%">'; + /* Now the customer charged to details in a sub table within a cell of the main table*/ + echo '<tr><td><b>' . _('Charge To') . ':</b>'; + echo '<br />' . $myrow['name'] . + '<br />' . $myrow['address1'] . + '<br />' . $myrow['address2'] . + '<br />' . $myrow['address3'] . + '<br />' . $myrow['address4'] . + '<br />' . $myrow['address5'] . + '<br />' . $myrow['address6']; + echo '</td>'; + + echo '<td><h2>' . $_SESSION['CompanyRecord']['coyname'] . '</h2><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; + echo '</td>'; + + echo '<td align="right">'; + if ($InvOrCredit=='Invoice') { + echo '<h2>' . _('TAX INVOICE') . '</h2>'; + } else { + echo '<h2 style="color:red">' . _('TAX CREDIT NOTE') . '</h2>'; + } + echo '<br />' . _('Number') . ' ' . $FromTransNo . '<br />' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td> + </tr>'; - if ($InvOrCredit=='Invoice') { - echo '<h2>' . _('TAX INVOICE') . ' '; - } else { - echo '<h2 style="color:red">' . _('TAX CREDIT NOTE') . ' '; - } - echo _('Number') . ' ' . $FromTransNo . '</h2><br />' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td> - </tr> - </table>'; + echo '<tr><td align="left"><b>' . _('Charge Branch') . ':</b>'; + echo '<br />' . $myrow['brname'] . + '<br />' . $myrow['braddress1'] . + '<br />' . $myrow['braddress2'] . + '<br />' . $myrow['braddress3'] . + '<br />' . $myrow['braddress4'] . + '<br />' . $myrow['braddress5'] . + '<br />' . $myrow['braddress6'] . '</td>'; - /* Now print out the logo and company name and address */ - echo '<table class="table1"> - <tr><td><h2>' . $_SESSION['CompanyRecord']['coyname'] . '</h2><br />'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; + if ($InvOrCredit=='Invoice') { + echo '<td align="left"><b>' . _('Delivered To') . ':</b>'; + echo '<br />' . $myrow['deliverto'] . + '<br />' . $myrow['deladd1'] . + '<br />' . $myrow['deladd2'] . + '<br />' . $myrow['deladd3'] . + '<br />' . $myrow['deladd4'] . + '<br />' . $myrow['deladd5'] . + '<br />' . $myrow['deladd6'] . '</td>'; + } + else { + echo '<td></td>'; + } - echo '</td><td style="width:50%" class="number">'; - - /* Now the customer charged to details in a sub table within a cell of the main table*/ - - echo '<table class="table1"> - <tr> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Charge To') . ':</b></td> - </tr> - <tr> - <td style="background-color:#EEEEEE">'; - echo $myrow['name'] . - '<br />' . $myrow['address1'] . - '<br />' . $myrow['address2'] . - '<br />' . $myrow['address3'] . - '<br />' . $myrow['address4'] . - '<br />' . $myrow['address5'] . - '<br />' . $myrow['address6']; + echo '<td align="right">'; + echo '<br /><b>' . _('All amounts stated in') . ' ' . $myrow['currcode'] . '</b>'; echo '</td> </tr> - </table>'; - /*end of the small table showing charge to account details */ - echo _('Page') . ': ' . $PageNumber; - echo '</td> - </tr> - </table>'; + </table>'; /*end of the main table showing the company name and charge to details */ if ($InvOrCredit=='Invoice') { - echo '<table class="table1"> - <tr> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Charge Branch') . ':</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Delivered To') . ':</b></td> - </tr>'; - echo '<tr> - <td style="background-color:#EEEEEE">' .$myrow['brname'] . - '<br />' . $myrow['braddress1'] . - '<br />' . $myrow['braddress2'] . - '<br />' . $myrow['braddress3'] . - '<br />' . $myrow['braddress4'] . - '<br />' . $myrow['braddress5'] . - '<br />' . $myrow['braddress6'] . '</td>'; - - echo '<td style="background-color:#EEEEEE">' . $myrow['deliverto'] . - '<br />' . $myrow['deladd1'] . - '<br />' . $myrow['deladd2'] . - '<br />' . $myrow['deladd3'] . - '<br />' . $myrow['deladd4'] . - '<br />' . $myrow['deladd5'] . - '<br />' . $myrow['deladd6'] . '</td> - </tr> - </table> - <hr />'; - - echo '<table class="table1"> - <tr> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Your Order Ref') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Our Order No') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Order Date') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Invoice Date') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Sales Person') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Shipper') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Consignment Ref') . '</b></td> + echo '<table style="width:100%"><tr> + <th><b>' . _('Your Order Ref') . '</b></th> + <th><b>' . _('Our Order No') . '</b></th> + <th><b>' . _('Order Date') . '</b></th> + <th><b>' . _('Invoice Date') . '</b></th> + <th><b>' . _('Sales Person') . '</b></th> + <th><b>' . _('Shipper') . '</b></th> + <th><b>' . _('Consignment Ref') . '</b></th> </tr>'; echo '<tr> - <td style="background-color:#EEEEEE">' . $myrow['customerref'] . '</td> - <td style="background-color:#EEEEEE">' .$myrow['orderno'] . '</td> - <td style="background-color:#EEEEEE">' . ConvertSQLDate($myrow['orddate']) . '</td> - <td style="background-color:#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> - <td style="background-color:#EEEEEE">' . $myrow['salesmanname'] . '</td> - <td style="background-color:#EEEEEE">' . $myrow['shippername'] . '</td> - <td style="background-color:#EEEEEE">' . $myrow['consignment'] . '</td> - </tr> - </table>'; + <td>' . $myrow['customerref'] . '</td> + <td>' .$myrow['orderno'] . '</td> + <td>' . ConvertSQLDate($myrow['orddate']) . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td>' . $myrow['salesmanname'] . '</td> + <td>' . $myrow['shippername'] . '</td> + <td>' . $myrow['consignment'] . '</td> + </tr></table>'; $sql ="SELECT stockmoves.stockid, stockmaster.description, @@ -840,25 +824,13 @@ } else { /* then its a credit note */ - echo '<table width="50%"><tr> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Branch') . ':</b></td> - </tr>'; - echo '<tr> - <td style="background-color:#EEEEEE">' .$myrow['brname'] . - '<br />' . $myrow['braddress1'] . - '<br />' . $myrow['braddress2'] . - '<br />' . $myrow['braddress3'] . - '<br />' . $myrow['braddress4'] . - '<br />' . $myrow['braddress5'] . - '<br />' . $myrow['braddress6'] . '</td> - </tr></table>'; - echo '<hr /><table class="table1"><tr> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Date') . '</b></td> - <td align="left" style="background-color:#BBBBBB"><b>' . _('Sales Person') . '</b></td> + echo '<table><tr> + <td><b>' . _('Date') . '</b></td> + <td><b>' . _('Sales Person') . '</b></td> </tr>'; echo '<tr> - <td style="background-color:#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> - <td style="background-color:#EEEEEE">' . $myrow['salesmanname'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td>' . $myrow['salesmanname'] . '</td> </tr></table>'; $sql ="SELECT stockmoves.stockid, @@ -877,9 +849,6 @@ AND stockmoves.show_on_inv_crds=1"; } - echo '<hr />'; - echo '<div class="centre"><h4>' . _('All amounts stated in') . ' ' . $myrow['currcode'] . '</h4></div>'; - $result=DB_query($sql); if (DB_error_no()!=0) { echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); @@ -890,7 +859,7 @@ } if (DB_num_rows($result)>0){ - echo '<table class="table1"> + echo '<table style="width:100%"> <tr><th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -942,115 +911,17 @@ $DisplayNet); if (mb_strlen($myrow2['narrative'])>1){ - echo $RowStarter . '<td></td><td colspan="6">' . $myrow2['narrative'] . '</td></tr>'; + $narrative = str_replace(array("\r\n", "\n", "\r", "\\r\\n"), '<br />', $myrow2['narrative']); + echo $RowStarter . '<td></td><td colspan="6">' . $narrative . '</td></tr>'; $LineCounter++; } $LineCounter++; - if ($LineCounter == ($_SESSION['PageLength'] - 2)){ - - /* head up a new invoice/credit note page */ - - $PageNumber++; - echo '</table> - <table class="table1"> - <tr><td valign="top"><img src="' . $_SESSION['LogoFile'] . '" alt="" /></td> - <td style="background-color:#BBBBBB">'; - - if ($InvOrCredit=='Invoice') { - echo '<h2>' . _('TAX INVOICE') . ' '; - } else { - echo '<h2 style="color:red">' . _('TAX CREDIT NOTE') . ' '; - } - echo _('Number') . ' ' . $FromTransNo . '</h2><br />' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; - - /*Now print out company name and address */ - echo '<table class="table1"><tr> - <td><h2>' . $_SESSION['CompanyRecord']['coyname'] . '</h2><br />'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class="number">' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; - echo '<table class="table1"> - <tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th> - </tr>'; - - $LineCounter = 10; - - } //end if need a new page headed up } //end while there are line items to print out echo '</table>'; } /*end if there are stock movements to show on the invoice or credit note*/ - /* check to see enough space left to print the totals/footer */ - $LinesRequiredForText = floor(mb_strlen($myrow['invtext'])/140); - - if ($LineCounter >= ($_SESSION['PageLength'] - 8 - $LinesRequiredForText)){ - - /* head up a new invoice/credit note page */ - $PageNumber++; - echo '<table class="table1"> - <tr><td valign="top"><img src="' . $_SESSION['LogoFile'] . '" alt="" /></td> - <td style="background-color:#BBBBBB">'; - - if ($InvOrCredit=='Invoice') { - echo '<h2>' . _('TAX INVOICE') .' '; - } else { - echo '<h2 style="color:red">' . _('TAX CREDIT NOTE') . ' '; - } - echo _('Number') . ' ' . $FromTransNo . '</h2><br />' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; - - /* Print out the logo and company name and address */ - echo '<table class="table1"> - <tr><td><h2>' . $_SESSION['CompanyRecord']['coyname'] . '</h2><br />'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class="number">' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; - echo '<table class="table1"> - <tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th> - </tr>'; - - $LineCounter = 10; - } - - /* Space out the footer to the bottom of the page */ - - echo '<br /><br />' . $myrow['invtext']; - - $LineCounter=$LineCounter+2+$LinesRequiredForText; - while ($LineCounter < ($_SESSION['PageLength'] -6)){ - echo '<br />'; - $LineCounter++; - } - /* Now print out the footer and totals */ if ($InvOrCredit=='Invoice') { @@ -1067,25 +938,17 @@ } /*Print out the invoice text entered */ - echo '<table class="table1"><tr> - <td class="number">' . _('Sub Total') . '</td> - <td class="number" style="background-color:#EEEEEE;width:15%">' . $DisplaySubTot . '</td></tr>'; - echo '<tr><td class="number">' . _('Freight') . '</td> - <td class="number" style="background-color:#EEEEEE">' . $DisplayFreight . '</td></tr>'; - echo '<tr><td class="number">' . _('Tax') . '</td> - <td class="number" style="background-color:#EEEEEE">' . $DisplayTax . '</td></tr>'; + echo '<table style="width:100%"><tr> + <td style="width:80%">' . $myrow['invtext'] . '</td> + <td class="number">' . _('Sub Total') . ' ' . $DisplaySubTot . '<br />'; + echo _('Freight') . ' ' . $DisplayFreight . '<br />'; + echo _('Tax') . ' ' . $DisplayTax . '<br />'; if ($InvOrCredit=='Invoice'){ - echo '<tr> - <td class="number"><b>' . _('TOTAL INVOICE') . '</b></td> - <td class="number" style="background-color:#EEEEEE"><b>' . $DisplayTotal . '</b></td> - </tr>'; + echo '<b>' . _('TOTAL INVOICE') . ' ' . $DisplayTotal . '</b>'; } else { - echo '<tr> - <td class="number" style="color:red"><b>' . _('TOTAL CREDIT') . '</b></td> - <td class="number" style="background-color:#EEEEEE;color:red"><b>' . $DisplayTotal . '</b></td> - </tr>'; + echo '<b>' . _('TOTAL CREDIT') . ' ' . $DisplayTotal . '</b>'; } - echo '</table>'; + echo '</td></tr></table>'; } /* end of check to see that there was an invoice record to print */ $FromTransNo++; } /* end loop to print invoices */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-08 04:45:50 UTC (rev 7208) +++ trunk/doc/Change.log 2015-03-08 22:44:47 UTC (rev 7209) @@ -1,5 +1,6 @@ webERP Change Log +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). 07/03/15 Exson: Fixed undefined index noise in ShipmentCosting.php. @@ -10,8 +11,8 @@ 07/03/15 Exson: Remove properties $_SESSION['Shipment']->GLLink which never been defined in Shipments.php. 07/03/15: Exson: Change login date of users without login record to 'No login record' instead of today. It's very confusion. 07/03/15 Exson: Fixed order value error that should be value undelivered instead of uncompleted line value and some notice noise in SelectSalesOrder.php. -3/4/15 Vitaly: Display Phantom assembly type correctly in SelectProduct.php -3/4/15 Vitaly: Added missing comma to SQL statement in Credit_Invoice.php +04/03/15 Vitaly: Display Phantom assembly type correctly in SelectProduct.php +04/03/15 Vitaly: Added missing comma to SQL statement in Credit_Invoice.php 3/3/15 RChacon: Adds cross.png to all css images for use in Reset or Cancel buttons as needed. 2/3/15 RChacon: Completes table-row colums, regroups price, cost and gross profit in one table-row, uses company decimal places for gross profit in SelectProduct.php. 25/2/15 TurboPT: Fix Z_ImportSupplier bug reported in forum by: Bill Schlaerth. |
From: <rc...@us...> - 2015-03-09 04:20:19
|
Revision: 7212 http://sourceforge.net/p/web-erp/reponame/7212 Author: rchacon Date: 2015-03-09 04:20:16 +0000 (Mon, 09 Mar 2015) Log Message: ----------- 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. Modified Paths: -------------- trunk/DailyBankTransactions.php trunk/css/aguapop/default.css trunk/css/default/default.css trunk/css/fluid/default.css trunk/css/fresh/default.css trunk/css/gel/default.css trunk/css/print.css trunk/css/professional/default.css trunk/css/professional-rtl/default.css trunk/css/silverwolf/default.css trunk/css/wood/default.css trunk/css/xenos/default.css trunk/doc/Change.log Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/DailyBankTransactions.php 2015-03-09 04:20:16 UTC (rev 7212) @@ -1,24 +1,14 @@ <?php -/* $Id: DailyBankTransactions.php 4556 2011-04-26 11:03:36Z daintree $ */ -/* This script allows you to view all bank transactions for a selected date range, and the inquiry can be filtered by matched or unmatched transactions, or all transactions can be chosen. */ +/* $Id: DailyBankTransactions.php 4556 2011-04-26 11:03:36Z daintree $*/ +/* Allows you to view all bank transactions for a selected date range, and the inquiry can be filtered by matched or unmatched transactions, or all transactions can be chosen. */ include('includes/session.inc'); -$Title = _('Daily Bank Transactions');// Screen identificator. +$Title = _('Daily Bank Transactions');// Screen identification. $ViewTopic = 'GeneralLedger';// Filename's id in ManualContents.php's TOC. $BookMark = 'DailyBankTransactions';// Anchor's id in the manual's html document. include('includes/header.inc'); -echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. - '/images/bank.png" title="' . - _('Bank Transactions Inquiry') . '" /> ' .// Icon title. - _('Bank Transactions Inquiry') . '</p>';// Page title. if (!isset($_POST['Show'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - - echo '<table class="selection">'; - $SQL = "SELECT bankaccountname, bankaccounts.accountcode, bankaccounts.currcode @@ -33,6 +23,16 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$ErrMsg,$DbgMsg); + echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + '/images/bank.png" title="' .// Icon image. + _('Bank Transactions Inquiry') . '" /> ' .// Icon title. + _('Bank Transactions Inquiry') . '</p>';// Page title. + + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<table class="selection">'; echo '<tr> <td>' . _('Bank Account') . ':</td> <td><select name="BankAccount">'; @@ -68,11 +68,11 @@ </tr> <tr> <td>' . _('Show Transactions') . '</td> - <td><select name="ShowType"> - <option value="All">' . _('All') . '</option> - <option value="Unmatched">' . _('Unmatched') . '</option> - <option value="Matched">' . _('Matched') . '</option> - </select></td> + <td><select name="ShowType"> + <option value="All">' . _('All') . '</option> + <option value="Unmatched">' . _('Unmatched') . '</option> + <option value="Matched">' . _('Matched') . '</option> + </select></td> </tr> </table> <br /> @@ -91,7 +91,6 @@ WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'"; $BankResult = DB_query($SQL,_('Could not retrieve the bank account details')); - $sql="SELECT banktrans.currcode, banktrans.amount, banktrans.amountcleared, @@ -112,28 +111,38 @@ WHERE bankact='".$_POST['BankAccount']."' AND transdate>='" . FormatDateForSQL($_POST['FromTransDate']) . "' AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "' - ORDER BY banktrans.transdate"; + ORDER BY banktrans.transdate ASC, banktrans.banktransid ASC"; $result = DB_query($sql); + if (DB_num_rows($result)==0) { + echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + '/images/bank.png" title="' .// Icon image. + _('Bank Transactions Inquiry') . '" /> ' .// Icon title. + _('Bank Transactions Inquiry') . '</p>';// Page title. prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); } else { $BankDetailRow = DB_fetch_array($BankResult); + echo '<div id="Report">';// Division to identify the report block. + echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + '/images/bank.png" title="' .// Icon image. + _('Bank Transactions Inquiry') . '" /> ' .// Icon title. + _('Account Transactions For').'<br />'.$BankDetailRow['bankaccountname'].'<br />'. + _('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</p>';// Page title.*/ echo '<table class="selection"> + <thead> <tr> - <th colspan="10"><h3>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</h3></th> + <th>' . ('Date') . '</th> + <th class="text">' . _('Transaction type') . '</th> + <th class="number">' . _('Number') . '</th> + <th class="text">' . _('Type') . '</th> + <th class="text">' . _('Reference') . '</th> + <th class="number">' . _('Amount in').' '.$BankDetailRow['currcode'] . '</th> + <th class="number">' . _('Running Total').' '.$BankDetailRow['currcode'] . '</th> + <th class="number">' . _('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> + <th class="number">' . _('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> + <th class="number">' . _('Cleared') . '</th> </tr> - <tr> - <th>' . ('Date') . '</th> - <th>' . _('Transaction type') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Type') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Amount in').' '.$BankDetailRow['currcode'] . '</th> - <th>' . _('Running Total').' '.$BankDetailRow['currcode'] . '</th> - <th>' . _('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> - <th>' . _('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'] . '</th> - <th>' . _('Cleared') . '</th> - </tr>'; + </thead><tbody>'; $AccountCurrTotal=0; $LocalCurrTotal =0; @@ -143,14 +152,14 @@ $AccountCurrTotal += $myrow['amount']; $LocalCurrTotal += $myrow['amount']/$myrow['functionalexrate']/$myrow['exrate']; - if ($myrow['amount']==$myrow['amountcleared']) { - $Matched=_('Yes'); - } else { - $Matched=_('No'); - } + if ($myrow['amount']==$myrow['amountcleared']) { + $Matched=_('Yes'); + } else { + $Matched=_('No'); + } echo '<tr> - <td>' . ConvertSQLDate($myrow['transdate']) . '</td> + <td class="centre">' . ConvertSQLDate($myrow['transdate']) . '</td> <td>' . _($myrow['typename']) . '</td> <td class="number"><a href="' . $RootPath . '/GLTransInquiry.php?TypeID=' . $myrow['typeid'] . '&TransNo=' . $myrow['transno'] . '">' . $myrow['transno'] . '</a></td> <td>' . $myrow['banktranstype'] . '</td> @@ -162,18 +171,25 @@ <td class="number">' . $Matched . '</td> </tr>'; } - echo '</table>'; + echo '</tbody></table>'; + echo '</div>';// div id="Report". } //end if no bank trans in the range to show echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> - <div> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> - <br /> - <div class="centre"> - <input type="submit" name="Return" value="' . _('Select Another Date'). '" /> - </div> - </div> - </form>'; + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <br /> + <div class="centre noprint">'. + '<button onclick="javascript:window.print()" type="button"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '/images/printer.png" /> ' . + _('Print This') . '</button>'.// "Print This" button. + '<button name="SelectADifferentPeriod" type="submit" value="'. _('Select A Different Period') .'"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '/images/gl.png" /> ' . + _('Select Another Date') . '</button>'.// "Select A Different Period" button. + '<button formaction="index.php?Application=GL" type="submit"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '/images/previous.png" /> ' . + _('Return') . '</button>'.// "Return" button. + '</div> + </form>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/css/aguapop/default.css =================================================================== --- trunk/css/aguapop/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/aguapop/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -97,10 +97,16 @@ visibility: visible; } th.number { + background-color: skyblue; + color: white; + font-weight: normal; text-align: right; - font-weight: normal; +} +th.text { background-color: skyblue; color: white; + font-weight: normal; + text-align: left; } td { font-family: Arial, Verdana, Helvetica, sans-serif; @@ -481,12 +487,12 @@ #FooterTimeDiv{ float:right; margin-top:15px; -} -#Report { - /* Division id for reports. */} -#Report table { - /* Body of a report formatted with table tag. */ -} +} +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} .centre { text-align:center; /* centre class (general). */ Modified: trunk/css/default/default.css =================================================================== --- trunk/css/default/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/default/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -81,10 +81,16 @@ visibility: visible; } th.number{ + background-color:#B06161; + color:white; + font-weight:normal; text-align:right; - font-weight:normal; +} +th.text{ background-color:#B06161; color:white; + font-weight:normal; + text-align:left; } td { text-align:left; @@ -457,4 +463,4 @@ .centre { text-align:center; /* centre class (general). */ -} \ No newline at end of file +} Modified: trunk/css/fluid/default.css =================================================================== --- trunk/css/fluid/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/fluid/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -52,11 +52,17 @@ text-align:center; } th.number{ - font-weight:normal; background-color:#cccce5; color:#330000; + font-weight:normal; text-align:right; } +th.text{ + background-color:#cccce5; + color:#330000; + font-weight:normal; + text-align:left; +} th.ascending { cursor: s-resize; } @@ -92,6 +98,9 @@ td.number{ text-align:right; } +td.text{ + text-align:left; +} .centre{ /* used */ margin:0 auto; text-align:center; Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/fresh/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -71,10 +71,16 @@ text-align: center; } th.number { + background-color: #800000; + color: white; + font-weight: normal; text-align: right; - font-weight: normal; +} +th.text { background-color: #800000; color: white; + font-weight: normal; + text-align: left; } th.ascending { cursor: s-resize; Modified: trunk/css/gel/default.css =================================================================== --- trunk/css/gel/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/gel/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -70,10 +70,16 @@ text-align: center; } th.number { + background-color: #ccc; + color: #330000; + font-weight: normal; text-align: right; - font-weight: normal; +} +th.text { background-color: #ccc; color: #330000; + font-weight: normal; + text-align: left; } th.ascending { cursor: s-resize; Modified: trunk/css/print.css =================================================================== --- trunk/css/print.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/print.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -60,6 +60,11 @@ /* number class (general). */ } +.text { + text-align:left; + /* number class (general). */ +} + .page_title_text { font-weight:bold; font-size: 207%; Modified: trunk/css/professional/default.css =================================================================== --- trunk/css/professional/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/professional/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -121,11 +121,17 @@ visibility: visible; } th.number { - font-weight: normal; background-color: #cccce5; color: #330000; + font-weight: normal; text-align: right; } +th.text { + background-color: #cccce5; + color: #330000; + font-weight: normal; + text-align: left; +} div.error { background-color:#fddbdb; color: red; Modified: trunk/css/professional-rtl/default.css =================================================================== --- trunk/css/professional-rtl/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/professional-rtl/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -100,12 +100,19 @@ text-align: center; } th.number { - font-weight: normal; - font-size: 10px; background-color: #cccce5; color: #330000; + font-size: 10px; + font-weight: normal; text-align: right; } +th.text { + background-color: #cccce5; + color: #330000; + font-size: 10px; + font-weight: normal; + text-align: left; +} th.ascending { cursor: s-resize; } Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/silverwolf/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -70,13 +70,21 @@ vertical-align:middle; } th.number{ - font-weight:normal; background-color:#cccce5; + color:#300; font-size:100%; - color:#300; + font-weight:normal; text-align:right; vertical-align:middle; } +th.text{ + background-color:#cccce5; + color:#300; + font-size:100%; + font-weight:normal; + text-align:left; + vertical-align:middle; +} th.ascending { cursor: s-resize; } Modified: trunk/css/wood/default.css =================================================================== --- trunk/css/wood/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/wood/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -81,10 +81,16 @@ text-align: center; } th.number { + background-color: #800000; + color: white; + font-weight: normal; text-align: right; - font-weight: normal; +} +th.text { background-color: #800000; color: white; + font-weight: normal; + text-align: left; } th.ascending { cursor: s-resize; @@ -571,15 +577,15 @@ #FooterTimeDiv{ float:right; margin-top:17px; -} -#Report { - /* Division id for reports. */} -#Report table { - /* Body of a report formatted with table tag. */ -} -.centre { - text-align:center; - /* centre class (general). */ } +#Report { + /* Division id for reports. */} +#Report table { + /* Body of a report formatted with table tag. */ +} +.centre { + text-align:center; + /* centre class (general). */ +} /* END */ Modified: trunk/css/xenos/default.css =================================================================== --- trunk/css/xenos/default.css 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/css/xenos/default.css 2015-03-09 04:20:16 UTC (rev 7212) @@ -75,10 +75,16 @@ border-bottom:thin solid #B3B3B3; } th.number { + background-color:#800000; + color:white; + font-weight:normal; text-align:right; - font-weight:normal; +} +th.text { background-color:#800000; color:white; + font-weight:normal; + text-align:left; } th.ascending { cursor:s-resize; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-09 02:32:27 UTC (rev 7211) +++ trunk/doc/Change.log 2015-03-09 04:20:16 UTC (rev 7212) @@ -1,5 +1,6 @@ webERP Change Log +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. 08/03/15 Vitaly: Fit HTML view of invoices to one screen 08/03/15 Exson: Fixed undefined index noise in PO_Items.php. |
From: <vv...@us...> - 2015-03-09 20:53:55
|
Revision: 7213 http://sourceforge.net/p/web-erp/reponame/7213 Author: vvs2012 Date: 2015-03-09 20:53:48 +0000 (Mon, 09 Mar 2015) Log Message: ----------- Page refresh when credit type changes in Credit_Invoce.php Modified Paths: -------------- trunk/Credit_Invoice.php trunk/doc/Change.log Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2015-03-09 04:20:16 UTC (rev 7212) +++ trunk/Credit_Invoice.php 2015-03-09 20:53:48 UTC (rev 7213) @@ -166,7 +166,7 @@ $myrow['controlled'], $myrow['serialised'], $myrow['decimalplaces'], - $myrow['narrative'], + str_replace("\\r\\n", " ", $myrow['narrative']), 'No', -1, $myrow['taxcatid'], @@ -275,13 +275,12 @@ NB QtyDispatched in the LineItems array is used for the quantity to credit */ echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/credit.png" title="' . _('Search') . '" alt="" />' . $Title . '</p>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '" method="post">'; +echo '<div>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + if(!isset($_POST['ProcessCredit'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '" method="post">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - - echo '<table cellpadding="2" class="selection">'; echo '<tr><th colspan="13">'; echo '<div class="centre"><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b> @@ -1517,7 +1516,7 @@ <table class="selection"> <tr> <td>' . _('Credit Note Type') . '</td> - <td><select name="CreditType" tabindex="'.$tabindex++.'">'; + <td><select name="CreditType" tabindex="'.$tabindex++.'" onchange="ReloadForm(Update)">'; if(!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return') { echo '<option selected="selected" value="Return">' . _('Goods returned to store') . '</option>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-03-09 04:20:16 UTC (rev 7212) +++ trunk/doc/Change.log 2015-03-09 20:53:48 UTC (rev 7213) @@ -1,5 +1,6 @@ webERP Change Log +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. 08/03/15 Vitaly: Fit HTML view of invoices to one screen |
From: <dai...@us...> - 2015-03-19 07:03:23
|
Revision: 7229 http://sourceforge.net/p/web-erp/reponame/7229 Author: daintree Date: 2015-03-19 07:03:20 +0000 (Thu, 19 Mar 2015) Log Message: ----------- remove duplicate sql upgrade files Modified Paths: -------------- trunk/sql/mysql/upgrade4.12.2-4.13.sql Removed Paths: ------------- trunk/locale/mr_IN.utf8/ trunk/sql/mysql/upgrade4.12-4.13.sql Deleted: trunk/sql/mysql/upgrade4.12-4.13.sql =================================================================== --- trunk/sql/mysql/upgrade4.12-4.13.sql 2015-03-14 10:00:31 UTC (rev 7228) +++ trunk/sql/mysql/upgrade4.12-4.13.sql 2015-03-19 07:03:20 UTC (rev 7229) @@ -1,3 +0,0 @@ -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'); ------UPDATE config SET confvalue='4.13' WHERE confname='VersionNumber'; \ No newline at end of file Modified: trunk/sql/mysql/upgrade4.12.2-4.13.sql =================================================================== --- trunk/sql/mysql/upgrade4.12.2-4.13.sql 2015-03-14 10:00:31 UTC (rev 7228) +++ trunk/sql/mysql/upgrade4.12.2-4.13.sql 2015-03-19 07:03:20 UTC (rev 7229) @@ -1,10 +1,6 @@ --- webERP 4.13. --- Release date: yyyy-mm-dd. --- +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'); - - - -- Update version number: UPDATE config SET confvalue='4.13' WHERE confname='VersionNumber'; |
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: <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-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: <dai...@us...> - 2015-04-19 05:32:08
|
Revision: 7265 http://sourceforge.net/p/web-erp/reponame/7265 Author: daintree Date: 2015-04-19 05:32:06 +0000 (Sun, 19 Apr 2015) Log Message: ----------- SelectSupplier - total supplier spend was incorrect only looked at supplier transactions excluding invoices? Now takes invoice net of debit notes Modified Paths: -------------- trunk/BackupDatabase.php trunk/SelectSupplier.php trunk/doc/Change.log Modified: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php 2015-04-07 10:31:12 UTC (rev 7264) +++ trunk/BackupDatabase.php 2015-04-19 05:32:06 UTC (rev 7265) @@ -35,19 +35,13 @@ $Command = 'mysqldump --opt -h' . $host . ' -u' . $DBUser . ' -p' . $DBPassword . ' ' . $_SESSION['DatabaseName'] . '| gzip > ' . $_SERVER['DOCUMENT_ROOT'] . $BackupFile; + exec($Command); + prnMsg(_('The backup file has now been created. You must now download this to your computer because in case the web-server has a disk failure the backup would then not on the same machine. Use the link below') . '<br /><br /><a href="' . $BackupFile . '">' . _('Download the backup file to your locale machine') . '</a>','success'); + prnMsg(_('Once you have downloaded the database backup file to your local machine you should use the link below to delete it - backup files can consume a lot of space on your hosting account and will accumulate if not deleted - they also contain sensitive information which would otherwise be available for others to download!'),'info'); + echo '<br /> + <br /> + <a href="'. htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; - $CommandOutput = array(); - exec($Command,$CommandOutput, $ReturnValue); - - if ($ReturnValue ==0) { - prnMsg(_('The backup file has now been created. You must now download this to your computer because in case the web-server has a disk failure the backup would then not on the same machine. Use the link below') . '<br /><br /><a href="' . $BackupFile . '">' . _('Download the backup file to your locale machine') . '</a>','success'); - prnMsg(_('Once you have downloaded the database backup file to your local machine you should use the link below to delete it - backup files can consume a lot of space on your hosting account and will accumulate if not deleted - they also contain sensitive information which would otherwise be available for others to download!'),'info'); - echo '<br /> - <br /> - <a href="'. htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; - } else { - prnMsg(_('There was some problem producing a backup using mysqldump. Normally this relates to a permissions issue - the web-server user must have permission to write to the companies directory'),'error'); - } } /* //this could be a weighty file attachment!! Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2015-04-07 10:31:12 UTC (rev 7264) +++ trunk/SelectSupplier.php 2015-04-19 05:32:06 UTC (rev 7265) @@ -371,7 +371,7 @@ $DataResult = DB_query($sql, $ErrMsg); $myrow = DB_fetch_array($DataResult); // Select some more data about the supplier - $SQL = "SELECT SUM(-ovamount) AS total FROM supptrans WHERE supplierno = '" . $_SESSION['SupplierID'] . "' and type != '20'"; + $SQL = "SELECT SUM(-ovamount) AS total FROM supptrans WHERE supplierno = '" . $_SESSION['SupplierID'] . "' AND (type == '20' OR type='21')"; $Total1Result = DB_query($SQL); $row = DB_fetch_array($Total1Result); echo '<br />'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-07 10:31:12 UTC (rev 7264) +++ trunk/doc/Change.log 2015-04-19 05:32:06 UTC (rev 7265) @@ -1,40 +1,41 @@ webERP Change Log -07/04/15 Exson: Fixed the Wiki link broken bug in SystemParameters.php. -04/04/15 Exson: Fixed the bug that Credit and Debit submit amount was duplicated processed by local_number_format function. -01/04/15 Exson: Remove comma from item description and suppliername to make csv file correctly in POReport.php. -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. +19/4/15 Phil: SelectSupplier - total supplier spend was incorrect only looked at supplier transactions excluding invoices? Now takes invoice net of debit notes reported by Andrew Galuski +07/4/15 Exson: Fixed the Wiki link broken bug in SystemParameters.php. +04/4/15 Exson: Fixed the bug that Credit and Debit submit amount was duplicated processed by local_number_format function. +01/4/15 Exson: Remove comma from item description and suppliername to make csv file correctly in POReport.php. +01/4/15 Exson: Fixed comma bug due to locale issue of POReport.php csv file. And add ordered/received quantity field in the report. +01/4/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/4/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. -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. -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/03/15 Exson: Make Labor type allowed by category select in WorkOrderIssue.php. -12/03/15 Exson: Make Order No sortable in SelectSalesOrder.php. -12/03/15 Exson: Fixed undefined parameters noise in PO_SelectPurchOrder.php. +27/3/15 Exson: Remove redundant code from PrintCustTrans.php. +27/3/15 Exson: Make credit not for freight only is printable in PrintCustTrans.php. +26/3/15 Exson: Fixed disabletrans status bug in CustomerBranches.php and fix index undefined noise. +25/3/15 Exson: Add planned accumulation in MRP report. +14/3/15 Exson: Fixed undefined index noise in Credit_Invoice.php. +13/3/15 Exson: fixed the undefined index noise in WorkOrderReceive.php. +13/3/15 Exson: Fixed the undefined index noise in SelectWorkOrder.php. +13/3/15 Exson: Make Labor type allowed by category select in WorkOrderIssue.php. +12/3/15 Exson: Make Order No sortable in SelectSalesOrder.php. +12/3/15 Exson: Fixed undefined parameters noise in PO_SelectPurchOrder.php. 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. -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). -07/03/15 Exson: Fixed undefined index noise in ShipmentCosting.php. -07/03/15 Exson: Fixed property ShiptCounter non defined bug in DefineSuppTransClass.php. -07/03/15 Exson: Fixed the undefine index OpenOrClose noise in Shipt_Select.php. -07/03/15 Exson: Fixed undefine index InputError noise in SupplierInvoice.php. -07/03/15 Exson: Fixed typo in AuditTrail.php. -07/03/15 Exson: Remove properties $_SESSION['Shipment']->GLLink which never been defined in Shipments.php. -07/03/15: Exson: Change login date of users without login record to 'No login record' instead of today. It's very confusion. -07/03/15 Exson: Fixed order value error that should be value undelivered instead of uncompleted line value and some notice noise in SelectSalesOrder.php. -04/03/15 Vitaly: Display Phantom assembly type correctly in SelectProduct.php -04/03/15 Vitaly: Added missing comma to SQL statement in Credit_Invoice.php +09/3/15 Vitaly: Page refresh when credit type changes in Credit_Invoce.php +09/3/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/3/15 Exson: Fixed undefined index noise of $_POST['SupplierContact'] in PO_Header.php. +08/3/15 Vitaly: Fit HTML view of invoices to one screen +08/3/15 Exson: Fixed undefined index noise in PO_Items.php. +07/3/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). +07/3/15 Exson: Fixed undefined index noise in ShipmentCosting.php. +07/3/15 Exson: Fixed property ShiptCounter non defined bug in DefineSuppTransClass.php. +07/3/15 Exson: Fixed the undefine index OpenOrClose noise in Shipt_Select.php. +07/3/15 Exson: Fixed undefine index InputError noise in SupplierInvoice.php. +07/3/15 Exson: Fixed typo in AuditTrail.php. +07/3/15 Exson: Remove properties $_SESSION['Shipment']->GLLink which never been defined in Shipments.php. +07/3/15: Exson: Change login date of users without login record to 'No login record' instead of today. It's very confusion. +07/3/15 Exson: Fixed order value error that should be value undelivered instead of uncompleted line value and some notice noise in SelectSalesOrder.php. +04/3/15 Vitaly: Display Phantom assembly type correctly in SelectProduct.php +04/3/15 Vitaly: Added missing comma to SQL statement in Credit_Invoice.php 3/3/15 RChacon: Adds cross.png to all css images for use in Reset or Cancel buttons as needed. 2/3/15 RChacon: Completes table-row colums, regroups price, cost and gross profit in one table-row, uses company decimal places for gross profit in SelectProduct.php. 25/2/15 TurboPT: Fix Z_ImportSupplier bug reported in forum by: Bill Schlaerth. |
From: <rc...@us...> - 2015-04-19 13:41:06
|
Revision: 7267 http://sourceforge.net/p/web-erp/reponame/7267 Author: rchacon Date: 2015-04-19 13:40:59 +0000 (Sun, 19 Apr 2015) Log Message: ----------- Add ".page_title_text img" as a display none class. This makes unnecessary to add the class noprint to the image in page_title_text. Modified Paths: -------------- trunk/css/print.css trunk/doc/Change.log Modified: trunk/css/print.css =================================================================== --- trunk/css/print.css 2015-04-19 07:14:59 UTC (rev 7266) +++ trunk/css/print.css 2015-04-19 13:40:59 UTC (rev 7267) @@ -3,7 +3,7 @@ @media print { -#FooterDiv, #HeaderDiv, #MainMenuDiv, .noprint, .site-description, .site-title { +#FooterDiv, #HeaderDiv, #MainMenuDiv, .noprint, .page_title_text img, .site-description, .site-title { display:none; /* Remove unwanted elements. */ } @@ -106,7 +106,8 @@ } #Report { - /* Division id for reports. */} + /* Division id for reports. */ +} #Report table { width:100%; /* Expands the body of the report to use the full width of the page. */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-19 07:14:59 UTC (rev 7266) +++ trunk/doc/Change.log 2015-04-19 13:40:59 UTC (rev 7267) @@ -1,5 +1,6 @@ webERP Change Log +19/4/15 RChacon: Add ".page_title_text img" as a display none class. This makes unnecessary to add the class noprint to the image in page_title_text. 19/4/15 Phil: SelectSupplier - total supplier spend was incorrect only looked at supplier transactions excluding invoices? Now takes invoice net of debit notes reported by Andrew Galuski 07/4/15 Exson: Fixed the Wiki link broken bug in SystemParameters.php. 04/4/15 Exson: Fixed the bug that Credit and Debit submit amount was duplicated processed by local_number_format function. |
From: <rc...@us...> - 2015-04-19 14:57:49
|
Revision: 7268 http://sourceforge.net/p/web-erp/reponame/7268 Author: rchacon Date: 2015-04-19 14:57:47 +0000 (Sun, 19 Apr 2015) Log Message: ----------- Remove the class noprint from the image in page_title_text. Modified Paths: -------------- trunk/DailyBankTransactions.php trunk/GLBalanceSheet.php trunk/GLProfit_Loss.php trunk/GLTrialBalance.php trunk/doc/Change.log Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2015-04-19 13:40:59 UTC (rev 7267) +++ trunk/DailyBankTransactions.php 2015-04-19 14:57:47 UTC (rev 7268) @@ -23,7 +23,7 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$ErrMsg,$DbgMsg); - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/bank.png" title="' .// Icon image. _('Bank Transactions Inquiry') . '" /> ' .// Icon title. _('Bank Transactions Inquiry') . '</p>';// Page title. @@ -115,7 +115,7 @@ $result = DB_query($sql); if (DB_num_rows($result)==0) { - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/bank.png" title="' .// Icon image. _('Bank Transactions Inquiry') . '" /> ' .// Icon title. _('Bank Transactions Inquiry') . '</p>';// Page title. @@ -123,7 +123,7 @@ } else { $BankDetailRow = DB_fetch_array($BankResult); echo '<div id="Report">';// Division to identify the report block. - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/bank.png" title="' .// Icon image. _('Bank Transactions Inquiry') . '" /> ' .// Icon title. _('Account Transactions For').'<br />'.$BankDetailRow['bankaccountname'].'<br />'. Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2015-04-19 13:40:59 UTC (rev 7267) +++ trunk/GLBalanceSheet.php 2015-04-19 14:57:47 UTC (rev 7268) @@ -17,7 +17,7 @@ /*Show a form to allow input of criteria for TB to show */ include('includes/header.inc'); - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/printer.png" title="' .// Icon image. _('Print Statement of Financial Position') . '" /> ' .// Icon title. _('Balance Sheet') . '</p>';// Page title. @@ -392,7 +392,7 @@ // Page title as IAS1 numerals 10 and 51: include_once('includes/CurrenciesArray.php');// Array to retrieve currency name. echo '<div id="Report">';// Division to identify the report block. - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" title="' .// Icon image. _('Statement of Financial Position') . '" /> ' .// Icon title. _('Balance Sheet') . '<br />' .// Page title, reporting statement. Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2015-04-19 13:40:59 UTC (rev 7267) +++ trunk/GLProfit_Loss.php 2015-04-19 14:57:47 UTC (rev 7268) @@ -20,7 +20,7 @@ OR isset($_POST['SelectADifferentPeriod'])){ include('includes/header.inc'); - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/printer.png" title="' .// Icon image. _('Print Statement of Comprehensive Income') . '" /> ' .// Icon title. _('Print Profit and Loss Report') . '</p>';// Page title. @@ -613,7 +613,7 @@ // Page title as IAS1 numerals 10 and 51: include_once('includes/CurrenciesArray.php');// Array to retrieve currency name. echo '<div id="Report">';// Division to identify the report block. - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" title="' .// Icon image. _('Statement of Comprehensive Income') . '" /> ' .// Icon title. _('Profit and Loss Statement') . '<br />' .// Page title, reporting statement. Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2015-04-19 13:40:59 UTC (rev 7267) +++ trunk/GLTrialBalance.php 2015-04-19 14:57:47 UTC (rev 7268) @@ -29,7 +29,7 @@ OR isset($_POST['SelectADifferentPeriod'])){ include ('includes/header.inc'); - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/printer.png" title="' .// Icon image. _('Print Trial Balance') . '" /> ' .// Icon title. _('Trial Balance') . '</p>';// Page title. @@ -433,7 +433,7 @@ $AccountsResult = DB_query($SQL, _('No general ledger accounts were returned by the SQL because'), _('The SQL that failed was:')); - echo '<p class="page_title_text"><img alt="" class="noprint" src="'.$RootPath.'/css/'.$Theme. + echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. '/images/gl.png" title="' .// Icon image. _('Trial Balance') . '" /> ' .// Icon title. _('Trial Balance for the month of ') . $PeriodToDate . '<br />' . Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-19 13:40:59 UTC (rev 7267) +++ trunk/doc/Change.log 2015-04-19 14:57:47 UTC (rev 7268) @@ -1,5 +1,6 @@ webERP Change Log +19/4/15 RChacon: Remove the class noprint from the image in page_title_text. 19/4/15 RChacon: Add ".page_title_text img" as a display none class. This makes unnecessary to add the class noprint to the image in page_title_text. 19/4/15 Phil: SelectSupplier - total supplier spend was incorrect only looked at supplier transactions excluding invoices? Now takes invoice net of debit notes reported by Andrew Galuski 07/4/15 Exson: Fixed the Wiki link broken bug in SystemParameters.php. |
From: <rc...@us...> - 2015-04-23 14:00:47
|
Revision: 7271 http://sourceforge.net/p/web-erp/reponame/7271 Author: rchacon Date: 2015-04-23 14:00:44 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Add noprint and other minor changes. Modified Paths: -------------- trunk/Locations.php trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2015-04-21 14:26:58 UTC (rev 7270) +++ trunk/Locations.php 2015-04-23 14:00:44 UTC (rev 7271) @@ -1,21 +1,26 @@ <?php /* $Id$*/ +/* Defines the inventory stocking locations or warehouses */ include('includes/session.inc'); -$Title = _('Location Maintenance'); -$ViewTopic = 'Inventory';// Filename in ManualContents.php's TOC. +$Title = _('Location Maintenance');// Screen identification. +$ViewTopic = 'Inventory';// Filename's id in ManualContents.php's TOC. $BookMark = 'Locations';// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '/images/supplier.png" title="' .// Icon image. + _('Inventory') . '" /> ' .// Icon title. + _('Location Maintenance') . '</p>';// Page title. include('includes/CountriesArray.php'); -if (isset($_GET['SelectedLocation'])){ +if(isset($_GET['SelectedLocation'])) { $SelectedLocation = $_GET['SelectedLocation']; -} elseif (isset($_POST['SelectedLocation'])){ +} elseif(isset($_POST['SelectedLocation'])) { $SelectedLocation = $_POST['SelectedLocation']; } -if (isset($_POST['submit'])) { +if(isset($_POST['submit'])) { $_POST['Managed']='off'; //initialise no input errors assumed initially before we test $InputError = 0; @@ -24,13 +29,13 @@ ie the page has called itself with some user input */ $_POST['LocCode']=mb_strtoupper($_POST['LocCode']); - if( trim($_POST['LocCode']) == '' ) { + if(trim($_POST['LocCode']) == '') { $InputError = 1; - prnMsg( _('The location code may not be empty'), 'error'); + prnMsg(_('The location code may not be empty'), 'error'); } - if ($_POST['CashSaleCustomer']!=''){ + if($_POST['CashSaleCustomer']!='') { - if ($_POST['CashSaleBranch']==''){ + if($_POST['CashSaleBranch']=='') { prnMsg(_('A cash sale customer and branch are necessary to fully setup the counter sales functionality'),'error'); $InputError =1; } else { //customer branch is set too ... check it ties up with a valid customer @@ -39,17 +44,17 @@ AND branchcode='" . $_POST['CashSaleBranch'] . "'"; $result = DB_query($sql); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { $InputError = 1; prnMsg(_('The cash sale customer for this location must be defined with both a valid customer code and a valid branch code for this customer'),'error'); } } } //end of checking the customer - branch code entered - if (isset($SelectedLocation) AND $InputError !=1) { + if(isset($SelectedLocation) AND $InputError !=1) { /* Set the managed field to 1 if it is checked, otherwise 0 */ - if(isset($_POST['Managed']) and $_POST['Managed'] == 'on'){ + if(isset($_POST['Managed']) and $_POST['Managed'] == 'on') { $_POST['Managed'] = 1; } else { $_POST['Managed'] = 0; @@ -80,7 +85,7 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg); - prnMsg( _('The location record has been updated'),'success'); + prnMsg(_('The location record has been updated'),'success'); unset($_POST['LocCode']); unset($_POST['LocationName']); unset($_POST['DelAdd1']); @@ -102,7 +107,7 @@ unset($_POST['UsedForWO']); - } elseif ($InputError !=1) { + } elseif($InputError !=1) { /* Set the managed field to 1 if it is checked, otherwise 0 */ if($_POST['Managed'] == 'on') { @@ -154,7 +159,7 @@ $DbgMsg = _('The SQL used to insert the location record was'); $result = DB_query($sql,$ErrMsg,$DbgMsg); - prnMsg( _('The new location record has been added'),'success'); + prnMsg(_('The new location record has been added'),'success'); /* Also need to add LocStock records for all existing stock items */ @@ -221,19 +226,19 @@ $DispTaxProvincesResult = DB_query("SELECT taxprovinceid FROM locations"); $TaxCatsResult = DB_query("SELECT taxcatid FROM taxcategories"); - if (DB_num_rows($TaxCatsResult) > 0 ) { // This will only work if there are levels else we get an error on seek. + if(DB_num_rows($TaxCatsResult) > 0) { // This will only work if there are levels else we get an error on seek. - while ($myrow=DB_fetch_row($DispTaxProvincesResult)){ + while ($myrow=DB_fetch_row($DispTaxProvincesResult)) { /*Check to see there are TaxAuthRates records set up for this TaxProvince */ $NoTaxRates = DB_query("SELECT taxauthority FROM taxauthrates WHERE dispatchtaxprovince='" . $myrow[0] . "'"); - if (DB_num_rows($NoTaxRates) < $NoTaxAuths[0]){ + if(DB_num_rows($NoTaxRates) < $NoTaxAuths[0]) { /*First off delete any tax authoritylevels already existing */ $DelTaxAuths = DB_query("DELETE FROM taxauthrates WHERE dispatchtaxprovince='" . $myrow[0] . "'"); /*Now add the new TaxAuthRates required */ - while ($CatRow = DB_fetch_row($TaxCatsResult)){ + while ($CatRow = DB_fetch_row($TaxCatsResult)) { $sql = "INSERT INTO taxauthrates (taxauthority, dispatchtaxprovince, taxcatid) @@ -250,7 +255,7 @@ } -} elseif (isset($_GET['delete'])) { +} elseif(isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button $CancelDelete = 0; @@ -259,17 +264,17 @@ $sql= "SELECT COUNT(*) FROM salesorders WHERE fromstkloc='". $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; - prnMsg( _('Cannot delete this location because sales orders have been created delivering from this location'),'warn'); + prnMsg(_('Cannot delete this location because sales orders have been created delivering from this location'),'warn'); echo _('There are') . ' ' . $myrow[0] . ' ' . _('sales orders with this Location code'); } else { $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockmoves.loccode='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; - prnMsg( _('Cannot delete this location because stock movements have been created using this location'),'warn'); + prnMsg(_('Cannot delete this location because stock movements have been created using this location'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock movements with this Location code'); } else { @@ -278,7 +283,7 @@ AND locstock.quantity !=0"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this location because location stock records exist that use this location and have a quantity on hand not equal to 0'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock items with stock on hand at this location code'); @@ -287,7 +292,7 @@ WHERE www_users.defaultlocation='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this location because it is the default location for a user') . '. ' . _('The user record must be modified first'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('users using this location as their default location'); @@ -296,7 +301,7 @@ WHERE bom.loccode='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this location because it is the default location for a bill of material') . '. ' . _('The bill of materials must be modified first'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bom components using this location'); @@ -305,25 +310,25 @@ WHERE workcentres.location='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; - prnMsg( _('Cannot delete this location because it is used by some work centre records'),'warn'); + prnMsg(_('Cannot delete this location because it is used by some work centre records'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('works centres using this location'); } else { $sql= "SELECT COUNT(*) FROM workorders WHERE workorders.loccode='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; - prnMsg( _('Cannot delete this location because it is used by some work order records'),'warn'); + prnMsg(_('Cannot delete this location because it is used by some work order records'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('work orders using this location'); } else { $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.defaultlocation='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this location because it is used by some branch records as the default location to deliver from'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches set up to use this location by default'); @@ -331,7 +336,7 @@ $sql= "SELECT COUNT(*) FROM purchorders WHERE intostocklocation='" . $SelectedLocation . "'"; $result = DB_query($sql); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this location because it is used by some purchase order records as the location to receive stock into'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('purchase orders set up to use this location as the receiving location'); @@ -344,7 +349,7 @@ } } } - if (! $CancelDelete) { + if(! $CancelDelete) { /* need to figure out if this location is the only one in the same tax province */ $result = DB_query("SELECT taxprovinceid FROM locations @@ -353,7 +358,7 @@ $result = DB_query("SELECT COUNT(taxprovinceid) FROM locations WHERE taxprovinceid='" .$TaxProvinceRow[0] . "'"); $TaxProvinceCount = DB_fetch_row($result); - if ($TaxProvinceCount[0]==1){ + if($TaxProvinceCount[0]==1) { /* if its the only location in this tax authority then delete the appropriate records in TaxAuthLevels */ $result = DB_query("DELETE FROM taxauthrates WHERE dispatchtaxprovince='" . $TaxProvinceRow[0] . "'"); @@ -363,14 +368,14 @@ $result = DB_query("DELETE FROM locationusers WHERE loccode='" . $SelectedLocation . "'"); $result = DB_query("DELETE FROM locations WHERE loccode='" . $SelectedLocation . "'"); - prnMsg( _('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success'); + prnMsg(_('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success'); unset ($SelectedLocation); } //end if Delete Location unset($SelectedLocation); unset($_GET['delete']); } -if (!isset($SelectedLocation)) { +if(!isset($SelectedLocation)) { /* It could still be the second time the page has been run and a record has been selected for modification - SelectedLocation will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of Locations will be displayed with @@ -385,22 +390,21 @@ ON locations.taxprovinceid=taxprovinces.taxprovinceid"; $result = DB_query($sql); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { prnMsg (_('There are no locations that match up with a tax province record to display. Check that tax provinces are set up for all dispatch locations'),'error'); } - echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/supplier.png" title="' . - _('Inventory') . '" alt="" />' . ' ' . $Title . '</p>'; echo '<table class="selection">'; echo '<tr> <th class="ascending">' . _('Location Code') . '</th> <th class="ascending">' . _('Location Name') . '</th> <th class="ascending">' . _('Tax Province') . '</th> + <th class="noprint" colspan="2"> </th> </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -417,16 +421,14 @@ printf('<td>%s</td> <td>%s</td> <td>%s</td> - <td><a href="%sSelectedLocation=%s">' . _('Edit') . '</a></td> - <td><a href="%sSelectedLocation=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this inventory location?') . '\');">' . _('Delete') . '</a></td> + <td class="noprint"><a href="%sSelectedLocation=%s">' . _('Edit') . '</a></td> + <td class="noprint"><a href="%sSelectedLocation=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this inventory location?') . '\');">' . _('Delete') . '</a></td> </tr>', $myrow['loccode'], $myrow['locationname'], $myrow['description'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', - $myrow['loccode'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', - $myrow['loccode']); + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $myrow['loccode'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $myrow['loccode']); } //END WHILE LIST LOOP @@ -436,21 +438,19 @@ //end of ifs and buts! echo '<br />'; -if (isset($SelectedLocation)) { +if(isset($SelectedLocation)) { echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Review Records') . '</a>'; } echo '<br />'; -if (!isset($_GET['delete'])) { +if(!isset($_GET['delete'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($SelectedLocation)) { + if(isset($SelectedLocation)) { //editing an existing Location - echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/supplier.png" title="' . - _('Inventory') . '" alt="" />' . ' ' . $Title . '</p>'; $sql = "SELECT loccode, locationname, @@ -507,7 +507,7 @@ <td>' . $_POST['LocCode'] . '</td> </tr>'; } else { //end of if $SelectedLocation only do the else when a new record is being entered - if (!isset($_POST['LocCode'])) { + if(!isset($_POST['LocCode'])) { $_POST['LocCode'] = ''; } echo '<table class="selection"> @@ -519,46 +519,46 @@ <td><input type="text" autofocus="autofocus" required="required" title="' . _('Enter up to five characters for the inventory location code') . '" data-type="no-illegal-chars" name="LocCode" value="' . $_POST['LocCode'] . '" size="5" maxlength="5" /></td> </tr>'; } - if (!isset($_POST['LocationName'])) { + if(!isset($_POST['LocationName'])) { $_POST['LocationName'] = ''; } - if (!isset($_POST['Contact'])) { + if(!isset($_POST['Contact'])) { $_POST['Contact'] = ''; } - if (!isset($_POST['DelAdd1'])) { + if(!isset($_POST['DelAdd1'])) { $_POST['DelAdd1'] = ' '; } - if (!isset($_POST['DelAdd2'])) { + if(!isset($_POST['DelAdd2'])) { $_POST['DelAdd2'] = ''; } - if (!isset($_POST['DelAdd3'])) { + if(!isset($_POST['DelAdd3'])) { $_POST['DelAdd3'] = ''; } - if (!isset($_POST['DelAdd4'])) { + if(!isset($_POST['DelAdd4'])) { $_POST['DelAdd4'] = ''; } - if (!isset($_POST['DelAdd5'])) { + if(!isset($_POST['DelAdd5'])) { $_POST['DelAdd5'] = ''; } - if (!isset($_POST['DelAdd6'])) { + if(!isset($_POST['DelAdd6'])) { $_POST['DelAdd6'] = ''; } - if (!isset($_POST['Tel'])) { + if(!isset($_POST['Tel'])) { $_POST['Tel'] = ''; } - if (!isset($_POST['Fax'])) { + if(!isset($_POST['Fax'])) { $_POST['Fax'] = ''; } - if (!isset($_POST['Email'])) { + if(!isset($_POST['Email'])) { $_POST['Email'] = ''; } - if (!isset($_POST['CashSaleCustomer'])) { + if(!isset($_POST['CashSaleCustomer'])) { $_POST['CashSaleCustomer'] = ''; } - if (!isset($_POST['CashSaleBranch'])) { + if(!isset($_POST['CashSaleBranch'])) { $_POST['CashSaleBranch'] = ''; } - if (!isset($_POST['Managed'])) { + if(!isset($_POST['Managed'])) { $_POST['Managed'] = 0; } @@ -593,10 +593,10 @@ <tr> <td>' . _('Country') . ':</td> <td><select name="DelAdd6">'; - foreach ($CountriesArray as $CountryEntry => $CountryName){ - if (isset($_POST['DelAdd6']) AND (strtoupper($_POST['DelAdd6']) == strtoupper($CountryName))){ + foreach ($CountriesArray as $CountryEntry => $CountryName) { + if(isset($_POST['DelAdd6']) AND (strtoupper($_POST['DelAdd6']) == strtoupper($CountryName))) { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif (!isset($_POST['Address6']) AND $CountryName == "") { + }elseif(!isset($_POST['Address6']) AND $CountryName == "") { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; @@ -621,8 +621,8 @@ <td><select name="TaxProvince">'; $TaxProvinceResult = DB_query("SELECT taxprovinceid, taxprovincename FROM taxprovinces"); - while ($myrow=DB_fetch_array($TaxProvinceResult)){ - if ($_POST['TaxProvince']==$myrow['taxprovinceid']){ + while ($myrow=DB_fetch_array($TaxProvinceResult)) { + if($_POST['TaxProvince']==$myrow['taxprovinceid']) { echo '<option selected="selected" value="' . $myrow['taxprovinceid'] . '">' . $myrow['taxprovincename'] . '</option>'; } else { echo '<option value="' . $myrow['taxprovinceid'] . '">' . $myrow['taxprovincename'] . '</option>'; @@ -642,12 +642,12 @@ echo '<tr> <td>' . _('Allow internal requests?') . ':</td> <td><select name="InternalRequest">'; - if ($_POST['InternalRequest']==1){ + if($_POST['InternalRequest']==1) { echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; } else { echo '<option value="1">' . _('Yes') . '</option>'; } - if ($_POST['InternalRequest']==0){ + if($_POST['InternalRequest']==0) { echo '<option selected="selected" value="0">' . _('No') . '</option>'; } else { echo '<option value="0">' . _('No') . '</option>'; @@ -657,12 +657,12 @@ echo '<tr> <td>' . _('Use for Work Order Productions?') . ':</td> <td><select name="UsedForWO">'; - if ($_POST['UsedForWO']==1){ + if($_POST['UsedForWO']==1) { echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; } else { echo '<option value="1">' . _('Yes') . '</option>'; } - if ($_POST['UsedForWO']==0){ + if($_POST['UsedForWO']==0) { echo '<option selected="selected" value="0">' . _('No') . '</option>'; } else { echo '<option value="0">' . _('No') . '</option>'; 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-04-21 14:26:58 UTC (rev 7270) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2015-04-23 14:00:44 UTC (rev 7271) @@ -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-23 18:29-0600\n" +"PO-Revision-Date: 2015-04-23 07:53-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -13211,7 +13211,7 @@ #: FixedAssetLocations.php:98 FixedAssetLocations.php:121 msgid "Location ID" -msgstr "ID de Ubicación" +msgstr "ID de ubicación" #: FixedAssetLocations.php:99 FixedAssetLocations.php:131 msgid "Location Description" @@ -16022,7 +16022,7 @@ #: InternalStockRequestAuthorisation.php:70 #: InternalStockRequestFulfill.php:288 msgid "Location Of Stock" -msgstr "Ubicación de la Existencia: " +msgstr "Ubicación del inventario" #: InternalStockRequestAuthorisation.php:71 #: InternalStockRequestFulfill.php:289 @@ -16704,7 +16704,7 @@ #: Locations.php:5 msgid "Location Maintenance" -msgstr "Administrar Ubicaciones" +msgstr "Administrar ubicaciones" #: Locations.php:29 msgid "The location code may not be empty" @@ -16917,11 +16917,11 @@ #: Locations.php:396 Locations.php:506 Locations.php:518 #: api/api_xml-rpc.php:876 msgid "Location Code" -msgstr "Código Localidad" +msgstr "Código de ubicación" #: Locations.php:397 Locations.php:566 msgid "Location Name" -msgstr "Nombre Localidad" +msgstr "Nombre de ubicación" #: Locations.php:398 Locations.php:620 TaxAuthorityRates.php:81 #: TaxProvinces.php:165 @@ -16943,7 +16943,7 @@ #: Locations.php:515 msgid "New Location details" -msgstr "Detalles Nueva Ubicación" +msgstr "Detalles de nueva ubicación" #: Locations.php:519 msgid "Enter up to five characters for the inventory location code" @@ -18328,7 +18328,7 @@ #: NoSalesItems.php:195 msgid "Location QOH" -msgstr "Ubicación" +msgstr "Ubicación de la disponibilidad" #: NoSalesItems.php:196 msgid "Total QOH" @@ -19389,7 +19389,7 @@ #: PDFPeriodStockTransListing.php:44 includes/DatabaseTranslations.php:30 msgid "Location Transfer" -msgstr "Transferencia de Localidad" +msgstr "Transferencia de ubicación" #: PDFPeriodStockTransListing.php:45 includes/DatabaseTranslations.php:31 msgid "Stock Adjustment" @@ -19437,7 +19437,7 @@ #: PDFPeriodStockTransListing.php:169 SelectProduct.php:405 msgid "Location Transfers" -msgstr "Transferencias de localidad" +msgstr "Transferencias de ubicación" #: PDFPeriodStockTransListing.php:172 StockAdjustments.php:8 msgid "Stock Adjustments" @@ -31752,7 +31752,7 @@ #: StockLocTransferReceive.php:454 msgid "Location Transfer Reference" -msgstr "Referencia de Ubicación de transferencia" +msgstr "Referencia de transferencia de ubicación" #: StockLocTransferReceive.php:460 msgid "Quantity Dispatched" @@ -40106,7 +40106,7 @@ #: Z_ChangeLocationCode.php:244 msgid "Location code" -msgstr "Código de Localidad" +msgstr "Código de ubicación" #: Z_ChangeLocationCode.php:255 msgid "Existing Location Code" @@ -43018,7 +43018,7 @@ #: api/api_errorcodes.php:215 msgid "Location Code Not Setup" -msgstr "Código de Localidad no Configurado" +msgstr "Código de ubicación sin configurar" #: api/api_errorcodes.php:216 msgid "Tax Group Id Not Setup" @@ -46023,7 +46023,7 @@ #: includes/PDFInventoryValnPageHeader.inc:15 msgid "location" -msgstr "Ubicación" +msgstr "ubicación" #: includes/PDFLowGPPageHeader.inc:15 msgid "Low GP Sales Between" |
From: <ex...@us...> - 2015-04-30 10:30:25
|
Revision: 7282 http://sourceforge.net/p/web-erp/reponame/7282 Author: exsonqu Date: 2015-04-30 10:30:23 +0000 (Thu, 30 Apr 2015) Log Message: ----------- 30/04/15 Exson: Fixed the notice noise in SupplierCredit.php and SupplierInvoice.php. Modified Paths: -------------- trunk/SupplierCredit.php trunk/SupplierInvoice.php Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2015-04-30 04:30:57 UTC (rev 7281) +++ trunk/SupplierCredit.php 2015-04-30 10:30:23 UTC (rev 7282) @@ -526,7 +526,7 @@ <td colspan="2"><input type="submit" name="ToggleTaxMethod" value="' . _('Update Tax Calculation') . '" /></td> <td><select name="OverRideTax" onchange="ReloadForm(form1.ToggleTaxMethod)">'; -if ($_POST['OverRideTax']=='Man'){ +if (isset($_POST['OverRideTax']) AND $_POST['OverRideTax']=='Man'){ echo '<option value="Auto">' . _('Automatic') . '</option> <option selected="selected" value="Man">' . _('Manual Entry') . '</option>'; } else { Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2015-04-30 04:30:57 UTC (rev 7281) +++ trunk/SupplierInvoice.php 2015-04-30 10:30:23 UTC (rev 7282) @@ -874,7 +874,7 @@ <td colspan="2"><input type="submit" name="ToggleTaxMethod" value="' . _('Update Tax Calculation') . '" /></td> <td><select name="OverRideTax" onchange="ReloadForm(form1.ToggleTaxMethod)">'; - if ($_POST['OverRideTax']=='Man'){ + if (isset($_POST['OverRideTax']) AND $_POST['OverRideTax']=='Man'){ echo '<option value="Auto">' . _('Automatic') . '</option> <option selected="selected" value="Man">' . _('Manually') . '</option>'; } else { |
From: <tu...@us...> - 2015-05-01 02:42:53
|
Revision: 7284 http://sourceforge.net/p/web-erp/reponame/7284 Author: turbopt Date: 2015-05-01 02:42:51 +0000 (Fri, 01 May 2015) Log Message: ----------- Add Delivery Date in GoodsReceived.php output [forum feature request], plus some very minor cleanup. Modified Paths: -------------- trunk/GoodsReceived.php trunk/doc/Change.log Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2015-04-30 10:31:08 UTC (rev 7283) +++ trunk/GoodsReceived.php 2015-05-01 02:42:51 UTC (rev 7284) @@ -92,9 +92,9 @@ echo '<table cellpadding="2" class="selection"> <tr><th colspan="2"></th> - <th align="center" colspan="3"><b>' . _('Supplier Units') . '</b></th> + <th class="centre" colspan="3"><b>' . _('Supplier Units') . '</b></th> <th></th> - <th align="center" colspan="5"><b>' . _('Our Receiving Units') . '</b></th> + <th class="centre" colspan="5"><b>' . _('Our Receiving Units') . '</b></th> </tr> <tr> <th>' . _('Item Code') . '</th> @@ -106,6 +106,7 @@ <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> + <th>' . _('Delivery') . '<br />' . _('Date') . '</th> <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th> <th>' . _('Completed') . '</th>'; @@ -170,6 +171,7 @@ <td class="number">' . $DisplayQtyOrd . '</td> <td>' . $LnItm->Units . '</td> <td class="number">' . $DisplayQtyRec . '</td> + <td>' . $LnItm->ReqDelDate . '</td> <td class="number">'; if ($LnItm->Controlled == 1) { @@ -206,7 +208,7 @@ $DisplayTotal = locale_number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); if ($_SESSION['ShowValueOnGRN']==1) { echo '<tr> - <td colspan="11" class="number"><b>' . _('Total value of goods received'). '</b></td> + <td colspan="13" class="number"><b>' . _('Total value of goods received'). '</b></td> <td class="number"><b>' . $DisplayTotal. '</b></td> </tr> </table>'; @@ -422,7 +424,7 @@ $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = (($CurrentStandardCost * $OrderLine->ReceiveQty) + ($_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost * $OrderLine->QtyReceived)) / ($OrderLine->ReceiveQty + $OrderLine->QtyReceived); } elseif ($myrow[1] == 'D') { //it's a dummy part which without stock. $Dummy = true; - if($OrderLine->QtyReceived == 0){//There is + if($OrderLine->QtyReceived == 0){//There is $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $LocalCurrencyPrice; } } @@ -612,7 +614,7 @@ $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); if ($_SESSION['QualityLogSamples']==1) { CreateQASample($OrderLine->StockID,$Item->BundleRef, '', 'Created from Purchase Order', 0, 0,$db); - } + } }//non blank BundleRef } //end foreach } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-04-30 10:31:08 UTC (rev 7283) +++ trunk/doc/Change.log 2015-05-01 02:42:51 UTC (rev 7284) @@ -1,5 +1,6 @@ webERP Change Log +30/04/15 TurboPT: Add Delivery Date in GoodsReceived.php output. Forum feature request by giusba71. 30/04/15 Exson: Fixed the notice noise in SupplierCredit.php and SupplierInvoice.php. 30/04/15 Exson: Fixed the properties initial bug and tidy code up by fix typo. 26/04/15 Exson: Add adjustment reason to the mail text and fixed the notice noise in StockAdjustments.php. |
From: <te...@us...> - 2015-05-02 21:28:41
|
Revision: 7285 http://sourceforge.net/p/web-erp/reponame/7285 Author: tehonu Date: 2015-05-02 21:28:39 +0000 (Sat, 02 May 2015) Log Message: ----------- Added bankaccountusers table in Z_ChangeGLAccountCode.php Modified Paths: -------------- trunk/Z_ChangeGLAccountCode.php trunk/doc/Change.log Modified: trunk/Z_ChangeGLAccountCode.php =================================================================== --- trunk/Z_ChangeGLAccountCode.php 2015-05-01 02:42:51 UTC (rev 7284) +++ trunk/Z_ChangeGLAccountCode.php 2015-05-02 21:28:39 UTC (rev 7285) @@ -68,6 +68,8 @@ ChangeFieldInTable("bankaccounts", "accountcode", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); + ChangeFieldInTable("bankaccountusers", "accountcode", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); + ChangeFieldInTable("banktrans", "bankact", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); ChangeFieldInTable("chartdetails", "accountcode", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-05-01 02:42:51 UTC (rev 7284) +++ trunk/doc/Change.log 2015-05-02 21:28:39 UTC (rev 7285) @@ -1,5 +1,5 @@ webERP Change Log - +02/05/15 TeHonu: Added bankaccountusers table in Z_ChangeGLAccountCode.php 30/04/15 TurboPT: Add Delivery Date in GoodsReceived.php output. Forum feature request by giusba71. 30/04/15 Exson: Fixed the notice noise in SupplierCredit.php and SupplierInvoice.php. 30/04/15 Exson: Fixed the properties initial bug and tidy code up by fix typo. |
From: <rc...@us...> - 2015-05-07 13:54:06
|
Revision: 7290 http://sourceforge.net/p/web-erp/reponame/7290 Author: rchacon Date: 2015-05-07 13:54:04 +0000 (Thu, 07 May 2015) Log Message: ----------- Hides submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. Modified Paths: -------------- trunk/SupplierInquiry.php trunk/doc/Change.log Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2015-05-04 06:55:21 UTC (rev 7289) +++ trunk/SupplierInquiry.php 2015-05-07 13:54:04 UTC (rev 7290) @@ -1,8 +1,9 @@ <?php /* $Id$*/ +/* Inquiry showing invoices, credit notes and payments made to suppliers together with the amounts outstanding. */ include('includes/session.inc'); -$Title = _('Supplier Inquiry'); +$Title = _('Supplier Inquiry');// Screen identification. $ViewTopic = 'AccountsPayable';// Filename in ManualContents.php's TOC./* RChacon: Is there any content for Supplier Inquiry? */ $BookMark = 'AccountsPayable';// Anchor's id in the manual's html document. include('includes/header.inc'); @@ -114,7 +115,7 @@ $SupplierRecord['overdue2'] = 0; } include('includes/CurrenciesArray.php'); // To get the currency name from the currency code. -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/supplier.png" title="' . _('Supplier') . '" alt="" /> ' . +echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.'/images/supplier.png" title="' . _('Supplier') . '" /> ' . _('Supplier') . ': ' . $SupplierID . ' - ' . $SupplierRecord['suppname'] . '<br />' . _('All amounts stated in') . ': ' . @@ -163,7 +164,7 @@ echo '<div> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Show all transactions after') . ': ' . '<input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="10" /> - <input type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '" /> + <input class="noprint" name="Refresh Inquiry" type="submit" value="' . _('Refresh Inquiry') . '" /> </div> </form> <br />'; @@ -204,7 +205,7 @@ /*show a table of the transactions returned by the SQL */ -echo '<table width="90%" class="selection"> +echo '<table class="selection"><thead> <tr> <th class="ascending">' . _('Date') . '</th> <th class="ascending">' . _('Type') . '</th> @@ -214,9 +215,10 @@ <th class="ascending">' . _('Total') . '</th> <th class="ascending">' . _('Allocated') . '</th> <th class="ascending">' . _('Balance') . '</th> - <th>' . _('More Info') . '</th> - <th>' . _('More Info') . '</th> - </tr>'; + <th class="noprint">' . _('More Info') . '</th> + <th class="noprint">' . _('More Info') . '</th> + </tr> + </thead><tbody>'; $j = 1; $k = 0;// Row colour counter. @@ -252,17 +254,17 @@ <td class="number">' . locale_number_format($myrow['allocated'],$SupplierRecord['currdecimalplaces']) . '</td> <td class="number">' . locale_number_format($myrow['totalamount']-$myrow['allocated'],$SupplierRecord['currdecimalplaces']) . '</td>'; - $PaymentTD1 = '<td><a href="' . $RootPath . '/PaymentAllocations.php?SuppID=%s&InvID=%s" title="' . + $PaymentTD1 = '<td class="noprint"><a href="' . $RootPath . '/PaymentAllocations.php?SuppID=%s&InvID=%s" title="' . _('Click to view payments') . '"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/money_delete.png" width="16"/> ' . _('Payments') . '</a></td>'; /* To do: $HoldValueTD1*/ - $AllocationTD1 = '<td><a href="' . $RootPath . '/SupplierAllocations.php?AllocTrans=%s" title="' . + $AllocationTD1 = '<td class="noprint"><a href="' . $RootPath . '/SupplierAllocations.php?AllocTrans=%s" title="' . _('Click to allocate funds') . '"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/allocation.png" /> ' . _('Allocation') . '</a></td>'; - $GLEntriesTD1 = '<td><a href="' . $RootPath . '/GLTransInquiry.php?TypeID=%s&TransNo=%s" target="_blank" title="' . + $GLEntriesTD1 = '<td class="noprint"><a href="' . $RootPath . '/GLTransInquiry.php?TypeID=%s&TransNo=%s" target="_blank" title="' . _('Click to view the GL entries') . '"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/gl.png" width="16" /> ' . _('GL Entries') . '</a></td>'; @@ -289,12 +291,12 @@ printf($BaseTD8); if ($AuthRow[0]==0) { - echo '<td><a href="' .htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?HoldType=' . $myrow['type'] . '&HoldTrans=' . $myrow['transno']. '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'].'">' . $HoldValue . '</a></td>'; + echo '<td class="noprint"><a href="' .htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?HoldType=' . $myrow['type'] . '&HoldTrans=' . $myrow['transno']. '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'].'">' . $HoldValue . '</a></td>'; } else { if ($HoldValue==_('Release')) { echo '<td>' . $HoldValue . '</a></td>'; } else { - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'). '?HoldType=' . $myrow['type'] .'&HoldTrans=' . $myrow['transno'] . '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'] .'">' . $HoldValue . '</a></td>'; + echo '<td class="noprint"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'). '?HoldType=' . $myrow['type'] .'&HoldTrans=' . $myrow['transno'] . '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'] .'">' . $HoldValue . '</a></td>'; } } printf($GLEntriesTD1 . '</tr>', @@ -306,14 +308,13 @@ } else { if ($myrow['totalamount'] - $myrow['allocated'] == 0) { /*The trans is settled so don't show option to hold */ - printf($BaseTD8 . '<td> </td><td> </td></tr>'); + echo $BaseTD8 . '<td class="noprint"> </td><td class="noprint"> </td></tr>'; } else { - printf($BaseTD8); - echo ' - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES,'UTF-8') . '/PaymentAllocations.php?SuppID=' . + echo $BaseTD8 . ' + <td class="noprint"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES,'UTF-8') . '/PaymentAllocations.php?SuppID=' . $myrow['type'] . '&InvID=' . $myrow['transno'] . '">' . _('View Payments') . '</a></td> - <td><a href="' . $HoldValue . '?HoldType=' . $_POST['TransAfterDate'] . '&HoldTrans=' . $HoldValue . '&HoldStatus=' . + <td class="noprint"><a href="' . $HoldValue . '?HoldType=' . $_POST['TransAfterDate'] . '&HoldTrans=' . $HoldValue . '&HoldStatus=' . $RootPath . '&FromDate='. $myrow['supplierno'] . '">' . $myrow['suppreference'] . '</a></td></tr>'; } } @@ -329,7 +330,7 @@ $myrow['transno']); } else { /*Not linked to GL */ - printf($BaseTD8 . $AllocationTD1 . '<td> </td></tr>', + printf($BaseTD8 . $AllocationTD1 . '<td class="noprint"> </td></tr>', // $AllocationTD1 parameters: $myrow['id']); @@ -337,6 +338,6 @@ }// End of page full new headings if }// End of while loop -echo '</table>'; +echo '</tbody></table>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-05-04 06:55:21 UTC (rev 7289) +++ trunk/doc/Change.log 2015-05-07 13:54:04 UTC (rev 7290) @@ -1,5 +1,6 @@ webERP Change Log +07/05/15 RChacon: Hides submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. 04/05/15 Exson: Make PO number searching also in compliance with location authority rules and make default search result as all if users have full location authority. 04/05/15 Exson: Make all option available for users who have authority for all locations and all option available for all stock categories in PO_SelectOSPurchOrder.php. 02/05/15 TeHonu: Added bankaccountusers table in Z_ChangeGLAccountCode.php |
From: <rc...@us...> - 2015-05-07 20:04:25
|
Revision: 7291 http://sourceforge.net/p/web-erp/reponame/7291 Author: rchacon Date: 2015-05-07 20:04:23 +0000 (Thu, 07 May 2015) Log Message: ----------- In CustomerInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. Modified Paths: -------------- trunk/CustomerInquiry.php trunk/doc/Change.log Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2015-05-07 13:54:04 UTC (rev 7290) +++ trunk/CustomerInquiry.php 2015-05-07 20:04:23 UTC (rev 7291) @@ -1,11 +1,11 @@ <?php /* $Id$*/ +/* Shows the customers account transactions with balances outstanding, links available to drill down to invoice/credit note or email invoices/credit notes. */ include('includes/session.inc'); -$Title = _('Customer Inquiry'); -/* Manual links before header.inc */ -$ViewTopic = 'ARInquiries'; // Filename in ManualContents.php's TOC. -$BookMark = 'CustomerInquiry'; // Anchor's id in the manual's html document. +$Title = _('Customer Inquiry');// Screen identification. +$ViewTopic = 'ARInquiries';// Filename's id in ManualContents.php's TOC. +$BookMark = 'CustomerInquiry';// Anchor's id in the manual's html document. include('includes/header.inc'); // always figure out the SQL required from the inputs available @@ -186,7 +186,7 @@ echo '<div class="centre"><form onSubmit="return VerifyForm(this);" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" method="post" class="noPrint"> <input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />'; -echo _('Show all transactions after'), ':<input tabindex="1" type="text" required="required" class="date" alt="', $_SESSION['DefaultDateFormat'], '" id="datepicker" name="TransAfterDate" value="', $_POST['TransAfterDate'], '" minlength="0" maxlength="10" size="12" />'; +echo _('Show all transactions after'), ':<input type="text" required="required" class="date" alt="', $_SESSION['DefaultDateFormat'], '" id="datepicker" name="TransAfterDate" value="', $_POST['TransAfterDate'], '" minlength="0" maxlength="10" size="12" />'; echo '<select name="Status">'; if ($_POST['Status'] == '') { @@ -206,7 +206,7 @@ } echo '</select>'; -echo '<input tabindex="3" type="submit" name="Refresh Inquiry" value="', _('Refresh Inquiry'), '" /> +echo '<input class="noprint" name="Refresh Inquiry" type="submit" value="', _('Refresh Inquiry'), '" /> </form></div>'; $DateAfterCriteria = FormatDateForSQL($_POST['TransAfterDate']); @@ -244,24 +244,25 @@ /* Show a table of the invoices returned by the SQL. */ -echo '<table class="selection"> - <tr> - <th class="ascending">', _('Type'), '</th> - <th class="ascending">', _('Number'), '</th> - <th class="ascending">', _('Date'), '</th> - <th>', _('Branch'), '</th> - <th class="ascending">', _('Reference'), '</th> - <th>', _('Comments'), '</th> - <th>', _('Order'), '</th> - <th>', _('Total'), '</th> - <th>', _('Allocated'), '</th> - <th>', _('Balance'), '</th> - <th>', _('More Info'), '</th> - <th>', _('More Info'), '</th> - <th>', _('More Info'), '</th> - <th>', _('More Info'), '</th> - <th>', _('More Info'), '</th> - </tr>'; +echo '<table class="selection"><thead> + <tr> + <th class="ascending">', _('Type'), '</th> + <th class="ascending">', _('Number'), '</th> + <th class="ascending">', _('Date'), '</th> + <th>', _('Branch'), '</th> + <th class="ascending">', _('Reference'), '</th> + <th>', _('Comments'), '</th> + <th>', _('Order'), '</th> + <th>', _('Total'), '</th> + <th>', _('Allocated'), '</th> + <th>', _('Balance'), '</th> + <th class="noprint">', _('More Info'), '</th> + <th class="noprint">', _('More Info'), '</th> + <th class="noprint">', _('More Info'), '</th> + <th class="noprint">', _('More Info'), '</th> + <th class="noprint">', _('More Info'), '</th> + </tr> + </thead><tbody>'; $k = 0; //row colour counter while ($MyRow = DB_fetch_array($TransResult)) { @@ -300,29 +301,33 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td> - <a href="', $RootPath, '/Credit_Invoice.php?InvoiceNumber=', $MyRow['transno'], '">', _('Credit '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/credit.png" title="', _('Click to credit the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/Credit_Invoice.php?InvoiceNumber=', $MyRow['transno'], '" title="', _('Click to credit the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/credit.png" /> ', + _('Credit'), ' </a> </td> - <td> - <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('HTML '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to preview the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" /> ', + _('HTML'), ' </a> </td> - <td> - <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True">', _('PDF '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True" title="', _('Click for PDF'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" /> ', + _('PDF'), ' </a> </td> - <td> - <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('Email '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to email the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/email.png" /> ', _('Email'), ' </a> </td> - <td> - <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">', _('View GL Entries'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '" title="', _('Click to view the GL entries'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/gl.png" /> ', + _('GL Entries'), ' </a> </td> </tr>'; @@ -342,27 +347,30 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td> - <a href="', $RootPath, '/Credit_Invoice.php?InvoiceNumber=', $MyRow['transno'], '">' . _('Credit ') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/credit.png" title="', _('Click to credit the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/Credit_Invoice.php?InvoiceNumber=', $MyRow['transno'], '" title="', _('Click to credit the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/credit.png" /> ', + _('Credit'), ' </a> </td> - <td> - <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('HTML '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to preview the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" /> ', + _('HTML'), ' </a> </td> - <td> - <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True">', _('PDF '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True" title="', _('Click for PDF'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" /> ', + _('PDF'), ' </a> </td> - <td> - <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('Email ') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to email the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/email.png" /> ', _('Email'), ' </a> </td> - <td></td> + <td class="noprint"> </td> </tr>'; } @@ -383,23 +391,25 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td></td> - <td> - <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('HTML '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the invoice'), '" alt="" /> + <td class="noprint"> </td> + <td class="noprint"> + <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to preview the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" /> ', + _('HTML'), ' </a> </td> - <td> - <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True" title="', _('Click for PDF'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" /> ', + _('PDF'), ' </a> </td> - <td> - <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice">', _('Email ') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the invoice'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to email the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/email.png" /> ', _('Email'), ' </a> </td> - <td></td> + <td class="noprint"> </td> </tr>'; } elseif ($MyRow['type'] == 11) { @@ -418,29 +428,33 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td> - <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit">', _('HTML '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the credit note'), '" /> + <td class="noprint"> + <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to preview the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" /> ', + _('HTML'), ' </a> </td> - <td> - <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit&PrintPDF=True">', _('PDF '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True" title="', _('Click for PDF'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" /> ', + _('PDF'), ' </a> </td> - <td> + <td class="noprint"> <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit">', _('Email'), ' <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the credit note'), '" alt="" /> </a> </td> - <td> - <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '">', _('Allocation'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/allocation.png" title="', _('Click to allocate funds'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '" title="', _('Click to allocate funds'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/allocation.png" /> ', + _('Allocation'), ' </a> </td> - <td> - <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">' . _('View GL Entries') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '" title="', _('Click to view the GL entries'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/gl.png" /> ', + _('GL Entries'), ' </a> </td> </tr>'; @@ -460,27 +474,30 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td> - <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit">', _('HTML '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/preview.png" title="', _('Click to preview the credit note'), '" /> + <td class="noprint"> + <a href="', $RootPath, '/PrintCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice" title="', _('Click to preview the invoice'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/preview.png" /> ', + _('HTML'), ' </a> </td> - <td> - <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit&PrintPDF=True">', _('PDF '), ' - <img src="', $RootPath, '/css/', $Theme, '/images/pdf.png" title="', _('Click for PDF'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/', $PrintCustomerTransactionScript, '?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Invoice&PrintPDF=True" title="', _('Click for PDF'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/pdf.png" /> ', + _('PDF'), ' </a> </td> - <td> + <td class="noprint"> <a href="', $RootPath, '/EmailCustTrans.php?FromTransNo=', $MyRow['transno'], '&InvOrCredit=Credit">', _('Email'), ' <img src="', $RootPath, '/css/', $Theme, '/images/email.png" title="', _('Click to email the credit note'), '" alt="" /> </a> </td> - <td> - <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '">', _('Allocation'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/allocation.png" title="', _('Click to allocate funds'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '" title="', _('Click to allocate funds'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/allocation.png" /> ', + _('Allocation'), ' </a> </td> - <td></td> + <td class="noprint"> </td> </tr>'; } @@ -500,17 +517,19 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td> - <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '">', _('Allocation'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/allocation.png" title="', _('Click to allocate funds'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '" title="', _('Click to allocate funds'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/allocation.png" /> ', + _('Allocation'), ' </a> </td> - <td></td> - <td></td> - <td></td> - <td> - <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">', _('View GL Entries'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> + <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '" title="', _('Click to view the GL entries'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/gl.png" /> ', + _('GL Entries'), ' </a> </td> </tr>'; @@ -530,15 +549,16 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td> - <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '">', _('Allocation'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/allocation.png" title="', _('Click to allocate funds'), '" alt="" /> + <td class="noprint"> + <a href="', $RootPath, '/CustomerAllocations.php?AllocTrans=', $MyRow['id'], '" title="', _('Click to allocate funds'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/allocation.png" /> ', + _('Allocation'), ' </a> </td> - <td></td> - <td></td> - <td></td> - <td></td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> </tr>'; } @@ -558,14 +578,15 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td></td> - <td></td> - <td></td> - <td></td> - <td> - <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">' . _('View GL Entries') . ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> - </a> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> + <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '" title="', _('Click to view the GL entries'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/gl.png" /> ', + _('GL Entries'), ' + </a> </td> </tr>'; @@ -584,11 +605,11 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td></td> - <td></td> - <td></td> - <td></td> - <td></td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> </tr>'; } } else { @@ -607,13 +628,14 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td></td> - <td></td> - <td></td> - <td></td> - <td> - <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '">', _('View GL Entries'), ' - <img src="', $RootPath, '/css/', $Theme, '/images/gl.png" title="', _('View GL Entries'), '" alt="" /> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> + <a href="', $RootPath, '/GLTransInquiry.php?TypeID=', $MyRow['type'], '&TransNo=', $MyRow['transno'], '" title="', _('Click to view the GL entries'), '"> + <img alt="" src="', $RootPath, '/css/', $Theme, '/images/gl.png" /> ', + _('GL Entries'), ' </a> </td> </tr>'; @@ -633,11 +655,11 @@ <td class="number">', locale_number_format($MyRow['totalamount'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> <td class="number">', locale_number_format($MyRow['totalamount'] - $MyRow['allocated'], $CustomerRecord['decimalplaces']), '</td> - <td></td> - <td></td> - <td></td> - <td></td> - <td></td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> + <td class="noprint"> </td> </tr>'; } } @@ -645,6 +667,6 @@ } //end of while loop -echo '</table>'; +echo '</tbody></table>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-05-07 13:54:04 UTC (rev 7290) +++ trunk/doc/Change.log 2015-05-07 20:04:23 UTC (rev 7291) @@ -1,6 +1,7 @@ webERP Change Log -07/05/15 RChacon: Hides submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. +07/05/15 RChacon: In CustomerInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. +07/05/15 RChacon: In SupplierInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. 04/05/15 Exson: Make PO number searching also in compliance with location authority rules and make default search result as all if users have full location authority. 04/05/15 Exson: Make all option available for users who have authority for all locations and all option available for all stock categories in PO_SelectOSPurchOrder.php. 02/05/15 TeHonu: Added bankaccountusers table in Z_ChangeGLAccountCode.php |
From: <rc...@us...> - 2015-05-08 14:42:04
|
Revision: 7292 http://sourceforge.net/p/web-erp/reponame/7292 Author: rchacon Date: 2015-05-08 14:42:02 +0000 (Fri, 08 May 2015) Log Message: ----------- In DeliveryDetails.php, add $ViewTopic and $BookMark to ManualSalesOrders.html. Modified Paths: -------------- trunk/DeliveryDetails.php trunk/doc/Change.log trunk/doc/Manual/ManualSalesOrders.html Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2015-05-07 20:04:23 UTC (rev 7291) +++ trunk/DeliveryDetails.php 2015-05-08 14:42:02 UTC (rev 7292) @@ -1,6 +1,6 @@ <?php - /* $Id$ */ +/* Used during order entry to allow the entry of delivery addresses other than the defaulted branch delivery address and information about carrier/shipping method etc. */ /* This is where the delivery details are confirmed/entered/modified and the order committed to the database once the place order/modify order button is hit. @@ -11,24 +11,27 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ include('includes/session.inc'); -$Title = _('Order Delivery Details'); +$Title = _('Order Delivery Details');// Screen identification. +$ViewTopic = 'SalesOrders';// Filename's id in ManualContents.php's TOC. +$BookMark = 'DeliveryDetails';// Anchor's id in the manual's html document. include('includes/header.inc'); + include('includes/FreightCalculation.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/CountriesArray.php'); -if (isset($_GET['identifier'])) { +if(isset($_GET['identifier'])) { $identifier=$_GET['identifier']; } unset($_SESSION['WarnOnce']); -if (!isset($_SESSION['Items'.$identifier]) OR !isset($_SESSION['Items'.$identifier]->DebtorNo)){ +if(!isset($_SESSION['Items'.$identifier]) OR !isset($_SESSION['Items'.$identifier]->DebtorNo)) { prnMsg(_('This page can only be read if an order has been entered') . '. ' . _('To enter an order select customer transactions then sales order entry'),'error'); include('includes/footer.inc'); exit; } -if ($_SESSION['Items'.$identifier]->ItemsOrdered == 0){ +if($_SESSION['Items'.$identifier]->ItemsOrdered == 0) { prnMsg(_('This page can only be read if an there are items on the order') . '. ' . _('To enter an order select customer transactions then sales order entry'),'error'); include('includes/footer.inc'); exit; @@ -38,7 +41,7 @@ $EarliestDispatch = CalcEarliestDispatchDate(); -if (isset($_POST['ProcessOrder']) OR isset($_POST['MakeRecurringOrder'])) { +if(isset($_POST['ProcessOrder']) OR isset($_POST['MakeRecurringOrder'])) { /*need to check for input errors in any case before order processed */ $_POST['Update']='Yes rerun the validation checks'; //no need for gettext! @@ -49,42 +52,42 @@ } -if (isset($_POST['Update']) +if(isset($_POST['Update']) OR isset($_POST['BackToLineDetails']) - OR isset($_POST['MakeRecurringOrder'])) { + OR isset($_POST['MakeRecurringOrder'])) { $InputErrors =0; - if (mb_strlen($_POST['DeliverTo'])<=1){ + if(mb_strlen($_POST['DeliverTo'])<=1) { $InputErrors =1; prnMsg(_('You must enter the person or company to whom delivery should be made'),'error'); } - if (mb_strlen($_POST['BrAdd1'])<=1){ + if(mb_strlen($_POST['BrAdd1'])<=1) { $InputErrors =1; prnMsg(_('You should enter the street address in the box provided') . '. ' . _('Orders cannot be accepted without a valid street address'),'error'); } -// if (mb_strpos($_POST['BrAdd1'],_('Box'))>0){ +// if(mb_strpos($_POST['BrAdd1'],_('Box'))>0) { // prnMsg(_('You have entered the word') . ' "' . _('Box') . '" ' . _('in the street address') . '. ' . _('Items cannot be delivered to') . ' ' ._('box') . ' ' . _('addresses'),'warn'); // } - if (!is_numeric($_POST['FreightCost'])){ + if(!is_numeric($_POST['FreightCost'])) { $InputErrors =1; prnMsg( _('The freight cost entered is expected to be numeric'),'error'); } - if (isset($_POST['MakeRecurringOrder']) AND $_POST['Quotation']==1){ + if(isset($_POST['MakeRecurringOrder']) AND $_POST['Quotation']==1) { $InputErrors =1; prnMsg( _('A recurring order cannot be made from a quotation'),'error'); } - if (($_POST['DeliverBlind'])<=0){ + if(($_POST['DeliverBlind'])<=0) { $InputErrors =1; prnMsg(_('You must select the type of packlist to print'),'error'); } -/* If (mb_strlen($_POST['BrAdd3'])==0 OR !isset($_POST['BrAdd3'])){ +/* if(mb_strlen($_POST['BrAdd3'])==0 OR !isset($_POST['BrAdd3'])) { $InputErrors =1; echo "<br />A region or city must be entered.<br />"; } Maybe appropriate in some installations but not here - If (mb_strlen($_POST['BrAdd2'])<=1){ + if(mb_strlen($_POST['BrAdd2'])<=1) { $InputErrors =1; echo "<br />You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br />"; } @@ -108,16 +111,16 @@ /* This check is not appropriate where orders need to be entered in retrospectively in some cases this check will be appropriate and this should be uncommented - elseif (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])){ + elseif(Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])) { $InputErrors =1; echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); } */ - if ($InputErrors==0){ + if($InputErrors==0) { - if ($_SESSION['DoFreightCalc']==True){ + if($_SESSION['DoFreightCalc']==True) { list ($_POST['FreightCost'], $BestShipper) = CalcFreightCost($_SESSION['Items'.$identifier]->total, $_POST['BrAdd2'], $_POST['BrAdd3'], @@ -129,7 +132,7 @@ $_SESSION['Items'.$identifier]->Location, $_SESSION['Items'.$identifier]->DefaultCurrency, $db); - if ( !empty($BestShipper) ){ + if( !empty($BestShipper) ) { $_POST['FreightCost'] = round($_POST['FreightCost'],2); $_POST['ShipVia'] = $BestShipper; } else { @@ -158,23 +161,23 @@ $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$ErrMsg,$DbgMsg); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); - if ($debug==1){ + if($debug==1) { echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; } include('includes/footer.inc'); exit; } - if (!isset($_POST['SpecialInstructions'])) { + if(!isset($_POST['SpecialInstructions'])) { $_POST['SpecialInstructions']=''; } - if (!isset($_POST['DeliveryDays'])){ + if(!isset($_POST['DeliveryDays'])) { $_POST['DeliveryDays']=0; } - if (!isset($_SESSION['Items'.$identifier])) { + if(!isset($_SESSION['Items'.$identifier])) { $myrow = DB_fetch_row($result); $_SESSION['Items'.$identifier]->DeliverTo = $myrow[0]; $_SESSION['Items'.$identifier]->DelAdd1 = $myrow[1]; @@ -232,7 +235,7 @@ and show a link to set them up - if shippers defined but the default shipper is bogus then use the first shipper defined */ - if ((isset($BestShipper) AND $BestShipper=='') AND ($_POST['ShipVia']=='' OR !isset($_POST['ShipVia']))){ + if((isset($BestShipper) AND $BestShipper=='') AND ($_POST['ShipVia']=='' OR !isset($_POST['ShipVia']))) { $sql = "SELECT shipper_id FROM shippers WHERE shipper_id='" . $_SESSION['Default_Shipper']."'"; @@ -240,7 +243,7 @@ $DbgMsg = _('SQL used to test for the default shipper') . ':'; $TestShipperExists = DB_query($sql,$ErrMsg,$DbgMsg); - if (DB_num_rows($TestShipperExists)==1){ + if(DB_num_rows($TestShipperExists)==1) { $BestShipper = $_SESSION['Default_Shipper']; @@ -250,7 +253,7 @@ FROM shippers"; $TestShipperExists = DB_query($sql,$ErrMsg,$DbgMsg); - if (DB_num_rows($TestShipperExists)>=1){ + if(DB_num_rows($TestShipperExists)>=1) { $ShipperReturned = DB_fetch_row($TestShipperExists); $BestShipper = $ShipperReturned[0]; } else { @@ -258,7 +261,7 @@ echo '<a href="' . $RootPath . 'Shippers.php">' . _('Enter') . '/' . _('Amend Freight Companies') . '</a>'; } } - if (isset($_SESSION['Items'.$identifier]->ShipVia) AND $_SESSION['Items'.$identifier]->ShipVia!=''){ + if(isset($_SESSION['Items'.$identifier]->ShipVia) AND $_SESSION['Items'.$identifier]->ShipVia!='') { $_POST['ShipVia'] = $_SESSION['Items'.$identifier]->ShipVia; } else { $_POST['ShipVia']=$BestShipper; @@ -267,7 +270,7 @@ } } -if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors){ +if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors) { echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $RootPath . '/RecurringOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">' . _('click here') . '</a> '. _('to continue'),'info'); @@ -276,7 +279,7 @@ } -if (isset($_POST['BackToLineDetails']) and $_POST['BackToLineDetails']==_('Modify Order Lines')){ +if(isset($_POST['BackToLineDetails']) and $_POST['BackToLineDetails']==_('Modify Order Lines')) { echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/SelectOrderItems.php?identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $RootPath . '/SelectOrderItems.php?identifier='.$identifier . '">' . _('click here') . '</a> '. _('to continue'),'info'); @@ -285,12 +288,12 @@ } -If (isset($_POST['ProcessOrder'])) { +if(isset($_POST['ProcessOrder'])) { /*Default OK_to_PROCESS to 1 change to 0 later if hit a snag */ - if ($InputErrors ==0) { + if($InputErrors ==0) { $OK_to_PROCESS = 1; } - If ($_POST['FreightCost'] != $OldFreightCost AND $_SESSION['DoFreightCalc']==True){ + if($_POST['FreightCost'] != $OldFreightCost AND $_SESSION['DoFreightCalc']==True) { $OK_to_PROCESS = 0; prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br /> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); } else { @@ -309,7 +312,7 @@ $myrow = DB_fetch_array($TermsResult); - if ($myrow['daysbeforedue']==0 AND $myrow['dayinfollowingmonth']==0){ + if($myrow['daysbeforedue']==0 AND $myrow['dayinfollowingmonth']==0) { /* THIS IS A CASH SALE NEED TO GO OFF TO 3RD PARTY SITE SENDING MERCHANT ACCOUNT DETAILS AND CHECK FOR APPROVAL FROM 3RD PARTY SITE BEFORE CONTINUING TO PROCESS THE ORDER @@ -325,7 +328,7 @@ } #end if else freight charge not altered } #end if process order -if (isset($OK_to_PROCESS) AND $OK_to_PROCESS == 1 AND $_SESSION['ExistingOrder'.$identifier]==0){ +if(isset($OK_to_PROCESS) AND $OK_to_PROCESS == 1 AND $_SESSION['ExistingOrder'.$identifier]==0) { /* finally write the order header to the database and then the order line details */ @@ -427,9 +430,9 @@ * and AutoCreateWOs is on * and it is a real order (not just a quotation)*/ - if ($StockItem->MBflag=='M' + if($StockItem->MBflag=='M' AND $_SESSION['AutoCreateWOs']==1 - AND $_SESSION['Items'.$identifier]->Quotation!=1){ //oh yeah its all on! + AND $_SESSION['Items'.$identifier]->Quotation!=1) { //oh yeah its all on! echo '<br />'; @@ -485,9 +488,9 @@ //Now we have the data - do we need to make any more? $ShortfallQuantity = $QOH-$QuantityDemand-$QuantityAssemblyDemand+$QuantityPurchOrders+$QuantityWorkOrders; - if ($ShortfallQuantity < 0) { //then we need to make a work order + if($ShortfallQuantity < 0) { //then we need to make a work order //How many should the work order be for?? - if ($ShortfallQuantity + $StockItem->EOQ < 0){ + if($ShortfallQuantity + $StockItem->EOQ < 0) { $WOQuantity = -$ShortfallQuantity; } else { $WOQuantity = $StockItem->EOQ; @@ -513,7 +516,7 @@ WHERE bom.parent='" . $StockItem->StockID . "' AND bom.loccode='" . $_SESSION['DefaultFactoryLocation'] . "'"); $CostRow = DB_fetch_row($CostResult); - if (is_null($CostRow[0]) OR $CostRow[0]==0){ + if(is_null($CostRow[0]) OR $CostRow[0]==0) { $Cost =0; prnMsg(_('In automatically creating a work order for') . ' ' . $StockItem->StockID . ' ' . _('an item on this sales order, the cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); } else { @@ -539,16 +542,16 @@ ":\n" . $StockItem->StockID . ' - ' . $StockItem->ItemDescription . ' x ' . $WOQuantity . ' ' . $StockItem->Units . "\n" . _('These are for') . ' ' . $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('there order ref') . ': ' . $_SESSION['Items'.$identifier]->CustRef . ' ' ._('our order number') . ': ' . $OrderNo; - if ($StockItem->Serialised AND $StockItem->NextSerialNo>0){ + if($StockItem->Serialised AND $StockItem->NextSerialNo>0) { //then we must create the serial numbers for the new WO also $FactoryManagerEmail .= "\n" . _('The following serial numbers have been reserved for this work order') . ':'; - for ($i=0;$i<$WOQuantity;$i++){ + for ($i=0;$i<$WOQuantity;$i++) { $result = DB_query("SELECT serialno FROM stockserialitems WHERE serialno='" . ($StockItem->NextSerialNo + $i) . "' AND stockid='" . $StockItem->StockID ."'"); - if (DB_num_rows($result)!=0){ + if(DB_num_rows($result)!=0) { $WOQuantity++; prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error'); } else { @@ -570,10 +573,10 @@ $EmailSubject = _('New Work Order Number') . ' ' . $WONo . ' ' . _('for') . ' ' . $StockItem->StockID . ' x ' . $WOQuantity; //Send email to the Factory Manager - if($_SESSION['SmtpSetting']==0){ + if($_SESSION['SmtpSetting']==0) { mail($_SESSION['FactoryManagerEmail'],$EmailSubject,$FactoryManagerEmail); - }else{ + }else { include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); $mail->setSubject($EmailSubject); @@ -586,16 +589,16 @@ $result = DB_Txn_Commit(); echo '<br />'; - if ($_SESSION['Items'.$identifier]->Quotation==1){ + if($_SESSION['Items'.$identifier]->Quotation==1) { prnMsg(_('Quotation Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); } else { prnMsg(_('Order Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); } - if (count($_SESSION['AllowedPageSecurityTokens'])>1){ + if(count($_SESSION['AllowedPageSecurityTokens'])>1) { /* Only allow print of packing slip for internal staff - customer logon's cannot go here */ - if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ + if($_POST['Quotation']==0) { /*then its not a quotation its a real order */ echo '<br /><table class="selection"> <tr> @@ -645,7 +648,7 @@ include('includes/footer.inc'); exit; -} elseif (isset($OK_to_PROCESS) AND ($OK_to_PROCESS == 1 AND $_SESSION['ExistingOrder'.$identifier]!=0)){ +} elseif(isset($OK_to_PROCESS) AND ($OK_to_PROCESS == 1 AND $_SESSION['ExistingOrder'.$identifier]!=0)) { /* update the order header then update the old order line details and insert the new lines */ @@ -656,12 +659,12 @@ $Result = DB_Txn_Begin(); /*see if this is a contract quotation being changed to an order? */ - if ($_SESSION['Items'.$identifier]->Quotation==0) { //now its being changed? to an order + if($_SESSION['Items'.$identifier]->Quotation==0) { //now its being changed? to an order $ContractResult = DB_query("SELECT contractref, requireddate FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] ."' AND status=1"); - if (DB_num_rows($ContractResult)==1){ //then it is a contract quotation being changed to an order + if(DB_num_rows($ContractResult)==1) { //then it is a contract quotation being changed to an order $ContractRow = DB_fetch_array($ContractResult); $WONo = GetNextTransNo(40,$db); $ErrMsg = _('Could not update the contract status'); @@ -709,7 +712,7 @@ ON stockmaster.stockid=contractbom.stockid WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'"); $CostRow = DB_fetch_row($CostResult); - if (is_null($CostRow[0]) OR $CostRow[0]==0){ + if(is_null($CostRow[0]) OR $CostRow[0]==0) { $Cost =0; prnMsg(_('In automatically creating a work order for') . ' ' . $ContractRow['contractref'] . ' ' . _('an item on this sales order, the cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); } else { @@ -776,7 +779,7 @@ /* Check to see if the quantity reduced to the same quantity as already invoiced - so should set the line to completed */ - if ($StockItem->Quantity == $StockItem->QtyInv){ + if($StockItem->Quantity == $StockItem->QtyInv) { $Completed = 1; } else { /* order line is not complete */ $Completed = 0; @@ -802,7 +805,7 @@ unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); - if($Quotation){ //handle Quotations and Orders print after modification + if($Quotation) { //handle Quotations and Orders print after modification prnMsg(_('Quotation Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); /*link to print the quotation */ @@ -818,7 +821,7 @@ <td>' . ' ' . '<a href="' . $RootPath . '/PDFQuotationPortrait.php?identifier='.$identifier . '&QuotationNo=' . $_SESSION['ExistingOrder'.$identifier] . '" target="_blank">' . _('Print Quotation (Portrait)') . '</a></td> </tr> </table>'; - }else{ + }else { prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); @@ -847,7 +850,7 @@ } -if (isset($_SESSION['Items'.$identifier]->SpecialInstructions) and mb_strlen($_SESSION['Items'.$identifier]->SpecialInstructions)>0) { +if(isset($_SESSION['Items'.$identifier]->SpecialInstructions) and mb_strlen($_SESSION['Items'.$identifier]->SpecialInstructions)>0) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'info'); } echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Delivery') . '" alt="" />' . ' ' . _('Delivery Details') . '</p>'; @@ -862,11 +865,11 @@ /*Display the order with or without discount depending on access level*/ -if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ +if(in_array(2,$_SESSION['AllowedPageSecurityTokens'])) { echo '<table>'; - if ($_SESSION['Items'.$identifier]->Quotation==1){ + if($_SESSION['Items'.$identifier]->Quotation==1) { echo '<tr><th colspan="7">' . _('Quotation Summary') . '</th></tr>'; } else { echo '<tr><th colspan="7">' . _('Order Summary') . '</th></tr>'; @@ -895,7 +898,7 @@ $DisplayDiscount = locale_number_format(($StockItem->DiscountPercent * 100),2); - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -961,7 +964,7 @@ $DisplayPrice = locale_number_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); - if ($k==1){ + if($k==1) { echo '<tr class="OddTableRows">'; $k=0; } else { @@ -1007,7 +1010,7 @@ <td>' . _('Deliver from the warehouse at') .':</td> <td><select name="Location">'; -if ($_SESSION['Items'.$identifier]->Location=='' OR !isset($_SESSION['Items'.$identifier]->Location)) { +if($_SESSION['Items'.$identifier]->Location=='' OR !isset($_SESSION['Items'.$identifier]->Location)) { $_SESSION['Items'.$identifier]->Location = $DefaultStockLocation; } @@ -1018,8 +1021,8 @@ $ErrMsg, $DbgMsg); -while ($myrow=DB_fetch_array($StkLocsResult)){ - if ($_SESSION['Items'.$identifier]->Location==$myrow['loccode']){ +while ($myrow=DB_fetch_array($StkLocsResult)) { + if($_SESSION['Items'.$identifier]->Location==$myrow['loccode']) { echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option value="'.$myrow['loccode'].'">' . $myrow['locationname'] . '</option>'; @@ -1029,13 +1032,13 @@ echo '</select></td></tr>'; // Set the default date to earliest possible date if not set already -if (!isset($_SESSION['Items'.$identifier]->DeliveryDate)) { +if(!isset($_SESSION['Items'.$identifier]->DeliveryDate)) { $_SESSION['Items'.$identifier]->DeliveryDate = Date($_SESSION['DefaultDateFormat'],$EarliestDispatch); } -if (!isset($_SESSION['Items'.$identifier]->QuoteDate)) { +if(!isset($_SESSION['Items'.$identifier]->QuoteDate)) { $_SESSION['Items'.$identifier]->QuoteDate = Date($_SESSION['DefaultDateFormat'],$EarliestDispatch); } -if (!isset($_SESSION['Items'.$identifier]->ConfirmedDate)) { +if(!isset($_SESSION['Items'.$identifier]->ConfirmedDate)) { $_SESSION['Items'.$identifier]->ConfirmedDate = Date($_SESSION['DefaultDateFormat'],$EarliestDispatch); } @@ -1077,10 +1080,10 @@ echo '<tr> <td>' . _('Country') . ':</td> <td><select name="BrAdd6">'; -foreach ($CountriesArray as $CountryEntry => $CountryName){ - if (isset($_POST['BrAdd6']) AND (strtoupper($_POST['BrAdd6']) == strtoupper($CountryName))){ +foreach ($CountriesArray as $CountryEntry => $CountryName) { + if(isset($_POST['BrAdd6']) AND (strtoupper($_POST['BrAdd6']) == strtoupper($CountryName))) { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif (!isset($_POST['BrAdd6']) AND $CountryName == $_SESSION['Items'.$identifier]->DelAdd6) { + }elseif(!isset($_POST['BrAdd6']) AND $CountryName == $_SESSION['Items'.$identifier]->DelAdd6) { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; @@ -1106,7 +1109,7 @@ <td><textarea name="Comments" cols="31" rows="5">' . $_SESSION['Items'.$identifier]->Comments . '</textarea></td> </tr>'; - if ($CustomerLogin == 1){ + if($CustomerLogin == 1) { echo '<input type="hidden" name="SalesPerson" value="' . $_SESSION['Items'.$identifier]->SalesPerson . '" /> <input type="hidden" name="DeliverBlind" value="1" /> <input type="hidden" name="FreightCost" value="0" /> @@ -1117,12 +1120,12 @@ <td>' . _('Sales person'). ':</td> <td><select name="SalesPerson">'; $SalesPeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman WHERE current=1"); - if (!isset($_POST['SalesPerson']) AND $_SESSION['SalesmanLogin']!=NULL ){ + if(!isset($_POST['SalesPerson']) AND $_SESSION['SalesmanLogin']!=NULL ) { $_SESSION['Items'.$identifier]->SalesPerson = $_SESSION['SalesmanLogin']; } - while ($SalesPersonRow = DB_fetch_array($SalesPeopleResult)){ - if ($SalesPersonRow['salesmancode']==$_SESSION['Items'.$identifier]->SalesPerson){ + while ($SalesPersonRow = DB_fetch_array($SalesPeopleResult)) { + if($SalesPersonRow['salesmancode']==$_SESSION['Items'.$identifier]->SalesPerson) { echo '<option selected="selected" value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; } else { echo '<option value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; @@ -1138,7 +1141,7 @@ echo '<tr><td>' . _('Packlist Type') . ':</td> <td><select name="DeliverBlind">'; - if ($_SESSION['Items'.$identifier]->DeliverBlind ==2){ + if($_SESSION['Items'.$identifier]->DeliverBlind ==2) { echo '<option value="1">' . _('Show Company Details/Logo') . '</option>'; echo '<option selected="selected" value="2">' . _('Hide Company Details/Logo') . '</option>'; } else { @@ -1147,7 +1150,7 @@ } echo '</select></td></tr>'; - if (isset($_SESSION['PrintedPackingSlip']) AND $_SESSION['PrintedPackingSlip']==1){ + if(isset($_SESSION['PrintedPackingSlip']) AND $_SESSION['PrintedPackingSlip']==1) { echo '<tr> <td>' . _('Reprint packing slip') .':</td> @@ -1163,12 +1166,12 @@ <td>' . _('Charge Freight Cost ex tax') .':</td> <td><input type="text" class="number" size="10" maxlength="12" name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '" /></td>'; - if ($_SESSION['DoFreightCalc']==true){ + if($_SESSION['DoFreightCalc']==true) { echo '<td><input type="submit" name="Update" value="' . _('Recalc Freight Cost') . '" /></td>'; } echo '</tr>'; - if ((!isset($_POST['ShipVia']) OR $_POST['ShipVia']=='') AND isset($_SESSION['Items'.$identifier]->ShipVia)){ + if((!isset($_POST['ShipVia']) OR $_POST['ShipVia']=='') AND isset($_SESSION['Items'.$identifier]->ShipVia)) { $_POST['ShipVia'] = $_SESSION['Items'.$identifier]->ShipVia; } @@ -1181,8 +1184,8 @@ $sql = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($sql,$ErrMsg,$DbgMsg); - while ($myrow=DB_fetch_array($ShipperResults)){ - if ($myrow['shipper_id']==$_POST['ShipVia']){ + while ($myrow=DB_fetch_array($ShipperResults)) { + if($myrow['shipper_id']==$_POST['ShipVia']) { echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; }else { echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; @@ -1194,7 +1197,7 @@ echo '<tr><td>' . _('Quotation Only') .':</td> <td><select name="Quotation">'; - if ($_SESSION['Items'.$identifier]->Quotation==1){ + if($_SESSION['Items'.$identifier]->Quotation==1) { echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; echo '<option value="0">' . _('No') . '</option>'; } else { @@ -1208,7 +1211,7 @@ echo '<br /><div class="centre"><input type="submit" name="BackToLineDetails" value="' . _('Modify Order Lines') . '" /><br />'; -if ($_SESSION['ExistingOrder'.$identifier]==0){ +if($_SESSION['ExistingOrder'.$identifier]==0) { echo '<br /><br /><input type="submit" name="ProcessOrder" value="' . _('Place Order') . '" />'; echo '<br /><br /><input type="submit" name="MakeRecurringOrder" value="' . _('Create Recurring Order') . '" />'; } else { @@ -1219,4 +1222,4 @@ </div> </form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-05-07 20:04:23 UTC (rev 7291) +++ trunk/doc/Change.log 2015-05-08 14:42:02 UTC (rev 7292) @@ -1,5 +1,6 @@ webERP Change Log +08/05/15 RChacon: In DeliveryDetails.php, add $ViewTopic and $BookMark to ManualSalesOrders.html. 07/05/15 RChacon: In CustomerInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. 07/05/15 RChacon: In SupplierInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. 04/05/15 Exson: Make PO number searching also in compliance with location authority rules and make default search result as all if users have full location authority. Modified: trunk/doc/Manual/ManualSalesOrders.html =================================================================== --- trunk/doc/Manual/ManualSalesOrders.html 2015-05-07 20:04:23 UTC (rev 7291) +++ trunk/doc/Manual/ManualSalesOrders.html 2015-05-08 14:42:02 UTC (rev 7292) @@ -72,7 +72,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Delivery Details</h3> +<h3><a id="DeliveryDetails">Delivery Details</a></h3> <p>By default the delivery details are obtained from the physical address of the branch. However, any of the information in this screen can be over-ridden. This information prints on the dispatch/packing slip and on the invoice.</p> @@ -84,7 +84,7 @@ <p>If the automatic freight calculations are being used - see the parameters in config.php, the freight cost will be calculated based on the sum of the whole order cubic metres and weight. The best shipping company will also be returned. The user can choose to charge the freight calculated or just use the cheapest freight company. The freight charge calculated can be over-ridden if required.</p> -<p>Once all details are entered correctly the Place Order button should be clicked. It is important to note that abandoning the order before this button is clicked there have been no updates to the database and nothing is saved. Clicking into some other screen loses the order as entered. Whilst it is perfectly acceptable to have several browser screens open looking at different inquiries at the same time. It is not possible to have two windows entering two separate sales orders at the same time, entries in the one window will over-write the other. +<p>Once all details are entered correctly the Place Order button should be clicked. It is important to note that abandoning the order before this button is clicked there have been no updates to the database and nothing is saved. Clicking into some other screen loses the order as entered. Whilst it is perfectly acceptable to have several browser screens open looking at different inquiries at the same time. It is not possible to have two windows entering two separate sales orders at the same time, entries in the one window will over-write the other. <!-- Help End: SelectOrderItems --></p> |
From: <rc...@us...> - 2015-05-10 01:01:54
|
Revision: 7295 http://sourceforge.net/p/web-erp/reponame/7295 Author: rchacon Date: 2015-05-10 01:01:51 +0000 (Sun, 10 May 2015) Log Message: ----------- Minor changes: add info. Modified Paths: -------------- trunk/CustomerBranches.php trunk/doc/Manual/ManualAccountsReceivable.html Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2015-05-09 11:12:08 UTC (rev 7294) +++ trunk/CustomerBranches.php 2015-05-10 01:01:51 UTC (rev 7295) @@ -1,37 +1,36 @@ <?php - /* $Id$*/ +/* Defines the details of customer branches such as delivery address and contact details - also sales area, representative etc.*/ include('includes/session.inc'); -$Title = _('Customer Branches'); -/* webERP manual links before header.inc */ -$ViewTopic= 'AccountsReceivable'; -$BookMark = 'NewCustomerBranch'; +$Title = _('Customer Branches');// Screen identification. +$ViewTopic= 'AccountsReceivable';// Filename's id in ManualContents.php's TOC. +$BookMark = 'NewCustomerBranch';// Anchor's id in the manual's html document. include('includes/header.inc'); + include('includes/CountriesArray.php'); -if (isset($_GET['DebtorNo'])) { +if(isset($_GET['DebtorNo'])) { $DebtorNo = mb_strtoupper($_GET['DebtorNo']); -} else if (isset($_POST['DebtorNo'])){ +} else if(isset($_POST['DebtorNo'])) { $DebtorNo = mb_strtoupper($_POST['DebtorNo']); } -if (!isset($DebtorNo)) { +if(!isset($DebtorNo)) { prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. - <br />' . _('When the pages is called from within the system this will always be the case').' <br />' . + <br />' . _('When the pages is called from within the system this will always be the case').' <br />' . _('Select a customer first then select the link to add/edit/delete branches'),'warn'); include('includes/footer.inc'); exit; } - -if (isset($_GET['SelectedBranch'])){ +if(isset($_GET['SelectedBranch'])) { $SelectedBranch = mb_strtoupper($_GET['SelectedBranch']); -} else if (isset($_POST['SelectedBranch'])){ +} else if(isset($_POST['SelectedBranch'])) { $SelectedBranch = mb_strtoupper($_POST['SelectedBranch']); } -if (isset($Errors)) { +if(isset($Errors)) { unset($Errors); } @@ -39,7 +38,7 @@ $Errors = array(); $InputError = 0; -if (isset($_POST['submit'])) { +if(isset($_POST['submit'])) { $i=1; @@ -50,53 +49,53 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $_POST['Salesman'] = $_SESSION['SalesmanLogin']; } - if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { + if(ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; - prnMsg(_('The Branch code cannot contain any of the following characters')." - & \' < >",'error'); + prnMsg(_('The Branch code cannot contain any of the following characters')." - & \' < >",'error'); $Errors[$i] = 'BranchCode'; $i++; } - if (mb_strlen($_POST['BranchCode'])==0) { + if(mb_strlen($_POST['BranchCode'])==0) { $InputError = 1; prnMsg(_('The Branch code must be at least one character long'),'error'); $Errors[$i] = 'BranchCode'; $i++; } - if (!is_numeric($_POST['FwdDate'])) { + 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) { + 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']))) { + 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) { + 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 (!isset($_POST['EstDeliveryDays'])) { + if(!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=1; } - if (!isset($Latitude)) { + if(!isset($Latitude)) { $Latitude=0.0; $Longitude=0.0; } - if ($_SESSION['geocode_integration']==1 ){ + if($_SESSION['geocode_integration']==1 ) { // Get the lat/long from our geocoding host $SQL = "SELECT * FROM geocode_param WHERE 1"; $ErrMsg = _('An error occurred in retrieving the information'); @@ -106,9 +105,9 @@ $map_host = $row['map_host']; define('MAPS_HOST', $map_host); define('KEY', $api_key); - if ($map_host=="") { + if($map_host=="") { // check that some sane values are setup already in geocode tables, if not skip the geocoding but add the record anyway. - echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; + echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { $address = $_POST['BrAddress1'] . ', ' . $_POST['BrAddress2'] . ', ' . $_POST['BrAddress3'] . ', ' . $_POST['BrAddress4']; $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml&key=' . KEY; @@ -121,7 +120,7 @@ $Longitude = $CoordinatesSplit[0]; $Status = $xml->Response->Status->code; - if (strcmp($Status, '200') == 0) { + if(strcmp($Status, '200') == 0) { // Successful geocode $Geocode_Pending = false; $Coordinates = $xml->Response->Placemark->Point->Coordinates; @@ -137,7 +136,7 @@ } } } - if (isset($SelectedBranch) AND $InputError !=1) { + if(isset($SelectedBranch) AND $InputError !=1) { /*SelectedBranch could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -172,13 +171,13 @@ deliverblind='" . $_POST['DeliverBlind'] . "' WHERE branchcode = '".$SelectedBranch."' AND debtorno='".$DebtorNo."'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $msg = $_POST['BrName'] . ' '._('branch has been updated.'); - } else if ($InputError !=1) { + } else if($InputError !=1) { /*Selected branch is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Customer Branches form */ @@ -251,11 +250,11 @@ //run the SQL from either of the above possibilites $ErrMsg = _('The branch record could not be inserted or updated because'); - if ($InputError==0) { + if($InputError==0) { $result = DB_query($SQL, $ErrMsg); } - if (DB_error_no() ==0 AND $InputError==0) { + if(DB_error_no() ==0 AND $InputError==0) { prnMsg($msg,'success'); unset($_POST['BranchCode']); unset($_POST['BrName']); @@ -287,7 +286,7 @@ unset($_POST['DeliverBlind']); unset($SelectedBranch); } -} else if (isset($_GET['delete'])) { +} else if(isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' @@ -296,7 +295,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because customer transactions have been created to this branch') . '<br />' . _('There are').' ' . $myrow[0] . ' '._('transactions with this Branch Code'),'error'); @@ -306,7 +305,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales analysis records exist for it'),'error'); echo '<br />' . _('There are').' ' . $myrow[0] . ' '._('sales analysis records with this Branch Code/customer'); @@ -316,7 +315,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because sales orders exist for it') . '. ' . _('Purge old sales orders first'),'warn'); echo '<br />' . _('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); } else { @@ -326,7 +325,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because users exist that refer to it') . '. ' . _('Purge old users first'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' '._('users referring to this Branch/customer'); } else { @@ -335,8 +334,8 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - - if ($myrow[0]>0) { + + if($myrow[0]>0) { prnMsg(_('Cannot delete this branch because contract have been created that refer to it') . '. ' . _('Purge old contracts first'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' '._('contracts referring to this branch/customer'); } else { @@ -345,17 +344,17 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - - if ($myrow[0]==1) { + + if($myrow[0]==1) { prnMsg(_('Cannot delete this branch because it is the only branch defined for this customer.'),'warn'); } else { $SQL="DELETE FROM custbranch WHERE branchcode='" . $SelectedBranch . "' AND debtorno='" . $DebtorNo . "'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $ErrMsg = _('The branch record could not be deleted') . ' - ' . _('the SQL server returned the following message'); $result = DB_query($SQL,$ErrMsg); - if (DB_error_no()==0){ + if(DB_error_no()==0) { prnMsg(_('Branch Deleted'),'success'); } } @@ -366,7 +365,7 @@ } //end ifs to test if the branch can be deleted } -if (!isset($SelectedBranch)){ +if(!isset($SelectedBranch)) { /* It could still be the second time the page has been run and a record has been selected for modification - SelectedBranch will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of branches will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ @@ -390,8 +389,8 @@ INNER JOIN taxgroups ON custbranch.taxgroupid=taxgroups.taxgroupid WHERE custbranch.debtorno = '".$DebtorNo."'"; - - if ($_SESSION['SalesmanLogin'] != '') { + + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -399,9 +398,11 @@ $myrow = DB_fetch_row($result); $TotalEnable = 0; $TotalDisable = 0; - if ($myrow) { - echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> - ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + if($myrow) { + echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/customer.png" title="',// Icon image. + _('Customer'), '" /> ',// Icon title. + _('Branches defined for'), ' ', $DebtorNo, ' - ', $myrow[0], '</p>';// Page title. echo '<table class="selection"> <tr> <th class="ascending">' . _('Code') . '</th> @@ -418,7 +419,7 @@ $k=0; do { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -458,14 +459,14 @@ urlencode($myrow[1]), _('Delete Branch')); - if ($myrow[10]){ + if($myrow[10]) { $TotalDisable++; }else { $TotalEnable++; } - } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP + echo '</table> <br /> <table class="selection"> @@ -489,7 +490,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text">' . _('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') . '</div>'; + echo '<div class="page_help_text">' . _('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') . '</div>'; $_POST['BranchCode'] = mb_substr($DebtorNo,0,10); $_POST['BrName'] = $myrow[0]; $_POST['BrAddress1'] = $myrow[1]; @@ -502,12 +503,12 @@ } } -if (!isset($_GET['delete'])) { +if(!isset($_GET['delete'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($SelectedBranch)) { + if(isset($SelectedBranch)) { //editing an existing branch $SQL = "SELECT branchcode, @@ -541,30 +542,30 @@ FROM custbranch WHERE branchcode='".$SelectedBranch."' AND debtorno='".$DebtorNo."'"; - - if ($_SESSION['SalesmanLogin'] != '') { + + if($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $result = DB_query($SQL); $myrow = DB_fetch_array($result); - if ($InputError==0) { + if($InputError==0) { $_POST['BranchCode'] = $myrow['branchcode']; - $_POST['BrName'] = $myrow['brname']; - $_POST['BrAddress1'] = $myrow['braddress1']; - $_POST['BrAddress2'] = $myrow['braddress2']; - $_POST['BrAddress3'] = $myrow['braddress3']; - $_POST['BrAddress4'] = $myrow['braddress4']; - $_POST['BrAddress5'] = $myrow['braddress5']; - $_POST['BrAddress6'] = $myrow['braddress6']; - $_POST['SpecialInstructions'] = $myrow['specialinstructions']; - $_POST['BrPostAddr1'] = $myrow['brpostaddr1']; - $_POST['BrPostAddr2'] = $myrow['brpostaddr2']; - $_POST['BrPostAddr3'] = $myrow['brpostaddr3']; - $_POST['BrPostAddr4'] = $myrow['brpostaddr4']; - $_POST['BrPostAddr5'] = $myrow['brpostaddr5']; - $_POST['EstDeliveryDays'] = locale_number_format($myrow['estdeliverydays'],0); + $_POST['BrName'] = $myrow['brname']; + $_POST['BrAddress1'] = $myrow['braddress1']; + $_POST['BrAddress2'] = $myrow['braddress2']; + $_POST['BrAddress3'] = $myrow['braddress3']; + $_POST['BrAddress4'] = $myrow['braddress4']; + $_POST['BrAddress5'] = $myrow['braddress5']; + $_POST['BrAddress6'] = $myrow['braddress6']; + $_POST['SpecialInstructions'] = $myrow['specialinstructions']; + $_POST['BrPostAddr1'] = $myrow['brpostaddr1']; + $_POST['BrPostAddr2'] = $myrow['brpostaddr2']; + $_POST['BrPostAddr3'] = $myrow['brpostaddr3']; + $_POST['BrPostAddr4'] = $myrow['brpostaddr4']; + $_POST['BrPostAddr5'] = $myrow['brpostaddr5']; + $_POST['EstDeliveryDays'] = locale_number_format($myrow['estdeliverydays'],0); $_POST['FwdDate'] =$myrow['fwddate']; $_POST['ContactName'] = $myrow['contactname']; $_POST['Salesman'] =$myrow['salesman']; @@ -585,7 +586,7 @@ echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; - if (isset($SelectedBranch)) { + if(isset($SelectedBranch)) { echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?DebtorNo=' . $DebtorNo. '">' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } echo '<br /> @@ -602,10 +603,10 @@ } else { //end of if $SelectedBranch only do the else when a new record is being entered - /* SETUP ANY $_GET VALUES THAT ARE PASSED. This really is just used coming from the Customers.php when a new customer is created. + /* SETUP ANY $_GET VALUES THAT ARE PASSED. This really is just used coming from the Customers.php when a new customer is created. Maybe should only do this when that page is the referrer? */ - if (isset($_GET['BranchCode'])){ + if(isset($_GET['BranchCode'])) { $SQL="SELECT name, address1, address2, @@ -619,7 +620,7 @@ $result = DB_query($SQL); $myrow = DB_fetch_array($result); $_POST['BranchCode'] = $_GET['BranchCode']; - $_POST['BrName'] = $myrow['name']; + $_POST['BrName'] = $myrow['name']; $_POST['BrAddress1'] = $myrow['addrsss1']; $_POST['BrAddress2'] = $myrow['addrsss2']; $_POST['BrAddress3'] = $myrow['addrsss3']; @@ -627,14 +628,14 @@ $_POST['BrAddress5'] = $myrow['addrsss5']; $_POST['BrAddress6'] = $myrow['addrsss6']; } - if (!isset($_POST['BranchCode'])) { + if(!isset($_POST['BranchCode'])) { $_POST['BranchCode']=''; } echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Add a Branch') . '</p>'; echo '<table class="selection"> <tr> <td>' . _('Branch Code'). ':</td> - <td><input data-type="no-illegal-chars" ' . (in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" required="required" title ="'._('Up to 10 characters for the branch code. The following characters are prohibited:') . ' \' " + . & \\ > <" placeholder="'._('alpha-numeric').'" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> + <td><input data-type="no-illegal-chars" ' . (in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" required="required" title ="'._('Up to 10 characters for the branch code. The following characters are prohibited:') . ' \' " + . & \\ > <" placeholder="'._('alpha-numeric').'" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> </tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -646,61 +647,61 @@ echo _('Branch Name').':</td>'; - if (!isset($_POST['BrName'])) {$_POST['BrName']='';} + if(!isset($_POST['BrName'])) {$_POST['BrName']='';} echo '<td><input tabindex="2" type="text" autofocus="autofocus" required="required" name="BrName" title="' . _('The branch name should identify the particular delivery address of the customer and must be entered') . '" minlength="5" size="41" maxlength="40" value="'. $_POST['BrName'].'" /></td> </tr>'; echo '<tr> <td>' . _('Branch Contact').':</td>'; - if (!isset($_POST['ContactName'])) {$_POST['ContactName']='';} + if(!isset($_POST['ContactName'])) {$_POST['ContactName']='';} echo '<td><input tabindex="3" type="text" name="ContactName" required="required" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td> </tr>'; echo '<tr><td>' . _('Street Address 1 (Street)').':</td>'; - if (!isset($_POST['BrAddress1'])) { + if(!isset($_POST['BrAddress1'])) { $_POST['BrAddress1']=''; } echo '<td><input tabindex="4" type="text" name="BrAddress1" size="41" maxlength="40" value="'. $_POST['BrAddress1'].'" /></td> </tr> <tr> <td>' . _('Street Address 2 (Street)').':</td>'; - if (!isset($_POST['BrAddress2'])) { + if(!isset($_POST['BrAddress2'])) { $_POST['BrAddress2']=''; } echo '<td><input tabindex="5" type="text" name="BrAddress2" size="41" maxlength="40" value="'. $_POST['BrAddress2'].'" /></td> </tr> <tr> <td>' . _('Street Address 3 (Suburb/City)').':</td>'; - if (!isset($_POST['BrAddress3'])) { + if(!isset($_POST['BrAddress3'])) { $_POST['BrAddress3']=''; } echo '<td><input tabindex="6" type="text" name="BrAddress3" size="41" maxlength="40" value="'. $_POST['BrAddress3'].'" /></td> </tr> <tr> <td>' . _('Street Address 4 (State/Province)').':</td>'; - if (!isset($_POST['BrAddress4'])) { + if(!isset($_POST['BrAddress4'])) { $_POST['BrAddress4']=''; } echo '<td><input tabindex="7" type="text" name="BrAddress4" size="51" maxlength="50" value="'. $_POST['BrAddress4'].'" /></td> </tr> <tr> <td>' . _('Street Address 5 (Postal Code)').':</td>'; - if (!isset($_POST['BrAddress5'])) { + if(!isset($_POST['BrAddress5'])) { $_POST['BrAddress5']=''; } echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td> </tr> <tr> <td>' . _('Country').':</td>'; - if (!isset($_POST['BrAddress6'])) { + if(!isset($_POST['BrAddress6'])) { $_POST['BrAddress6']=''; } echo '<td><select name="BrAddress6">'; - foreach ($CountriesArray as $CountryEntry => $CountryName){ - if (isset($_POST['BrAddress6']) AND ($_POST['BrAddress6'] == $CountryName)){ - echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif (!isset($_POST['BrAddress6']) AND $CountryName == "") { - echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; + foreach ($CountriesArray as $CountryEntry => $CountryName) { + if(isset($_POST['BrAddress6']) AND ($_POST['BrAddress6'] == $CountryName)) { + echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; + }elseif(!isset($_POST['BrAddress6']) AND $CountryName == "") { + echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { - echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; + echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; } } echo '</select></td> @@ -708,27 +709,27 @@ echo '<tr> <td>' . _('Special Instructions').':</td>'; - if (!isset($_POST['SpecialInstructions'])) { + if(!isset($_POST['SpecialInstructions'])) { $_POST['SpecialInstructions']=''; } echo '<td><input tabindex="10" type="text" name="SpecialInstructions" size="56" value="'. $_POST['SpecialInstructions'].'" /></td> </tr> <tr> <td>' . _('Default days to deliver').':</td>'; - if (!isset($_POST['EstDeliveryDays'])) { + if(!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=0; } - echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class="integer" name="EstDeliveryDays" size="4" maxlength="2" value="'. $_POST['EstDeliveryDays'].'" /></td> + echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class="integer" name="EstDeliveryDays" size="4" maxlength="2" value="'. $_POST['EstDeliveryDays'].'" /></td> </tr> <tr> <td>' . _('Forward Date After (day in month)').':</td>'; - if (!isset($_POST['FwdDate'])) { + if(!isset($_POST['FwdDate'])) { $_POST['FwdDate']=0; } - echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" class="integer" name="FwdDate" size="4" maxlength="2" value="'. $_POST['FwdDate'].'" /></td> + echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" class="integer" name="FwdDate" size="4" maxlength="2" value="'. $_POST['FwdDate'].'" /></td> </tr>'; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { echo '<tr> <td>' . _('Salesperson').':</td><td>'; echo $_SESSION['UsersRealName']; @@ -744,7 +745,7 @@ $result = DB_query($SQL); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); echo '<p align="center"><a href="' . $RootPath . '/SalesPeople.php">' . _('Define Sales People') . '</a>'; @@ -757,7 +758,7 @@ <td><select tabindex="13" name="Salesman">'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['Salesman']) AND $myrow['salesmancode']==$_POST['Salesman']) { + if(isset($_POST['Salesman']) AND $myrow['salesmancode']==$_POST['Salesman']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -773,7 +774,7 @@ } $SQL = "SELECT areacode, areadescription FROM areas"; $result = DB_query($SQL); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no areas defined as yet') . ' - ' . _('customer branches must be allocated to an area') . '. ' . _('Please use the link below to define at least one sales area'),'error'); echo '<br /><a href="' . $RootPath. '/Areas.php">' . _('Define Sales Areas') . '</a>'; @@ -785,7 +786,7 @@ <td>' . _('Sales Area').':</td> <td><select tabindex="14" name="Area">'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['Area']) AND $myrow['areacode']==$_POST['Area']) { + if(isset($_POST['Area']) AND $myrow['areacode']==$_POST['Area']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -799,10 +800,10 @@ </tr>'; DB_data_seek($result,0); - $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; + $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($SQL); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no stock locations defined as yet') . ' - ' . _('customer branches must refer to a default location where stock is normally drawn from') . '. ' . _('Please use the link below to define at least one stock location'),'error'); echo '<br /><a href="' . $RootPath . '/Locations.php">' . _('Define Stock Locations') . '</a>'; @@ -815,7 +816,7 @@ <td><select tabindex="15" name="DefaultLocation">'; while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['DefaultLocation']) AND $myrow['loccode']==$_POST['DefaultLocation']) { + if(isset($_POST['DefaultLocation']) AND $myrow['loccode']==$_POST['DefaultLocation']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -828,7 +829,7 @@ </tr> <tr> <td>' . _('Phone Number').':</td>'; - if (!isset($_POST['PhoneNo'])) { + if(!isset($_POST['PhoneNo'])) { $_POST['PhoneNo']=''; } echo '<td><input tabindex="16" type="tel" name="PhoneNo" pattern="[0-9+()\s-]*" size="22" maxlength="20" value="'. $_POST['PhoneNo'].'" /></td> @@ -836,18 +837,18 @@ echo '<tr> <td>' . _('Fax Number').':</td>'; - if (!isset($_POST['FaxNo'])) { + if(!isset($_POST['FaxNo'])) { $_POST['FaxNo']=''; } echo '<td><input tabindex="17" type="tel" name="FaxNo" pattern="[0-9+()\s-]*" size="22" maxlength="20" value="'. $_POST['FaxNo'].'" /></td> </tr>'; - if (!isset($_POST['Email'])) { + if(!isset($_POST['Email'])) { $_POST['Email']=''; } echo '<tr> <td>' . (($_POST['Email']) ? '<a href="Mailto:'.$_POST['Email'].'">' . _('Email').':</a>' : _('Email').':') . '</td>'; - //only display email link if there is an email address + //only display email link if there is an email address echo '<td><input tabindex="18" type="email" name="Email" placeholder="e.g. ex...@do..." size="56" maxlength="55" value="'. $_POST['Email'].'" /></td> </tr>'; @@ -855,7 +856,7 @@ $SQL = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; $TaxGroupResults = DB_query($SQL); - if (DB_num_rows($TaxGroupResults)==0){ + if(DB_num_rows($TaxGroupResults)==0) { echo '</table>'; prnMsg(_('There are no tax groups defined - these must be set up first before any branches can be set up') . ' <br /><a href="' . $RootPath . '/TaxGroups.php">' . _('Define Tax Groups') . '</a>','error'); @@ -867,7 +868,7 @@ <td><select tabindex="19" name="TaxGroup">'; while ($myrow = DB_fetch_array($TaxGroupResults)) { - if (isset($_POST['TaxGroup']) AND $myrow['taxgroupid']==$_POST['TaxGroup']) { + if(isset($_POST['TaxGroup']) AND $myrow['taxgroupid']==$_POST['TaxGroup']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; @@ -881,7 +882,7 @@ <tr> <td>' . _('Transactions on this branch') . ':</td> <td><select tabindex="20" name="DisableTrans">'; - if (isset($_POST['DisableTrans']) AND $_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 { @@ -891,12 +892,12 @@ echo ' </select></td> </tr>'; - - + + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL); - if (DB_num_rows($ShipperResults)==0){ + if(DB_num_rows($ShipperResults)==0) { echo '</table>'; prnMsg(_('There are no shippers defined - these must be set up first before any branches can be set up') . ' <br /><a href="' . $RootPath . '/Shippers.php">' . _('Define Shippers') . '</a>','error'); @@ -906,8 +907,8 @@ echo '<tr> <td>' . _('Default freight/shipper method') . ':</td> <td><select tabindex="21" name="DefaultShipVia">'; - while ($myrow=DB_fetch_array($ShipperResults)){ - if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ + while ($myrow=DB_fetch_array($ShipperResults)) { + if(isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']) { echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; }else { echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; @@ -923,9 +924,9 @@ echo '<tr> <td>' . _('Default Packlist') . ':</td> <td><select tabindex="22" name="DeliverBlind">'; - if ($_POST['DeliverBlind']==2){ + if($_POST['DeliverBlind']==2) { echo '<option value="1">' . _('Show company details and logo') . '</option> - <option selected="selected" value="2">' . _('Hide company details and logo') . '</option>'; + <option selected="selected" value="2">' . _('Hide company details and logo') . '</option>'; } else { echo '<option selected="selected" value="1">' . _('Show company details and logo') . '</option> <option value="2">' . _('Hide company details and logo') . '</option>'; @@ -933,7 +934,7 @@ echo '</select></td> </tr>'; - if (!isset($_POST['BrPostAddr1'])) { // Postal address, line 1. Database: custbranch.brpostaddr1, varchar(40) + if(!isset($_POST['BrPostAddr1'])) {// Postal address, line 1. Database: custbranch.brpostaddr1, varchar(40) $_POST['BrPostAddr1']=''; } echo '<tr> @@ -941,7 +942,7 @@ <td><input tabindex="23" type="text" name="BrPostAddr1" size="41" maxlength="40" value="'. $_POST['BrPostAddr1'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr2'])) { // Postal address, line 2. Database: custbranch.brpostaddr2, varchar(40) + if(!isset($_POST['BrPostAddr2'])) {// Postal address, line 2. Database: custbranch.brpostaddr2, varchar(40) $_POST['BrPostAddr2']=''; } echo '<tr> @@ -949,7 +950,7 @@ <td><input tabindex="24" type="text" name="BrPostAddr2" size="41" maxlength="40" value="'. $_POST['BrPostAddr2'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr3'])) { // Postal address, line 3. Database: custbranch.brpostaddr3, varchar(40) + if(!isset($_POST['BrPostAddr3'])) {// Postal address, line 3. Database: custbranch.brpostaddr3, varchar(40) $_POST['BrPostAddr3']=''; } echo '<tr> @@ -957,7 +958,7 @@ <td><input tabindex="25" type="text" name="BrPostAddr3" size="41" maxlength="40" value="'. $_POST['BrPostAddr3'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr4'])) { // Postal address, line 4. Database: custbranch.brpostaddr4, varchar(40) + if(!isset($_POST['BrPostAddr4'])) {// Postal address, line 4. Database: custbranch.brpostaddr4, varchar(40) $_POST['BrPostAddr4']=''; } echo '<tr> @@ -965,7 +966,7 @@ <td><input tabindex="26" type="text" name="BrPostAddr4" size="41" maxlength="40" value="'. $_POST['BrPostAddr4'].'" /></td> </tr>'; - if (!isset($_POST['BrPostAddr5'])) { // Postal address, line 5. Database: custbranch.brpostaddr5, varchar(20) + if(!isset($_POST['BrPostAddr5'])) {// Postal address, line 5. Database: custbranch.brpostaddr5, varchar(20) $_POST['BrPostAddr5']=''; } echo '<tr> @@ -973,7 +974,7 @@ <td><input tabindex="27" type="text" name="BrPostAddr5" size="21" maxlength="20" value="'. $_POST['BrPostAddr5'].'" /></td> </tr>'; - if (!isset($_POST['CustBranchCode'])) { + if(!isset($_POST['CustBranchCode'])) { $_POST['CustBranchCode']=''; } echo '<tr> @@ -991,4 +992,4 @@ } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Manual/ManualAccountsReceivable.html =================================================================== --- trunk/doc/Manual/ManualAccountsReceivable.html 2015-05-09 11:12:08 UTC (rev 7294) +++ trunk/doc/Manual/ManualAccountsReceivable.html 2015-05-10 01:01:51 UTC (rev 7295) @@ -98,7 +98,6 @@ </div> <h2><a id="NewCustomerBranch">Entering Customer Branches</a></h2> - <p>A customer code entered on its own is insufficient to enter sales orders against. All customers must have at least one branch. The branch records contain the information about the delivery address, the sales area, the tax code, the sales representative and other regional information. New branches can be set up at any time. The first step will always be to select the customer, then to Add/Edit/Delete Customer Branch Records from the Customer menu. There is no limit to the number of branches that can be referenced against a single charge account (customer record). However, branches cannot be transferred between different customers. Only one statement will print per customer, but each invoice will be referenced to the branch it was delivered to.</p> <h3>Branch Name</h3> @@ -123,7 +122,7 @@ <h3>Draw Stock From</h3> -<p>Branches local to a particular warehouse can be associated with the local warehouse by setting this field to the preferred stocking location. This affects the entry of sales orders that default to the stock location entered here. It can be overridden at the time of order entry.</p> +<p>Branches local to a particular warehouse can be associated with the local warehouse by setting this field to the preferred stocking location (see <a href="ManualContents.php?ViewTopic=Inventory#Locations">Inventory Locations Maintenance</a>). This affects the entry of sales orders that default to the stock location entered here. It can be overridden at the time of order entry.</p> <h3>Forward Date From A Day In The Month</h3> |
From: <rc...@us...> - 2015-05-10 04:54:14
|
Revision: 7296 http://sourceforge.net/p/web-erp/reponame/7296 Author: rchacon Date: 2015-05-10 04:54:12 +0000 (Sun, 10 May 2015) Log Message: ----------- New features: (1) GL account code for an inventory location, so that you can have general ledger transactions of inventory transfers to or from this location; useful for pledged inventory and goods on consignment. (2) Allow Invoicing parameter to allow or deny the availability of a location to be delivered; useful when a location stores compromised good that can not be sold. Modified Paths: -------------- trunk/CustomerBranches.php trunk/DeliveryDetails.php trunk/Locations.php trunk/StockLocTransferReceive.php trunk/StockTransfers.php trunk/Z_ChangeGLAccountCode.php trunk/Z_ChangeLocationCode.php trunk/doc/Change.log trunk/doc/Manual/ManualAccountsReceivable.html trunk/doc/Manual/ManualInventory.html trunk/doc/Manual/ManualSalesOrders.html trunk/includes/DefineStockTransfers.php trunk/sql/mysql/upgrade4.12.2-4.13.sql Added Paths: ----------- trunk/doc/Manual/images/InventoryLocations.png Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2015-05-10 01:01:51 UTC (rev 7295) +++ trunk/CustomerBranches.php 2015-05-10 04:54:12 UTC (rev 7296) @@ -12,7 +12,7 @@ if(isset($_GET['DebtorNo'])) { $DebtorNo = mb_strtoupper($_GET['DebtorNo']); -} else if(isset($_POST['DebtorNo'])) { +} elseif(isset($_POST['DebtorNo'])) { $DebtorNo = mb_strtoupper($_POST['DebtorNo']); } @@ -26,7 +26,7 @@ if(isset($_GET['SelectedBranch'])) { $SelectedBranch = mb_strtoupper($_GET['SelectedBranch']); -} else if(isset($_POST['SelectedBranch'])) { +} elseif(isset($_POST['SelectedBranch'])) { $SelectedBranch = mb_strtoupper($_POST['SelectedBranch']); } @@ -177,7 +177,7 @@ $msg = $_POST['BrName'] . ' '._('branch has been updated.'); - } else if($InputError !=1) { + } elseif($InputError !=1) { /*Selected branch is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Customer Branches form */ @@ -286,7 +286,7 @@ unset($_POST['DeliverBlind']); unset($SelectedBranch); } -} else if(isset($_GET['delete'])) { +} elseif(isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' @@ -461,7 +461,7 @@ if($myrow[10]) { $TotalDisable++; - }else { + } else { $TotalEnable++; } } while ($myrow = DB_fetch_row($result)); @@ -698,7 +698,7 @@ foreach ($CountriesArray as $CountryEntry => $CountryName) { if(isset($_POST['BrAddress6']) AND ($_POST['BrAddress6'] == $CountryName)) { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif(!isset($_POST['BrAddress6']) AND $CountryName == "") { + } elseif(!isset($_POST['BrAddress6']) AND $CountryName == "") { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; @@ -735,7 +735,7 @@ echo $_SESSION['UsersRealName']; echo '</td> </tr>'; - }else{ + } else { //SQL to poulate account selection boxes $SQL = "SELECT salesmanname, @@ -800,30 +800,38 @@ </tr>'; DB_data_seek($result,0); - $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; +// BEGIN: ********************************************************************** + $SQL = "SELECT locations.loccode, locationname + FROM locations + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode + AND locationusers.userid='" . $_SESSION['UserID'] . "' + AND locationusers.canupd=1 + WHERE locations.allowinvoicing='1'"; $result = DB_query($SQL); if(DB_num_rows($result)==0) { echo '</table>'; prnMsg(_('There are no stock locations defined as yet') . ' - ' . _('customer branches must refer to a default location where stock is normally drawn from') . '. ' . _('Please use the link below to define at least one stock location'),'error'); - echo '<br /><a href="' . $RootPath . '/Locations.php">' . _('Define Stock Locations') . '</a>'; + echo '<br /><a href="', $RootPath, '/Locations.php">', _('Define Stock Locations'), '</a>'; include('includes/footer.inc'); exit; } echo '<tr> - <td>' . _('Draw Stock From').':</td> - <td><select tabindex="15" name="DefaultLocation">'; + <td>', _('Draw Stock From'), ':</td> + <td><select name="DefaultLocation" tabindex="15">'; - while ($myrow = DB_fetch_array($result)) { + while($myrow = DB_fetch_array($result)) { if(isset($_POST['DefaultLocation']) AND $myrow['loccode']==$_POST['DefaultLocation']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; } - echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo $myrow['loccode'], '">', $myrow['locationname'], '</option>'; - } //end while loop + }// End while loop. +// END: ************************************************************************ echo '</select></td> </tr> @@ -910,7 +918,7 @@ while ($myrow=DB_fetch_array($ShipperResults)) { if(isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']) { echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; - }else { + } else { echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; } } @@ -938,53 +946,53 @@ $_POST['BrPostAddr1']=''; } echo '<tr> - <td>' . _('Postal Address 1 (Street)').':</td> - <td><input tabindex="23" type="text" name="BrPostAddr1" size="41" maxlength="40" value="'. $_POST['BrPostAddr1'].'" /></td> + <td>', _('Postal Address 1 (Street)'), ':</td> + <td><input maxlength="40" name="BrPostAddr1" size="41" tabindex="23" type="text" value="', $_POST['BrPostAddr1'].'" /></td> </tr>'; if(!isset($_POST['BrPostAddr2'])) {// Postal address, line 2. Database: custbranch.brpostaddr2, varchar(40) $_POST['BrPostAddr2']=''; } echo '<tr> - <td>' . _('Postal Address 2 (Suburb/City)').':</td> - <td><input tabindex="24" type="text" name="BrPostAddr2" size="41" maxlength="40" value="'. $_POST['BrPostAddr2'].'" /></td> + <td>', _('Postal Address 2 (Suburb/City)'), ':</td> + <td><input maxlength="40" name="BrPostAddr2" size="41" tabindex="24" type="text" value="', $_POST['BrPostAddr2'].'" /></td> </tr>'; if(!isset($_POST['BrPostAddr3'])) {// Postal address, line 3. Database: custbranch.brpostaddr3, varchar(40) $_POST['BrPostAddr3']=''; } echo '<tr> - <td>' . _('Postal Address 3 (State)').':</td> - <td><input tabindex="25" type="text" name="BrPostAddr3" size="41" maxlength="40" value="'. $_POST['BrPostAddr3'].'" /></td> + <td>', _('Postal Address 3 (State)'), ':</td> + <td><input maxlength="40" name="BrPostAddr3" size="41" tabindex="25" type="text" value="', $_POST['BrPostAddr3'].'" /></td> </tr>'; if(!isset($_POST['BrPostAddr4'])) {// Postal address, line 4. Database: custbranch.brpostaddr4, varchar(40) $_POST['BrPostAddr4']=''; } echo '<tr> - <td>' . _('Postal Address 4 (Postal Code)').':</td> - <td><input tabindex="26" type="text" name="BrPostAddr4" size="41" maxlength="40" value="'. $_POST['BrPostAddr4'].'" /></td> + <td>', _('Postal Address 4 (Postal Code)'), ':</td> + <td><input maxlength="40" name="BrPostAddr4" size="41" tabindex="26" type="text" value="', $_POST['BrPostAddr4'].'" /></td> </tr>'; if(!isset($_POST['BrPostAddr5'])) {// Postal address, line 5. Database: custbranch.brpostaddr5, varchar(20) $_POST['BrPostAddr5']=''; } echo '<tr> - <td>' . _('Postal Address 5').':</td> - <td><input tabindex="27" type="text" name="BrPostAddr5" size="21" maxlength="20" value="'. $_POST['BrPostAddr5'].'" /></td> + <td>', _('Postal Address 5'), ':</td> + <td><input maxlength="20" name="BrPostAddr5" size="21" tabindex="27" type="text" value="', $_POST['BrPostAddr5'].'" /></td> </tr>'; if(!isset($_POST['CustBranchCode'])) { $_POST['CustBranchCode']=''; } echo '<tr> - <td>' . _('Customers Internal Branch Code (EDI)').':</td> - <td><input tabindex="28" type="text" name="CustBranchCode" size="31" maxlength="30" value="'. $_POST['CustBranchCode'].'" /></td> + <td>', _('Customers Internal Branch Code (EDI)'), ':</td> + <td><input maxlength="30" name="CustBranchCode" size="31" tabindex="28" type="text" value="', $_POST['CustBranchCode'], '" /></td> </tr> </table> <br /> <div class="centre"> - <input tabindex="28" type="submit" name="submit" value="' . _('Enter Or Update Branch') . '" /> + <input name="submit" tabindex="29" type="submit" value="', _('Enter Or Update Branch'), '" /> </div> </div> </form>'; Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2015-05-10 01:01:51 UTC (rev 7295) +++ trunk/DeliveryDetails.php 2015-05-10 04:54:12 UTC (rev 7296) @@ -113,7 +113,7 @@ elseif(Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])) { $InputErrors =1; - echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); + echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); } */ @@ -236,7 +236,7 @@ - if shippers defined but the default shipper is bogus then use the first shipper defined */ if((isset($BestShipper) AND $BestShipper=='') AND ($_POST['ShipVia']=='' OR !isset($_POST['ShipVia']))) { - $sql = "SELECT shipper_id + $sql = "SELECT shipper_id FROM shippers WHERE shipper_id='" . $_SESSION['Default_Shipper']."'"; $ErrMsg = _('There was a problem testing for the default shipper'); @@ -258,7 +258,7 @@ $BestShipper = $ShipperReturned[0]; } else { prnMsg(_('We have a problem') . ' - ' . _('there are no shippers defined'). '. ' . _('Please use the link below to set up shipping or freight companies') . ', ' . _('the system expects the shipping company to be selected or a default freight company to be used'),'error'); - echo '<a href="' . $RootPath . 'Shippers.php">' . _('Enter') . '/' . _('Amend Freight Companies') . '</a>'; + echo '<a href="' . $RootPath . 'Shippers.php">' . _('Enter') . '/' . _('Amend Freight Companies') . '</a>'; } } if(isset($_SESSION['Items'.$identifier]->ShipVia) AND $_SESSION['Items'.$identifier]->ShipVia!='') { @@ -272,8 +272,8 @@ if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors) { - echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; - prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $RootPath . '/RecurringOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">' . _('click here') . '</a> '. _('to continue'),'info'); + echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; + prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $RootPath . '/RecurringOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">' . _('click here') . '</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; } @@ -281,8 +281,8 @@ if(isset($_POST['BackToLineDetails']) and $_POST['BackToLineDetails']==_('Modify Order Lines')) { - echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/SelectOrderItems.php?identifier='.$identifier . '">'; - prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $RootPath . '/SelectOrderItems.php?identifier='.$identifier . '">' . _('click here') . '</a> '. _('to continue'),'info'); + echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/SelectOrderItems.php?identifier='.$identifier . '">'; + prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $RootPath . '/SelectOrderItems.php?identifier='.$identifier . '">' . _('click here') . '</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; @@ -318,7 +318,7 @@ UNTIL ONLINE CREDIT CARD PROCESSING IS PERFORMED ASSUME OK TO PROCESS - NOT YET CODED */ + NOT YET CODED */ $OK_to_PROCESS =1; @@ -540,7 +540,7 @@ $FactoryManagerEmail = _('A new work order has been created for') . ":\n" . $StockItem->StockID . ' - ' . $StockItem->ItemDescription . ' x ' . $WOQuantity . ' ' . $StockItem->Units . - "\n" . _('These are for') . ' ' . $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('there order ref') . ': ' . $_SESSION['Items'.$identifier]->CustRef . ' ' ._('our order number') . ': ' . $OrderNo; + "\n" . _('These are for') . ' ' . $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('there order ref') . ': ' . $_SESSION['Items'.$identifier]->CustRef . ' ' ._('our order number') . ': ' . $OrderNo; if($StockItem->Serialised AND $StockItem->NextSerialNo>0) { //then we must create the serial numbers for the new WO also @@ -603,16 +603,16 @@ echo '<br /><table class="selection"> <tr> <td><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" /></td> - <td>' . ' ' . '<a target="_blank" href="' . $RootPath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">' . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' . '</a></td> + <td>' . ' ' . '<a target="_blank" href="' . $RootPath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">' . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' . '</a></td> </tr>'; echo '<tr> <td><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" /></td> - <td>' . ' ' . '<a target="_blank" href="' . $RootPath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">' . _('Print packing slip') . ' (' . _('Laser') . ')' . '</a></td> + <td>' . ' ' . '<a target="_blank" href="' . $RootPath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">' . _('Print packing slip') . ' (' . _('Laser') . ')' . '</a></td> </tr>'; echo '<tr> <td><img src="'.$RootPath.'/css/'.$Theme.'/images/reports.png" title="' . _('Invoice') . '" alt="" /></td> - <td>' . ' ' . '<a href="' . $RootPath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">' . _('Confirm Dispatch and Produce Invoice') . '</a></td> + <td>' . ' ' . '<a href="' . $RootPath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">' . _('Confirm Dispatch and Produce Invoice') . '</a></td> </tr>'; echo '</table>'; @@ -622,7 +622,7 @@ echo '<br /><table class="selection"> <tr> <td><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Order') . '" alt=""></td> - <td>' . ' ' . '<a href="' . $RootPath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '" target="_blank">' . _('Print Quotation (Landscape)') . '</a></td> + <td>' . ' ' . '<a href="' . $RootPath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '" target="_blank">' . _('Print Quotation (Landscape)') . '</a></td> </tr> </table>'; echo '<br /><table class="selection"> @@ -1007,29 +1007,30 @@ </tr>'; echo '<tr> - <td>' . _('Deliver from the warehouse at') .':</td> + <td>', _('Deliver from the warehouse at'), ':</td> <td><select name="Location">'; if($_SESSION['Items'.$identifier]->Location=='' OR !isset($_SESSION['Items'.$identifier]->Location)) { $_SESSION['Items'.$identifier]->Location = $DefaultStockLocation; } +// BEGIN: ********************************************************************** +$SQL = "SELECT locations.loccode, locationname + FROM locations + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode + AND locationusers.userid='" . $_SESSION['UserID'] . "' + AND locationusers.canupd=1 + WHERE locations.allowinvoicing='1'"; $ErrMsg = _('The stock locations could not be retrieved'); $DbgMsg = _('SQL used to retrieve the stock locations was') . ':'; -$StkLocsResult = DB_query("SELECT locationname,locations.loccode - FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1", - $ErrMsg, - $DbgMsg); - -while ($myrow=DB_fetch_array($StkLocsResult)) { - if($_SESSION['Items'.$identifier]->Location==$myrow['loccode']) { - echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } else { - echo '<option value="'.$myrow['loccode'].'">' . $myrow['locationname'] . '</option>'; - } +$StkLocsResult = DB_query($SQL, $ErrMsg, $DbgMsg); +// COMMENT: What if there is no authorized locations available for this user? +while($myrow=DB_fetch_array($StkLocsResult)) { + echo '<option', ($_SESSION['Items'.$identifier]->Location==$myrow['loccode'] ? ' selected="selected"' : ''), ' value="', $myrow['loccode'], '">', $myrow['locationname'], '</option>'; } - echo '</select></td></tr>'; +// END: ************************************************************************ // Set the default date to earliest possible date if not set already if(!isset($_SESSION['Items'.$identifier]->DeliveryDate)) { Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2015-05-10 01:01:51 UTC (rev 7295) +++ trunk/Locations.php 2015-05-10 04:54:12 UTC (rev 7296) @@ -77,7 +77,9 @@ cashsalebranch ='" . $_POST['CashSaleBranch'] . "', managed = '" . $_POST['Managed'] . "', internalrequest = '" . $_POST['InternalRequest'] . "', - usedforwo = '" . $_POST['UsedForWO'] . "' + usedforwo = '" . $_POST['UsedForWO'] . "', + glaccountcode = '" . $_POST['GLAccountCode'] . "', + allowinvoicing = '" . $_POST['AllowInvoicing'] . "' WHERE loccode = '" . $SelectedLocation . "'"; $ErrMsg = _('An error occurred updating the') . ' ' . $SelectedLocation . ' ' . _('location record because'); @@ -105,6 +107,8 @@ unset($_POST['Contact']); unset($_POST['InternalRequest']); unset($_POST['UsedForWO']); + unset($_POST['GLAccountCode']); + unset($_POST['AllowInvoicing']); } elseif($InputError !=1) { @@ -135,7 +139,9 @@ cashsalebranch, managed, internalrequest, - usedforwo) + usedforwo, + glaccountcode, + allowinvoicing) VALUES ('" . $_POST['LocCode'] . "', '" . $_POST['LocationName'] . "', '" . $_POST['DelAdd1'] ."', @@ -150,13 +156,15 @@ '" . $_POST['Contact'] . "', '" . $_POST['TaxProvince'] . "', '" . $_POST['CashSaleCustomer'] . "', - '" . $_POST['CashSaleBranch'] . "', + '" . $_POST['CashSaleBranch'] . "', '" . $_POST['Managed'] . "', - '" . $_POST['InternalRequest'] ."', - '" . $_POST['UsedForWO'] . "')"; + '" . $_POST['InternalRequest'] . "', + '" . $_POST['UsedForWO'] . "', + '" . $_POST['GLAccountCode'] . "', + '" . $_POST['AllowInvoicing'] . "')"; - $ErrMsg = _('An error occurred inserting the new location record because'); - $DbgMsg = _('The SQL used to insert the location record was'); + $ErrMsg = _('An error occurred inserting the new location record because'); + $DbgMsg = _('The SQL used to insert the location record was'); $result = DB_query($sql,$ErrMsg,$DbgMsg); prnMsg(_('The new location record has been added'),'success'); @@ -174,10 +182,10 @@ 0 FROM stockmaster"; - $ErrMsg = _('An error occurred inserting the new location stock records for all pre-existing parts because'); - $DbgMsg = _('The SQL used to insert the new stock location records was'); + $ErrMsg = _('An error occurred inserting the new location stock records for all pre-existing parts because'); + $DbgMsg = _('The SQL used to insert the new stock location records was'); $result = DB_query($sql,$ErrMsg, $DbgMsg); - prnMsg ('........ ' . _('and new stock locations inserted for all existing stock items for the new location'), 'success'); + prnMsg('........ ' . _('and new stock locations inserted for all existing stock items for the new location'), 'success'); /* Also need to add locationuser records for all existing users*/ $sql = "INSERT INTO locationusers (userid, loccode, canview, canupd) @@ -190,7 +198,7 @@ ON www_users.userid = locationusers.userid AND locations.loccode = locationusers.loccode WHERE locationusers.userid IS NULL - AND locations.loccode='". $_POST['LocCode'] . "';"; + AND locations.loccode='". $_POST['LocCode'] . "';"; $ErrMsg = _('The users/locations that need user location records created cannot be retrieved because'); $Result = DB_query($sql,$ErrMsg); @@ -215,7 +223,8 @@ unset($_POST['Contact']); unset($_POST['InternalRequest']); unset($_POST['UsedForWO']); - + unset($_POST['GLAccountCode']); + unset($_POST['AllowInvoicing']); } @@ -267,7 +276,7 @@ if($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this location because sales orders have been created delivering from this location'),'warn'); - echo _('There are') . ' ' . $myrow[0] . ' ' . _('sales orders with this Location code'); + echo _('There are') . ' ' . $myrow[0] . ' ' . _('sales orders with this Location code'); } else { $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockmoves.loccode='" . $SelectedLocation . "'"; $result = DB_query($sql); @@ -385,20 +394,24 @@ $sql = "SELECT loccode, locationname, taxprovinces.taxprovincename as description, + glaccountcode, + allowinvoicing, managed FROM locations INNER JOIN taxprovinces ON locations.taxprovinceid=taxprovinces.taxprovinceid"; $result = DB_query($sql); if(DB_num_rows($result)==0) { - prnMsg (_('There are no locations that match up with a tax province record to display. Check that tax provinces are set up for all dispatch locations'),'error'); + prnMsg(_('There are no locations that match up with a tax province record to display. Check that tax provinces are set up for all dispatch locations'),'error'); } - echo '<table class="selection">'; - echo '<tr> - <th class="ascending">' . _('Location Code') . '</th> - <th class="ascending">' . _('Location Name') . '</th> - <th class="ascending">' . _('Tax Province') . '</th> + echo '<table class="selection"> + <tr> + <th class="ascending">', _('Location Code'), '</th> + <th class="ascending">', _('Location Name'), '</th> + <th class="ascending">', _('Tax Province'), '</th> + <th class="ascending">', _('GL Account Code'), '</th> + <th class="ascending">', _('Allow Invoicing'), '</th> <th class="noprint" colspan="2"> </th> </tr>'; @@ -414,22 +427,25 @@ /* warehouse management not implemented ... yet if($myrow['managed'] == 1) { $myrow['managed'] = _('Yes'); - } else { + } else { $myrow['managed'] = _('No'); } */ printf('<td>%s</td> <td>%s</td> <td>%s</td> + <td class="number">%s</td> + <td class="centre">%s</td> <td class="noprint"><a href="%sSelectedLocation=%s">' . _('Edit') . '</a></td> <td class="noprint"><a href="%sSelectedLocation=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this inventory location?') . '\');">' . _('Delete') . '</a></td> </tr>', $myrow['loccode'], $myrow['locationname'], $myrow['description'], + ($myrow['glaccountcode']!='' ? $myrow['glaccountcode'] : ' '),// Use a non-breaking space to avoid an empty cell in a HTML table. + ($myrow['allowinvoicing']==1 ? _('Yes') : _('No')), htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $myrow['loccode'], htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?', $myrow['loccode']); - } //END WHILE LIST LOOP echo '</table>'; @@ -446,7 +462,7 @@ if(!isset($_GET['delete'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; + echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if(isset($SelectedLocation)) { @@ -469,7 +485,9 @@ cashsalebranch, managed, internalrequest, - usedforwo + usedforwo, + glaccountcode, + allowinvoicing FROM locations WHERE loccode='" . $SelectedLocation . "'"; @@ -477,7 +495,7 @@ $myrow = DB_fetch_array($result); $_POST['LocCode'] = $myrow['loccode']; - $_POST['LocationName'] = $myrow['locationname']; + $_POST['LocationName'] = $myrow['locationname']; $_POST['DelAdd1'] = $myrow['deladd1']; $_POST['DelAdd2'] = $myrow['deladd2']; $_POST['DelAdd3'] = $myrow['deladd3']; @@ -494,8 +512,9 @@ $_POST['Managed'] = $myrow['managed']; $_POST['InternalRequest'] = $myrow['internalrequest']; $_POST['UsedForWO'] = $myrow['usedforwo']; + $_POST['GLAccountCode'] = $myrow['glaccountcode']; + $_POST['AllowInvoicing'] = $myrow['allowinvoicing']; - echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; echo '<input type="hidden" name="LocCode" value="' . $_POST['LocCode'] . '" />'; echo '<table class="selection">'; @@ -561,9 +580,12 @@ if(!isset($_POST['Managed'])) { $_POST['Managed'] = 0; } + if(!isset($_POST['AllowInvoicing'])) { + $_POST['AllowInvoicing'] = 1;// If not set, set value to "Yes". + } echo '<tr> - <td>' . _('Location Name') . ':' . '</td> + <td>' . _('Location Name') . ':' . '</td> <td><input type="text" name="LocationName" required="required" value="'. $_POST['LocationName'] . '" title="' . _('Enter the inventory location name this could be either a warehouse or a factory') . '" namesize="51" maxlength="50" /></td> </tr> <tr> @@ -571,23 +593,23 @@ <td><input type="text" name="Contact" required="required" value="' . $_POST['Contact'] . '" title="' . _('Enter the name of the responsible person to contact for this inventory location') . '" size="31" maxlength="30" /></td> </tr> <tr> - <td>' . _('Delivery Address 1 (Building)') . ':' . '</td> + <td>' . _('Delivery Address 1 (Building)') . ':' . '</td> <td><input type="text" name="DelAdd1" value="' . $_POST['DelAdd1'] . '" size="41" maxlength="40" /></td> </tr> <tr> <td>' . _('Delivery Address 2 (Street)') . ':' . '</td> - <td><input type="text" name="DelAdd2" value="' . $_POST['DelAdd2'] . '" size="41" maxlength="40" /></td> + <td><input type="text" name="DelAdd2" value="' . $_POST['DelAdd2'] . '" size="41" maxlength="40" /></td> </tr> <tr> - <td>' . _('Delivery Address 3 (Suburb)') . ':' . '</td> - <td><input type="text" name="DelAdd3" value="' . $_POST['DelAdd3'] . '" size="41" maxlength="40" /></td> + <td>' . _('Delivery Address 3 (Suburb)') . ':' . '</td> + <td><input type="text" name="DelAdd3" value="' . $_POST['DelAdd3'] . '" size="41" maxlength="40" /></td> </tr> <tr> - <td>' . _('Delivery Address 4 (City)') . ':' . '</td> + <td>' . _('Delivery Address 4 (City)') . ':' . '</td> <td><input type="text" name="DelAdd4" value="' . $_POST['DelAdd4'] . '" size="41" maxlength="40" /></td> </tr> <tr> - <td>' . _('Delivery Address 5 (Zip Code)') . ':' . '</td> + <td>' . _('Delivery Address 5 (Zip Code)') . ':' . '</td> <td><input type="text" name="DelAdd5" value="' . $_POST['DelAdd5'] . '" size="21" maxlength="20" /></td> </tr> <tr> @@ -595,29 +617,29 @@ <td><select name="DelAdd6">'; foreach ($CountriesArray as $CountryEntry => $CountryName) { if(isset($_POST['DelAdd6']) AND (strtoupper($_POST['DelAdd6']) == strtoupper($CountryName))) { - echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif(!isset($_POST['Address6']) AND $CountryName == "") { - echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; + echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; + } elseif(!isset($_POST['Address6']) AND $CountryName == "") { + echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { - echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; + echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; } } echo '</select></td> </tr> <tr> - <td>' . _('Telephone No') . ':' . '</td> - <td><input type="tel" name="Tel" pattern="[0-9+\-\s()]*" value="' . $_POST['Tel'] . '" size="31" maxlength="30" title="' . _('The phone number should consist of numbers, spaces, parentheses, or the + character') . '" /></td> + <td>' . _('Telephone No') . ':' . '</td> + <td><input name="Tel" type="tel" pattern="[0-9+\-\s()]*" value="' . $_POST['Tel'] . '" size="31" maxlength="30" title="' . _('The phone number should consist of numbers, spaces, parentheses, or the + character') . '" /></td> </tr> <tr> - <td>' . _('Facsimile No') . ':' . '</td> - <td><input type="tel" name="Fax" pattern="[0-9+\-\s()]*" value="' . $_POST['Fax'] . '" size="31" maxlength="30" title="' . _('The fax number should consist of numbers, parentheses, spaces or the + character') . '"/></td> + <td>' . _('Facsimile No') . ':' . '</td> + <td><input name="Fax" type="tel" pattern="[0-9+\-\s()]*" value="' . $_POST['Fax'] . '" size="31" maxlength="30" title="' . _('The fax number should consist of numbers, parentheses, spaces or the + character') . '"/></td> </tr> <tr> - <td>' . _('Email') . ':' . '</td> - <td><input type="email" name="Email" value="' . $_POST['Email'] . '" size="31" maxlength="55" /></td> + <td>' . _('Email') . ':' . '</td> + <td><input name="Email" type="email" value="' . $_POST['Email'] . '" size="31" maxlength="55" /></td> </tr> <tr> - <td>' . _('Tax Province') . ':' . '</td> + <td>' . _('Tax Province') . ':' . '</td> <td><select name="TaxProvince">'; $TaxProvinceResult = DB_query("SELECT taxprovinceid, taxprovincename FROM taxprovinces"); @@ -668,6 +690,18 @@ echo '<option value="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; + // Location's ledger account: + echo '<tr title="', _('Enter the GL account for this location, or leave it in blank if not needed'), '"> + <td><label for="GLAccountCode">', _('GL Account Code'), ':</label></td> + <td><input data-type="no-illegal-chars" id="GLAccountCode" maxlength="20" name="GLAccountCode" size="20" type="text" value="', $_POST['GLAccountCode'], '" /></td></tr>'; + // Allow or deny the invoicing of items in this location: + echo '<tr title="', _('Use this parameter to indicate whether these inventory location allows or denies the invoicing of its items.'), '"> + <td><label for="AllowInvoicing">', _('Allow Invoicing'), ':</label></td> + <td><select name="AllowInvoicing"> + <option', ($_POST['AllowInvoicing']==1 ? ' selected="selected"' : ''), ' value="1">', _('Yes'), '</option> + <option', ($_POST['AllowInvoicing']==0 ? ' selected="selected"' : ''), ' value="0">', _('No'), '</option> + </select></td> + </tr>'; /* This functionality is not written yet ... @@ -677,12 +711,12 @@ echo '</table> <br /> <div class="centre"> - <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> - </div> + </div> </form>'; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2015-05-10 01:01:51 UTC (rev 7295) +++ trunk/StockLocTransferReceive.php 2015-05-10 04:54:12 UTC (rev 7296) @@ -6,21 +6,22 @@ include('includes/DefineStockTransfers.php'); include('includes/session.inc'); -$Title = _('Inventory Transfer') . ' - ' . _('Receiving'); -$BookMark = "LocationTransfers"; -$ViewTopic = "Inventory"; +$Title = _('Inventory Transfer') . ' - ' . _('Receiving');// Screen identification. +$ViewTopic = 'Inventory';// Filename's id in ManualContents.php's TOC. +$BookMark = 'LocationTransfers';// Anchor's id in the manual's html document. include('includes/header.inc'); + include('includes/SQL_CommonFunctions.inc'); -if (isset($_GET['NewTransfer'])){ +if(isset($_GET['NewTransfer'])) { unset($_SESSION['Transfer']); } -if ( isset($_SESSION['Transfer']) and $_SESSION['Transfer']->TrfID == ''){ +if(isset($_SESSION['Transfer']) and $_SESSION['Transfer']->TrfID == '') { unset($_SESSION['Transfer']); } -if(isset($_POST['ProcessTransfer'])){ +if(isset($_POST['ProcessTransfer'])) { /*Ok Time To Post transactions to Inventory Transfers, and Update Posted variable & received Qty's to LocTransfers */ $PeriodNo = GetPeriod ($_SESSION['Transfer']->TranDate, $db); @@ -30,24 +31,24 @@ $i=0; $TotalQuantity = 0; foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { - if (is_numeric(filter_number_format($_POST['Qty' . $i]))){ + if(is_numeric(filter_number_format($_POST['Qty' . $i]))) { /*Update the quantity received from the inputs */ $_SESSION['Transfer']->TransferItem[$i]->Quantity= round(filter_number_format($_POST['Qty' . $i]),$_SESSION['Transfer']->TransferItem[$i]->DecimalPlaces); - } elseif ($_POST['Qty' . $i]=='') { + } elseif($_POST['Qty' . $i]=='') { $_SESSION['Transfer']->TransferItem[$i]->Quantity= 0; - } else { + } else { prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is not numeric') . '. ' . _('All quantities must be numeric'),'error'); $InputError = True; } - if (filter_number_format($_POST['Qty' . $i])<0){ + if(filter_number_format($_POST['Qty' . $i])<0) { prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is negative') . '. ' . _('All quantities must be for positive numbers greater than zero'),'error'); $InputError = True; } - if ($TrfLine->PrevRecvQty + $TrfLine->Quantity > $TrfLine->ShipQty){ + if($TrfLine->PrevRecvQty + $TrfLine->Quantity > $TrfLine->ShipQty) { prnMsg( _('The Quantity entered plus the Quantity Previously Received can not be greater than the Total Quantity shipped for').' '. $TrfLine->StockID , 'error'); $InputError = True; } - if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ + if(isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1) { $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; } else { $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; @@ -55,16 +56,16 @@ $TotalQuantity += $TrfLine->Quantity; $i++; } /*end loop to validate and update the SESSION['Transfer'] data */ - if ($TotalQuantity < 0){ + if($TotalQuantity < 0) { prnMsg( _('All quantities entered are less than zero') . '. ' . _('Please correct that and try again'), 'error' ); $InputError = True; } //exit; - if (!$InputError){ + if(!$InputError) { /*All inputs must be sensible so make the stock movement records and update the locations stocks */ foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { - if ($TrfLine->Quantity >=0){ + if($TrfLine->Quantity >=0) { $Result = DB_Txn_Begin(); /* Need to get the current location quantity will need it later for the stock movement */ @@ -74,7 +75,7 @@ AND loccode= '" . $_SESSION['Transfer']->StockLocationFrom . "'"; $Result = DB_query($SQL, _('Could not retrieve the stock quantity at the dispatch stock location prior to this transfer being processed') ); - if (DB_num_rows($Result)==1){ + if(DB_num_rows($Result)==1) { $LocQtyRow = DB_fetch_row($Result); $QtyOnHandPrior = $LocQtyRow[0]; } else { @@ -115,8 +116,8 @@ /*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ - if ($TrfLine->Controlled ==1){ - foreach($TrfLine->SerialItems as $Item){ + if($TrfLine->Controlled ==1) { + foreach($TrfLine->SerialItems as $Item) { /*We need to add or update the StockSerialItem record and The StockSerialMoves as well */ @@ -131,7 +132,7 @@ $Result = DB_query($SQL,'<br />' . _('Could not determine if the serial item exists') ); $SerialItemExistsRow = DB_fetch_row($Result); - if ($SerialItemExistsRow[0]==1){ + if($SerialItemExistsRow[0]==1) { $SQL = "UPDATE stockserialitems SET quantity= quantity - " . $Item->BundleQty . " @@ -188,7 +189,7 @@ AND loccode= '" . $_SESSION['Transfer']->StockLocationTo . "'"; $Result = DB_query($SQL, _('Could not retrieve the quantity on hand at the location being transferred to') ); - if (DB_num_rows($Result)==1){ + if(DB_num_rows($Result)==1) { $LocQtyRow = DB_fetch_row($Result); $QtyOnHandPrior = $LocQtyRow[0]; } else { @@ -196,6 +197,49 @@ $QtyOnHandPrior = 0; } +// COMMENT: "if($TrfLine->Quantity !=0) {}" should be as a general condition to avoid transactions in zero. + +// BEGIN: ********************************************************************** + // Insert outgoing inventory GL transaction if any of the locations has a GL account code: + if(($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') and $TrfLine->Quantity !=0) { + // Get the account code: + if($_SESSION['Transfer']->StockLocationFromAccount !='') { + $AccountCode = $_SESSION['Transfer']->StockLocationFromAccount; + } else { + $StockGLCode = GetStockGLCode($TrfLine->StockID, $db);// Get Category's account codes. + $AccountCode = $StockGLCode['stockact'];// Select account code for stock. + } + // Get the item cost: + $SQLstandardcost = "SELECT stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost AS standardcost + FROM stockmaster + WHERE stockmaster.stockid ='" . $TrfLine->StockID . "'"; + $ErrMsg = _('The standard cost of the item cannot be retrieved because'); + $DbgMsg = _('The SQL that failed was'); + $myrow = DB_fetch_array(DB_query($SQLstandardcost,$ErrMsg,$DbgMsg)); + $StandardCost = $myrow['standardcost'];// QUESTION: Standard cost for: Assembly (value="A") and Manufactured (value="M") items ? + // Insert record: + $SQL = "INSERT INTO gltrans ( + periodno, + trandate, + type, + typeno, + account, + narrative, + amount) + VALUES ('" . + $PeriodNo . "','" . + $SQLTransferDate . + "',16,'" . + $_SESSION['Transfer']->TrfID . "','" . + $AccountCode . "','" . + $_SESSION['Transfer']->StockLocationFrom.' - '.$TrfLine->StockID.' x '.$TrfLine->Quantity.' @ '. $StandardCost . "','" . + -$TrfLine->Quantity * $StandardCost . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The outgoing inventory GL transacction record could not be inserted because'); + $DbgMsg = _('The following SQL to insert records was used'); + $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); + } +// END: ************************************************************************ + // Insert the stock movement for the stock coming into the to location $SQL = "INSERT INTO stockmoves (stockid, type, @@ -228,13 +272,11 @@ /*Get the ID of the StockMove... */ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); - /*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ + /*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ + if($TrfLine->Controlled ==1) { + foreach($TrfLine->SerialItems as $Item) { + /*We need to add or update the StockSerialItem record and the StockSerialMoves as well */ - if ($TrfLine->Controlled ==1){ - foreach($TrfLine->SerialItems as $Item){ - /*We need to add or update the StockSerialItem record and - The StockSerialMoves as well */ - /*First need to check if the serial items already exists or not in the location to */ $SQL = "SELECT COUNT(*) FROM stockserialitems @@ -247,7 +289,7 @@ $SerialItemExistsRow = DB_fetch_row($Result); - if ($SerialItemExistsRow[0]==1){ + if($SerialItemExistsRow[0]==1) { $SQL = "UPDATE stockserialitems SET quantity= quantity + '" . $Item->BundleQty . "' @@ -312,9 +354,50 @@ $DbgMsg = _('The following SQL to update the stock record was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); +// BEGIN: ********************************************************************** + // Insert incoming inventory GL transaction if any of the locations has a GL account code: + if(($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') and $TrfLine->Quantity !=0) { + // Get the account code: + if($_SESSION['Transfer']->StockLocationToAccount !='') { + $AccountCode = $_SESSION['Transfer']->StockLocationToAccount; + } else { + $StockGLCode = GetStockGLCode($TrfLine->StockID, $db);// Get Category's account codes. + $AccountCode = $StockGLCode['stockact'];// Select account code for stock. + } + // Get the item cost: + $SQLstandardcost = "SELECT stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost AS standardcost + FROM stockmaster + WHERE stockmaster.stockid ='" . $TrfLine->StockID . "'"; + $ErrMsg = _('The standard cost of the item cannot be retrieved because'); + $DbgMsg = _('The SQL that failed was'); + $myrow = DB_fetch_array(DB_query($SQLstandardcost,$ErrMsg,$DbgMsg)); + $StandardCost = $myrow['standardcost'];// QUESTION: Standard cost for: Assembly (value="A") and Manufactured (value="M") items ? + // Insert record: + $SQL = "INSERT INTO gltrans ( + periodno, + trandate, + type, + typeno, + account, + narrative, + amount) + VALUES ('" . + $PeriodNo . "','" . + $SQLTransferDate . "', + 16,'" . + $_SESSION['Transfer']->TrfID . "','" . + $AccountCode . "','" . + $_SESSION['Transfer']->StockLocationTo.' - '.$TrfLine->StockID.' x '.$TrfLine->Quantity.' @ '. $StandardCost . "','" . + $TrfLine->Quantity * $StandardCost . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The incoming inventory GL transacction record could not be inserted because'); + $DbgMsg = _('The following SQL to insert records was used'); + $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); + } +// END: ************************************************************************ + prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success'); - if ($TrfLine->CancelBalance==1){ + if($TrfLine->CancelBalance==1) { $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', shipqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', recdate = '".Date('Y-m-d H:i:s'). "' @@ -323,22 +406,22 @@ } else { $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', recdate = '".Date('Y-m-d H:i:s'). "' - WHERE reference = '". $_SESSION['Transfer']->TrfID . "' - AND stockid = '". $TrfLine->StockID."'"; + WHERE reference = '". $_SESSION['Transfer']->TrfID . "' + AND stockid = '". $TrfLine->StockID."'"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('Unable to update the Location Transfer Record'); $Result = DB_query($sql, $ErrMsg, $DbgMsg, true); unset ($_SESSION['Transfer']->LineItem[$i]); unset ($_POST['Qty' . $i]); } /*end if Quantity > 0 */ - if ($TrfLine->CancelBalance==1){ + if($TrfLine->CancelBalance==1) { $sql = "UPDATE loctransfers SET shipqty = recqty WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('Unable to set the quantity received to the quantity shipped to cancel the balance on this transfer line'); $Result = DB_query($sql, $ErrMsg, $DbgMsg, true); // send an email to the inventory manager about this cancellation (as can lead to employee fraud) - if ($_SESSION['InventoryManagerEmail']!=''){ + if($_SESSION['InventoryManagerEmail']!='') { $ConfirmationText = _('Cancelled balance of transfer'). ': ' . $_SESSION['Transfer']->TrfID . "\r\n" . _('From Location') . ': ' . $_SESSION['Transfer']->StockLocationFrom . "\r\n" . _('To Location') . ': ' . $_SESSION['Transfer']->StockLocationTo . @@ -347,7 +430,7 @@ "\r\n" . _('By user') . ': ' . $_SESSION['UserID'] . "\r\n" . _('At') . ': ' . Date('Y-m-d H:i:s'); $EmailSubject = _('Cancelled balance of transfer'). ' ' . $_SESSION['Transfer']->TrfID; - if($_SESSION['SmtpSetting']==0){ + if($_SESSION['SmtpSetting']==0) { mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText); }else{ include('includes/htmlMimeMail.php'); @@ -370,7 +453,7 @@ } /*end of PRocess Transfer */ -if(isset($_GET['Trf_ID'])){ +if(isset($_GET['Trf_ID'])) { unset($_SESSION['Transfer']); @@ -384,7 +467,9 @@ loctransfers.shipqty, loctransfers.recqty, locations.locationname as shiplocationname, + locations.glaccountcode as shipaccountcode, reclocations.locationname as reclocationname, + reclocations.glaccountcode as recaccountcode, loctransfers.shiploc, loctransfers.recloc FROM loctransfers INNER JOIN locations @@ -401,7 +486,7 @@ $DbgMsg = _('The SQL to retrieve the transfer was'); $result = DB_query($sql,$ErrMsg,$DbgMsg); - if(DB_num_rows($result) == 0){ + if(DB_num_rows($result) == 0) { echo '<h3>' . _('Transfer') . ' #' . $_GET['Trf_ID'] . ' '. _('Does Not Exist') . '</h3><br />'; include('includes/footer.inc'); exit; @@ -412,8 +497,10 @@ $_SESSION['Transfer']= new StockTransfer($_GET['Trf_ID'], $myrow['shiploc'], $myrow['shiplocationname'], + $myrow['shipaccountcode'], $myrow['recloc'], $myrow['reclocationname'], + $myrow['recaccountcode'], Date($_SESSION['DefaultDateFormat']) ); /*Populate the StockTransfer TransferItem s array with the lines to be transferred */ $i = 0; @@ -435,7 +522,7 @@ } /* $_GET['Trf_ID'] is set */ -if (isset($_SESSION['Transfer'])){ +if(isset($_SESSION['Transfer'])) { //Begin Form for receiving shipment echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/supplier.png" title="' . _('Dispatch') . @@ -467,7 +554,7 @@ echo $tableheader; $k=0; foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -479,14 +566,14 @@ <td>' . $TrfLine->ItemDescription . '</td>'; echo '<td class="number">' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; - if (isset($_POST['Qty' . $i]) AND is_numeric(filter_number_format($_POST['Qty' . $i]))){ + if(isset($_POST['Qty' . $i]) AND is_numeric(filter_number_format($_POST['Qty' . $i]))) { $_SESSION['Transfer']->TransferItem[$i]->Quantity= round(filter_number_format($_POST['Qty' . $i]),$TrfLine->DecimalPlaces); $Qty = round(filter_number_format($_POST['Qty' . $i]),$TrfLine->DecimalPlaces); - } else if ($TrfLine->Controlled==1) { - if (sizeOf($TrfLine->SerialItems)==0) { + } else if($TrfLine->Controlled==1) { + if(sizeOf($TrfLine->SerialItems)==0) { $Qty = 0; } else { $Qty = $TrfLine->Quantity; @@ -496,7 +583,7 @@ } echo '<td class="number">' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; - if ($TrfLine->Controlled==1){ + if($TrfLine->Controlled==1) { echo '<td class="number"><input type="hidden" name="Qty' . $i . '" value="' . locale_number_format($Qty,$TrfLine->DecimalPlaces) . '" /><a href="' . $RootPath .'/StockTransferControlled.php?TransferItem=' . $i . '" />' . $Qty . '</a></td>'; } else { echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength="10" size="auto" value="' . locale_number_format($Qty,$TrfLine->DecimalPlaces) . '" /></td>'; @@ -507,8 +594,8 @@ echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value="1" /></td>'; - if ($TrfLine->Controlled==1){ - if ($TrfLine->Serialised==1){ + if($TrfLine->Controlled==1) { + if($TrfLine->Serialised==1) { echo '<td><a href="' . $RootPath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Serial Numbers') . '</a></td>'; } else { echo '<td><a href="' . $RootPath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Batch Refs') . '</a></td>'; @@ -545,11 +632,11 @@ <td>' . _('Select Location Receiving Into'). ':</td> <td>'; echo '<select name="RecLocation" onchange="ReloadForm(form1.RefreshTransferList)">'; - if (!isset($_POST['RecLocation'])){ + if(!isset($_POST['RecLocation'])) { $_POST['RecLocation'] = $_SESSION['UserStockLocation']; } - while ($myrow=DB_fetch_array($LocResult)){ - if ($myrow['loccode'] == $_POST['RecLocation']){ + while ($myrow=DB_fetch_array($LocResult)) { + if($myrow['loccode'] == $_POST['RecLocation']) { echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -570,7 +657,7 @@ AND recqty < shipqty"; $TrfResult = DB_query($sql); - if (DB_num_rows($TrfResult)>0){ + if(DB_num_rows($TrfResult)>0) { $LocSql = "SELECT locationname FROM locations WHERE loccode='" . $_POST['RecLocation'] . "'"; $LocResult = DB_query($LocSql); $LocRow = DB_fetch_array($LocResult); @@ -581,9 +668,9 @@ <th>' . _('Transfer From'). '</th> <th>' . _('Dispatch Date'). '</th></tr>'; $k=0; - while ($myrow=DB_fetch_array($TrfResult)){ + while ($myrow=DB_fetch_array($TrfResult)) { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -597,7 +684,7 @@ </tr>'; } echo '</table>'; - } else if (!isset($_POST['ProcessTransfer'])) { + } else if(!isset($_POST['ProcessTransfer'])) { prnMsg(_('There are no incoming transfers to this location'), 'info'); } echo '</div> Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2015-05-10 01:01:51 UTC (rev 7295) +++ trunk/StockTransfers.php 2015-05-10 04:54:12 UTC (rev 7296) @@ -1,35 +1,36 @@ <?php /* $Id$*/ -/* Inventory Transfer - Item Dispatch */ +/* Entry of point to point stock location transfers of a single part. */ include('includes/DefineSerialItems.php'); include('includes/DefineStockTransfers.php'); include('includes/session.inc'); -$Title = _('Stock Transfers'); -$BookMark = "LocationTransfers"; -$ViewTopic = "Inventory"; +$Title = _('Stock Transfers');// Screen identification. +$ViewTopic = "Inventory";// Filename's id in ManualContents.php's TOC. +$BookMark = "LocationTransfers";// Anchor's id in the manual's html document. include('includes/header.inc'); + include('includes/SQL_CommonFunctions.inc'); -if (isset($_GET['New'])) { +if(isset($_GET['New'])) { unset($_SESSION['Transfer']); } -if (isset($_GET['From'])) { +if(isset($_GET['From'])) { $_POST['StockLocationFrom']=$_GET['From']; $_POST['StockLocationTo']=$_GET['To']; $_POST['Quantity']=$_GET['Quantity']; } -if (isset($_POST['CheckCode'])) { +if(isset($_POST['CheckCode'])) { echo '<p class="page_title_text"> <img src="'.$RootPath.'/css/'.$Theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" /> ' . ' ' . _('Select Item to Transfer') . ' </p>'; - if (mb_strlen($_POST['StockText'])>0) { + if(mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, description FROM stockmaster @@ -48,7 +49,7 @@ <th class="ascending">' . _('Stock Code') . '</th> <th class="ascending">' . _('Stock Description') . '</th> </tr>'; - while ($myrow = DB_fetch_array($result)) { + while($myrow = DB_fetch_array($result)) { echo '<tr> <td>' . $myrow['stockid'] . '</td> <td>' . $myrow['description'] . '</td> @@ -64,18 +65,18 @@ $NewTransfer = false; /*initialise this first then determine from form inputs */ -if (isset($_GET['NewTransfer'])){ +if(isset($_GET['NewTransfer'])) { unset($_SESSION['Transfer']); unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual transfers */ $NewTransfer=$_GET['NewTransfer']; } -if (isset($_GET['StockID'])){ /*carry the stockid through to the form for additional inputs */ +if(isset($_GET['StockID'])) { /*carry the stockid through to the form for additional inputs */ $_POST['StockID'] = trim(mb_strtoupper($_GET['StockID'])); -} elseif (isset($_POST['StockID'])){ /* initiate a new transfer only if the StockID is different to the previous entry */ - if (isset($_SESSION['Transfer']->TransferItem[0])) { - if ($_POST['StockID'] != $_SESSION['Transfer']->TransferItem[0]->StockID){ +} elseif(isset($_POST['StockID'])) { /* initiate a new transfer only if the StockID is different to the previous entry */ + if(isset($_SESSION['Transfer']->TransferItem[0])) { + if($_POST['StockID'] != $_SESSION['Transfer']->TransferItem[0]->StockID) { unset($_SESSION['Transfer']); $NewTransfer = true; } @@ -84,12 +85,12 @@ } } -if ($NewTransfer){ +if($NewTransfer) { - if(!isset($_POST['StockLocationFrom'])){ + if(!isset($_POST['StockLocationFrom'])) { $_POST['StockLocationFrom']=''; } - if(!isset($_POST['StockLocationTo'])){ + if(!isset($_POST['StockLocationTo'])) { $_POST['StockLocationTo']=''; } @@ -111,11 +112,11 @@ FROM stockmaster WHERE stockid='" . trim(mb_strtoupper($_POST['StockID'])) . "'"); - if (DB_num_rows($result) == 0){ + if(DB_num_rows($result) == 0) { prnMsg( _('Unable to locate Stock Code').' '.mb_strtoupper($_POST['StockID']), 'error' ); - } elseif (DB_num_rows($result)>0){ + } elseif(DB_num_rows($result)>0) { $myrow = DB_fetch_array($result); - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(mb_strtoupper($_POST['StockID'])), + $_SESSION['Transfer']->TransferItem[0] = new LineItem( trim(mb_strtoupper($_POST['StockID'])), $myrow['description'], filter_number_format($_POST['Quantity']), $myrow['units'], @@ -127,66 +128,66 @@ $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow['standardcost']; - if ($myrow['mbflag']=='D' OR $myrow['mbflag']=='A' OR $myrow['mbflag']=='K'){ + if($myrow['mbflag']=='D' OR $myrow['mbflag']=='A' OR $myrow['mbflag']=='K') { prnMsg(_('The part entered is either or a dummy part or an assembly or a kit-set part') . '. ' . _('These parts are not physical parts and no stock holding is maintained for them') . '. ' . _('Stock Transfers are therefore not possible'),'warn'); echo '.<hr />'; echo '<a href="' . $RootPath . '/StockTransfers.php?NewTransfer=Yes">' . _('Enter another Transfer') . '</a>'; - unset ($_SESSION['Transfer']); - include ('includes/footer.inc'); + unset($_SESSION['Transfer']); + include('includes/footer.inc'); exit; } } } -if (isset($_POST['Quantity']) +if(isset($_POST['Quantity']) AND isset($_SESSION['Transfer']->TransferItem[0]->Controlled) - AND $_SESSION['Transfer']->TransferItem[0]->Controlled==0){ + AND $_SESSION['Transfer']->TransferItem[0]->Controlled==0) { $_SESSION['Transfer']->TransferItem[0]->Quantity = filter_number_format($_POST['Quantity']); } -if ( isset($_POST['StockLocationFrom']) - AND $_POST['StockLocationFrom']!= $_SESSION['Transfer']->StockLocationFrom ){ +if(isset($_POST['StockLocationFrom']) + AND $_POST['StockLocationFrom']!= $_SESSION['Transfer']->StockLocationFrom ) { $_SESSION['Transfer']->StockLocationFrom = $_POST['StockLocationFrom']; $_SESSION['Transfer']->StockLocationTo = $_POST['StockLocationTo']; $_SESSION['Transfer']->TransferItem[0]->Quantity=filter_number_format($_POST['Quantity']); $_SESSION['Transfer']->TransferItem[0]->SerialItems=array(); } -if ( isset($_POST['StockLocationTo']) ){ +if(isset($_POST['StockLocationTo']) ) { $_SESSION['Transfer']->StockLocationTo = $_POST['StockLocationTo']; } -if ( isset($_POST['EnterTransfer']) ){ +if(isset($_POST['EnterTransfer']) ) { $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID ."'"); $myrow = DB_fetch_row($result); $InputError = false; - if (DB_num_rows($result)==0) { + if(DB_num_rows($result)==0) { echo '<br />'; prnMsg(_('The entered item code does not exist'), 'error'); $InputError = true; - } elseif (!is_numeric($_SESSION['Transfer']->TransferItem[0]->Quantity)){ + } elseif(!is_numeric($_SESSION['Transfer']->TransferItem[0]->Quantity)) { echo '<br />'; prnMsg( _('The quantity entered must be numeric'), 'error' ); $InputError = true; - } elseif ($_SESSION['Transfer']->TransferItem[0]->Quantity <= 0){ + } elseif($_SESSION['Transfer']->TransferItem[0]->Quantity <= 0) { echo '<br />'; prnMsg( _('The quantity entered must be a positive number greater than zero'), 'error'); $InputError = true; } - if ($_SESSION['Transfer']->StockLocationFrom==$_SESSION['Transfer']->StockLocationTo){ + if($_SESSION['Transfer']->StockLocationFrom==$_SESSION['Transfer']->StockLocationTo) { echo '<br />'; prnMsg( _('The locations to transfer from and to must be different'), 'error'); $InputError = true; } - if ($InputError==False) { + if($InputError==False) { /*All inputs must be sensible so make the stock movement records and update the locations stocks */ $TransferNumber = GetNextTransNo(16,$db); - $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $... [truncated message content] |
From: <rc...@us...> - 2015-05-10 20:53:05
|
Revision: 7299 http://sourceforge.net/p/web-erp/reponame/7299 Author: rchacon Date: 2015-05-10 20:53:03 +0000 (Sun, 10 May 2015) Log Message: ----------- Minor changes: clean up code. Modified Paths: -------------- trunk/CustomerBranches.php trunk/DeliveryDetails.php trunk/Locations.php trunk/StockLocTransferReceive.php trunk/StockTransfers.php trunk/Z_ChangeGLAccountCode.php trunk/Z_ChangeLocationCode.php Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/CustomerBranches.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -4,7 +4,7 @@ include('includes/session.inc'); $Title = _('Customer Branches');// Screen identification. -$ViewTopic= 'AccountsReceivable';// Filename's id in ManualContents.php's TOC. +$ViewTopic = 'AccountsReceivable';// Filename's id in ManualContents.php's TOC. $BookMark = 'NewCustomerBranch';// Anchor's id in the manual's html document. include('includes/header.inc'); @@ -362,7 +362,7 @@ } } } - } //end ifs to test if the branch can be deleted + }//end ifs to test if the branch can be deleted } if(!isset($SelectedBranch)) { @@ -601,7 +601,7 @@ <td>' . $_POST['BranchCode'] . '</td> </tr>'; - } else { //end of if $SelectedBranch only do the else when a new record is being entered + } else {//end of if $SelectedBranch only do the else when a new record is being entered /* SETUP ANY $_GET VALUES THAT ARE PASSED. This really is just used coming from the Customers.php when a new customer is created. Maybe should only do this when that page is the referrer? @@ -765,12 +765,12 @@ } echo $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; - } //end while loop + }//end while loop echo '</select></td> </tr>'; - // DB_data_seek($result,0); //by thumb + // DB_data_seek($result,0);//by thumb } $SQL = "SELECT areacode, areadescription FROM areas"; $result = DB_query($SQL); @@ -793,14 +793,13 @@ } echo $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; - } //end while loop + }//end while loop echo '</select></td> </tr>'; DB_data_seek($result,0); -// BEGIN: ********************************************************************** $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers @@ -831,7 +830,6 @@ echo $myrow['loccode'], '">', $myrow['locationname'], '</option>'; }// End while loop. -// END: ************************************************************************ echo '</select></td> </tr> @@ -856,7 +854,7 @@ } echo '<tr> <td>' . (($_POST['Email']) ? '<a href="Mailto:'.$_POST['Email'].'">' . _('Email').':</a>' : _('Email').':') . '</td>'; - //only display email link if there is an email address + //only display email link if there is an email address echo '<td><input tabindex="18" type="email" name="Email" placeholder="e.g. ex...@do..." size="56" maxlength="55" value="'. $_POST['Email'].'" /></td> </tr>'; @@ -883,7 +881,7 @@ } echo $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; - } //end while loop + }//end while loop echo '</select></td> </tr> @@ -997,7 +995,7 @@ </div> </form>'; -} //end if record deleted no point displaying form to add record +}//end if record deleted no point displaying form to add record include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/DeliveryDetails.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -44,7 +44,7 @@ if(isset($_POST['ProcessOrder']) OR isset($_POST['MakeRecurringOrder'])) { /*need to check for input errors in any case before order processed */ - $_POST['Update']='Yes rerun the validation checks'; //no need for gettext! + $_POST['Update']='Yes rerun the validation checks';//no need for gettext! /*store the old freight cost before it is recalculated to ensure that there has been no change - test for change after freight recalculated and get user to re-confirm if changed */ @@ -432,7 +432,7 @@ if($StockItem->MBflag=='M' AND $_SESSION['AutoCreateWOs']==1 - AND $_SESSION['Items'.$identifier]->Quotation!=1) { //oh yeah its all on! + AND $_SESSION['Items'.$identifier]->Quotation!=1) {//oh yeah its all on! echo '<br />'; @@ -488,7 +488,7 @@ //Now we have the data - do we need to make any more? $ShortfallQuantity = $QOH-$QuantityDemand-$QuantityAssemblyDemand+$QuantityPurchOrders+$QuantityWorkOrders; - if($ShortfallQuantity < 0) { //then we need to make a work order + if($ShortfallQuantity < 0) {//then we need to make a work order //How many should the work order be for?? if($ShortfallQuantity + $StockItem->EOQ < 0) { $WOQuantity = -$ShortfallQuantity; @@ -565,25 +565,25 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); $FactoryManagerEmail .= "\n" . ($StockItem->NextSerialNo + $i); } - } //end loop around creation of woserialnos + }//end loop around creation of woserialnos $NewNextSerialNo = ($StockItem->NextSerialNo + $WOQuantity +1); $ErrMsg = _('Could not update the new next serial number for the item'); $UpdateNextSerialNoResult = DB_query("UPDATE stockmaster SET nextserialno='" . $NewNextSerialNo . "' WHERE stockid='" . $StockItem->StockID . "'",$ErrMsg,$DbgMsg,true); - } // end if the item is serialised and nextserialno is set + }// end if the item is serialised and nextserialno is set $EmailSubject = _('New Work Order Number') . ' ' . $WONo . ' ' . _('for') . ' ' . $StockItem->StockID . ' x ' . $WOQuantity; //Send email to the Factory Manager if($_SESSION['SmtpSetting']==0) { mail($_SESSION['FactoryManagerEmail'],$EmailSubject,$FactoryManagerEmail); - }else { + } else { include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); $mail->setSubject($EmailSubject); $result = SendmailBySmtp($mail,array($_SESSION['FactoryManagerEmail'])); } - } //end if with this sales order there is a shortfall of stock - need to create the WO + }//end if with this sales order there is a shortfall of stock - need to create the WO }//end if auto create WOs in on } /* end inserted line items into sales order details */ @@ -659,12 +659,12 @@ $Result = DB_Txn_Begin(); /*see if this is a contract quotation being changed to an order? */ - if($_SESSION['Items'.$identifier]->Quotation==0) { //now its being changed? to an order + if($_SESSION['Items'.$identifier]->Quotation==0) {//now its being changed? to an order $ContractResult = DB_query("SELECT contractref, requireddate FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] ."' AND status=1"); - if(DB_num_rows($ContractResult)==1) { //then it is a contract quotation being changed to an order + if(DB_num_rows($ContractResult)==1) {//then it is a contract quotation being changed to an order $ContractRow = DB_fetch_array($ContractResult); $WONo = GetNextTransNo(40,$db); $ErrMsg = _('Could not update the contract status'); @@ -716,7 +716,7 @@ $Cost =0; prnMsg(_('In automatically creating a work order for') . ' ' . $ContractRow['contractref'] . ' ' . _('an item on this sales order, the cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); } else { - $Cost = $CostRow[0]; //cost of contract BOM + $Cost = $CostRow[0];//cost of contract BOM } $CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost FROM contractreqts @@ -740,8 +740,8 @@ //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements WoRealRequirements($db, $WONo, $_SESSION['Items'.$identifier]->Location, $ContractRow['contractref']); - } //end processing if the order was a contract quotation being changed to an order - } //end test to see if the order was a contract quotation being changed to an order + }//end processing if the order was a contract quotation being changed to an order + }//end test to see if the order was a contract quotation being changed to an order $HeaderSQL = "UPDATE salesorders SET debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "', @@ -805,7 +805,7 @@ unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); - if($Quotation) { //handle Quotations and Orders print after modification + if($Quotation) {//handle Quotations and Orders print after modification prnMsg(_('Quotation Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); /*link to print the quotation */ @@ -821,7 +821,7 @@ <td>' . ' ' . '<a href="' . $RootPath . '/PDFQuotationPortrait.php?identifier='.$identifier . '&QuotationNo=' . $_SESSION['ExistingOrder'.$identifier] . '" target="_blank">' . _('Print Quotation (Portrait)') . '</a></td> </tr> </table>'; - }else { + } else { prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); @@ -887,7 +887,7 @@ $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; $_SESSION['Items'.$identifier]->totalWeight = 0; - $k = 0; //row colour counter + $k = 0;//row colour counter foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { @@ -956,7 +956,7 @@ $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; $_SESSION['Items'.$identifier]->totalWeight = 0; - $k=0; // row colour counter + $k=0;// row colour counter foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); @@ -1014,7 +1014,6 @@ $_SESSION['Items'.$identifier]->Location = $DefaultStockLocation; } -// BEGIN: ********************************************************************** $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers @@ -1030,7 +1029,6 @@ echo '<option', ($_SESSION['Items'.$identifier]->Location==$myrow['loccode'] ? ' selected="selected"' : ''), ' value="', $myrow['loccode'], '">', $myrow['locationname'], '</option>'; } echo '</select></td></tr>'; -// END: ************************************************************************ // Set the default date to earliest possible date if not set already if(!isset($_SESSION['Items'.$identifier]->DeliveryDate)) { @@ -1084,7 +1082,7 @@ foreach ($CountriesArray as $CountryEntry => $CountryName) { if(isset($_POST['BrAdd6']) AND (strtoupper($_POST['BrAdd6']) == strtoupper($CountryName))) { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; - }elseif(!isset($_POST['BrAdd6']) AND $CountryName == $_SESSION['Items'.$identifier]->DelAdd6) { + } elseif(!isset($_POST['BrAdd6']) AND $CountryName == $_SESSION['Items'.$identifier]->DelAdd6) { echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>'; } else { echo '<option value="' . $CountryName . '">' . $CountryName . '</option>'; @@ -1187,15 +1185,13 @@ $ShipperResults = DB_query($sql,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($ShipperResults)) { if($myrow['shipper_id']==$_POST['ShipVia']) { - echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; - }else { + echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; + } else { echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>'; } } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Quotation Only') .':</td> <td><select name="Quotation">'; if($_SESSION['Items'.$identifier]->Quotation==1) { @@ -1206,7 +1202,7 @@ echo '<option selected="selected" value="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; - } //end if it is NOT a CustomerLogin + }//end if it is NOT a CustomerLogin echo '</table>'; Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/Locations.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -7,10 +7,10 @@ $ViewTopic = 'Inventory';// Filename's id in ManualContents.php's TOC. $BookMark = 'Locations';// Anchor's id in the manual's html document. include('includes/header.inc'); -echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. - '/images/supplier.png" title="' .// Icon image. - _('Inventory') . '" /> ' .// Icon title. - _('Location Maintenance') . '</p>';// Page title. +echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/supplier.png" title="',// Icon image. + _('Inventory'), '" /> ',// Icon title. + _('Location Maintenance'), '</p>';// Page title. include('includes/CountriesArray.php'); @@ -38,7 +38,7 @@ if($_POST['CashSaleBranch']=='') { prnMsg(_('A cash sale customer and branch are necessary to fully setup the counter sales functionality'),'error'); $InputError =1; - } else { //customer branch is set too ... check it ties up with a valid customer + } else {//customer branch is set too ... check it ties up with a valid customer $sql = "SELECT * FROM custbranch WHERE debtorno='" . $_POST['CashSaleCustomer'] . "' AND branchcode='" . $_POST['CashSaleBranch'] . "'"; @@ -49,7 +49,7 @@ prnMsg(_('The cash sale customer for this location must be defined with both a valid customer code and a valid branch code for this customer'),'error'); } } - } //end of checking the customer - branch code entered + }//end of checking the customer - branch code entered if(isset($SelectedLocation) AND $InputError !=1) { @@ -235,7 +235,7 @@ $DispTaxProvincesResult = DB_query("SELECT taxprovinceid FROM locations"); $TaxCatsResult = DB_query("SELECT taxcatid FROM taxcategories"); - if(DB_num_rows($TaxCatsResult) > 0) { // This will only work if there are levels else we get an error on seek. + if(DB_num_rows($TaxCatsResult) > 0) {// This will only work if there are levels else we get an error on seek. while ($myrow=DB_fetch_row($DispTaxProvincesResult)) { /*Check to see there are TaxAuthRates records set up for this TaxProvince */ @@ -379,7 +379,7 @@ prnMsg(_('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success'); unset ($SelectedLocation); - } //end if Delete Location + }//end if Delete Location unset($SelectedLocation); unset($_GET['delete']); } @@ -415,7 +415,7 @@ <th class="noprint" colspan="2"> </th> </tr>'; -$k=0; //row colour counter +$k=0;//row colour counter while ($myrow = DB_fetch_array($result)) { if($k==1) { echo '<tr class="EvenTableRows">'; @@ -525,7 +525,7 @@ <td>' . _('Location Code') . ':</td> <td>' . $_POST['LocCode'] . '</td> </tr>'; - } else { //end of if $SelectedLocation only do the else when a new record is being entered + } else {//end of if $SelectedLocation only do the else when a new record is being entered if(!isset($_POST['LocCode'])) { $_POST['LocCode'] = ''; } @@ -716,7 +716,7 @@ </div> </form>'; -} //end if record deleted no point displaying form to add record +}//end if record deleted no point displaying form to add record include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/StockLocTransferReceive.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -199,7 +199,6 @@ // COMMENT: "if($TrfLine->Quantity !=0) {}" should be as a general condition to avoid transactions in zero. -// BEGIN: ********************************************************************** // Insert outgoing inventory GL transaction if any of the locations has a GL account code: if(($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') and $TrfLine->Quantity !=0) { // Get the account code: @@ -238,7 +237,6 @@ $DbgMsg = _('The following SQL to insert records was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); } -// END: ************************************************************************ // Insert the stock movement for the stock coming into the to location $SQL = "INSERT INTO stockmoves (stockid, @@ -354,7 +352,6 @@ $DbgMsg = _('The following SQL to update the stock record was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); -// BEGIN: ********************************************************************** // Insert incoming inventory GL transaction if any of the locations has a GL account code: if(($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') and $TrfLine->Quantity !=0) { // Get the account code: @@ -393,7 +390,6 @@ $DbgMsg = _('The following SQL to insert records was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); } -// END: ************************************************************************ prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success'); @@ -432,7 +428,7 @@ $EmailSubject = _('Cancelled balance of transfer'). ' ' . $_SESSION['Transfer']->TrfID; if($_SESSION['SmtpSetting']==0) { mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText); - }else{ + } else{ include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); $mail->setSubject($EmailSubject); @@ -533,7 +529,7 @@ prnMsg(_('Please Verify Shipment Quantities Received'),'info'); - $i = 0; //Line Item Array pointer + $i = 0;//Line Item Array pointer echo '<br /> <table class="selection">'; @@ -691,4 +687,4 @@ </form>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/StockTransfers.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -25,10 +25,10 @@ if(isset($_POST['CheckCode'])) { - echo '<p class="page_title_text"> - <img src="'.$RootPath.'/css/'.$Theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" /> - ' . ' ' . _('Select Item to Transfer') . ' - </p>'; + echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/magnifier.png" title="',// Icon image. + _('Dispatch'), '" /> ',// Icon title. + _('Select Item to Transfer'), '</p>';// Page title. if(mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -215,7 +215,6 @@ include('includes/footer.inc'); exit; } -// BEGIN: ********************************************************************** // Insert outgoing inventory GL transaction if any of the locations has a GL account code: if($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') { // Get the account code: @@ -254,7 +253,6 @@ $DbgMsg = _('The following SQL to insert records was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); } -// END: ************************************************************************ // Insert the stock movement for the stock going out of the from location $SQL = "INSERT INTO stockmoves(stockid, type, @@ -372,7 +370,6 @@ // There must actually be some error this should never happen $QtyOnHandPrior = 0; } -// BEGIN: ********************************************************************** // Insert incoming inventory GL transaction if any of the locations has a GL account code: if($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') { // Get the account code: @@ -411,7 +408,6 @@ $DbgMsg = _('The following SQL to insert records was used'); $Result = DB_query($SQL, $ErrMsg, $DbgMsg, true); } -// END: ************************************************************************ // Insert the stock movement for the stock coming into the to location $SQL = "INSERT INTO stockmoves (stockid, type, Modified: trunk/Z_ChangeGLAccountCode.php =================================================================== --- trunk/Z_ChangeGLAccountCode.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/Z_ChangeGLAccountCode.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -4,17 +4,17 @@ include ('includes/session.inc'); $Title = _('UTILITY PAGE Change A GL Account Code');// Screen identificator. -$ViewTopic = 'SpecialUtilities'; // Filename's id in ManualContents.php's TOC. -$BookMark = 'Z_ChangeGLAccountCode'; // Anchor's id in the manual's html document. +$ViewTopic = 'SpecialUtilities';// Filename's id in ManualContents.php's TOC. +$BookMark = 'Z_ChangeGLAccountCode';// Anchor's id in the manual's html document. include('includes/header.inc'); -echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. - '/images/gl.png" title="' . - _('Change A GL Account Code') . '" /> ' .// Icon title. - _('Change A GL Account Code') . '</p>';// Page title. +echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/gl.png" title="',// Icon image. + _('Change A GL Account Code'), '" /> ',// Icon title. + _('Change A GL Account Code'), '</p>';// Page title. include('includes/SQL_CommonFunctions.inc'); -if (isset($_POST['ProcessGLAccountCode'])){ +if(isset($_POST['ProcessGLAccountCode'])) { $InputError =0; @@ -22,17 +22,17 @@ /*First check the code exists */ $result=DB_query("SELECT accountcode FROM chartmaster WHERE accountcode='" . $_POST['OldAccountCode'] . "'"); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { prnMsg(_('The GL account code') . ': ' . $_POST['OldAccountCode'] . ' ' . _('does not currently exist as a GL account code in the system'),'error'); $InputError =1; } - if (ContainsIllegalCharacters($_POST['NewAccountCode'])){ + if(ContainsIllegalCharacters($_POST['NewAccountCode'])) { prnMsg(_('The new GL account code to change the old code to contains illegal characters - no changes will be made'),'error'); $InputError =1; } - if ($_POST['NewAccountCode']==''){ + if($_POST['NewAccountCode']=='') { prnMsg(_('The new GL account code to change the old code to must be entered as well'),'error'); $InputError =1; } @@ -40,14 +40,14 @@ /*Now check that the new code doesn't already exist */ $result=DB_query("SELECT accountcode FROM chartmaster WHERE accountcode='" . $_POST['NewAccountCode'] . "'"); - if (DB_num_rows($result)!=0){ + if(DB_num_rows($result)!=0) { echo '<br /><br />'; prnMsg(_('The replacement GL account code') . ': ' . $_POST['NewAccountCode'] . ' ' . _('already exists as a GL account code in the system') . ' - ' . _('a unique GL account code must be entered for the new code'),'error'); $InputError =1; } - if ($InputError ==0){ // no input errors + if($InputError ==0) {// no input errors $result = DB_Txn_Begin(); echo '<br />' . _('Adding the new chartmaster record'); $sql = "INSERT INTO chartmaster (accountcode, @@ -96,9 +96,7 @@ ChangeFieldInTable("lastcostrollup", "stockact", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); ChangeFieldInTable("lastcostrollup", "adjglact", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); -// BEGIN: ********************************************************************** ChangeFieldInTable("locations", "glaccountcode", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db);// Location's ledger account. -// END: ************************************************************************ ChangeFieldInTable("pcexpenses", "glaccount", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db); @@ -133,9 +131,8 @@ $result = DB_query($sql,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - echo '<p>' . _('GL account Code') . ': ' . $_POST['OldAccountCode'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewAccountCode']; - } //only do the stuff above if $InputError==0 + }//only do the stuff above if $InputError==0 } Modified: trunk/Z_ChangeLocationCode.php =================================================================== --- trunk/Z_ChangeLocationCode.php 2015-05-10 18:10:27 UTC (rev 7298) +++ trunk/Z_ChangeLocationCode.php 2015-05-10 20:53:03 UTC (rev 7299) @@ -1,20 +1,20 @@ <?php /* $Id: Z_ChangeLocationCode.php 5296 2012-04-29 15:28:19Z vvs2012 $*/ -/* This script is an utility to change a location code. */ +/* Utility to change a location code. */ include ('includes/session.inc'); $Title = _('UTILITY PAGE Change A Location Code');// Screen identificator. -$ViewTopic = 'SpecialUtilities'; // Filename's id in ManualContents.php's TOC. -$BookMark = 'Z_ChangeLocationCode'; // Anchor's id in the manual's html document. +$ViewTopic = 'SpecialUtilities';// Filename's id in ManualContents.php's TOC. +$BookMark = 'Z_ChangeLocationCode';// Anchor's id in the manual's html document. include('includes/header.inc'); -echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. - '/images/maintenance.png" title="' . - _('Change A Location Code') . '" /> ' .// Icon title. - _('Change A Location Code') . '</p>';// Page title. +echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/maintenance.png" title="',// Icon image. + _('Change A Location Code'), '" /> ',// Icon title. + _('Change A Location Code'), '</p>';// Page title. include('includes/SQL_CommonFunctions.inc'); -if (isset($_POST['ProcessLocationChange'])){ +if(isset($_POST['ProcessLocationChange'])) { $InputError =0; @@ -22,39 +22,39 @@ /*First check the location code exists */ $result=DB_query("SELECT loccode FROM locations WHERE loccode='" . $_POST['OldLocationID'] . "'"); - if (DB_num_rows($result)==0){ + if(DB_num_rows($result)==0) { prnMsg(_('The location code') . ': ' . $_POST['OldLocationID'] . ' ' . _('does not currently exist as a location code in the system'),'error'); $InputError =1; } - if (ContainsIllegalCharacters($_POST['NewLocationID'])){ + if(ContainsIllegalCharacters($_POST['NewLocationID'])) { prnMsg(_('The new location code to change the old code to contains illegal characters - no changes will be made'),'error'); $InputError =1; } - if ($_POST['NewLocationID']==''){ + if($_POST['NewLocationID']=='') { prnMsg(_('The new location code to change the old code to must be entered as well'),'error'); $InputError =1; } - if (ContainsIllegalCharacters($_POST['NewLocationName'])){ + if(ContainsIllegalCharacters($_POST['NewLocationName'])) { prnMsg(_('The new location name to change the old name to contains illegal characters - no changes will be made'),'error'); $InputError =1; } - if ($_POST['NewLocationName']==''){ + if($_POST['NewLocationName']=='') { prnMsg(_('The new location name to change the old name to must be entered as well'),'error'); $InputError =1; } /*Now check that the new code doesn't already exist */ $result=DB_query("SELECT loccode FROM locations WHERE loccode='" . $_POST['NewLocationID'] . "'"); - if (DB_num_rows($result)!=0){ + if(DB_num_rows($result)!=0) { echo '<br /><br />'; prnMsg(_('The replacement location code') . ': ' . $_POST['NewLocationID'] . ' ' . _('already exists as a location code in the system') . ' - ' . _('a unique location code must be entered for the new code'),'error'); $InputError =1; } - if ($InputError ==0){ // no input errors + if($InputError ==0) {// no input errors $result = DB_Txn_Begin(); DB_IgnoreForeignKeys(); @@ -159,7 +159,7 @@ //check if MRP tables exist before assuming $result = DB_query("SELECT COUNT(*) FROM mrpparameters",'','',false,false); - if (DB_error_no()==0) { + if(DB_error_no()==0) { echo '<br />' . _('Changing MRP parameters information'); $sql = "UPDATE mrpparameters SET location='" . $_POST['NewLocationID'] . "' WHERE location='" . $_POST['OldLocationID'] . "'"; $ErrMsg = _('The SQL to update the mrpparameters records failed'); @@ -251,7 +251,7 @@ echo '<p>' . _('Location code') . ': ' . $_POST['OldLocationID'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewLocationID']; - } //only do the stuff above if $InputError==0 + }//only do the stuff above if $InputError==0 } echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; @@ -279,4 +279,4 @@ </form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file |
From: <dai...@us...> - 2015-05-16 23:38:46
|
Revision: 7301 http://sourceforge.net/p/web-erp/reponame/7301 Author: daintree Date: 2015-05-16 23:38:43 +0000 (Sat, 16 May 2015) Log Message: ----------- added check bank accounts before delete currency; Modified Paths: -------------- trunk/Currencies.php trunk/doc/Change.log Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2015-05-14 14:33:10 UTC (rev 7300) +++ trunk/Currencies.php 2015-05-16 23:38:43 UTC (rev 7301) @@ -264,10 +264,19 @@ } elseif ($FunctionalCurrency==$SelectedCurrency){ prnMsg(_('Cannot delete this currency because it is the functional currency of the company'),'warn'); } else { - //only delete if used in neither customer or supplier, comp prefs, bank trans accounts - $sql="DELETE FROM currencies WHERE currabrev='" . $SelectedCurrency . "'"; + $sql= "SELECT COUNT(*) FROM bankaccounts + WHERE currcode = '" . $SelectedCurrency . "'"; $result = DB_query($sql); - prnMsg(_('The currency definition record has been deleted'),'success'); + $myrow = DB_fetch_row($result); + if ($myrow[0] > 0){ + prnMsg(_('Cannot delete this currency because there are bank accounts that use this currency') . + '<br />' . ' ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank accounts that refer to this currency'),'warn'); + } else { + //only delete if used in neither customer or supplier, comp prefs, bank trans accounts + $sql="DELETE FROM currencies WHERE currabrev='" . $SelectedCurrency . "'"; + $result = DB_query($sql); + prnMsg(_('The currency definition record has been deleted'),'success'); + } } } } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-05-14 14:33:10 UTC (rev 7300) +++ trunk/doc/Change.log 2015-05-16 23:38:43 UTC (rev 7301) @@ -1,5 +1,6 @@ webERP Change Log +17/5/15 Phil: Made currencies delete check first for bank accounts set up using the currency - as reported by Ricard 10/05/15 RChacon: New features: (1) GL account code for an inventory location, so that you can have general ledger transactions of inventory transfers to or from this location; useful for pledged inventory and goods on consignment. (2) Allow Invoicing parameter to allow or deny the availability of a location to be delivered; useful when a location stores compromised good that can not be sold. 08/05/15 RChacon: In DeliveryDetails.php, add $ViewTopic and $BookMark to ManualSalesOrders.html. 07/05/15 RChacon: In CustomerInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page. @@ -7,7 +8,7 @@ 04/05/15 Exson: Make PO number searching also in compliance with location authority rules and make default search result as all if users have full location authority. 04/05/15 Exson: Make all option available for users who have authority for all locations and all option available for all stock categories in PO_SelectOSPurchOrder.php. 02/05/15 TeHonu: Added bankaccountusers table in Z_ChangeGLAccountCode.php -30/04/15 TurboPT: Add Delivery Date in GoodsReceived.php output. Forum feature request by giusba71. +30/04/15 TurboPT: Add Delivery Date in GoodsReceived.php output. Forum feature request by giusba71. 30/04/15 Exson: Fixed the notice noise in SupplierCredit.php and SupplierInvoice.php. 30/04/15 Exson: Fixed the properties initial bug and tidy code up by fix typo. 26/04/15 Exson: Add adjustment reason to the mail text and fixed the notice noise in StockAdjustments.php. |