From: <afc...@us...> - 2017-10-17 22:06:51
|
Revision: 7859 http://sourceforge.net/p/web-erp/reponame/7859 Author: afcouling Date: 2017-10-17 22:06:48 +0000 (Tue, 17 Oct 2017) Log Message: ----------- Removed reference to css class 'toplink' in CustomerInquiry.php and CustomerAccount.php. Modified Paths: -------------- trunk/CustomerAccount.php trunk/CustomerInquiry.php trunk/doc/Change.log Modified: trunk/CustomerAccount.php =================================================================== --- trunk/CustomerAccount.php 2017-10-17 08:02:49 UTC (rev 7858) +++ trunk/CustomerAccount.php 2017-10-17 22:06:48 UTC (rev 7859) @@ -212,7 +212,7 @@ $CustomerRecord = DB_fetch_array($CustomerResult); -echo '<div class="noprint toplink"> +echo '<div class="noprint centre"> <a href="', $RootPath, '/SelectCustomer.php">', _('Back to Customer Screen'), '</a> </div>'; Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2017-10-17 08:02:49 UTC (rev 7858) +++ trunk/CustomerInquiry.php 2017-10-17 22:06:48 UTC (rev 7859) @@ -154,7 +154,7 @@ $CustomerRecord['overdue2'] = 0; } -echo '<div class="toplink"> +echo '<div class="noprint center"> <a href="', $RootPath, '/SelectCustomer.php">', _('Back to Customer Screen'), '</a> </div>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-10-17 08:02:49 UTC (rev 7858) +++ trunk/doc/Change.log 2017-10-17 22:06:48 UTC (rev 7859) @@ -1,5 +1,6 @@ webERP Change Log +17/10/17 Andy Couling: Removed reference to css class 'toplink' in CustomerInquiry.php and CustomerAccount.php. 17/10/17 Phil: Fix InventoryPlanning.php and includes/PDFInventoryPlanPageHeader.inc to display categories selected and fix month headings displayed 15/10/17 Andy Couling: New Expenses/Update Expense table header in PcClaimExpensesFromTab.php 15/10/17 Andy Couling: Fixed the edit/delete cash assignment functionality in PcAssignCashToTab.php @@ -7,8 +8,7 @@ 15/10/17 Andy Couling: Fixed expense deletion dialogue box in PcClaimExpensesFromTab.php. 15/10/17 Andy Couling: Missing $Id comments added to Petty Cash scripts. 17/10/12 Exson: Fixed the bug that Narrative information will loss when add or remove controlled items lot no in StockAdjustments.php. -17/10/11 RChacon: If it is set the $_SESSION['ShowPageHelp'] parameter AND it is FALSE, hides the page help text (simplifies code using css -). +17/10/11 RChacon: If it is set the $_SESSION['ShowPageHelp'] parameter AND it is FALSE, hides the page help text (simplifies code using css). 17/10/11 RChacon: Set decimals variable for exchange rate in Currencies.php. 17/10/11 RChacon: Improve currency showing and set decimals variable for exchange rate in Payments.php. 17/10/11 Exson: Fix the indian_number_format bug in MiscFunctions.php. |
From: <afc...@us...> - 2017-11-23 22:45:07
|
Revision: 7866 http://sourceforge.net/p/web-erp/reponame/7866 Author: afcouling Date: 2017-11-23 22:45:05 +0000 (Thu, 23 Nov 2017) Log Message: ----------- Added Petty Cash receipt file upload to directory functionality. Modified Paths: -------------- trunk/PcAssignCashTabToTab.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeCash.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcReportExpense.php trunk/PcReportTab.php trunk/PcTabExpensesList.php trunk/doc/Change.log trunk/doc/Manual/ManualPettyCash.html Modified: trunk/PcAssignCashTabToTab.php =================================================================== --- trunk/PcAssignCashTabToTab.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcAssignCashTabToTab.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -29,7 +29,6 @@ unset($Days); unset($_POST['Amount']); unset($_POST['Notes']); - unset($_POST['Receipt']); } if (isset($_POST['Process'])) { @@ -117,8 +116,7 @@ amount, authorized, posted, - notes, - receipt) + notes) VALUES (NULL, '" . $_POST['SelectedTabs'] . "', '" . FormatDateForSQL($_POST['Date']) . "', @@ -127,9 +125,8 @@ '0000-00-00', '0', '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' - ), - (NULL, + ), + (NULL, '" . $SelectedTabsTo . "', '" . FormatDateForSQL($_POST['Date']) . "', 'ASSIGNCASH', @@ -137,7 +134,7 @@ '0000-00-00', '0', '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "')"; + )"; $msg = _('Assignment of cash from PC Tab ') . ' ' . $SelectedTabs . ' ' . _('to ') . $SelectedTabsTo . ' ' . _('has been created'); } @@ -148,7 +145,6 @@ unset($_POST['SelectedExpense']); unset($_POST['Amount']); unset($_POST['Notes']); - unset($_POST['Receipt']); unset($_POST['SelectedTabs']); unset($_POST['Date']); } @@ -235,7 +231,6 @@ unset($_POST['Amount']); unset($_POST['Date']); unset($_POST['Notes']); - unset($_POST['Receipt']); } if(!isset ($Days)){ @@ -259,8 +254,7 @@ amount, authorized, posted, - notes, - receipt + notes FROM pcashdetails WHERE tabcode='" . $SelectedTabs . "' AND date >= DATE_SUB(CURDATE(), INTERVAL " . $Days . " DAY) @@ -269,22 +263,28 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '"> <div> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> - <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + //Limit expenses history to X days + echo '<table class="selection"> <tr> - <th colspan="8">' . _('Detail of Tab Movements For Last') .': + <td>' . _('Detail of Tab Movements For Last') .': <input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> <input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days') . ' - <input type="submit" name="Go" value="' . _('Go') . '" /></th> + <input type="submit" name="Go" value="' . _('Go') . '" /> + </td> </tr> - <tr> - <th>' . _('Date') . '</th> - <th>' . _('Expense Code') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> - <th>' . _('Date Authorised') . '</th> - </tr>'; + </table>'; + + echo '<table class="selection"> + <tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt Attachment') . '</th> + <th>' . _('Date Authorised') . '</th> + </tr>'; $k = 0; //row colour counter @@ -309,6 +309,18 @@ $ExpenseCodeDes = $MyRow['codeexpense'] . ' - ' . $Description[0]; } + //Generate download link for expense receipt, or show text if no receipt file is found. + $ReceiptSupportedExt = array('png','jpg','jpeg','pdf','doc','docx','xls','xlsx'); //Supported file extensions + $ReceiptFileDir = $PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/expenses_receipts/' . mb_strtolower($SelectedTabs); //Receipts upload directory + $ReceiptFilePathMatched = reset(glob($ReceiptFileDir . '/' . $MyRow['counterindex'] . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE)); //Find the relevant receipt file for the expense. There should only be one (file type), but limit to one result just in case. + if (!empty($ReceiptFilePathMatched)) { //If no receipt file for the expenses is found + $ReceiptText = '<a href="' . $ReceiptFilePathMatched . '" download="ExpenseReceipt-' . mb_strtolower($SelectedTabs) . '-[' . $MyRow['date'] . ']-[' . $MyRow['counterindex'] . ']">' . _('Download attachment') . '</a>'; + } elseif ($ExpenseCodeDes == 'ASSIGNCASH') { + $ReceiptText = ''; + } else { + $ReceiptText = _('No attachment'); + } + if ($MyRow['authorized'] == '0000-00-00') { $AuthorisedDate = _('Unauthorised'); } else { @@ -321,7 +333,7 @@ <td>', $ExpenseCodeDes, '</td> <td class="number">' . locale_number_format($MyRow['amount'],$CurrDecimalPlaces) . '</td> <td>' . $MyRow['notes'] . '</td> - <td>' . $MyRow['receipt'] . '</td> + <td>' . $ReceiptText . '</td> <td>' . $AuthorisedDate . '</td> </tr>'; }else{ @@ -329,7 +341,7 @@ <td>', $ExpenseCodeDes, '</td> <td class="number">' . locale_number_format($MyRow['amount'],$CurrDecimalPlaces) . '</td> <td>' . $MyRow['notes'] . '</td> - <td>' . $MyRow['receipt'] . '</td> + <td>' . $ReceiptText . '</td> <td>' . $AuthorisedDate . '</td> </tr>'; } @@ -416,16 +428,8 @@ <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td> </tr>'; - if (!isset($_POST['Receipt'])) { - $_POST['Receipt'] = ''; - } - - echo '<tr> - <td>' . _('Receipt') . ':</td> - <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td> - </tr> - </table> - <input type="hidden" name="CurrentAmount" value="' . $SelectedTab['0']. '" /> + echo '</table>'; // close main table + echo '<input type="hidden" name="CurrentAmount" value="' . $SelectedTab['0']. '" /> <input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> <input type="hidden" name="Days" value="' . $Days . '" /> <input type="hidden" name="SelectedTabsTo" value="' . $SelectedTabsTo[1] . '" /> Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcAssignCashToTab.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -28,7 +28,6 @@ unset($Days); unset($_POST['Amount']); unset($_POST['Notes']); - unset($_POST['Receipt']); } if (isset($_POST['Process'])) { if ($SelectedTabs == '') { @@ -80,7 +79,6 @@ amount = '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' WHERE counterindex = '" . $SelectedIndex . "'"; $Msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); } elseif ($InputError != 1) { @@ -93,8 +91,7 @@ amount, authorized, posted, - notes, - receipt) + notes) VALUES (NULL, '" . $_POST['SelectedTabs'] . "', '" . FormatDateForSQL($_POST['Date']) . "', @@ -103,7 +100,6 @@ '0000-00-00', '0', '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' )"; $Msg = _('Assignment of cash to PC Tab ') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); } @@ -114,7 +110,6 @@ unset($_POST['SelectedExpense']); unset($_POST['Amount']); unset($_POST['Notes']); - unset($_POST['Receipt']); unset($_POST['SelectedTabs']); unset($_POST['Date']); } @@ -188,7 +183,6 @@ unset($_POST['Amount']); unset($_POST['Date']); unset($_POST['Notes']); - unset($_POST['Receipt']); } if (!isset($Days)) { $Days = 30; @@ -209,8 +203,7 @@ amount, authorized, posted, - notes, - receipt + notes FROM pcashdetails WHERE tabcode='" . $SelectedTabs . "' AND date >=DATE_SUB(CURDATE(), INTERVAL " . $Days . " DAY) @@ -219,20 +212,25 @@ $Result = DB_query($SQL); echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '">'; echo '<input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />'; + + //Limit expenses history to X days echo '<table class="selection"> <tr> - <th colspan="8">', _('Detail of Tab Movements For Last'), ': + <td>', _('Detail of Tab Movements For Last'), ': <input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" /> <input type="text" class="number" name="Days" value="', $Days, '" required="required" maxlength="3" size="4" />' . _('Days') . ' <input type="submit" name="Go" value="' . _('Go') . '" /></th> - </th> + </td> </tr> + </table>'; + + echo '<table class="selection"> <tr> <th>', _('Date'), '</th> <th>', _('Expense Code'), '</th> <th>', _('Amount'), '</th> <th>', _('Notes'), '</th> - <th>', _('Receipt'), '</th> + <th>', _('Receipt Attachment'), '</th> <th>', _('Date Authorised'), '</th> </tr>'; $k = 0; //row colour counter @@ -262,6 +260,18 @@ $AuthorisedDate = ConvertSQLDate($MyRow['authorized']); } + //Generate download link for expense receipt, or show text if no receipt file is found. + $ReceiptSupportedExt = array('png','jpg','jpeg','pdf','doc','docx','xls','xlsx'); //Supported file extensions + $ReceiptFileDir = $PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/expenses_receipts/' . mb_strtolower($SelectedTabs); //Receipts upload directory + $ReceiptFilePathMatched = reset(glob($ReceiptFileDir . '/' . $MyRow['counterindex'] . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE)); //Find the relevant receipt file for the expense. There should only be one (file type), but limit to one result just in case. + if (!empty($ReceiptFilePathMatched)) { //If no receipt file for the expenses is found + $ReceiptText = '<a href="' . $ReceiptFilePathMatched . '" download="ExpenseReceipt-' . mb_strtolower($SelectedTabs) . '-[' . $MyRow['date'] . ']-[' . $MyRow['counterindex'] . ']">' . _('Download attachment') . '</a>'; + } elseif ($ExpenseCodeDes == 'ASSIGNCASH') { + $ReceiptText = ''; + } else { + $ReceiptText = _('No attachment'); + } + if (($MyRow['authorized'] == '0000-00-00') and ($ExpenseCodeDes == 'ASSIGNCASH')) { // only cash assignations NOT authorized can be modified or deleted echo '<td>', ConvertSQLDate($MyRow['date']), '</td> @@ -268,7 +278,7 @@ <td>', $ExpenseCodeDes, '</td> <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td> + <td>', $ReceiptText, '</td> <td>', $AuthorisedDate, '</td> <td><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '?SelectedIndex=', $MyRow['counterindex'], '&SelectedTabs=', $SelectedTabs, '&Days=', $Days, '&edit=yes">', _('Edit'), '</a></td> <td><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '?SelectedIndex=', $MyRow['counterindex'], '&SelectedTabs=', $SelectedTabs, '&Days=', $Days, '&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this assigned cash?') . '");\'>' . _('Delete') . '</a></td> @@ -278,7 +288,7 @@ <td>', $ExpenseCodeDes, '</td> <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td> + <td>', $ReceiptText, '</td> <td>', $AuthorisedDate, '</td> </tr>'; } @@ -323,9 +333,8 @@ authorized, posted, notes, - receipt - FROM pcashdetails - WHERE counterindex='" . $SelectedIndex . "'"; + FROM pcashdetails + WHERE counterindex='" . $SelectedIndex . "'"; $Result = DB_query($SQL); $MyRow = DB_fetch_array($Result); $_POST['Date'] = ConvertSQLDate($MyRow['date']); @@ -332,7 +341,6 @@ $_POST['SelectedExpense'] = $MyRow['codeexpense']; $_POST['Amount'] = $MyRow['amount']; $_POST['Notes'] = $MyRow['notes']; - $_POST['Receipt'] = $MyRow['receipt']; echo '<input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" />'; echo '<input type="hidden" name="SelectedIndex" value="', $SelectedIndex, '" />'; echo '<input type="hidden" name="CurrentAmount" value="', $Amount[0], '" />'; @@ -372,13 +380,6 @@ <td>', _('Notes'), ':</td> <td><input type="text" name="Notes" size="50" maxlength="49" value="', $_POST['Notes'], '" /></td> </tr>'; - if (!isset($_POST['Receipt'])) { - $_POST['Receipt'] = ''; - } - echo '<tr> - <td>' . _('Receipt') . ':</td> - <td><input type="text" name="Receipt" size="50" maxlength="49" value="', $_POST['Receipt'], '" /></td> - </tr>'; echo '</table>'; // close main table echo '<input type="hidden" name="CurrentAmount" value="', $Amount['0'], '" />'; echo '<input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" />'; Modified: trunk/PcAuthorizeCash.php =================================================================== --- trunk/PcAuthorizeCash.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcAuthorizeCash.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -55,14 +55,17 @@ if (!isset($Days)) { $Days = 30; } - echo '<input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" />'; + + //Limit expenses history to X days echo '<table class="selection"> <tr> - <th colspan="6">', _('Detail of Tab Movements For Last '), ': + <td>', _('Detail of Tab Movements For Last '), ': + <input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" /> <input type="text" class="number" name="Days" value="', $Days, '" maxlength="3" size="4" />', _('Days'), ' <input type="submit" name="Go" value="', _('Go'), '" /> - </th> - </tr>'; + </td> + </tr> + </table>'; $SQL = "SELECT pcashdetails.counterindex, pcashdetails.tabcode, pcashdetails.date, @@ -71,7 +74,6 @@ pcashdetails.authorized, pcashdetails.posted, pcashdetails.notes, - pcashdetails.receipt, pctabs.glaccountassignment, pctabs.glaccountpcash, pctabs.usercode, @@ -86,14 +88,14 @@ AND pcashdetails.codeexpense='ASSIGNCASH' ORDER BY pcashdetails.date, pcashdetails.counterindex ASC"; $Result = DB_query($SQL); - echo '<tr> - <th>', _('Date'), '</th> - <th>', _('Expense Code'), '</th> - <th>', _('Amount'), '</th> - <th>', _('Notes'), '</th> - <th>', _('Receipt'), '</th> - <th>', _('Date Authorised'), '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>', _('Date'), '</th> + <th>', _('Expense Code'), '</th> + <th>', _('Amount'), '</th> + <th>', _('Notes'), '</th> + <th>', _('Date Authorised'), '</th> + </tr>'; $k = 0; //row colour counter $CurrDecimalPlaces = 2; while ($MyRow = DB_fetch_array($Result)) { @@ -127,7 +129,7 @@ //get typeno $typeno = GetNextTransNo($type,$db); //build narrative - $Narrative = _('PettyCash') . ' - ' . $MyRow['tabcode'] . ' - ' . $MyRow['codeexpense'] . ' - ' . DB_escape_string($MyRow['notes']) . ' - ' . $MyRow['receipt']; + $Narrative = _('PettyCash') . ' - ' . $MyRow['tabcode'] . ' - ' . $MyRow['codeexpense'] . ' - ' . DB_escape_string($MyRow['notes']); //insert to gltrans DB_Txn_Begin(); $SQLFrom = "INSERT INTO `gltrans` (`counterindex`, @@ -229,19 +231,10 @@ $k = 1; } - /* - if ($MyRow['posted'] == 0) { - $Posted = _('No'); - } else { - $Posted = _('Yes'); - } - */ - echo '<td>', ConvertSQLDate($MyRow['date']), '</td> <td>', $MyRow['codeexpense'], '</td> <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> - <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td>'; + <td>', $MyRow['notes'], '</td>'; if (isset($_POST[$MyRow['counterindex']])) { echo '<td>' . ConvertSQLDate(Date('Y-m-d')); } else { Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcAuthorizeExpenses.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -55,14 +55,17 @@ if (!isset($Days)) { $Days = 30; } - echo '<input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" />'; + + //Limit expenses history to X days echo '<table class="selection"> <tr> - <th colspan="9">', _('Detail of Tab Movements For Last '), ': + <td>', _('Detail of Tab Movements For Last '), ': + <input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" /> <input type="text" class="number" name="Days" value="', $Days, '" maxlength="3" size="4" />', _('Days'), ' <input type="submit" name="Go" value="', _('Go'), '" /> - </th> - </tr>'; + </td> + </tr> + </table>'; $SQL = "SELECT pcashdetails.counterindex, pcashdetails.tabcode, pcashdetails.tag, @@ -72,7 +75,6 @@ pcashdetails.authorized, pcashdetails.posted, pcashdetails.notes, - pcashdetails.receipt, pctabs.glaccountassignment, pctabs.glaccountpcash, pctabs.usercode, @@ -87,17 +89,18 @@ AND pcashdetails.codeexpense<>'ASSIGNCASH' ORDER BY pcashdetails.date, pcashdetails.counterindex ASC"; $Result = DB_query($SQL); - echo '<tr> - <th>', _('Date of Expense'), '</th> - <th>', _('Expense Code'), '</th> - <th>', _('Gross Amount'), '</th> - <th>', _('Tax'), '</th> - <th>', _('Tax Group'), '</th> - <th>', _('Tag'), '</th> - <th>', _('Notes'), '</th> - <th>', _('Receipt'), '</th> - <th>', _('Date Authorised'), '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>', _('Date of Expense'), '</th> + <th>', _('Expense Code'), '</th> + <th>', _('Gross Amount'), '</th> + <th>', _('Tax'), '</th> + <th>', _('Tax Group'), '</th> + <th>', _('Tag'), '</th> + <th>', _('Notes'), '</th> + <th>', _('Receipt Attachment'), '</th> + <th>', _('Date Authorised'), '</th> + </tr>'; $k = 0; //row colour counter while ($MyRow = DB_fetch_array($Result)) { $CurrDecimalPlaces = $MyRow['decimalplaces']; @@ -120,13 +123,13 @@ $NetAmount = ($MyRow['amount'] - $TaxTotalRow['totaltax']) / $MyRow['rate']; } if ($MyRow['codeexpense'] == 'ASSIGNCASH') { - $type = 2; + $Type = 2; $AccountFrom = $MyRow['glaccountassignment']; $AccountTo = $MyRow['glaccountpcash']; $TagTo = 0; $TagDescription = '0 - ' . _('None'); } else { - $type = 1; + $Type = 1; $NetAmount = -$NetAmount; $AccountFrom = $MyRow['glaccountpcash']; $SQLAccExp = "SELECT glaccount, @@ -141,9 +144,9 @@ } if (isset($_POST['Submit']) and $_POST['Submit'] == _('Update') and isset($_POST[$MyRow['counterindex']])) { //get typeno - $typeno = GetNextTransNo($type,$db); + $TypeNo = GetNextTransNo($Type,$db); //build narrative - $Narrative = _('PettyCash') . ' - ' . $MyRow['tabcode'] . ' - ' . $MyRow['codeexpense'] . ' - ' . DB_escape_string($MyRow['notes']) . ' - ' . $MyRow['receipt']; + $Narrative = _('PettyCash') . ' - ' . $MyRow['tabcode'] . ' - ' . $MyRow['codeexpense'] . ' - ' . DB_escape_string($MyRow['notes']); //insert to gltrans DB_Txn_Begin(); $SQLFrom = "INSERT INTO `gltrans` (`counterindex`, @@ -159,8 +162,8 @@ `jobref`, `tag`) VALUES (NULL, - '" . $type . "', - '" . $typeno . "', + '" . $Type . "', + '" . $TypeNo . "', 0, '" . $MyRow['date'] . "', '" . $PeriodNo . "', @@ -184,8 +187,8 @@ `jobref`, `tag`) VALUES (NULL, - '" . $type . "', - '" . $typeno . "', + '" . $Type . "', + '" . $TypeNo . "', 0, '" . $MyRow['date'] . "', '" . $PeriodNo . "', @@ -222,8 +225,8 @@ `jobref`, `tag`) VALUES (NULL, - '" . $type . "', - '" . $typeno . "', + '" . $Type . "', + '" . $TypeNo . "', 0, '" . $MyRow['date'] . "', '" . $PeriodNo . "', @@ -283,14 +286,6 @@ $k = 1; } - /* - if ($MyRow['posted'] == 0) { - $Posted = _('No'); - } else { - $Posted = _('Yes'); - } - */ - $SQLDes = "SELECT description FROM pcexpenses WHERE codeexpense='" . $MyRow['codeexpense'] . "'"; @@ -320,7 +315,19 @@ $TaxesDescription .= $MyTaxRow['description'] . '<br />'; $TaxesTaxAmount .= locale_number_format($MyTaxRow['amount'], $CurrDecimalPlaces) . '<br />'; } - + + //Generate download link for expense receipt, or show text if no receipt file is found. + $ReceiptSupportedExt = array('png','jpg','jpeg','pdf','doc','docx','xls','xlsx'); //Supported file extensions + $ReceiptFileDir = $PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/expenses_receipts/' . mb_strtolower($SelectedTabs); //Receipts upload directory + $ReceiptFilePathMatched = reset(glob($ReceiptFileDir . '/' . $MyRow['counterindex'] . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE)); //Find the relevant receipt file for the expense. There should only be one (file type), but limit to one result just in case. + if (!empty($ReceiptFilePathMatched)) { //If no receipt file for the expenses is found + $ReceiptText = '<a href="' . $ReceiptFilePathMatched . '" download="ExpenseReceipt-' . mb_strtolower($SelectedTabs) . '-[' . $MyRow['date'] . ']-[' . $MyRow['counterindex'] . ']">' . _('Download attachment') . '</a>'; + } elseif ($ExpenseCodeDes == 'ASSIGNCASH') { + $ReceiptText = ''; + } else { + $ReceiptText = _('No attachment'); + } + echo '<td>', ConvertSQLDate($MyRow['date']), '</td> <td>', $ExpenseCodeDes, '</td> <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> @@ -328,7 +335,7 @@ <td>', $TaxesDescription, '</td> <td>', $TagDescription, '</td> <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td>'; + <td>', $ReceiptText, '</td>'; if (isset($_POST[$MyRow['counterindex']])) { echo '<td>' . ConvertSQLDate(Date('Y-m-d')); } else { Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcClaimExpensesFromTab.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -28,7 +28,7 @@ unset($Days); unset($_POST['Amount']); unset($_POST['Notes']); - unset($_POST['Receipt']); + unset($_FILES['Receipt']); } if (isset($_POST['Process'])) { if ($_POST['SelectedTabs'] == '') { @@ -42,6 +42,9 @@ $Days = 30; } } +//Define receipt attachment upload functions and variables which are used in various places within script +$ReceiptSupportedExt = array('png','jpg','jpeg','pdf','doc','docx','xls','xlsx'); //Supported file extensions +$ReceiptFileDir = $PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/expenses_receipts/' . mb_strtolower($SelectedTabs); //Receipts upload directory if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test $InputError = 0; @@ -59,14 +62,13 @@ $InputError = 1; prnMsg(_('The date input is not in the correct format'), 'error'); } - if (isset($SelectedIndex) and $InputError != 1) { + if (isset($SelectedIndex) and $InputError != 1) { //Edit $SQL = "UPDATE pcashdetails SET date = '" . FormatDateForSQL($_POST['Date']) . "', tag = '" . $_POST['Tag'] . "', codeexpense = '" . $_POST['SelectedExpense'] . "', amount = '" . -filter_number_format($_POST['Amount']) . "', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + notes = '" . $_POST['Notes'] . "' WHERE counterindex = '" . $SelectedIndex . "'"; $Msg = _('The expense claim on tab') . ' ' . $SelectedTabs . ' ' . _('has been updated'); $Result = DB_query($SQL); @@ -85,6 +87,59 @@ $Result = DB_query($SQL); } } + if (isset($_FILES['Receipt']) and $_FILES['Receipt']['name'] != '') { + $UploadOriginalName = $_FILES['Receipt']['name']; + $UploadTempName = $_FILES['Receipt']['tmp_name']; + $UploadSize = $_FILES['Receipt']['size']; + $UploadType = $_FILES['Receipt']['type']; + $UploadError = $_FILES['Receipt']['error']; + $UploadTheFile = 'Yes'; //Assume all is well to start off with, but check for the worst + $ReceiptSupportedMime = array('image/png','image/jpeg','application/pdf','application/msword','application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/vnd.ms-excel','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); //list of support mime types, corresponding to the list of support file extensions in $ReceiptSupportedExt + if ($UploadSize > ($_SESSION['MaxImageSize'] * 1024)) { //Server-side file size check. This will usually be caught by $UploadError == 2 (MAX_FILE_SIZE), but we must not trust the user. + prnMsg(_('The uploaded file exceeds the maximum file size of') . ' ' . $_SESSION['MaxImageSize'] . 'KB', 'warn'); + $UploadTheFile = 'No'; + } elseif (!in_array($UploadType, $ReceiptSupportedMime) and $UploadError != 2) { //File type check. If $UploadError == 2, then $UploadType will be empty. + prnMsg(_('File type not accepted. Only the following file types can be attached') . ': ' . implode(', ', $ReceiptSupportedExt), 'warn'); + $UploadTheFile = 'No'; + } elseif ($UploadError == 1 ) { //upload_max_filesize error check + prnMsg(_('The uploaded file exceeds the upload_max_filesize directive in php.ini. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 2 ) { //Client-side file size error check (MAX_FILE_SIZE) + prnMsg(_('The uploaded file exceeds the maximum file size of') . ' ' . $_SESSION['MaxImageSize'] . 'KB', 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 3 ) { //Partial upload error check + prnMsg( _('The uploaded file was only partially uploaded. Please try again.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 4 ) { //No file uploaded error check + prnMsg( _('No file was uploaded'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 5 ) { //Undefined error check + prnMsg( _('Undefined error'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 6 ) { //Temp directory error check + prnMsg( _('A necessary temporary folder is missing. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 7 ) { //Disk write failure error check + prnMsg( _('Cannot write file to disk. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 8 ) { //Upload stopped by PHP extension error check + prnMsg( _('The file upload was stopped by a PHP extension. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } + if ($UploadTheFile == 'Yes') { //Passed all the above validation + if (!file_exists($ReceiptFileDir)) { //Create the receipts directory if it doesn't already exist + mkdir($ReceiptFileDir, 0775, true); + } + $ReceiptFileExt = pathinfo($UploadOriginalName, PATHINFO_EXTENSION); //Grab the file extension of the uploaded file + $ReceiptFileName = $SelectedIndex . '.' . $ReceiptFileExt; //Rename the uploaded file with the expenses index number + $ReceiptFilePath = $ReceiptFileDir . '/' . $ReceiptFileName; + $ReceiptExistingFiles = glob($ReceiptFileDir . '/' . $SelectedIndex . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE); //Find all existing receipt files for the expense, in case more than 1 file type is currently in the receipts directory + foreach($ReceiptExistingFiles as $ReceiptExistingFile) { // Overwrite existing files, and delete all other file types. + unlink($ReceiptExistingFile); + }; + move_uploaded_file($UploadTempName, $ReceiptFilePath); //Move the uploaded file from the temp directory to the receipts directory. + } + } prnMsg($Msg, 'success'); } elseif ($InputError != 1) { // First check the type is not being duplicated @@ -97,8 +152,7 @@ amount, authorized, posted, - notes, - receipt) + notes) VALUES (NULL, '" . $_POST['SelectedTabs'] . "', '" . $_POST['Tag'] . "', @@ -107,12 +161,11 @@ '" . -filter_number_format($_POST['Amount']) . "', 0, 0, - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . $_POST['Notes'] . "' )"; $Msg = _('The expense claim on tab') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); $Result = DB_query($SQL); - $PcCashDetail = DB_Last_Insert_ID($db, 'pcashdetails', 'counterindex'); + $SelectedIndex = DB_Last_Insert_ID($db, 'pcashdetails', 'counterindex'); foreach ($_POST as $Index => $Value) { if (substr($Index, 0, 5) == 'index') { $Index = $Value; @@ -127,7 +180,7 @@ amount ) VALUES ( NULL, - '" . $PcCashDetail . "', + '" . $SelectedIndex . "', '" . $_POST['CalculationOrder' . $Index] . "', '" . $_POST['Description' . $Index] . "', '" . $_POST['TaxAuthority' . $Index] . "', @@ -139,6 +192,59 @@ $Result = DB_query($SQL); } } + if (isset($_FILES['Receipt']) and $_FILES['Receipt']['name'] != '') { + $UploadOriginalName = $_FILES['Receipt']['name']; + $UploadTempName = $_FILES['Receipt']['tmp_name']; + $UploadSize = $_FILES['Receipt']['size']; + $UploadType = $_FILES['Receipt']['type']; + $UploadError = $_FILES['Receipt']['error']; + $UploadTheFile = 'Yes'; //Assume all is well to start off with, but check for the worst + $ReceiptSupportedMime = array('image/png','image/jpeg','application/pdf','application/msword','application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/vnd.ms-excel','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); //list of support mime types, corresponding to the list of support file extensions in $ReceiptSupportedExt + if ($UploadSize > ($_SESSION['MaxImageSize'] * 1024)) { //Server-side file size check. This will usually be caught by $UploadError == 2 (MAX_FILE_SIZE), but we must not trust the user. + prnMsg(_('The uploaded file exceeds the maximum file size of') . ' ' . $_SESSION['MaxImageSize'] . 'KB', 'warn'); + $UploadTheFile = 'No'; + } elseif (!in_array($UploadType, $ReceiptSupportedMime) and $UploadError != 2) { //File type check. If $UploadError == 2, then $UploadType will be empty. + prnMsg(_('File type not accepted. Only the following file types can be attached') . ': ' . implode(', ', $ReceiptSupportedExt), 'warn'); + $UploadTheFile = 'No'; + } elseif ($UploadError == 1 ) { //upload_max_filesize error check + prnMsg(_('The uploaded file exceeds the upload_max_filesize directive in php.ini. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 2 ) { //Client-side file size error check (MAX_FILE_SIZE) + prnMsg(_('The uploaded file exceeds the maximum file size of') . ' ' . $_SESSION['MaxImageSize'] . 'KB', 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 3 ) { //Partial upload error check + prnMsg( _('The uploaded file was only partially uploaded. Please try again.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 4 ) { //No file uploaded error check + prnMsg( _('No file was uploaded'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 5 ) { //Undefined error check + prnMsg( _('Undefined error'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 6 ) { //Temp directory error check + prnMsg( _('A necessary temporary folder is missing. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 7 ) { //Disk write failure error check + prnMsg( _('Cannot write file to disk. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } elseif ($UploadError == 8 ) { //Upload stopped by PHP extension error check + prnMsg( _('The file upload was stopped by a PHP extension. Please contact your system administrator.'), 'warn'); + $UploadTheFile ='No'; + } + if ($UploadTheFile == 'Yes') { //Passed all the above validation + if (!file_exists($ReceiptFileDir)) { //Create the receipts directory if it doesn't already exist + mkdir($ReceiptFileDir, 0775, true); + } + $ReceiptFileExt = pathinfo($UploadOriginalName, PATHINFO_EXTENSION); //Grab the file extension of the uploaded file + $ReceiptFileName = $SelectedIndex . '.' . $ReceiptFileExt; //Rename the uploaded file with the expenses index number + $ReceiptFilePath = $ReceiptFileDir . '/' . $ReceiptFileName; + $ReceiptExistingFiles = glob($ReceiptFileDir . '/' . $SelectedIndex . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE); //Find all existing receipt files for the expense, in case more than 1 file type is currently in the receipts directory + foreach($ReceiptExistingFiles as $ReceiptExistingFile) { // Overwrite existing files, and delete all other file types. + unlink($ReceiptExistingFile); + }; + move_uploaded_file($UploadTempName, $ReceiptFilePath); //Move the uploaded file from the temp directory to the receipts directory. + } + } prnMsg($Msg, 'success'); } if ($InputError != 1) { @@ -147,9 +253,9 @@ unset($_POST['Tag']); unset($_POST['Date']); unset($_POST['Notes']); - unset($_POST['Receipt']); + unset($_FILES['Receipt']); } -} elseif (isset($_GET['Delete'])) { +} elseif (isset($_GET['delete'])) { $SQL = "DELETE FROM pcashdetails, pcashdetailtaxes USING pcashdetails INNER JOIN pcashdetailtaxes @@ -158,7 +264,12 @@ $ErrMsg = _('Petty Cash Expense record could not be deleted because'); $Result = DB_query($SQL, $ErrMsg); prnMsg(_('Petty Cash expense record') . ' ' . $SelectedTabs . ' ' . _('has been deleted'), 'success'); - unset($_GET['Delete']); + //Delete receipt attachments. There should be only one per expenses, but check for all possible file extensions anyway. + $ReceiptExistingFiles = glob($ReceiptFileDir . '/' . $SelectedIndex . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE); //Find all existing receipt files for the expense, in case more than 1 file type is currently in the receipts directory + foreach($ReceiptExistingFiles as $ReceiptExistingFile) { + unlink($ReceiptExistingFile); + }; + unset($_GET['delete']); } //end of get delete if (!isset($SelectedTabs)) { /* It could still be the first time the page has been run and a record has been selected for modification - SelectedTabs will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters @@ -168,7 +279,7 @@ echo '<p class="page_title_text"> <img src="', $RootPath, '/css/', $_SESSION['Theme'], '/images/money_add.png" title="', _('Payment Entry'), '" alt="" />', ' ', $Title, ' </p>'; - echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '">'; + echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" enctype="multipart/form-data">'; echo '<input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />'; echo '<table class="selection"> <tr> @@ -214,7 +325,7 @@ $Result = DB_query($SQLDecimalPlaces); $MyRow = DB_fetch_array($Result); $CurrDecimalPlaces = $MyRow['decimalplaces']; - echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '">'; + echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" enctype="multipart/form-data">'; echo '<input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />'; echo '<br /><table class="selection">'; echo '<tr> @@ -222,20 +333,23 @@ <td>' . $SelectedTabs . '</td> </tr>'; echo '</table>'; + + //Limit expenses history to X days echo '<table class="selection"> <tr> - <th colspan="9">', _('Detail of Tab Movements For Last '), ': + <td>', _('Detail of Tab Movements For Last '), ': <input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" /> <input type="text" class="number" name="Days" value="', $Days, '" required="required" maxlength="3" size="4" /> ', _('Days'), ' <input type="submit" name="Go" value="', _('Go'), '" /> - </th> - </tr>'; + </td> + </tr> + </table>'; if (isset($_POST['Cancel'])) { unset($_POST['SelectedExpense']); unset($_POST['Amount']); unset($_POST['Date']); unset($_POST['Notes']); - unset($_POST['Receipt']); + unset($_FILES['Receipt']); } $SQL = "SELECT counterindex, tabcode, @@ -245,8 +359,7 @@ amount, authorized, posted, - notes, - receipt + notes FROM pcashdetails WHERE tabcode='" . $SelectedTabs . "' AND date >=DATE_SUB(CURDATE(), INTERVAL " . $Days . " DAY) @@ -253,17 +366,18 @@ ORDER BY date, counterindex ASC"; $Result = DB_query($SQL); - echo '<tr> - <th>', _('Date of Expense'), '</th> - <th>', _('Expense Code'), '</th> - <th>', _('Gross Amount'), '</th> - <th>', _('Tax'), '</th> - <th>', _('Tax Group'), '</th> - <th>', _('Tag'), '</th> - <th>', _('Notes'), '</th> - <th>', _('Receipt'), '</th> - <th>', _('Date Authorised'), '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>', _('Date of Expense'), '</th> + <th>', _('Expense Code'), '</th> + <th>', _('Gross Amount'), '</th> + <th>', _('Tax'), '</th> + <th>', _('Tax Group'), '</th> + <th>', _('Tag'), '</th> + <th>', _('Notes'), '</th> + <th>', _('Receipt Attachment'), '</th> + <th>', _('Date Authorised'), '</th> + </tr>'; $k = 0; //row colour counter while ($MyRow = DB_fetch_array($Result)) { if ($k == 1) { @@ -291,6 +405,16 @@ $AuthorisedDate = ConvertSQLDate($MyRow['authorized']); } + //Generate download link for expense receipt, or show text if no receipt file is found. + $ReceiptFilePathMatched = reset(glob($ReceiptFileDir . '/' . $MyRow['counterindex'] . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE)); //Find the relevant receipt file for the expense. There should only be one (file type), but limit to one result just in case. + if (!empty($ReceiptFilePathMatched)) { //If no receipt file for the expenses is found + $ReceiptText = '<a href="' . $ReceiptFilePathMatched . '" download="ExpenseReceipt-' . mb_strtolower($SelectedTabs) . '-[' . $MyRow['date'] . ']-[' . $MyRow['counterindex'] . ']">' . _('Download attachment') . '</a>'; + } elseif ($ExpenseCodeDes == 'ASSIGNCASH') { + $ReceiptText = ''; + } else { + $ReceiptText = _('No attachment'); + } + $TagSQL = "SELECT tagdescription FROM tags WHERE tagref='" . $MyRow['tag'] . "'"; $TagResult = DB_query($TagSQL); $TagRow = DB_fetch_array($TagResult); @@ -298,8 +422,12 @@ $TagRow['tagdescription'] = _('None'); } $TagTo = $MyRow['tag']; - $TagDescription = $TagTo . ' - ' . $TagRow['tagdescription']; - + if ($ExpenseCodeDes == 'ASSIGNCASH') { + $TagDescription = ''; + } else { + $TagDescription = $TagTo . ' - ' . $TagRow['tagdescription']; + } + $TaxesDescription = ''; $TaxesTaxAmount = ''; $TaxSQL = "SELECT counterindex, @@ -318,32 +446,32 @@ $TaxesDescription .= $MyTaxRow['description'] . '<br />'; $TaxesTaxAmount .= locale_number_format($MyTaxRow['amount'], $CurrDecimalPlaces) . '<br />'; } - if (($MyRow['authorized'] == '0000-00-00') and ($ExpenseCodeDes != 'ASSIGNCASH')) { - // only movements NOT authorised can be modified or deleted - echo '<td>', ConvertSQLDate($MyRow['date']), '</td> - <td>', $ExpenseCodeDes, '</td> - <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> - <td class="number">', $TaxesTaxAmount, '</td> - <td>', $TaxesDescription, '</td> - <td>', $TagDescription, '</td> - <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td> - <td>', $AuthorisedDate, '</td> - <td><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedIndex=', $MyRow['counterindex'], '&SelectedTabs=' . $SelectedTabs . '&Days=' . $Days . '&edit=yes">' . _('Edit') . '</a></td> - <td><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedIndex=', $MyRow['counterindex'], '&SelectedTabs=' . $SelectedTabs . '&Days=' . $Days . '&Delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this expense?') . '");\'>' . _('Delete') . '</a></td> - </tr>'; - } else { - echo '<td>', ConvertSQLDate($MyRow['date']), '</td> - <td>', $ExpenseCodeDes, '</td> - <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> - <td class="number">', $TaxesTaxAmount, '</td> - <td>', $TaxesDescription, '</td> - <td>', $MyRow['tag'], ' - ', $TagRow['tagdescription'], '</td> - <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td> - <td>', $AuthorisedDate, '</td> - </tr>'; - } + if (($MyRow['authorized'] == '0000-00-00') and ($ExpenseCodeDes != 'ASSIGNCASH')) { + // only movements NOT authorised can be modified or deleted + echo '<td>', ConvertSQLDate($MyRow['date']), '</td> + <td>', $ExpenseCodeDes, '</td> + <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> + <td class="number">', $TaxesTaxAmount, '</td> + <td>', $TaxesDescription, '</td> + <td>', $TagDescription, '</td> + <td>', $MyRow['notes'], '</td> + <td>', $ReceiptText, '</td> + <td>', $AuthorisedDate, '</td> + <td><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedIndex=', $MyRow['counterindex'], '&SelectedTabs=' . $SelectedTabs . '&Days=' . $Days . '&edit=yes">' . _('Edit') . '</a></td> + <td><a href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedIndex=', $MyRow['counterindex'], '&SelectedTabs=' . $SelectedTabs . '&Days=' . $Days . '&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this expense?') . '");\'>' . _('Delete') . '</a></td> + </tr>'; + } else { + echo '<td>', ConvertSQLDate($MyRow['date']), '</td> + <td>', $ExpenseCodeDes, '</td> + <td class="number">', locale_number_format($MyRow['amount'], $CurrDecimalPlaces), '</td> + <td class="number">', $TaxesTaxAmount, '</td> + <td>', $TaxesDescription, '</td> + <td>', $TagDescription, '</td> + <td>', $MyRow['notes'], '</td> + <td>', $ReceiptText, '</td> + <td>', $AuthorisedDate, '</td> + </tr>'; + } } //END WHILE LIST LOOP $SQLAmount = "SELECT sum(amount) @@ -361,8 +489,8 @@ echo '</table>'; echo '</form>'; } - if (!isset($_GET['Delete'])) { - echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '">'; + if (!isset($_GET['delete'])) { + echo '<form method="post" action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" enctype="multipart/form-data">'; echo '<input type="hidden" name="FormID" value="', $_SESSION['FormID'], '" />'; if (isset($_GET['edit'])) { $SQL = "SELECT counterindex, @@ -373,10 +501,9 @@ amount, authorized, posted, - notes, - receipt - FROM pcashdetails - WHERE counterindex='" . $SelectedIndex . "'"; + notes + FROM pcashdetails + WHERE counterindex='" . $SelectedIndex . "'"; $Result = DB_query($SQL); $MyRow = DB_fetch_array($Result); $_POST['Date'] = ConvertSQLDate($MyRow['date']); @@ -384,7 +511,6 @@ $_POST['Amount'] = -$MyRow['amount']; $_POST['Notes'] = $MyRow['notes']; $_POST['Tag'] = $MyRow['tag']; - $_POST['Receipt'] = $MyRow['receipt']; echo '<input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" />'; echo '<input type="hidden" name="SelectedIndex" value="', $SelectedIndex, '" />'; echo '<input type="hidden" name="Days" value="', $Days, '" />'; @@ -409,7 +535,7 @@ </td> </tr> <tr> - <td>', _('Code of Expense'), ':</td> + <td>', _('Expense Code'), ':</td> <td> <select required="required" name="SelectedExpense">'; DB_free_result($Result); @@ -434,30 +560,6 @@ echo '</select> </td> </tr>'; - //Select the tag - echo '<tr> - <td>', _('Tag'), ':</td> - <td><select name="Tag">'; - $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; - $Result = DB_query($SQL); - if (!isset($_POST['Tag'])) { - $_POST['Tag'] = $DefaultTag; - } - echo '<option value="0">0 - ', _('None'), '</option>'; - while ($MyRow = DB_fetch_array($Result)) { - if ($_POST['Tag'] == $MyRow['tagref']) { - echo '<option selected="selected" value="', $MyRow['tagref'], '">', $MyRow['tagref'], ' - ', $MyRow['tagdescription'], '</option>'; - } else { - echo '<option value="', $MyRow['tagref'], '">', $MyRow['tagref'], ' - ', $MyRow['tagdescription'], '</option>'; - } - } - echo '</select> - </td> - </tr>'; - // End select tag if (!isset($_POST['Amount'])) { $_POST['Amount'] = 0; } @@ -522,12 +624,50 @@ echo '<input type="hidden" name="TaxOnTax', $i, '" value="', $MyTaxRow['taxontax'], '" />'; echo '<input type="hidden" name="TaxRate', $i, '" value="', $MyTaxRow['taxrate'], '" />'; echo '<tr> - <td>', $MyTaxRow['description'], ' - ', ($MyTaxRow['taxrate'] * 100), '%</td> + <td>', $MyTaxRow['description'], ' - ', ($MyTaxRow['taxrate'] * 100), '%:</td> <td><input type="text" class="number" size="12" name="TaxAmount', $i, '" value="0" /></td> </tr>'; ++$i; } } + + //Select the tag + echo '<tr> + <td>', _('Tag'), ':</td> + <td><select name="Tag">'; + $SQL = "SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; + $Result = DB_query($SQL); + if (!isset($_POST['Tag'])) { + $_POST['Tag'] = $DefaultTag; + } + echo '<option value="0">0 - ', _('None'), '</option>'; + while ($MyRow = DB_fetch_array($Result)) { + if ($_POST['Tag'] == $MyRow['tagref']) { + echo '<option selected="selected" value="', $MyRow['tagref'], '">', $MyRow['tagref'], ' - ', $MyRow['tagdescription'], '</option>'; + } else { + echo '<option value="', $MyRow['tagref'], '">', $MyRow['tagref'], ' - ', $MyRow['tagdescription'], '</option>'; + } + } + echo '</select> + </td> + </tr>'; + // End select tag + + //For the accept attribute of the file element, prefix dots to the front of each supported file extension. + $ReceiptSupportedExtDotPrefix = array_map(function($ReceiptSupportedExt) { + return '.' . $ReceiptSupportedExt; + }, $ReceiptSupportedExt); + echo '<tr> + <td>', _('Attach Receipt'), ':</td> + <td> + <input type="hidden" name="MAX_FILE_SIZE" value="' . $_SESSION['MaxImageSize'] * 1024 . '" /> + <input type="file" name="Receipt" id="Receipt" accept="' . implode(',', $ReceiptSupportedExtDotPrefix) . '" title="', _('Accepted file types'), ': ', implode(', ', $ReceiptSupportedExt), '" /> + </td> + </tr>'; + if (!isset($_POST['Notes'])) { $_POST['Notes'] = ''; } @@ -537,13 +677,7 @@ <input type="text" name="Notes" size="50" maxlength="49" value="', $_POST['Notes'], '" /> </td> </tr>'; - if (!isset($_POST['Receipt'])) { - $_POST['Receipt'] = ''; - } - echo '<tr> - <td>', _('Receipt'), ':</td> - <td><input type="text" name="Receipt" size="50" maxlength="49" value="', $_POST['Receipt'], '" /></td> - </tr>'; + echo '</table>'; // close main table echo '<input type="hidden" name="SelectedTabs" value="', $SelectedTabs, '" />'; echo '<input type="hidden" name="Days" value="', $Days, '" />'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcExpenses.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -36,16 +36,16 @@ prnMsg(_('The Expense type code cannot be an empty string or spaces'), 'error'); } elseif (mb_strlen($_POST['CodeExpense']) > 20) { $InputError = 1; - prnMsg(_('The Expense code must be twenty characters or less long'), 'error'); + prnMsg(_('The expense code must be twenty characters or less long'), 'error'); } elseif (ContainsIllegalCharacters($_POST['CodeExpense'])) { $InputError = 1; - prnMsg(_('The Expense code cannot contain any of the following characters " \' - &'), 'error'); + prnMsg(_('The expense code cannot contain any of the following characters ') . '" \' - &', 'error'); } elseif (ContainsIllegalCharacters($_POST['Description'])) { $InputError = 1; - prnMsg(_('The Expense description cannot contain any of the following characters " \' - &'), 'error'); + prnMsg(_('The expense description cannot contain any of the following characters ') . '" \' - &', 'error'); } elseif (mb_strlen($_POST['Description']) > 50) { $InputError = 1; - prnMsg(_('The tab code must be Fifty characters or less long'), 'error'); + prnMsg(_('The tab code must be fifty characters or less long'), 'error'); } elseif (mb_strlen($_POST['Description']) == 0) { $InputError = 1; echo prnMsg(_('The tab code description must be entered'), 'error'); @@ -139,7 +139,7 @@ $Result = DB_query($SQL); echo '<table class="selection"> <tr> - <th>', _('Code Of Expense'), '</th> + <th>', _('Expense Code'), '</th> <th>', _('Description'), '</th> <th>', _('Account Code'), '</th> <th>', _('Account Description'), '</th> @@ -213,7 +213,7 @@ // We dont allow the user to change an existing type code echo '<table class="selection"> <tr> - <td>', _('Code Of Expense'), ':</td> + <td>', _('Expense Code'), ':</td> <td>', $_POST['CodeExpense'], '</td> </tr>'; } else { @@ -220,7 +220,7 @@ // This is a new type so the user may volunteer a type code echo '<table class="selection"> <tr> - <td>', _('Code Of Expense'), ':</td> + <td>', _('Expense Code'), ':</td> <td><input type="text" name="CodeExpense" autofocus="autofocus" required="required" maxlength="20" /></td> </tr>'; } Modified: trunk/PcReportExpense.php =================================================================== --- trunk/PcReportExpense.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcReportExpense.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -3,6 +3,7 @@ include ('includes/session.php'); $Title = _('Petty Cash Expense Management Report'); +/* webERP manual links before header.php */ $ViewTopic = 'PettyCash'; $BookMark = 'PcReportExpense'; @@ -115,7 +116,6 @@ pcashdetails.authorized, pcashdetails.posted, pcashdetails.notes, - pcashdetails.receipt, pctabs.currency, currencies.decimalplaces FROM pcashdetails, pctabs, currencies @@ -139,11 +139,10 @@ <th>' . _('Tab') . '</th> <th>' . _('Currency') . '</th> <th>' . _('Gross Amount') . '</th> - <th>', _('Total Tax'), '</th> + <th>', _('Tax'), '</th> <th>', _('Tax Group'), '</th> <th>', _('Tag'), '</th> <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> <th>' . _('Date Authorised') . '</th> </tr>'; @@ -186,7 +185,7 @@ $TagDescription = $TagTo . ' - ' . $TagRow['tagdescription']; if ($MyRow['authorized'] == '0000-00-00') { - $AuthorisedDate = _('Unauthorised'); + $AuthorisedDate = _('Unauthorised'); } else { $AuthorisedDate = ConvertSQLDate($MyRow['authorized']); } @@ -207,7 +206,6 @@ <td>', $TaxesDescription, '</td> <td>', $TagDescription, '</td> <td>', $MyRow['notes'], '</td> - <td>', $MyRow['receipt'], '</td> <td>', $AuthorisedDate, '</td> </tr>'; } //end of looping Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2017-11-07 01:57:00 UTC (rev 7865) +++ trunk/PcReportTab.php 2017-11-23 22:45:05 UTC (rev 7866) @@ -3,12 +3,12 @@ include ('includes/session.php'); $Title = _('Petty Cash Management Report'); +/* webERP manual links before header.php */ $ViewTopic = 'PettyCash'; $BookMark = 'PcReportTab'; include ('includes/SQL_CommonFunctions.inc'); - if (isset($_POST['SelectedTabs'])){ $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ @@ -41,21 +41,19 @@ <td><select name="SelectedTabs">'; $SQL = "SELECT tabcode - FROM pctabs - WHERE ( authorizer = '" . $_SESSION['UserID'] . - "' OR usercode = '" . $_SESSION['UserID']. - "' OR assigner = '" . $_SESSION['UserID'] . "' ) - ORDER BY tabcode"; + FROM pctabs + WHERE ( authorizer = '" . $_SESSION['UserID'] . + "' OR usercode = '" . $_SESSION['UserID']. + "' OR assigner = '" . $_SESSION['UserID'] . "' ) + ORDER BY tabcode"; $Result = DB_query($SQL); while ($MyRow = DB_fetch_array($Result)) { if (isset($_POST['SelectedTabs']) and $MyRow['tabcode'] == $_POST['SelectedTabs']) { - echo '<option selected="selected" value="'; + echo '<option selected="selected" value="', $MyRow['tabcode'], '">', $MyRow['tabcode'], '</option>'; } else { - echo '<option value="'; + echo '<option value="', $MyRow['tabcode'], '">', $MyRow['tabcode'], '</option>'; } - echo $MyRow['tabcode'] . '">' . $MyRow['tabcode'] . '</option>'; - } //end while loop get type of tab DB_free_result($Result); @@ -100,8 +98,7 @@ amount, authorized, posted, - notes, - receipt + notes FROM pcashdetails WHERE tabcode = '" . $SelectedTabs . "' AND date >= '" . $SQLFromDate . "' AND date <= '" . $SQLToDate . "' @@ -219,11 +216,10 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,70,$FontSize,_('Date of Expense')); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,100,$FontSize,_('Expense Code')); $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,100,$FontSize,_('Gross Amount')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+210,$YPos,100,$FontSize,_('Total Tax')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+245,$YPos,100,$FontSize,_('Tax Group')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+285,$YPos,100,$FontSize,_('Tag')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+330,$YPos,100,$FontSize,_('Note')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+395,$YPos,100,$FontSize,_('Receipt')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+210,$YPos,100,$FontSize,_('Tax')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+255,$YPos,100,$FontSize,_('Tax Group')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+320,$YPos,100,$FontSize,_('Tag')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+380,$YPos,100,$FontSize,_('Notes')); $LeftOvers = $pdf->addTextWrap($Left_Margin+465,$YPos,100,$FontSize,_('Date Authorised')); $YPos -= (2 * $line_height); @@ -264,10 +260,20 @@ $TaxResult = DB_query($TaxSQL); while ($MyTaxRow = DB_fetch_array($TaxResult)) { - $TaxesDescription .= $MyTaxRow['description']; - $TaxesTaxAmount .= locale_number_format($MyTaxRow['amount'], $CurrDecimalPlaces); + $TaxesDescription .= $MyTaxRow['description'] . "\n"; //Line breaks not working !? + $TaxesTaxAmount .= locale_number_format($MyTaxRow['amount'], $CurrDecimalPlaces) . "\n"; //Line breaks not working !? } + //Generate download link for expense receipt, or show text if no receipt file is found. + $ReceiptSupportedExt = array('png','jpg','jpeg','pdf','doc','docx','xls','xlsx'); //Supported file extensions + $ReceiptFileDir = $PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/expenses_receipts/' . mb_strtolower($SelectedTabs); //Receipts upload directory + $ReceiptFilePath = reset(glob($ReceiptFileDir . '/' . $MyRow['counterindex'] . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE)); //Find the relevant receipt file for the expense. There should only be one (file type), but limit to one result just in case. + if (empty($ReceiptFilePath)) { //If no receipt file for the expenses is found + $ReceiptText = _('No attachment'); + } else { + $ReceiptText = '<a href="' . $ReceiptFilePath . '" download="ExpenseReceipt-' . mb_strtolower($SelectedTabs) . '-[' . $MyRow['date'] . ']-[' . $MyRow['counterindex'] . ']">' . _('Download attachment') . '</a>'; + } + if ($MyRow['authorized'] == '0000-00-00') { $AuthorisedDate = _('Unauthorised'); } else { @@ -279,10 +285,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,130,$FontSize,$Description[0]); $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,50,$FontSize,locale_number_format($MyRow['amount'], $CurrDecimalPlaces),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+210,$YPos,50,$FontSize,$TaxesTaxAmount); - $LeftOvers = $pdf->addTextWrap($Left_Margin+245,$YPos,50,$FontSize,$TaxesDescription); - $LeftOvers = $pdf->addTextWrap($Left_Margin+285,$YPos,50,$FontSize,$TagDescription); - $LeftOvers = $pdf->addTextWrap($Left_Margin+330,$YPos,60,$FontSize,$MyRow['notes']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+395,$YPos,65,$FontSize,$MyRow['receipt']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+255,$YPos,50,$FontSize,$TaxesDescription); + $LeftOvers = $pdf->addTextWrap($Left_Margin+320,$YPos,50,$FontSize,$TagDescription); + $LeftOvers = $pdf->addTextWrap($Left_Margin+380,$YPos,60,$FontSize,$MyRow['notes']); $LeftOvers = $pdf->addTextWrap($Left_Margin+465,$YPos,70,$FontSize,$AuthorisedDate); $YPos -= $line_height; @@ -445,8 +450,7 @@ amount, authorized, posted, - notes, - receipt + notes FROM pcashdetails WHERE tabcode = '" . $SelectedTabs . "' AND date >= '" . $SQLFromDate . "' @@ -462,11 +466,11 @@ <th>' . _('Date of Expense') . '</th> <th>' . _('Expense Code') . '</th> <th>' . _('Gross Amount') . '</th> - <th>' . _('Total Tax') . '</th> + <th>' . _('Tax') . '</th> <th>' . _('Tax Group') . '</th> <th>' . _('Tag') . '</th> <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> + <th>' . _('Receipt Attachment') . '</th> <th>' . _('Date Authorised') . '</th> </tr>'; @@ -510,6 +514,16 @@ $TaxesTaxAmount .= locale_number_format($MyTaxRow['amount'], $CurrDecimalPlaces) . '<br />'; } + //Generate download link for expense receipt, or show text if no receipt file is found. + $ReceiptSupportedExt = array('png','jpg','jpeg','pdf','doc','docx','xls','xlsx'); //Supported file extensions + $ReceiptFileDir = $PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/expenses_receipts/' . mb_strtolower($SelectedTabs); //Receipts upload directory + $ReceiptFilePath = reset(glob($ReceiptFileDir . '/' . $MyRow['counterindex'] . '.{' . implode(',', $ReceiptSupportedExt) . '}', GLOB_BRACE)); //Find the relevant receipt file for the expense. There should only be one (file type), but limit to one result just in case. + if (empty($ReceiptFilePath)) { //If no receipt file for the expenses is found + $ReceiptText = _('No attachment'); + } else { + $ReceiptText = '<a href="' . $ReceiptFilePath . '" download="ExpenseReceipt-' . mb_strtolower($SelectedTabs) . '-[' . $MyRow['date'] . ']-[' . $MyRow['counterindex'] . ']">' . _('Download attachment') . '</a>'; + } + if ($MyRow['authorized'] == '0000-00-00') { $AuthorisedDate =... [truncated message content] |
From: <dai...@us...> - 2017-12-02 07:37:10
|
Revision: 7868 http://sourceforge.net/p/web-erp/reponame/7868 Author: daintree Date: 2017-12-02 07:37:07 +0000 (Sat, 02 Dec 2017) Log Message: ----------- VortecCPI: PurchaseReport fix only noticed on US locale Modified Paths: -------------- trunk/PurchasesReport.php trunk/doc/Change.log Modified: trunk/PurchasesReport.php =================================================================== --- trunk/PurchasesReport.php 2017-11-23 22:48:11 UTC (rev 7867) +++ trunk/PurchasesReport.php 2017-12-02 07:37:07 UTC (rev 7868) @@ -61,8 +61,8 @@ $TotalGlAmount = 0; $TotalGlTax = 0; $k = 1;// Row colour counter. - $PeriodFrom = ConvertSQLDate($_POST['PeriodFrom']); - $PeriodTo = ConvertSQLDate($_POST['PeriodTo']); + $PeriodFrom = FormatDateForSQL($_POST['PeriodFrom']); + $PeriodTo = FormatDateForSQL($_POST['PeriodTo']); if($_POST['ShowDetails']) {// Parameters: PeriodFrom, PeriodTo, ShowDetails=on. echo '<th>', _('Date'), '</th> <th>', _('Purchase Invoice'), '</th> @@ -278,8 +278,8 @@ </tr>', // Show the budget for the period: '<tr>', - '<td><label for="ShowDetails">', _('Show details'), '</label></td> - <td><input',($_POST['ShowDetails'] ? ' checked="checked"' : ''), ' id="ShowDetails" name="ShowDetails" type="checkbox">', // "Checked" if ShowDetails is set AND it is TRUE. + '<td><label>', _('Show details'), '</label></td> + <td><input', (isset($_POST['ShowDetails']) ? ' checked="checked"' : ''), ' name="ShowDetails" type="checkbox">', // "Checked" if ShowDetails is set AND it is TRUE. (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Check this box to show purchase invoices') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-11-23 22:48:11 UTC (rev 7867) +++ trunk/doc/Change.log 2017-12-02 07:37:07 UTC (rev 7868) @@ -1,11 +1,12 @@ webERP Change Log +2/12/17 Phil: Purchases report - also deleted id non-exsitent in css committed changes suggested by VortecCPI http://www.weberp.org/forum/showthread.php?tid=7943 23/11/2017 Andy Couling: Added Petty Cash receipt file upload to directory functionality. -17/11/07 Exson: Remove cost updating for WAC method in BOMs.php. -17/10/25 Exson: Fixed the salesman authority problem in PrintCustTrans.php. -17/10/23 Exson: Prevent sales man from viewing other sales' sales orders in PrintCustTrans.php. -17/10/23 Exson: Prevent customer from modifying or viewing other customer's order in SelectOrderItems.php and PrintCustTrans.php. -17/10/21 Exson: Change header to meta data to avoid header do not work in some server environment in SelectCompletedOrder.php and SelectGLAccount.php +7/11/17 Exson: Remove cost updating for WAC method in BOMs.php. +25/10/17 Exson: Fixed the salesman authority problem in PrintCustTrans.php. +23/10/17 Exson: Prevent sales man from viewing other sales' sales orders in PrintCustTrans.php. +23/10/17 Exson: Prevent customer from modifying or viewing other customer's order in SelectOrderItems.php and PrintCustTrans.php. +21/10/18 Exson: Change header to meta data to avoid header do not work in some server environment in SelectCompletedOrder.php and SelectGLAccount.php 17/10/17 Andy Couling: Removed reference to css class 'toplink' in CustomerInquiry.php and CustomerAccount.php. 17/10/17 Phil: Fix InventoryPlanning.php and includes/PDFInventoryPlanPageHeader.inc to display categories selected and fix month headings displayed 15/10/17 Andy Couling: New Expenses/Update Expense table header in PcClaimExpensesFromTab.php @@ -13,19 +14,19 @@ 15/10/17 Andy Couling: Table header labels corrected in PcClaimExpensesFromTab.php and PcAuthorizeExpenses.php. 15/10/17 Andy Couling: Fixed expense deletion dialogue box in PcClaimExpensesFromTab.php. 15/10/17 Andy Couling: Missing $Id comments added to Petty Cash scripts. -17/10/12 Exson: Fixed the bug that Narrative information will loss when add or remove controlled items lot no in StockAdjustments.php. -17/10/11 RChacon: If it is set the $_SESSION['ShowPageHelp'] parameter AND it is FALSE, hides the page help text (simplifies code using css). -17/10/11 RChacon: Set decimals variable for exchange rate in Currencies.php. -17/10/11 RChacon: Improve currency showing and set decimals variable for exchange rate in Payments.php. -17/10/11 Exson: Fix the indian_number_format bug in MiscFunctions.php. -17/10/09 Exson: Fixed the non-balance bug in CustomerReceipt.php. And fixed the non rollback problem when there is a non-balance existed. Fixed error noises. -17/10/03 Exson: Add html view to SuppPriceList.php. -01/10/26 RChacon: Standardise and add icons for usability. -27/09/26 RChacon: Increases accuracy in coordinates. -17/09/26 Exson: Fixed the wrong price retrieved bug in PO_Header.php. -17/09/26 Exson: Fixed the vendor price bug to ensure only the effective price showed by suppliers in SelectProduct.php. -17/09/20 Exson: Fixed the bug to make GRN reverse workable. -17/09/19 Exson: Fixed customer information missing in CustomerReceipt.php. Reported by Steven Fu. +10/10/12 Exson: Fixed the bug that Narrative information will loss when add or remove controlled items lot no in StockAdjustments.php. +10/10/17 RChacon: If it is set the $_SESSION['ShowPageHelp'] parameter AND it is FALSE, hides the page help text (simplifies code using css). +10/10/17 RChacon: Set decimals variable for exchange rate in Currencies.php. +10/10/17 RChacon: Improve currency showing and set decimals variable for exchange rate in Payments.php. +10/10/17 Exson: Fix the indian_number_format bug in MiscFunctions.php. +9/10/17 Exson: Fixed the non-balance bug in CustomerReceipt.php. And fixed the non rollback problem when there is a non-balance existed. Fixed error noises. +3/10/17 Exson: Add html view to SuppPriceList.php. +20/9/17 RChacon: Standardise and add icons for usability. +20/9/17 RChacon: Increases accuracy in coordinates. +20/9/17 Exson: Fixed the wrong price retrieved bug in PO_Header.php. +20/9/17 Exson: Fixed the vendor price bug to ensure only the effective price showed by suppliers in SelectProduct.php. +20/9/17 Exson: Fixed the bug to make GRN reverse workable. +19/9/17 Exson: customer information missing in CustomerReceipt.php. Reported by Steven Fu. 18/9/2017 Tim (committed by Andy): Geocode bug fixes. http://www.weberp.org/forum/showthread.php?tid=4380 17/9/17 VortecCPI: SelectProduct.php made image dispay code match that used in WorkOrderEntry.php 11/9/17 Andy Couling: Fixed the onclick delete confirmation box call in ContractBOM.php, was 'MakeConfirm'. |
From: <dai...@us...> - 2017-12-02 07:55:19
|
Revision: 7869 http://sourceforge.net/p/web-erp/reponame/7869 Author: daintree Date: 2017-12-02 07:55:17 +0000 (Sat, 02 Dec 2017) Log Message: ----------- Tim fixed US date format date picker javascript Modified Paths: -------------- trunk/doc/Change.log trunk/javascripts/MiscFunctions.js Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-02 07:37:07 UTC (rev 7868) +++ trunk/doc/Change.log 2017-12-02 07:55:17 UTC (rev 7869) @@ -1,6 +1,7 @@ webERP Change Log -2/12/17 Phil: Purchases report - also deleted id non-exsitent in css committed changes suggested by VortecCPI http://www.weberp.org/forum/showthread.php?tid=7943 +2/12/17 Phil committed Tim Schofield's fix for javascript date picker for US date formats +2/12/17 Phil/Paul Becker: Purchases report - also deleted id non-exsitent in css committed changes suggested by VortecCPI http://www.weberp.org/forum/showthread.php?tid=7943 23/11/2017 Andy Couling: Added Petty Cash receipt file upload to directory functionality. 7/11/17 Exson: Remove cost updating for WAC method in BOMs.php. 25/10/17 Exson: Fixed the salesman authority problem in PrintCustTrans.php. Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2017-12-02 07:37:07 UTC (rev 7868) +++ trunk/javascripts/MiscFunctions.js 2017-12-02 07:55:17 UTC (rev 7869) @@ -249,8 +249,8 @@ break; case "m/d/Y": dA = dS.split("/"); - m = parseInt(dA[0], 10); - d = parseInt(dA[1], 10)-1; + m = parseInt(dA[0], 10)-1; + d = parseInt(dA[1], 10); y = parseInt(dA[2], 10); break; case "Y-m-d": |
From: <dai...@us...> - 2017-12-02 23:30:03
|
Revision: 7871 http://sourceforge.net/p/web-erp/reponame/7871 Author: daintree Date: 2017-12-02 23:30:00 +0000 (Sat, 02 Dec 2017) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.14.1-4.14.2.sql Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-02 13:19:00 UTC (rev 7870) +++ trunk/doc/Change.log 2017-12-02 23:30:00 UTC (rev 7871) @@ -1,5 +1,7 @@ webERP Change Log + +3/12/17 Phil commited Tim's BankAccountBalances.php script 2/12/17 Exson: Fixed the outstanding quantity is not right in PO_SelectOSPurchOrder.php. 2/12/17 Phil committed Tim Schofield's fix for javascript date picker for US date formats 2/12/17 Phil/Paul Becker: Purchases report - also deleted id non-exsitent in css committed changes suggested by VortecCPI http://www.weberp.org/forum/showthread.php?tid=7943 Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2017-12-02 13:19:00 UTC (rev 7870) +++ trunk/includes/MainMenuLinksArray.php 2017-12-02 23:30:00 UTC (rev 7871) @@ -367,7 +367,8 @@ '/BankMatching.php?Type=Receipts', '/GLJournal.php?NewJournal=Yes'); -$MenuItems['GL']['Reports']['Caption'] = array( _('Bank Account Reconciliation Statement'), +$MenuItems['GL']['Reports']['Caption'] = array( _('Bank Account Balances'), + _('Bank Account Reconciliation Statement'), _('Cheque Payments Listing'), _('Daily Bank Transactions'), _('Account Inquiry'), @@ -383,7 +384,8 @@ _('Tag Reports'), _('Tax Reports')); -$MenuItems['GL']['Reports']['URL'] = array( '/BankReconciliation.php', +$MenuItems['GL']['Reports']['URL'] = array( '/BankAccountBalances.php', + '/BankReconciliation.php', '/PDFChequeListing.php', '/DailyBankTransactions.php', '/SelectGLAccount.php', Modified: trunk/sql/mysql/upgrade4.14.1-4.14.2.sql =================================================================== --- trunk/sql/mysql/upgrade4.14.1-4.14.2.sql 2017-12-02 13:19:00 UTC (rev 7870) +++ trunk/sql/mysql/upgrade4.14.1-4.14.2.sql 2017-12-02 23:30:00 UTC (rev 7871) @@ -28,5 +28,5 @@ ALTER TABLE `custbranch` CHANGE `lng` `lng` FLOAT(12,8) NOT NULL DEFAULT '0.00000000'; ALTER TABLE pcashdetails MODIFY receipt text COMMENT 'Column redundant. Replaced by receipt file upload. Nov 2017.'; +INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('BankAccountBalances.php', '1', 'Shows bank accounts authorised for with balances'); - |
From: <dai...@us...> - 2017-12-05 05:55:18
|
Revision: 7872 http://sourceforge.net/p/web-erp/reponame/7872 Author: daintree Date: 2017-12-05 05:55:16 +0000 (Tue, 05 Dec 2017) Log Message: ----------- Modified Paths: -------------- trunk/MailInventoryValuation.php trunk/ManualContents.php trunk/api/api_session.inc trunk/doc/Manual/ManualSupplierTenders.html trunk/includes/session.php Modified: trunk/MailInventoryValuation.php =================================================================== --- trunk/MailInventoryValuation.php 2017-12-02 23:30:00 UTC (rev 7871) +++ trunk/MailInventoryValuation.php 2017-12-05 05:55:16 UTC (rev 7872) @@ -244,7 +244,7 @@ include('includes/footer.php'); exit; - }else{ + } else { $Title = _('Print Inventory Valuation Error'); include('includes/header.php'); prnMsg(_('There are errors lead to mails not sent'),'error'); @@ -255,4 +255,4 @@ } } -?> +?> \ No newline at end of file Modified: trunk/ManualContents.php =================================================================== --- trunk/ManualContents.php 2017-12-02 23:30:00 UTC (rev 7871) +++ trunk/ManualContents.php 2017-12-05 05:55:16 UTC (rev 7872) @@ -9,8 +9,8 @@ Selecting multiple sections is for printing. The outline of the Table of Contents is contained in the 'ManualOutline.php' file that can be easily translated. The individual topics in the manual are in straight html files that are called along with the header and foot from here. -Each function in KwaMoja can initialise a $ViewTopic and $Bookmark variable, prior to including the header.php file. -This will display the specified topic and bookmark if it exists when the user clicks on the Manual link in the KwaMoja main menu. +Each function in webERP can initialise a $ViewTopic and $Bookmark variable, prior to including the header.php file. +This will display the specified topic and bookmark if it exists when the user clicks on the Manual link in the webERP main menu. In this way the help can be easily broken into sections for online context-sensitive help. Comments beginning with Help Begin and Help End denote the beginning and end of a section that goes into the online help. What section is named after Help Begin: and there can be multiple sections separated with a comma. Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2017-12-02 23:30:00 UTC (rev 7871) +++ trunk/api/api_session.inc 2017-12-05 05:55:16 UTC (rev 7872) @@ -56,7 +56,7 @@ } return $hash; } - + function VerifyPass($Password,$Hash) { if(PHP_VERSION_ID < 50500) { return (crypt($Password,$Hash)==$Hash); Modified: trunk/doc/Manual/ManualSupplierTenders.html =================================================================== --- trunk/doc/Manual/ManualSupplierTenders.html 2017-12-02 23:30:00 UTC (rev 7871) +++ trunk/doc/Manual/ManualSupplierTenders.html 2017-12-05 05:55:16 UTC (rev 7872) @@ -16,7 +16,7 @@ <p>Clicking on the "Select Suppliers" button brings up a screen to search for suppliers. Only suppliers with email addresses input will show in the supplier search screen. This is because the tendering system works by sending emails to everyone involved. You can choose as many suppliers as you want to send the tender request to.</p> </li> <li><h3>Items to be included in the tender</h3> - <p>Clicking on the "Select Item Details" button brings up an item search screen. You can search for any item currently set up on KwaMoja and select any quantity to be put for tender. You can select multiple items from one screen. Any number of otems can be on the tender.</p> + <p>Clicking on the "Select Item Details" button brings up an item search screen. You can search for any item currently set up on webERP and select any quantity to be put for tender. You can select multiple items from one screen. Any number of otems can be on the tender.</p> </li> </ul> Modified: trunk/includes/session.php =================================================================== --- trunk/includes/session.php 2017-12-02 23:30:00 UTC (rev 7871) +++ trunk/includes/session.php 2017-12-05 05:55:16 UTC (rev 7872) @@ -133,9 +133,11 @@ header('Location: index.php'); } elseif (isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ - $_SESSION['AllowedPageSecurityTokens'] = array(); - $_SESSION['DatabaseName'] = $DefaultDatabase; - $_SESSION['CompanyName'] = $DefaultDatabase; + if (!isset($_SESSION['DatabaseName'])){ + $_SESSION['AllowedPageSecurityTokens'] = array(); + $_SESSION['DatabaseName'] = $DefaultDatabase; + $_SESSION['CompanyName'] = $DefaultDatabase; + } include_once ($PathPrefix . 'includes/ConnectDB_' . $DBType . '.inc'); include($PathPrefix . 'includes/GetConfig.php'); } else { |
From: <rc...@us...> - 2017-12-06 21:10:16
|
Revision: 7873 http://sourceforge.net/p/web-erp/reponame/7873 Author: rchacon Date: 2017-12-06 21:10:14 +0000 (Wed, 06 Dec 2017) Log Message: ----------- Order by transaction date and add link to debtors. Modified Paths: -------------- trunk/Dashboard.php trunk/doc/Change.log trunk/sql/mysql/upgrade4.14.1-4.14.2.sql Modified: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php 2017-12-05 05:55:16 UTC (rev 7872) +++ trunk/Dashboard.php 2017-12-06 21:10:14 UTC (rev 7873) @@ -183,7 +183,8 @@ $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); $TotOD1 += ($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2']); $TotOD2 += $AgedAnalysis['overdue2']; - echo '<td class="text" colspan="4"><b>', $AgedAnalysis['debtorno'], ' - ', $AgedAnalysis['name'], '</b></td> + echo ' <td class="text" colspan="4"><a href="CustomerInquiry.php?CustomerID=', $AgedAnalysis['debtorno'],'"><b>', + $AgedAnalysis['debtorno'], ' - ', $AgedAnalysis['name'], '</b></a></td> <td class="number"><b>', $DisplayBalance, '</b></td> <td class="number"><b>', $DisplayCurrent, '</b></td> <td class="number" style="color:orange;"><b>', $DisplayDue, '</b></td> @@ -233,7 +234,8 @@ AND debtorsmaster.paymentterms = paymentterms.termsindicator AND debtorsmaster.debtorno = debtortrans.debtorno AND debtortrans.debtorno = '" . $AgedAnalysis['debtorno'] . "' - AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004"; + AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004 + ORDER BY debtortrans.trandate"; if($_SESSION['SalesmanLogin'] != '') { $Sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-05 05:55:16 UTC (rev 7872) +++ trunk/doc/Change.log 2017-12-06 21:10:14 UTC (rev 7873) @@ -1,6 +1,6 @@ webERP Change Log - +6/12/17 RChacon: Order by transaction date and add link to debtors in Dashboard.php script. 3/12/17 Phil commited Tim's BankAccountBalances.php script 2/12/17 Exson: Fixed the outstanding quantity is not right in PO_SelectOSPurchOrder.php. 2/12/17 Phil committed Tim Schofield's fix for javascript date picker for US date formats Modified: trunk/sql/mysql/upgrade4.14.1-4.14.2.sql =================================================================== --- trunk/sql/mysql/upgrade4.14.1-4.14.2.sql 2017-12-05 05:55:16 UTC (rev 7872) +++ trunk/sql/mysql/upgrade4.14.1-4.14.2.sql 2017-12-06 21:10:14 UTC (rev 7873) @@ -1,16 +1,17 @@ -ALTER table supptrans ADD chequeno varchar(16) NOT NULL DEFAULT ''; -ALTER table supptrans ADD void tinyint(1) NOT NULL DEFAULT 0; -ALTER table banktrans ADD chequeno varchar(16) NOT NULL DEFAULT ''; -INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('Z_RemovePurchaseBackOrders.php', '1', 'Removes all purchase order back orders'); -ALTER table supptrans DROP KEY `TypeTransNo`; -ALTER table supptrans ADD KEY `TypeTransNo`(`transno`,`type`); -ALTER TABLE pcexpenses ADD COLUMN taxcatid TINYINT(4) NOT NULL DEFAULT 1 AFTER tag; -ALTER TABLE pctabs ADD COLUMN defaulttag TINYINT(4) NOT NULL DEFAULT 0 AFTER glaccountpcash; -ALTER TABLE pctabs ADD COLUMN taxgroupid TINYINT(4) NOT NULL DEFAULT 1 AFTER defaulttag; -ALTER TABLE pctabs ADD COLUMN authorizerexpenses VARCHAR(20) NOT NULL AFTER authorizer; -UPDATE pctabs SET authorizerexpenses=authorizer -ALTER TABLE pcashdetails ADD COLUMN tag INT(11) NOT NULL DEFAULT 0 AFTER tabcode; -INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('PcAuthorizeCash.php', '6', 'Authorisation of assigned cash'); +ALTER TABLE `banktrans` ADD `chequeno` VARCHAR(16) NOT NULL DEFAULT '' AFTER `currcode`; +ALTER TABLE `supptrans` ADD `chequeno` VARCHAR(16) NOT NULL DEFAULT '' AFTER `hold`; +ALTER TABLE `supptrans` ADD `void` TINYINT(1) NOT NULL DEFAULT 0 AFTER `chequeno`; +ALTER table `supptrans` DROP KEY `TypeTransNo`; +ALTER table `supptrans` ADD KEY `TypeTransNo`(`transno`,`type`); + +ALTER TABLE `pcexpenses` ADD COLUMN `taxcatid` TINYINT(4) NOT NULL DEFAULT 1 AFTER `tag`; +ALTER TABLE `pctabs` ADD COLUMN `defaulttag` TINYINT(4) NOT NULL DEFAULT 0 AFTER `glaccountpcash`; +ALTER TABLE `pctabs` ADD COLUMN `taxgroupid` TINYINT(4) NOT NULL DEFAULT 1 AFTER `defaulttag`; +ALTER TABLE `pctabs` ADD COLUMN `authorizerexpenses` VARCHAR(20) NOT NULL AFTER `authorizer`; +UPDATE `pctabs` SET authorizerexpenses=authorizer; +ALTER TABLE `pcashdetails` ADD COLUMN `tag` INT(11) NOT NULL DEFAULT 0 AFTER `tabcode`; +INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('PcAuthorizeCash.php', '6', 'Authorisation of assigned cash'); +INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_RemovePurchaseBackOrders.php', '1', 'Removes all purchase order back orders'); CREATE TABLE `pcashdetailtaxes` ( `counterindex` INT(20) NOT NULL AUTO_INCREMENT, `pccashdetail` INT(20) NOT NULL DEFAULT 0, @@ -30,3 +31,6 @@ ALTER TABLE pcashdetails MODIFY receipt text COMMENT 'Column redundant. Replaced by receipt file upload. Nov 2017.'; INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('BankAccountBalances.php', '1', 'Shows bank accounts authorised for with balances'); + +UPDATE config SET confvalue='4.15' WHERE confname='VersionNumber'; + |
From: <tu...@us...> - 2017-12-11 17:47:32
|
Revision: 7875 http://sourceforge.net/p/web-erp/reponame/7875 Author: turbopt Date: 2017-12-11 17:47:30 +0000 (Mon, 11 Dec 2017) Log Message: ----------- PHP 7 constructor compatibility change to htmlMimeMail.php and mimePart.php Modified Paths: -------------- trunk/doc/Change.log trunk/includes/htmlMimeMail.php trunk/includes/mimePart.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-08 04:09:11 UTC (rev 7874) +++ trunk/doc/Change.log 2017-12-11 17:47:30 UTC (rev 7875) @@ -1,5 +1,6 @@ webERP Change Log +11/12/17 PaulT: PHP 7 constructor compatibility change to htmlMimeMail.php and mimePart.php 6/12/17 RChacon: Order by transaction date and add link to debtors in Dashboard.php script. 3/12/17 Phil commited Tim's BankAccountBalances.php script 2/12/17 Exson: Fixed the outstanding quantity is not right in PO_SelectOSPurchOrder.php. Modified: trunk/includes/htmlMimeMail.php =================================================================== --- trunk/includes/htmlMimeMail.php 2017-12-08 04:09:11 UTC (rev 7874) +++ trunk/includes/htmlMimeMail.php 2017-12-11 17:47:30 UTC (rev 7875) @@ -90,7 +90,7 @@ * if supplied. */ - function htmlMimeMail() + function __construct() { /** * Initialise some variables. Modified: trunk/includes/mimePart.php =================================================================== --- trunk/includes/mimePart.php 2017-12-08 04:09:11 UTC (rev 7874) +++ trunk/includes/mimePart.php 2017-12-11 17:47:30 UTC (rev 7875) @@ -124,7 +124,7 @@ * charset - Character set to use * @access public */ - function Mail_mimePart($body = '', $params = array()) + function __construct($body = '', $params = array()) { if (!defined('MAIL_MIMEPART_CRLF')) { define('MAIL_MIMEPART_CRLF', defined('MAIL_MIME_CRLF') ? MAIL_MIME_CRLF : "\r\n", TRUE); |
From: <tu...@us...> - 2017-12-11 20:57:13
|
Revision: 7876 http://sourceforge.net/p/web-erp/reponame/7876 Author: turbopt Date: 2017-12-11 20:57:10 +0000 (Mon, 11 Dec 2017) Log Message: ----------- (forums) SelectSalesOrder.php: Consistent delivery address and correct a unit conversion issue. Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/doc/Change.log Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2017-12-11 17:47:30 UTC (rev 7875) +++ trunk/SelectSalesOrder.php 2017-12-11 20:57:10 UTC (rev 7876) @@ -286,6 +286,7 @@ suppdeladdress5, suppdeladdress6, supptel, + contact, version, revised, deliveryby, @@ -300,12 +301,12 @@ '" . $SuppRow['rate'] . "', '" . $_SESSION['UserID'] . "', '" . $_SESSION['UserStockLocation'] . "', - '" . $DelAddRow['locationname'] . "', '" . $DelAddRow['deladd1'] . "', '" . $DelAddRow['deladd2'] . "', '" . $DelAddRow['deladd3'] . "', '" . $DelAddRow['deladd4'] . "', - '" . $DelAddRow['deladd5'] . ' ' . $DelAddRow['deladd6'] . "', + '" . $DelAddRow['deladd5'] . "', + '" . $DelAddRow['deladd6'] . "', '" . $DelAddRow['tel'] . "', '" . $SuppRow['address1'] . "', '" . $SuppRow['address2'] . "', @@ -314,6 +315,7 @@ '" . $SuppRow['address5'] . "', '" . $SuppRow['address6'] . "', '" . $SuppRow['telephone'] . "', + '" . $DelAddRow['contact'] . "', '1.0', '" . Date('Y-m-d') . "', '" . $_SESSION['Default_Shipper'] . "', @@ -345,7 +347,7 @@ '" . FormatDateForSQL($DeliveryDate) . "', '" . $ItemRow['suppliers_partno'] . ' ' . $ItemRow['supplierdescription'] . "', '" . $ItemRow['stockact'] . "', - '" . $ItemRow['price'] . "', + '" . $ItemRow['price']/$ItemRow['conversionfactor'] . "', '" . $ItemRow['orderqty'] . "', '" . $ItemRow['suppliersuom'] . "', '" . $ItemRow['suppliers_partno'] . "', @@ -354,7 +356,7 @@ $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); $result =DB_query($sql,$ErrMsg,$DbgMsg,true); - $Order_Value += ($ItemRow['price']*$ItemRow['orderqty']); + $Order_Value += ($ItemRow['price']*$ItemRow['orderqty']/$ItemRow['conversionfactor']); } /* end of the loop round the items on the sales order that we wish to place purchase orders for */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-11 17:47:30 UTC (rev 7875) +++ trunk/doc/Change.log 2017-12-11 20:57:10 UTC (rev 7876) @@ -1,5 +1,6 @@ webERP Change Log +11/12/17 Paul Becker: (forums) SelectSalesOrder.php: Consistent delivery address and correct a unit conversion issue. 11/12/17 PaulT: PHP 7 constructor compatibility change to htmlMimeMail.php and mimePart.php 6/12/17 RChacon: Order by transaction date and add link to debtors in Dashboard.php script. 3/12/17 Phil commited Tim's BankAccountBalances.php script |
From: <tu...@us...> - 2017-12-12 04:30:32
|
Revision: 7877 http://sourceforge.net/p/web-erp/reponame/7877 Author: turbopt Date: 2017-12-12 04:30:30 +0000 (Tue, 12 Dec 2017) Log Message: ----------- PHP 7 constructor compatibility change to phplot.php. (Reported in forums by rjonesbsink) Modified Paths: -------------- trunk/doc/Change.log trunk/includes/phplot/phplot.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-11 20:57:10 UTC (rev 7876) +++ trunk/doc/Change.log 2017-12-12 04:30:30 UTC (rev 7877) @@ -1,5 +1,6 @@ webERP Change Log +11/12/17 PaulT: PHP 7 constructor compatibility change to phplot.php. (Reported in forums by rjonesbsink) 11/12/17 Paul Becker: (forums) SelectSalesOrder.php: Consistent delivery address and correct a unit conversion issue. 11/12/17 PaulT: PHP 7 constructor compatibility change to htmlMimeMail.php and mimePart.php 6/12/17 RChacon: Order by transaction date and add link to debtors in Dashboard.php script. Modified: trunk/includes/phplot/phplot.php =================================================================== --- trunk/includes/phplot/phplot.php 2017-12-11 20:57:10 UTC (rev 7876) +++ trunk/includes/phplot/phplot.php 2017-12-12 04:30:30 UTC (rev 7877) @@ -274,7 +274,7 @@ * $which_output_file : Filename for output. * $which_input_file : Path to a file to be used as background. */ - function PHPlot($which_width=600, $which_height=400, $which_output_file=NULL, $which_input_file=NULL) + function __construct($which_width=600, $which_height=400, $which_output_file=NULL, $which_input_file=NULL) { $this->SetRGBArray($this->color_array); |
From: <tu...@us...> - 2017-12-13 19:23:24
|
Revision: 7879 http://sourceforge.net/p/web-erp/reponame/7879 Author: turbopt Date: 2017-12-13 19:23:22 +0000 (Wed, 13 Dec 2017) Log Message: ----------- QATests.php: Correct wrong attribute name in two option tags. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/QATests.php trunk/doc/Change.log Modified: trunk/QATests.php =================================================================== --- trunk/QATests.php 2017-12-12 23:23:56 UTC (rev 7878) +++ trunk/QATests.php 2017-12-13 19:23:22 UTC (rev 7879) @@ -259,7 +259,7 @@ if ($_POST['Type']==0){ echo '<option selected="selected" value="0">' . _('Text Box') . '</option>'; } else { - echo '<option Type="0">' . _('Text Box') . '</option>'; + echo '<option value="0">' . _('Text Box') . '</option>'; } if ($_POST['Type']==1){ echo '<option selected="selected" value="1">' . _('Select Box') . '</option>'; @@ -269,7 +269,7 @@ if ($_POST['Type']==2){ echo '<option selected="selected" value="2">' . _('Check Box') . '</option>'; } else { - echo '<option Type="2">' . _('Check Box') . '</option>'; + echo '<option value="2">' . _('Check Box') . '</option>'; } if ($_POST['Type']==3){ echo '<option selected="selected" value="3">' . _('Date Box') . '</option>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-12 23:23:56 UTC (rev 7878) +++ trunk/doc/Change.log 2017-12-13 19:23:22 UTC (rev 7879) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: QATests.php: Correct wrong attribute name in two option tags. (Reported in forums by Paul Becker) 11/12/17 PaulT: PHP 7 constructor compatibility change to phplot.php. (Reported in forums by rjonesbsink) 11/12/17 Paul Becker: (forums) SelectSalesOrder.php: Consistent delivery address and correct a unit conversion issue. 11/12/17 PaulT: PHP 7 constructor compatibility change to htmlMimeMail.php and mimePart.php |
From: <tu...@us...> - 2017-12-13 19:58:17
|
Revision: 7880 http://sourceforge.net/p/web-erp/reponame/7880 Author: turbopt Date: 2017-12-13 19:58:15 +0000 (Wed, 13 Dec 2017) Log Message: ----------- CustomerReceipt.php: Add identifier to URL for delete link. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/CustomerReceipt.php trunk/doc/Change.log Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2017-12-13 19:23:22 UTC (rev 7879) +++ trunk/CustomerReceipt.php 2017-12-13 19:58:15 UTC (rev 7880) @@ -270,7 +270,7 @@ $BankAccounts[$i]= $Act[0]; $i++; } - + /*Start a transaction to do the whole lot inside */ $result = DB_Txn_Begin(); $_SESSION['ReceiptBatch' . $identifier]->BatchNo = GetNextTransNo(12,$db); @@ -1018,7 +1018,7 @@ <td>' . $ReceiptItem->GLCode.' - '.$myrow['accountname'] . '</td> <td>' . stripslashes($ReceiptItem->Narrative) . '</td> <td>' . $ReceiptItem->TagName . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type'] . '&identifier=' . $identifier . '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-13 19:23:22 UTC (rev 7879) +++ trunk/doc/Change.log 2017-12-13 19:58:15 UTC (rev 7880) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: CustomerReceipt.php: Add identifier to URL for delete link. (Reported in forums by Paul Becker) 11/13/17 PaulT: QATests.php: Correct wrong attribute name in two option tags. (Reported in forums by Paul Becker) 11/12/17 PaulT: PHP 7 constructor compatibility change to phplot.php. (Reported in forums by rjonesbsink) 11/12/17 Paul Becker: (forums) SelectSalesOrder.php: Consistent delivery address and correct a unit conversion issue. |
From: <tu...@us...> - 2017-12-13 20:17:25
|
Revision: 7881 http://sourceforge.net/p/web-erp/reponame/7881 Author: turbopt Date: 2017-12-13 20:17:22 +0000 (Wed, 13 Dec 2017) Log Message: ----------- PDFQALabel.php: Overlapping in the PDF when printing non-controlled items. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/PDFQALabel.php trunk/doc/Change.log Modified: trunk/PDFQALabel.php =================================================================== --- trunk/PDFQALabel.php 2017-12-13 19:58:15 UTC (rev 7880) +++ trunk/PDFQALabel.php 2017-12-13 20:17:22 UTC (rev 7881) @@ -91,6 +91,9 @@ } //controlled item*/ else { + if ($PageNumber>1){ + $pdf->newPage(); + } $pdf->addJpegFromFile($_SESSION['LogoFile'] ,$FormDesign->logo->x,$Page_Height-$FormDesign->logo->y,$FormDesign->logo->width,$FormDesign->logo->height); $LeftOvers = $pdf->addText($FormDesign->ItemNbr->x,$Page_Height-$FormDesign->ItemNbr->y,$FormDesign->ItemNbr->FontSize,'Item: ' . $myrow['itemcode']); $LeftOvers = $pdf->addText($FormDesign->ItemDesc->x,$Page_Height-$FormDesign->ItemDesc->y,$FormDesign->ItemDesc->FontSize,'Description: ' . $myrow['itemdescription']); @@ -99,9 +102,6 @@ //$LeftOvers = $pdf->addText($FormDesign->Lot->x,$Page_Height-$FormDesign->Lot->y,$FormDesign->Lot->FontSize,'Lot: ' . $myrow['serialno']); $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize,'Receipt Date: ' . $myrow['deliverydate']); $LeftOvers = $pdf->addText($FormDesign->OrderNumber->x,$Page_Height-$FormDesign->OrderNumber->y,$FormDesign->OrderNumber->FontSize,'P/O: ' . $myrow['orderno']); - if ($PageNumber>1){ - $pdf->newPage(); - } $PageNumber++; } //else not controlled } //end of loop around GRNs to print Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-13 19:58:15 UTC (rev 7880) +++ trunk/doc/Change.log 2017-12-13 20:17:22 UTC (rev 7881) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: PDFQALabel.php: Overlapping in the PDF when printing non-controlled items. (Reported in forums by Paul Becker) 11/13/17 PaulT: CustomerReceipt.php: Add identifier to URL for delete link. (Reported in forums by Paul Becker) 11/13/17 PaulT: QATests.php: Correct wrong attribute name in two option tags. (Reported in forums by Paul Becker) 11/12/17 PaulT: PHP 7 constructor compatibility change to phplot.php. (Reported in forums by rjonesbsink) |
From: <tu...@us...> - 2017-12-13 22:49:23
|
Revision: 7882 http://sourceforge.net/p/web-erp/reponame/7882 Author: turbopt Date: 2017-12-13 22:49:21 +0000 (Wed, 13 Dec 2017) Log Message: ----------- HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) Modified Paths: -------------- trunk/HistoricalTestResults.php trunk/SelectQASamples.php trunk/TestPlanResults.php trunk/doc/Change.log Modified: trunk/HistoricalTestResults.php =================================================================== --- trunk/HistoricalTestResults.php 2017-12-13 20:17:22 UTC (rev 7881) +++ trunk/HistoricalTestResults.php 2017-12-13 22:49:21 UTC (rev 7882) @@ -70,11 +70,11 @@ echo '</tr> <tr> <td>' . _('From Sample Date') . ': </td> - <td><input name="FromDate" size="10" class="date" value="' . $_POST['FromDate'] . '"/></td> + <td><input name="FromDate" size="10" class="date" value="' . $_POST['FromDate'] . '" alt="' . $_SESSION['DefaultDateFormat'] . '" /></td> </tr> <tr> <td> ' . _('To Sample Date') . ':</td> - <td> <input name="ToDate" size="10" class="date" value="' . $_POST['ToDate'] . '"/></td> + <td> <input name="ToDate" size="10" class="date" value="' . $_POST['ToDate'] . '" alt="' . $_SESSION['DefaultDateFormat'] . '" /></td> </tr> </table> </div> Modified: trunk/SelectQASamples.php =================================================================== --- trunk/SelectQASamples.php 2017-12-13 20:17:22 UTC (rev 7881) +++ trunk/SelectQASamples.php 2017-12-13 22:49:21 UTC (rev 7882) @@ -248,7 +248,7 @@ echo _('For the part') . ':<b>' . $SelectedStockItem . '</b> ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="' . $SelectedStockItem . '" />'; } echo _('Lot Number') . ': <input name="LotNumber" autofocus="autofocus" maxlength="20" size="12" value="' . $LotNumber . '"/> ' . _('Sample ID') . ': <input name="SampleID" maxlength="10" size="10" value="' . $SampleID . '"/> '; - echo _('From Sample Date') . ': <input name="FromDate" size="10" class="date" value="' . $_POST['FromDate'] . '"/> ' . _('To Sample Date') . ': <input name="ToDate" size="10" class="date" value="' . $_POST['ToDate'] . '"/> '; + echo _('From Sample Date') . ': <input name="FromDate" size="10" class="date" value="' . $_POST['FromDate'] . '" alt="' . $_SESSION['DefaultDateFormat'] . '" /> ' . _('To Sample Date') . ': <input name="ToDate" size="10" class="date" value="' . $_POST['ToDate'] . '" alt="' . $_SESSION['DefaultDateFormat'] . '" /> '; echo '<input type="submit" name="SearchSamples" value="' . _('Search Samples') . '" /></td> </tr> </table>'; @@ -509,7 +509,7 @@ </tr> <tr> <td>' . _('Sample Date') . ':</td> - <td><input class="date" type="text" name="SampleDate" size="10" maxlength="10" value="' . $_POST['SampleDate']. '" /></td> + <td><input class="date" type="text" name="SampleDate" size="10" maxlength="10" value="' . $_POST['SampleDate']. '" alt="' . $_SESSION['DefaultDateFormat'] . '" /></td> </tr> <tr> <td>' . _('Use for Cert?') . ':</td> Modified: trunk/TestPlanResults.php =================================================================== --- trunk/TestPlanResults.php 2017-12-13 20:17:22 UTC (rev 7881) +++ trunk/TestPlanResults.php 2017-12-13 22:49:21 UTC (rev 7882) @@ -125,7 +125,7 @@ echo _('For the part') . ':<b>' . $SelectedStockItem . '</b> ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="' . $SelectedStockItem . '" />'; } echo _('Lot Number') . ': <input name="LotNumber" autofocus="autofocus" maxlength="20" size="12" value="' . $LotNumber . '"/> ' . _('Sample ID') . ': <input name="SampleID" maxlength="10" size="10" value="' . $SampleID . '"/> '; - echo _('From Sample Date') . ': <input name="FromDate" size="10" class="date" value="' . $_POST['FromDate'] . '"/> ' . _('To Sample Date') . ': <input name="ToDate" size="10" class="date" value="' . $_POST['ToDate'] . '"/> '; + echo _('From Sample Date') . ': <input name="FromDate" size="10" class="date" value="' . $_POST['FromDate'] . '" alt="' . $_SESSION['DefaultDateFormat'] . '" /> ' . _('To Sample Date') . ': <input name="ToDate" size="10" class="date" value="' . $_POST['ToDate'] . '" alt="' . $_SESSION['DefaultDateFormat'] . '" /> '; echo '<input type="submit" name="SearchSamples" value="' . _('Search Samples') . '" /></td> </tr> </table>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-13 20:17:22 UTC (rev 7881) +++ trunk/doc/Change.log 2017-12-13 22:49:21 UTC (rev 7882) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) 11/13/17 PaulT: PDFQALabel.php: Overlapping in the PDF when printing non-controlled items. (Reported in forums by Paul Becker) 11/13/17 PaulT: CustomerReceipt.php: Add identifier to URL for delete link. (Reported in forums by Paul Becker) 11/13/17 PaulT: QATests.php: Correct wrong attribute name in two option tags. (Reported in forums by Paul Becker) |
From: <tu...@us...> - 2017-12-14 00:10:52
|
Revision: 7883 http://sourceforge.net/p/web-erp/reponame/7883 Author: turbopt Date: 2017-12-14 00:10:50 +0000 (Thu, 14 Dec 2017) Log Message: ----------- PDFCOA.php, PDFProdSpec: Minor value adjustment to correct inconsistent footer wrap. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/PDFCOA.php trunk/PDFProdSpec.php trunk/doc/Change.log Modified: trunk/PDFCOA.php =================================================================== --- trunk/PDFCOA.php 2017-12-13 22:49:21 UTC (rev 7882) +++ trunk/PDFCOA.php 2017-12-14 00:10:50 UTC (rev 7883) @@ -312,7 +312,7 @@ $LeftOvers = $pdf->addTextWrap($XPos+5,$YPos,500,$FontSize,$Disclaimer); while (mb_strlen($LeftOvers) > 1) { $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap($XPos+5,$YPos,445,$FontSize, $LeftOvers, 'left'); + $LeftOvers = $pdf->addTextWrap($XPos+5,$YPos,500,$FontSize, $LeftOvers, 'left'); } $pdf->OutputI($_SESSION['DatabaseName'] . 'COA' . date('Y-m-d') . '.pdf'); Modified: trunk/PDFProdSpec.php =================================================================== --- trunk/PDFProdSpec.php 2017-12-13 22:49:21 UTC (rev 7882) +++ trunk/PDFProdSpec.php 2017-12-14 00:10:50 UTC (rev 7883) @@ -280,7 +280,7 @@ $LeftOvers = $pdf->addTextWrap($XPos+5,$YPos,500,$FontSize,$Disclaimer); while (mb_strlen($LeftOvers) > 1) { $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap($XPos+5,$YPos,445,$FontSize, $LeftOvers, 'left'); + $LeftOvers = $pdf->addTextWrap($XPos+5,$YPos,500,$FontSize, $LeftOvers, 'left'); } $pdf->OutputI($_SESSION['DatabaseName'] . '_ProductSpecification_' . date('Y-m-d') . '.pdf'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-13 22:49:21 UTC (rev 7882) +++ trunk/doc/Change.log 2017-12-14 00:10:50 UTC (rev 7883) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: PDFCOA.php, PDFProdSpec: Minor value adjust to correct inconsistent footer wrap. (Reported in forums by Paul Becker) 11/13/17 PaulT: HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) 11/13/17 PaulT: PDFQALabel.php: Overlapping in the PDF when printing non-controlled items. (Reported in forums by Paul Becker) 11/13/17 PaulT: CustomerReceipt.php: Add identifier to URL for delete link. (Reported in forums by Paul Becker) |
From: <tu...@us...> - 2017-12-14 03:57:53
|
Revision: 7884 http://sourceforge.net/p/web-erp/reponame/7884 Author: turbopt Date: 2017-12-14 03:57:51 +0000 (Thu, 14 Dec 2017) Log Message: ----------- PDFCOA.php: Add column prodspeckey to queries which is used as a description alternative. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/PDFCOA.php trunk/doc/Change.log Modified: trunk/PDFCOA.php =================================================================== --- trunk/PDFCOA.php 2017-12-14 00:10:50 UTC (rev 7883) +++ trunk/PDFCOA.php 2017-12-14 03:57:51 UTC (rev 7884) @@ -88,6 +88,7 @@ type, testvalue, sampledate, + prodspeckey, groupby FROM qasamples INNER JOIN sampleresults ON sampleresults.sampleid=qasamples.sampleid @@ -108,6 +109,7 @@ type, testvalue, sampledate, + prodspeckey, groupby FROM qasamples INNER JOIN sampleresults ON sampleresults.sampleid=qasamples.sampleid Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-14 00:10:50 UTC (rev 7883) +++ trunk/doc/Change.log 2017-12-14 03:57:51 UTC (rev 7884) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: PDFCOA.php: Add column prodspeckey to queries which is used as a description alternative. (Reported in forums by Paul Becker) 11/13/17 PaulT: PDFCOA.php, PDFProdSpec: Minor value adjust to correct inconsistent footer wrap. (Reported in forums by Paul Becker) 11/13/17 PaulT: HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) 11/13/17 PaulT: PDFQALabel.php: Overlapping in the PDF when printing non-controlled items. (Reported in forums by Paul Becker) |
From: <tu...@us...> - 2017-12-15 01:06:50
|
Revision: 7885 http://sourceforge.net/p/web-erp/reponame/7885 Author: turbopt Date: 2017-12-15 01:06:48 +0000 (Fri, 15 Dec 2017) Log Message: ----------- CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) Modified Paths: -------------- trunk/CustomerReceipt.php trunk/doc/Change.log Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2017-12-14 03:57:51 UTC (rev 7884) +++ trunk/CustomerReceipt.php 2017-12-15 01:06:48 UTC (rev 7885) @@ -1018,7 +1018,10 @@ <td>' . $ReceiptItem->GLCode.' - '.$myrow['accountname'] . '</td> <td>' . stripslashes($ReceiptItem->Narrative) . '</td> <td>' . $ReceiptItem->TagName . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type'] . '&identifier=' . $identifier . '">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . urlencode($ReceiptItem->ID) + . '&Type=' . urlencode($_GET['Type']) + . '&identifier=' . urlencode($identifier) . '">' + . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-14 03:57:51 UTC (rev 7884) +++ trunk/doc/Change.log 2017-12-15 01:06:48 UTC (rev 7885) @@ -1,5 +1,6 @@ webERP Change Log +11/13/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) 11/13/17 PaulT: PDFCOA.php: Add column prodspeckey to queries which is used as a description alternative. (Reported in forums by Paul Becker) 11/13/17 PaulT: PDFCOA.php, PDFProdSpec: Minor value adjust to correct inconsistent footer wrap. (Reported in forums by Paul Becker) 11/13/17 PaulT: HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) |
From: <tu...@us...> - 2017-12-15 22:54:47
|
Revision: 7886 http://sourceforge.net/p/web-erp/reponame/7886 Author: turbopt Date: 2017-12-15 22:54:45 +0000 (Fri, 15 Dec 2017) Log Message: ----------- MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/doc/Change.log Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2017-12-15 01:06:48 UTC (rev 7885) +++ trunk/MRPPlannedPurchaseOrders.php 2017-12-15 22:54:45 UTC (rev 7886) @@ -149,26 +149,24 @@ while ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; - // Use to alternate between lines with transparent and painted background - if ($_POST['Fill'] == 'yes'){ - $fill=!$fill; - } - // Print information on part break - if ($Partctr > 0 & $holdpart != $myrow['part']) { + if ($Partctr > 0 AND $holdpart != $myrow['part']) { $pdf->addTextWrap(50,$YPos,130,$FontSize,$holddescription,'',0,$fill); $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); - $pdf->addTextWrap(230,$YPos,40,$FontSize,locale_number_format($holdcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(270,$YPos,50,$FontSize,locale_number_format($totalpartqty, $holddecimalplaces),'right',0,$fill); - $pdf->addTextWrap(320,$YPos,60,$FontSize,locale_number_format($totalpartcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(380,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); - $pdf->addTextWrap(410,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($holdcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($totalpartqty, $holddecimalplaces),'right',0,$fill); + $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($totalpartcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); + $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + // Get and print supplier info for part list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; + if (!Is_Date($lastdate)) { $displaydate = ' '; } + $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); $pdf->addTextWrap(130,$YPos,60,$FontSize,$displaydate,'left',0,$fill); @@ -179,6 +177,11 @@ $totalpartcost = 0; $totalpartqty = 0; $YPos -= (2*$line_height); + + // Use to alternate between lines with transparent and painted background + if ($_POST['Fill'] == 'yes'){ + $fill=!$fill; + } } // Parameters for addTextWrap are defined in /includes/class.pdf.php @@ -193,12 +196,14 @@ $pdf->addTextWrap(200,$YPos,60,$FontSize,$FormatedSupMRPDate,'right',0,$fill); $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'],$myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($extcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + if ($_POST['Consolidation'] == 'None'){ $pdf->addTextWrap(370,$YPos,80,$FontSize,$myrow['ordertype'],'right',0,$fill); $pdf->addTextWrap(450,$YPos,80,$FontSize,$myrow['orderno'],'right',0,$fill); } else { $pdf->addTextWrap(370,$YPos,100,$FontSize,$myrow['consolidatedcount'],'right',0,$fill); - }; + } + $holddescription = $myrow['description']; $holdpart = $myrow['part']; $holdmbflag = $myrow['mbflag']; @@ -214,23 +219,26 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$_POST['Consolidation'],$ReportDate); } + } /*end while loop */ - } /*end while loop */ // Print summary information for last part $YPos -=$line_height; - $pdf->addTextWrap(40,$YPos,130,$FontSize,$holddescription,'',0,$fill); - $pdf->addTextWrap(170,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(50,$YPos,130,$FontSize,$holddescription,'',0,$fill); + $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($holdcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($totalpartqty,$holddecimalplaces),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($totalpartcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + // Get and print supplier info for part list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; + if (!Is_Date($lastdate)) { $displaydate = ' '; } + $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); $pdf->addTextWrap(130,$YPos,60,$FontSize,$displaydate,'left',0,$fill); @@ -246,7 +254,8 @@ $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedPurchaseOrdersPageHeader.inc'); } -/*Print out the grand totals */ + + /*Print out the grand totals */ $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Purchase Orders: '), 'left'); $pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left'); $pdf->addTextWrap(200,$YPos,100,$FontSize,_('Total Extended Cost:'), 'right'); @@ -255,7 +264,6 @@ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRP_Planned_Purchase_Orders_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); - } else { /*The option to print PDF was not hit so display form */ $Title=_('MRP Planned Purchase Orders Reporting'); Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2017-12-15 01:06:48 UTC (rev 7885) +++ trunk/MRPPlannedWorkOrders.php 2017-12-15 22:54:45 UTC (rev 7886) @@ -68,7 +68,7 @@ stockmaster.overheadcost, computedcost ORDER BY mrpplannedorders.part,weekindex"; - } else { + } else { // This else consolidates by month $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, EXTRACT(YEAR_MONTH from duedate) AS yearmonth, @@ -111,7 +111,7 @@ include('includes/footer.php'); exit; } - if (DB_num_rows($result)==0){ //then there's nothing to print + if (DB_num_rows($result)==0){ //then there is nothing to print $Title = _('MRP Planned Work Orders'); include('includes/header.php'); prnMsg(_('There were no items with demand greater than supply'),'info'); @@ -135,7 +135,7 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$_POST['Consolidation'],$ReportDate); - $PartCounter = 0; + $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted $FontSize=8; @@ -151,18 +151,12 @@ while ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; - // Use to alternate between lines with transparent and painted background - if ($_POST['Fill'] == 'yes'){ - $fill=!$fill; - } - // Print information on part break - if ($PartCounter > 0 AND $HoldPart != $myrow['part']) { + if ($Partctr > 0 AND $HoldPart != $myrow['part']) { $pdf->addTextWrap(50,$YPos,130,$FontSize,$HoldDescription,'',0,$fill); - $pdf->addTextWrap(180,$YPos,40,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($HoldCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($TotalPartQty, - $HoldDecimalPlaces),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($TotalPartQty, $HoldDecimalPlaces),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($TotalPartCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); $pdf->addTextWrap(400,$YPos,15,$FontSize,$HoldMBFlag,'right',0,$fill); @@ -169,6 +163,11 @@ $TotalPartCost = 0; $TotalPartQty = 0; $YPos -= (2*$line_height); + + // Use to alternate between lines with transparent and painted background + if ($_POST['Fill'] == 'yes'){ + $fill=!$fill; + } } // Parameters for addTextWrap are defined in /includes/class.pdf.php @@ -181,15 +180,16 @@ $pdf->addTextWrap($Left_Margin,$YPos,110,$FontSize,$myrow['part'],'',0,$fill); $pdf->addTextWrap(150,$YPos,50,$FontSize,$FormatedSupDueDate,'right',0,$fill); $pdf->addTextWrap(200,$YPos,60,$FontSize,$FormatedSupMRPDate,'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'], - $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'], $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($ExtCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + if ($_POST['Consolidation'] == 'None'){ $pdf->addTextWrap(370,$YPos,80,$FontSize,$myrow['ordertype'],'right',0,$fill); $pdf->addTextWrap(450,$YPos,80,$FontSize,$myrow['orderno'],'right',0,$fill); } else { $pdf->addTextWrap(370,$YPos,100,$FontSize,$myrow['consolidatedcount'],'right',0,$fill); - }; + } + $HoldDescription = $myrow['description']; $HoldPart = $myrow['part']; $HoldMBFlag = $myrow['mbflag']; @@ -199,7 +199,7 @@ $TotalPartQty += $myrow['supplyquantity']; $Total_ExtCost += $ExtCost; - $PartCounter++; + $Partctr++; if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, @@ -206,12 +206,12 @@ $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } + } /*end while loop */ - } /*end while loop */ // Print summary information for last part $YPos -=$line_height; - $pdf->addTextWrap(40,$YPos,130,$FontSize,$HoldDescription,'',0,$fill); - $pdf->addTextWrap(170,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(50,$YPos,130,$FontSize,$HoldDescription,'',0,$fill); + $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($HoldCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($TotalPartQty,$HoldDecimalPlaces),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($TotalPartCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); @@ -225,18 +225,16 @@ $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } + /*Print out the grand totals */ $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Work Orders: '), 'left'); - $pdf->addTextWrap(150,$YPos,30,$FontSize,$PartCounter, 'left'); + $pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left'); $pdf->addTextWrap(200,$YPos,100,$FontSize,_('Total Extended Cost:'), 'right'); - $DisplayTotalVal = locale_number_format($Total_ExtCost,2); + $DisplayTotalVal = locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']); $pdf->addTextWrap(310,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); $pdf->OutputD($_SESSION['DatabaseName'] . '_MRP_Planned_Work_Orders_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); - - - } else { // Review planned work orders $Title = _('Review/Convert MRP Planned Work Orders'); @@ -324,7 +322,7 @@ echo '<table class="selection">'; echo '<tr> <td>' . _('Consolidation') . ':</td> - <td><select name="Consolidation"> + <td><select required="required" name="Consolidation"> <option selected="selected" value="None">' . _('None') . '</option> <option value="Weekly">' . _('Weekly') . '</option> <option value="Monthly">' . _('Monthly') . '</option> @@ -331,8 +329,8 @@ </select></td> </tr> <tr> - <td>' . _('Print Option') . ':</td><td> - <select name="Fill"> + <td>' . _('Print Option') . ':</td> + <td><select name="Fill"> <option selected="selected" value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> <option value="no">' . _('Plain Print') . '</option> </select></td> @@ -402,5 +400,5 @@ $FontSize=8; $YPos =$YPos - (2*$line_height); $PageNumber++; -} // End of PrintHeader() function +} // End of PrintHeader function ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-15 01:06:48 UTC (rev 7885) +++ trunk/doc/Change.log 2017-12-15 22:54:45 UTC (rev 7886) @@ -1,6 +1,7 @@ webERP Change Log -11/13/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) +11/14/17 PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) +11/14/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) 11/13/17 PaulT: PDFCOA.php: Add column prodspeckey to queries which is used as a description alternative. (Reported in forums by Paul Becker) 11/13/17 PaulT: PDFCOA.php, PDFProdSpec: Minor value adjust to correct inconsistent footer wrap. (Reported in forums by Paul Becker) 11/13/17 PaulT: HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) |
From: <tu...@us...> - 2017-12-18 23:35:41
|
Revision: 7887 http://sourceforge.net/p/web-erp/reponame/7887 Author: turbopt Date: 2017-12-18 23:35:39 +0000 (Mon, 18 Dec 2017) Log Message: ----------- PDFBOMListingPageHeader.inc, BOMListing.php: Adjust PDF position values, and add UoM. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/BOMListing.php trunk/doc/Change.log trunk/includes/PDFBOMListingPageHeader.inc Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2017-12-15 22:54:45 UTC (rev 7886) +++ trunk/BOMListing.php 2017-12-18 23:35:39 UTC (rev 7887) @@ -22,6 +22,7 @@ bom.component, stockmaster.description as compdescription, stockmaster.decimalplaces, + stockmaster.units, bom.quantity, bom.loccode, bom.workcentreadded, @@ -86,10 +87,11 @@ $DisplayQuantity = locale_number_format($BOMList['quantity'],$BOMList['decimalplaces']); $LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_frm']),'left'); - $LeftOvers = $pdf->addTextWrap(370,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); - $LeftOvers = $pdf->addTextWrap(420,$YPos,20,$FontSize,$BOMList['loccode'],'left'); - $LeftOvers = $pdf->addTextWrap(440,$YPos,30,$FontSize,$BOMList['workcentreadded'],'left'); + $LeftOvers = $pdf->addTextWrap(375,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); + $LeftOvers = $pdf->addTextWrap(430,$YPos,30,$FontSize,$BOMList['loccode'],'left'); + $LeftOvers = $pdf->addTextWrap(465,$YPos,30,$FontSize,$BOMList['workcentreadded'],'left'); $LeftOvers = $pdf->addTextWrap(480,$YPos,60,$FontSize,$DisplayQuantity,'right'); + $LeftOvers = $pdf->addTextWrap(540,$YPos,20,$FontSize,$BOMList['units'],'left'); if ($YPos < $Bottom_Margin + $line_height){ include('includes/PDFBOMListingPageHeader.inc'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-15 22:54:45 UTC (rev 7886) +++ trunk/doc/Change.log 2017-12-18 23:35:39 UTC (rev 7887) @@ -1,6 +1,7 @@ webERP Change Log -11/14/17 PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) +11/18/17 PaulT: PDFBOMListingPageHeader.inc, BOMListing.php: Adjust PDF position values, and add UoM. (Reported in forums by Paul Becker) +11/15/17 PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) 11/14/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) 11/13/17 PaulT: PDFCOA.php: Add column prodspeckey to queries which is used as a description alternative. (Reported in forums by Paul Becker) 11/13/17 PaulT: PDFCOA.php, PDFProdSpec: Minor value adjust to correct inconsistent footer wrap. (Reported in forums by Paul Becker) Modified: trunk/includes/PDFBOMListingPageHeader.inc =================================================================== --- trunk/includes/PDFBOMListingPageHeader.inc 2017-12-15 22:54:45 UTC (rev 7886) +++ trunk/includes/PDFBOMListingPageHeader.inc 2017-12-18 23:35:39 UTC (rev 7887) @@ -36,12 +36,12 @@ /*set up the headings */ $Xpos = $Left_Margin+1; -$LeftOvers = $pdf->addTextWrap($Xpos,$YPos,320 - $Left_Margin,$FontSize,_('Component Part/Description'),'centre'); -$LeftOvers = $pdf->addTextWrap(300,$YPos,60,$FontSize,_('Effective After'),'centre'); -$LeftOvers = $pdf->addTextWrap(348,$YPos,60,$FontSize,_('Effective To'),'centre'); -$LeftOvers = $pdf->addTextWrap(403,$YPos,40,$FontSize,_('Locn'),'centre'); -$LeftOvers = $pdf->addTextWrap(435,$YPos,40,$FontSize,_('Wrk Cntr'),'centre'); -$LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,_('Quantity'),'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos,$YPos,320 - $Left_Margin,$FontSize,_('Component Part/Description'),'center'); +$LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,_('Effective After'),'left'); +$LeftOvers = $pdf->addTextWrap(380,$YPos,50,$FontSize,_('Effective To'),'left'); +$LeftOvers = $pdf->addTextWrap(440,$YPos,30,$FontSize,_('Locn'),'left'); +$LeftOvers = $pdf->addTextWrap(480,$YPos,30,$FontSize,_('Wrk Cntr'),'left'); +$LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,_('Quantity'),'right'); $YPos =$YPos - (2*$line_height); |
From: <tu...@us...> - 2017-12-19 00:06:39
|
Revision: 7888 http://sourceforge.net/p/web-erp/reponame/7888 Author: turbopt Date: 2017-12-19 00:06:37 +0000 (Tue, 19 Dec 2017) Log Message: ----------- BOMIndented.php, BOMIndentedReverse.php: Adjust PDF position values, and add UoM, remove stray 0-9 string output. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/doc/Change.log Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2017-12-18 23:35:39 UTC (rev 7887) +++ trunk/BOMIndented.php 2017-12-19 00:06:37 UTC (rev 7888) @@ -177,7 +177,8 @@ $Tot_Val=0; $sql = "SELECT tempbom.*, stockmaster.description, - stockmaster.mbflag + stockmaster.mbflag, + stockmaster.units FROM tempbom,stockmaster WHERE tempbom.component = stockmaster.stockid ORDER BY sortpart"; @@ -206,14 +207,15 @@ // 1) X position 2) Y position 3) Width // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - $pdf->addTextWrap($Left_Margin+($myrow['level'] * 5),$YPos,90,$FontSize,$myrow['component'],'',0,$fill); - $pdf->addTextWrap(160,$YPos,20,$FontSize,$myrow['mbflag'],'',0,$fill); - $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); - $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],'Variable'),'right',0,$fill); - $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); - $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); + $pdf->addTextWrap($Left_Margin+($myrow['level'] * 5),$YPos,90,$FontSize,$myrow['component'],'left',0,$fill); + $pdf->addTextWrap(160,$YPos,20,$FontSize,$myrow['mbflag'],'left',0,$fill); + $pdf->addTextWrap(180,$YPos,165,$FontSize,$myrow['description'],'left',0,$fill); + $pdf->addTextWrap(345,$YPos,30,$FontSize,$myrow['loccode'],'left',0,$fill); + $pdf->addTextWrap(375,$YPos,25,$FontSize,$myrow['workcentreadded'],'left',0,$fill); + $pdf->addTextWrap(400,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],'Variable'),'right',0,$fill); + $pdf->addTextWrap(445,$YPos,20,$FontSize,$myrow['units'],'left',0,$fill); + $pdf->addTextWrap(465,$YPos,50,$FontSize,$FormatedEffectiveAfter,'left',0,$fill); + $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'left',0,$fill); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, @@ -312,12 +314,13 @@ $pdf->addTextWrap($Xpos,$YPos,90,$FontSize,_('Part Number'), 'left'); $pdf->addTextWrap(160,$YPos,20,$FontSize,_('M/B'), 'left'); - $pdf->addTextWrap(180,$YPos,180,$FontSize,_('Description'), 'center'); - $pdf->addTextWrap(360,$YPos,30,$FontSize,_('Locn'), 'right'); - $pdf->addTextWrap(390,$YPos,25,$FontSize,_('WC'), 'right'); - $pdf->addTextWrap(415,$YPos,45,$FontSize,_('Quantity'), 'right'); - $pdf->addTextWrap(460,$YPos,55,$FontSize,_('From Date'), 'right'); - $pdf->addTextWrap(515,$YPos,50,$FontSize,_('To Date'), 'right'); + $pdf->addTextWrap(180,$YPos,165,$FontSize,_('Description'), 'center'); + $pdf->addTextWrap(345,$YPos,30,$FontSize,_('Locn'), 'left'); + $pdf->addTextWrap(375,$YPos,25,$FontSize,_('WC'), 'left'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,_('Quantity'), 'right'); + $pdf->addTextWrap(445,$YPos,20,$FontSize,_('UOM'), 'left'); + $pdf->addTextWrap(465,$YPos,50,$FontSize,_('From Date'), 'left'); + $pdf->addTextWrap(515,$YPos,50,$FontSize,_('To Date'), 'left'); $YPos =$YPos - $line_height; $FontSize=8; @@ -328,8 +331,6 @@ $pdf->addTextWrap(185,$YPos,150,$FontSize,$assemblydesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; - $pdf->addTextWrap($Xpos,$YPos,90,$FontSize,_(' 12345678901234567890'), 'left'); - $YPos -=$line_height; $PageNumber++; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2017-12-18 23:35:39 UTC (rev 7887) +++ trunk/BOMIndentedReverse.php 2017-12-19 00:06:37 UTC (rev 7888) @@ -166,7 +166,8 @@ $pdf->SetFillColor(224,235,255); $sql = "SELECT tempbom.*, stockmaster.description, - stockmaster.mbflag + stockmaster.mbflag, + stockmaster.units FROM tempbom INNER JOIN stockmaster ON tempbom.parent = stockmaster.stockid INNER JOIN locationusers ON locationusers.loccode=tempbom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 @@ -192,14 +193,15 @@ // 1) X position 2) Y position 3) Width // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - $pdf->addTextWrap($Left_Margin+($myrow['level'] * 5),$YPos,90,$FontSize,$myrow['parent'],'',0,$fill); - $pdf->addTextWrap(160,$YPos,20,$FontSize,$myrow['mbflag'],'',0,$fill); - $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); - $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],'Variable'),'right',0,$fill); - $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); - $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); + $pdf->addTextWrap($Left_Margin+($myrow['level'] * 5),$YPos,90,$FontSize,$myrow['component'],'left',0,$fill); + $pdf->addTextWrap(160,$YPos,20,$FontSize,$myrow['mbflag'],'left',0,$fill); + $pdf->addTextWrap(180,$YPos,165,$FontSize,$myrow['description'],'left',0,$fill); + $pdf->addTextWrap(345,$YPos,30,$FontSize,$myrow['loccode'],'left',0,$fill); + $pdf->addTextWrap(375,$YPos,25,$FontSize,$myrow['workcentreadded'],'left',0,$fill); + $pdf->addTextWrap(400,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],'Variable'),'right',0,$fill); + $pdf->addTextWrap(445,$YPos,20,$FontSize,$myrow['units'],'left',0,$fill); + $pdf->addTextWrap(465,$YPos,50,$FontSize,$FormatedEffectiveAfter,'left',0,$fill); + $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'left',0,$fill); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, @@ -215,6 +217,7 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$AssemblyDesc); } + if ($ListCount == 0) { $Title = _('Print Reverse Indented BOM Listing Error'); include('includes/header.php'); @@ -265,7 +268,6 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$AssemblyDesc) { - $line_height=12; /*PDF page header for Reverse Indented BOM Listing report */ if ($PageNumber>1){ @@ -290,23 +292,24 @@ $pdf->addTextWrap($Xpos,$YPos,90,$FontSize,_('Part Number'), 'left'); $pdf->addTextWrap(160,$YPos,20,$FontSize,_('M/B'), 'left'); - $pdf->addTextWrap(180,$YPos,180,$FontSize,_('Description'), 'center'); - $pdf->addTextWrap(360,$YPos,30,$FontSize,_('Locn'), 'right'); - $pdf->addTextWrap(390,$YPos,25,$FontSize,_('WC'), 'right'); - $pdf->addTextWrap(415,$YPos,45,$FontSize,_('Quantity'), 'right'); - $pdf->addTextWrap(460,$YPos,55,$FontSize,_('From Date'), 'right'); - $pdf->addTextWrap(515,$YPos,50,$FontSize,_('To Date'), 'right'); + $pdf->addTextWrap(180,$YPos,165,$FontSize,_('Description'), 'center'); + $pdf->addTextWrap(345,$YPos,30,$FontSize,_('Locn'), 'left'); + $pdf->addTextWrap(375,$YPos,25,$FontSize,_('WC'), 'left'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,_('Quantity'), 'right'); + $pdf->addTextWrap(445,$YPos,20,$FontSize,_('UOM'), 'left'); + $pdf->addTextWrap(465,$YPos,50,$FontSize,_('From Date'), 'left'); + $pdf->addTextWrap(515,$YPos,50,$FontSize,_('To Date'), 'left'); $YPos =$YPos - $line_height; + $FontSize=8; + $YPos =$YPos - (2*$line_height); + $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,_('Component:'),'',0); $pdf->addTextWrap(100,$YPos,100,$FontSize,mb_strtoupper($_POST['Part']),'',0); $pdf->addTextWrap(200,$YPos,150,$FontSize,$AssemblyDesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; - $FontSize=8; - $pdf->addTextWrap($Xpos,$YPos,90,$FontSize,_(' 12345678901234567890'), 'left'); - $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader function Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-18 23:35:39 UTC (rev 7887) +++ trunk/doc/Change.log 2017-12-19 00:06:37 UTC (rev 7888) @@ -1,5 +1,6 @@ webERP Change Log +11/18/17 PaulT: BOMIndented.php, BOMIndentedReverse.php: Adjust PDF position values, and add UoM, remove stray 0-9 string output. (Reported in forums by Paul Becker) 11/18/17 PaulT: PDFBOMListingPageHeader.inc, BOMListing.php: Adjust PDF position values, and add UoM. (Reported in forums by Paul Becker) 11/15/17 PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) 11/14/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) |
From: <tu...@us...> - 2017-12-19 04:31:42
|
Revision: 7889 http://sourceforge.net/p/web-erp/reponame/7889 Author: turbopt Date: 2017-12-19 04:31:39 +0000 (Tue, 19 Dec 2017) Log Message: ----------- ReportCreator.php: PHP 7.1 array compatibility change. (Reported in forums by rjonesbsink) Modified Paths: -------------- trunk/doc/Change.log trunk/reportwriter/admin/ReportCreator.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-19 00:06:37 UTC (rev 7888) +++ trunk/doc/Change.log 2017-12-19 04:31:39 UTC (rev 7889) @@ -1,5 +1,6 @@ webERP Change Log +11/18/17 PaulT: ReportCreator.php: PHP 7.1 array compatibility change. (Reported in forums by rjonesbsink) 11/18/17 PaulT: BOMIndented.php, BOMIndentedReverse.php: Adjust PDF position values, and add UoM, remove stray 0-9 string output. (Reported in forums by Paul Becker) 11/18/17 PaulT: PDFBOMListingPageHeader.inc, BOMListing.php: Adjust PDF position values, and add UoM. (Reported in forums by Paul Becker) 11/15/17 PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) Modified: trunk/reportwriter/admin/ReportCreator.php =================================================================== --- trunk/reportwriter/admin/ReportCreator.php 2017-12-19 00:06:37 UTC (rev 7888) +++ trunk/reportwriter/admin/ReportCreator.php 2017-12-19 04:31:39 UTC (rev 7889) @@ -35,7 +35,8 @@ require_once('defaults.php'); require('RCFunctions.inc'); -$usrMsg = ''; // initialize array for return messages +$usrMsg = array(); // initialize array for return messages + // a valid report id needs to be passed as a post field to do anything, except create new report if (!isset($_POST['ReportID'])) { // entered for the first time or created new report $ReportID = ''; |
From: <tu...@us...> - 2017-12-19 20:49:27
|
Revision: 7890 http://sourceforge.net/p/web-erp/reponame/7890 Author: turbopt Date: 2017-12-19 20:49:25 +0000 (Tue, 19 Dec 2017) Log Message: ----------- Contract_Readin.php: Add customerref field to query to appear in the form when a contract is modified. Modified Paths: -------------- trunk/doc/Change.log trunk/includes/Contract_Readin.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-19 04:31:39 UTC (rev 7889) +++ trunk/doc/Change.log 2017-12-19 20:49:25 UTC (rev 7890) @@ -1,5 +1,6 @@ webERP Change Log +11/19/17 PaulT: Contract_Readin.php: Add customerref field to query to appear in the form when a contract is modified. 11/18/17 PaulT: ReportCreator.php: PHP 7.1 array compatibility change. (Reported in forums by rjonesbsink) 11/18/17 PaulT: BOMIndented.php, BOMIndentedReverse.php: Adjust PDF position values, and add UoM, remove stray 0-9 string output. (Reported in forums by Paul Becker) 11/18/17 PaulT: PDFBOMListingPageHeader.inc, BOMListing.php: Adjust PDF position values, and add UoM. (Reported in forums by Paul Becker) Modified: trunk/includes/Contract_Readin.php =================================================================== --- trunk/includes/Contract_Readin.php 2017-12-19 04:31:39 UTC (rev 7889) +++ trunk/includes/Contract_Readin.php 2017-12-19 20:49:25 UTC (rev 7890) @@ -6,6 +6,7 @@ contracts.debtorno, contracts.branchcode, contracts.loccode, + contracts.customerref, status, categoryid, orderno, @@ -39,6 +40,7 @@ $_SESSION['Contract'.$identifier]->DebtorNo = $myrow['debtorno']; $_SESSION['Contract'.$identifier]->BranchCode = $myrow['branchcode']; $_SESSION['Contract'.$identifier]->LocCode = $myrow['loccode']; + $_SESSION['Contract'.$identifier]->CustomerRef = $myrow['customerref']; $_SESSION['Contract'.$identifier]->Status = $myrow['status']; $_SESSION['Contract'.$identifier]->CategoryID = $myrow['categoryid']; $_SESSION['Contract'.$identifier]->OrderNo = $myrow['orderno']; |
From: <tu...@us...> - 2017-12-20 00:48:38
|
Revision: 7891 http://sourceforge.net/p/web-erp/reponame/7891 Author: turbopt Date: 2017-12-20 00:48:35 +0000 (Wed, 20 Dec 2017) Log Message: ----------- Contracts.php: Move work center handling causing a partial form to appear after the footer when no work centers exist. Modified Paths: -------------- trunk/Contracts.php trunk/doc/Change.log Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2017-12-19 20:49:25 UTC (rev 7890) +++ trunk/Contracts.php 2017-12-20 00:48:35 UTC (rev 7891) @@ -840,6 +840,16 @@ } echo '</p>'; + $sql = "SELECT code, description FROM workcentres INNER JOIN locationusers ON locationusers.loccode=workcentres.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; + $wcresults = DB_query($sql); + + if (DB_num_rows($wcresults)==0){ + prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); + echo '<br /><a href="'.$RootPath.'/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; + include('includes/footer.php'); + exit; + } + /*Set up form for entry of contract header stuff */ echo '<table class="selection"> @@ -857,7 +867,7 @@ </tr> <tr> <td>' . _('Category') . ':</td> - <td><select name="CategoryID" >'; + <td><select name="CategoryID">'; $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); @@ -872,7 +882,7 @@ } } - echo '</select><a target="_blank" href="'. $RootPath . '/StockCategories.php">' . _('Add or Modify Contract Categories') . '</a></td></tr>'; + echo '</select> <a target="_blank" href="'. $RootPath . '/StockCategories.php">' . _('Add or Modify Contract Categories') . '</a></td></tr>'; $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $ErrMsg = _('The stock locations could not be retrieved because'); @@ -881,7 +891,7 @@ echo '<tr> <td>' . _('Location') . ':</td> - <td><select name="LocCode" >'; + <td><select name="LocCode">'; while ($myrow=DB_fetch_array($result)){ if (!isset($_SESSION['Contract'.$identifier]->LocCode) or $myrow['loccode']==$_SESSION['Contract'.$identifier]->LocCode){ echo '<option selected="selected" value="'. $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -891,20 +901,11 @@ } echo '</select></td></tr>'; - $sql = "SELECT code, description FROM workcentres INNER JOIN locationusers ON locationusers.loccode=workcentres.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; - $result = DB_query($sql); - - if (DB_num_rows($result)==0){ - prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); - echo '<br /><a href="'.$RootPath.'/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; - include('includes/footer.php'); - exit; - } echo '<tr><td>' . _('Default Work Centre') . ': </td><td>'; echo '<select name="DefaultWorkCentre">'; - while ($myrow = DB_fetch_array($result)) { + while ($myrow = DB_fetch_array($wcresults)) { if (isset($_POST['DefaultWorkCentre']) and $myrow['code']==$_POST['DefaultWorkCentre']) { echo '<option selected="selected" value="'.$myrow['code'] . '">' . $myrow['description'] . '</option>'; } else { @@ -913,6 +914,7 @@ } //end while loop DB_free_result($result); + DB_free_result($wcresults); echo '</select></td> </tr> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-19 20:49:25 UTC (rev 7890) +++ trunk/doc/Change.log 2017-12-20 00:48:35 UTC (rev 7891) @@ -1,5 +1,6 @@ webERP Change Log +11/19/17 PaulT: Contracts.php: Move work center handling causing a partial form to appear after the footer when no work centers exist. 11/19/17 PaulT: Contract_Readin.php: Add customerref field to query to appear in the form when a contract is modified. 11/18/17 PaulT: ReportCreator.php: PHP 7.1 array compatibility change. (Reported in forums by rjonesbsink) 11/18/17 PaulT: BOMIndented.php, BOMIndentedReverse.php: Adjust PDF position values, and add UoM, remove stray 0-9 string output. (Reported in forums by Paul Becker) |
From: <tu...@us...> - 2017-12-20 01:29:06
|
Revision: 7893 http://sourceforge.net/p/web-erp/reponame/7893 Author: turbopt Date: 2017-12-20 01:29:04 +0000 (Wed, 20 Dec 2017) Log Message: ----------- PDFOrderStatus.php: Remove redundant ConnectDB.inc include reference. (already included by session.php at the top of the file) Modified Paths: -------------- trunk/PDFOrderStatus.php trunk/doc/Change.log Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2017-12-20 01:10:51 UTC (rev 7892) +++ trunk/PDFOrderStatus.php 2017-12-20 01:29:04 UTC (rev 7893) @@ -2,7 +2,7 @@ /* $Id$*/ -include ('includes/session.php'); +include('includes/session.php'); include('includes/SQL_CommonFunctions.inc'); $InputError=0; @@ -86,7 +86,6 @@ include('includes/footer.php'); exit; } else { - include('includes/ConnectDB.inc'); include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Order Status Report')); $pdf->addInfo('Subject',_('Orders from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-20 01:10:51 UTC (rev 7892) +++ trunk/doc/Change.log 2017-12-20 01:29:04 UTC (rev 7893) @@ -1,5 +1,6 @@ webERP Change Log +19/12/17 PaulT: PDFOrderStatus.php: Remove redundant ConnectDB.inc include reference. (already included by session.php at the top of the file) 19/12/17 PaulT: Change.log: Correct my Day/Month entry references over the last few days. 19/12/17 PaulT: Contracts.php: Move work center handling causing a partial form to appear after the footer when no work centers exist. 19/12/17 PaulT: Contract_Readin.php: Add customerref field to query to appear in the form when a contract is modified. |
From: <tu...@us...> - 2017-12-20 18:36:11
|
Revision: 7894 http://sourceforge.net/p/web-erp/reponame/7894 Author: turbopt Date: 2017-12-20 18:36:08 +0000 (Wed, 20 Dec 2017) Log Message: ----------- RCFunctions.inc, FormMaker.php: PHP 7.1 array compatibility change. Modified Paths: -------------- trunk/doc/Change.log trunk/reportwriter/FormMaker.php trunk/reportwriter/admin/RCFunctions.inc Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-20 01:29:04 UTC (rev 7893) +++ trunk/doc/Change.log 2017-12-20 18:36:08 UTC (rev 7894) @@ -1,5 +1,6 @@ webERP Change Log +20/12/17 PaulT: RCFunctions.inc, FormMaker.php: PHP 7.1 array compatibility change. 19/12/17 PaulT: PDFOrderStatus.php: Remove redundant ConnectDB.inc include reference. (already included by session.php at the top of the file) 19/12/17 PaulT: Change.log: Correct my Day/Month entry references over the last few days. 19/12/17 PaulT: Contracts.php: Move work center handling causing a partial form to appear after the footer when no work centers exist. Modified: trunk/reportwriter/FormMaker.php =================================================================== --- trunk/reportwriter/FormMaker.php 2017-12-20 01:29:04 UTC (rev 7893) +++ trunk/reportwriter/FormMaker.php 2017-12-20 18:36:08 UTC (rev 7894) @@ -147,7 +147,7 @@ ORDER BY groupname, reportname"; $Result=DB_query($sql,'','',false,true); - $FormList = ''; + $FormList = array(); while ($Temp = DB_fetch_array($Result)) $FormList[] = $Temp; foreach ($FormGroups as $index=>$value) { $Group=explode(':',$index); // break into main group and form group array Modified: trunk/reportwriter/admin/RCFunctions.inc =================================================================== --- trunk/reportwriter/admin/RCFunctions.inc 2017-12-20 01:29:04 UTC (rev 7893) +++ trunk/reportwriter/admin/RCFunctions.inc 2017-12-20 18:36:08 UTC (rev 7894) @@ -75,7 +75,7 @@ WHERE defaultreport='1' AND reporttype='frm' ORDER BY groupname, reportname"; $Result=DB_query($sql,'','',false,true); - $FormList = ''; + $FormList = array(); while ($Temp = DB_fetch_array($Result)) $FormList[] = $Temp; foreach ($FormGroups as $index=>$value) { $Group=explode(':',$index); // break into main group and form group array |