This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ex...@us...> - 2016-08-31 06:32:59
|
Revision: 7605 http://sourceforge.net/p/web-erp/reponame/7605 Author: exsonqu Date: 2016-08-31 06:32:57 +0000 (Wed, 31 Aug 2016) Log Message: ----------- 31/08/16 Exson: Addd new feature assign cash from one tab to another. Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.13-4.13.1.sql Added Paths: ----------- trunk/PcAssignCashTabToTab.php Added: trunk/PcAssignCashTabToTab.php =================================================================== --- trunk/PcAssignCashTabToTab.php (rev 0) +++ trunk/PcAssignCashTabToTab.php 2016-08-31 06:32:57 UTC (rev 7605) @@ -0,0 +1,393 @@ +<?php + +include('includes/session.inc'); +$Title = _('Assignment of Cash From Tab To Tab'); +/* webERP manual links before header.inc */ +$ViewTopic= 'PettyCash'; +$BookMark = 'CashAssignment'; +include('includes/header.inc'); + +if (isset($_POST['SelectedTabs'])){ + $SelectedTabs = mb_strtoupper($_POST['SelectedTabs']); +} elseif (isset($_GET['SelectedTabs'])){ + $SelectedTabs = mb_strtoupper($_GET['SelectedTabs']); +} + +if (isset($_POST['Days'])){ + $Days = $_POST['Days']; +} elseif (isset($_GET['Days'])){ + $Days = $_GET['Days']; +} + +if (isset($_POST['Cancel'])) { + unset($SelectedTabs); + unset($Days); + unset($_POST['Amount']); + unset($_POST['Notes']); + unset($_POST['Receipt']); +} + +if (isset($_POST['Process'])) { + if ($SelectedTabs=='') { + prnMsg(_('You Must First Select a Petty Cash Tab To Assign Cash'),'error'); + unset($SelectedTabs); + } + if ($SelectedTabs == mb_strtoupper($_POST['SelectedTabsTo'])) { + prnMsg(_('The Tab selected From should not be the same as the selected To'),'error'); + unset($SelectedTabs); + unset($_POST['SelectedTabsTo']); + unset($_POST['Process']); + } +} + +if (isset($_POST['Go'])) { + $InputError = 0; + if ($Days<=0) { + $InputError = 1; + prnMsg(_('The number of days must be a positive number'),'error'); + $Days=30; + } +} + +if (isset($_POST['submit'])) { + //initialise no input errors assumed initially before we test + $InputError = 0; + + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . + _('Search') . '" alt="" />' . ' ' . $Title. '</p>'; + + /* actions to take once the user has clicked the submit button + ie the page has called itself with some user input */ + + $i=1; + + if ($_POST['Amount']==0) { + $InputError = 1; + prnMsg('<br />' . _('The Amount must be input'),'error'); + } + + $sqlLimit = "SELECT tablimit,tabcode + FROM pctabs + WHERE tabcode IN ('" . $SelectedTabs . "','" . $_POST['SelectedTabsTo'] . "')"; + + $ResultLimit = DB_query($sqlLimit,$db); + while ($LimitRow=DB_fetch_array($ResultLimit)){ + if ($LimitRow['tabcode'] == $SelectedTabs) { + if (($_POST['CurrentAmount']+$_POST['Amount'])>$LimitRow['tablimit']){ + $InputError = 1; + prnMsg(_('The balance after this assignment would be greater than the specified limit for this PC tab') . ' ' . $LimitRow[1],'error'); + } + } elseif ($_POST['SelectedTabsToAmt'] - $_POST['Amount']>$LimitRow['tablimit']) { + $InputError = 1; + prnMsg(_('The balance after this assignment would be greater than the specified limit for this PC tab') . ' ' . $LimitRow[1],'error'); + } + } + + if ($InputError !=1 ) { + // Add these 2 new record on submit + $sql = "INSERT INTO pcashdetails + (counterindex, + tabcode, + date, + codeexpense, + amount, + authorized, + posted, + notes, + receipt) + VALUES (NULL, + '" . $_POST['SelectedTabs'] . "', + '".FormatDateForSQL($_POST['Date'])."', + 'ASSIGNCASH', + '" . filter_number_format($_POST['Amount']) . "', + '0000-00-00', + '0', + '" . $_POST['Notes'] . "', + '" . $_POST['Receipt'] . "' + ), + (NULL, + '" . $_POST['SelectedTabsTo'] . "', + '" . FormatDateForSQL($_POST['Date']) . "', + 'ASSIGNCASH', + '" . filter_number_format(-$_POST['Amount']) . "', + '0000-00-00', + '0', + '" . $_POST['Notes'] . "', + '" . $_POST['Receipt'] . "')"; + $msg = _('Assignment of cash from PC Tab ') . ' ' . $_POST['SelectedTabs'] . ' ' . _('to') . $_POST['SelectedTabsTo'] . ' ' . _('has been created'); + } + + if ( $InputError !=1) { + //run the SQL from either of the above possibilites + $result = DB_query($sql,$db); + prnMsg($msg,'success'); + unset($_POST['SelectedExpense']); + unset($_POST['Amount']); + unset($_POST['Notes']); + unset($_POST['Receipt']); + unset($_POST['SelectedTabs']); + unset($_POST['Date']); + } + +} + +if (!isset($SelectedTabs)){ + + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . + _('Search') . '" alt="" />' . ' ' . $Title. '</p>'; + + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + $SQL = "SELECT tabcode + FROM pctabs + WHERE assigner='" . $_SESSION['UserID'] . "' + ORDER BY tabcode"; + + $result = DB_query($SQL,$db); + + echo '<br /><table class="selection">'; //Main table + + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash From') . ':</td> + <td><select name="SelectedTabs">'; + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . '</option>'; + } + + echo '</select></td></tr>'; + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash To') . ':</td> + <td><select name="SelectedTabsTo">'; + DB_data_seek($result,0); + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectTabsTo']) AND $myrow['tabcode'] == $_POST['SelectTabs']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . '</option>'; + } + echo '</select></td></tr>'; + echo '</table>'; // close main table + DB_free_result($result); + + echo '<br /> + <div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; + echo '</div> + </form>'; +} + +//end of ifs and buts! +if (isset($_POST['Process']) OR isset($SelectedTabs)) { + + if (!isset($_POST['submit'])) { + echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . + _('Search') . '" alt="" />' . ' ' . $Title. '</p>'; + } + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Select another tab') . '</a></div>'; + + + + if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ + + if (isset($_POST['Cancel'])) { + unset($_POST['Amount']); + unset($_POST['Date']); + unset($_POST['Notes']); + unset($_POST['Receipt']); + } + + if(!isset ($Days)){ + $Days=30; + } + + /* Retrieve decimal places to display */ + $SqlDecimalPlaces="SELECT decimalplaces + FROM currencies,pctabs + WHERE currencies.currabrev = pctabs.currency + AND tabcode='" . $SelectedTabs . "'"; + $result = DB_query($SqlDecimalPlaces,$db); + $myrow=DB_fetch_array($result); + $CurrDecimalPlaces = $myrow['decimalplaces']; + + $sql = "SELECT * FROM pcashdetails + WHERE tabcode='" . $SelectedTabs . "' + AND date >=DATE_SUB(CURDATE(), INTERVAL " . $Days . " DAY) + ORDER BY date, counterindex ASC"; + $result = DB_query($sql,$db); + + 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"> + <tr> + <th colspan="8">' . _('Detail Of PC 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> + <tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Authorised') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + </tr>'; + + $k=0; //row colour counter + + while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $sqldes="SELECT description + FROM pcexpenses + WHERE codeexpense='". $myrow['3'] . "'"; + + $ResultDes = DB_query($sqldes,$db); + $Description=DB_fetch_array($ResultDes); + + if (!isset($Description['0'])){ + $Description['0']='ASSIGNCASH'; + } + + if (($myrow['authorized'] == '0000-00-00') and ($Description['0'] == 'ASSIGNCASH')){ + // only cash assignations NOT authorized can be modified or deleted + echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> + <td>' . $Description['0'] . '</td> + <td class="number">' . locale_number_format($myrow['amount'],$CurrDecimalPlaces) . '</td> + <td>' . ConvertSQLDate($myrow['authorized']) . '</td> + <td>' . $myrow['notes'] . '</td> + <td>' . $myrow['receipt'] . '</td> + </tr>'; + }else{ + echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> + <td>' . $Description['0'] . '</td> + <td class="number">' . locale_number_format($myrow['amount'],$CurrDecimalPlaces) . '</td> + <td>' . ConvertSQLDate($myrow['authorized']) . '</td> + <td>' . $myrow['notes'] . '</td> + <td>' . $myrow['receipt'] . '</td> + </tr>'; + } + } + //END WHILE LIST LOOP + + $sqlamount="SELECT sum(amount) as amt, + tabcode + FROM pcashdetails + WHERE tabcode IN ('".$SelectedTabs."','" . $_POST['SelectedTabsTo'] . "') + GROUP BY tabcode"; + + $ResultAmount = DB_query($sqlamount,$db); + if (DB_num_rows($ResultAmount)>0) { + while ($AmountRow=DB_fetch_array($ResultAmount)) { + if (is_null($AmountRow['amt'])) { + $AmountRow['amt'] = 0; + } + if ($AmountRow['tabcode'] == $SelectedTabs) { + $SelectedTab = array($AmountRow['amt'],$SelectedTabs); + } else { + $SelectedTabsTo = array($AmountRow['amt'],$_POST['SelectedTabsTo']); + } + } + } + if (!isset($SelectedTab)) { + $SelectedTab = array(0,$SelectedTabs); + $SelectedTabsTo = array(0,$_POST['SelectedTabsTo']); + } + + + + echo '<tr> + <td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> + <td>' . locale_number_format($SelectedTab['0'],$CurrDecimalPlaces) . '</td></tr> + <input type="hidden" name="CurrentAmount" value="' . $SelectedTab[0] . '" /> + <input type="hidden" name="SelectedTabs" value="' . $SelectedTab[1] . '" /> + <input type="hidden" name="SelectedTabsTo" value="' . $SelectedTabsTo[1] . '" /> + <input type="hidden" name="SelectedTabsToAmt" value="' . $SelectedTabsTo[0] . '" />'; + + + echo '</table>'; + echo '</div> + </form>'; + } + + + + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'"> + <div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + +/* Ricard: needs revision of this date initialization */ + if (!isset($_POST['Date'])) { + $_POST['Date']=Date($_SESSION['DefaultDateFormat']); + } + + echo '<br /> + <table class="selection">'; //Main table + echo '<tr> + <th colspan="2"><h3>' . _('New Cash Assignment') . '</h3></th> + </tr>'; + echo '<tr> + <td>' . _('Cash Assignation Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" required="required" autofocus="autofocus" size="10" maxlength="10" value="' . $_POST['Date'] . '" /></td> + </tr>'; + + + if (!isset($_POST['Amount'])) { + $_POST['Amount']=0; + } + + echo '<tr> + <td>' . _('Amount') . ':</td> + <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . locale_number_format($_POST['Amount'],$CurrDecimalPlaces) . '" /></td> + </tr>'; + + if (!isset($_POST['Notes'])) { + $_POST['Notes']=''; + } + + echo '<tr> + <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> + </table> + <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] . '" /> + <input type="hidden" name="SelectedTabsToAmt" value="' . $SelectedTabsTo[0] . '" /> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div> + </div> + </form>'; + +} + +include('includes/footer.inc'); +?> Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2016-08-25 21:05:53 UTC (rev 7604) +++ trunk/includes/MainMenuLinksArray.php 2016-08-31 06:32:57 UTC (rev 7605) @@ -446,10 +446,12 @@ '/MaintenanceTasks.php'); $MenuItems['PC']['Transactions']['Caption'] = array(_('Assign Cash to PC Tab'), + _('Cash Transfer Between Tabs'), _('Claim Expenses From PC Tab'), _('Expenses Authorisation')); $MenuItems['PC']['Transactions']['URL'] = array('/PcAssignCashToTab.php', + '/PcAssignCashTabToTab.php', '/PcClaimExpensesFromTab.php', '/PcAuthorizeExpenses.php'); Modified: trunk/sql/mysql/upgrade4.13-4.13.1.sql =================================================================== --- trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-25 21:05:53 UTC (rev 7604) +++ trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-31 06:32:57 UTC (rev 7605) @@ -8,5 +8,6 @@ -- standardise transaction date to DATE type: ALTER TABLE `debtortrans` CHANGE `trandate` `trandate` DATE NOT NULL DEFAULT '0000-00-00'; ALTER table supplierdiscounts CONVERT TO CHARACTER SET utf8; +INSERT INTO scripts VALUES ('PcAssignCashTabToTab.php',12,'Assign cash from one tab to another'); |
From: <rc...@us...> - 2016-08-25 21:05:54
|
Revision: 7604 http://sourceforge.net/p/web-erp/reponame/7604 Author: rchacon Date: 2016-08-25 21:05:53 +0000 (Thu, 25 Aug 2016) Log Message: ----------- Add missing space. Modified Paths: -------------- trunk/SuppInvGRNs.php Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2016-08-24 09:56:08 UTC (rev 7603) +++ trunk/SuppInvGRNs.php 2016-08-25 21:05:53 UTC (rev 7604) @@ -297,7 +297,7 @@ if(isset($_POST['SelectAll'])) { echo ' checked'; } - echo 'name=" GRNNo_', $GRNTmp->GRNNo, '" type="checkbox" /></td> + echo ' name=" GRNNo_', $GRNTmp->GRNNo, '" type="checkbox" /></td> </tr>'; } echo '</tbody> @@ -315,4 +315,4 @@ echo '</div> </form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2016-08-24 09:56:10
|
Revision: 7603 http://sourceforge.net/p/web-erp/reponame/7603 Author: exsonqu Date: 2016-08-24 09:56:08 +0000 (Wed, 24 Aug 2016) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-24 09:55:22 UTC (rev 7602) +++ trunk/doc/Change.log 2016-08-24 09:56:08 UTC (rev 7603) @@ -1,5 +1,5 @@ webERP Change Log - +24/08/16 Exson: Fixed the latin1 charset mixed bug in supplierdiscounts table; 24/9/16 Exson: Fixed the bug that days of payment terms in the following month over 31 days can not be handled correctly in DateFunctions.inc. 20/08/16 RChacon: In ConfirmDispatch_Invoice.php, fix table html code. 18/08/16 RChacon: In PDFStatementPageHeader.inc, replace addJpegFromFile() and RoundRectangle() functions from class.pdf.php with Image() and RoundedRect() functions from tcpdf.php. |
From: <ex...@us...> - 2016-08-24 09:55:24
|
Revision: 7602 http://sourceforge.net/p/web-erp/reponame/7602 Author: exsonqu Date: 2016-08-24 09:55:22 +0000 (Wed, 24 Aug 2016) Log Message: ----------- 24/08/16 Exson: Fixed the latin1 charset mixed bug in supplierdiscounts table; Modified Paths: -------------- trunk/sql/mysql/upgrade4.13-4.13.1.sql Modified: trunk/sql/mysql/upgrade4.13-4.13.1.sql =================================================================== --- trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-24 09:04:09 UTC (rev 7601) +++ trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-24 09:55:22 UTC (rev 7602) @@ -7,5 +7,6 @@ -- standardise transaction date to DATE type: ALTER TABLE `debtortrans` CHANGE `trandate` `trandate` DATE NOT NULL DEFAULT '0000-00-00'; +ALTER table supplierdiscounts CONVERT TO CHARACTER SET utf8; |
From: <ex...@us...> - 2016-08-24 09:04:12
|
Revision: 7601 http://sourceforge.net/p/web-erp/reponame/7601 Author: exsonqu Date: 2016-08-24 09:04:09 +0000 (Wed, 24 Aug 2016) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-24 09:03:08 UTC (rev 7600) +++ trunk/doc/Change.log 2016-08-24 09:04:09 UTC (rev 7601) @@ -1,5 +1,6 @@ webERP Change Log +24/9/16 Exson: Fixed the bug that days of payment terms in the following month over 31 days can not be handled correctly in DateFunctions.inc. 20/08/16 RChacon: In ConfirmDispatch_Invoice.php, fix table html code. 18/08/16 RChacon: In PDFStatementPageHeader.inc, replace addJpegFromFile() and RoundRectangle() functions from class.pdf.php with Image() and RoundedRect() functions from tcpdf.php. 18/08/16 Exson: Add a Cancel button on SupplierAllocations.php to make user can return to previous page easily. |
From: <ex...@us...> - 2016-08-24 09:03:11
|
Revision: 7600 http://sourceforge.net/p/web-erp/reponame/7600 Author: exsonqu Date: 2016-08-24 09:03:08 +0000 (Wed, 24 Aug 2016) Log Message: ----------- 24/9/16 Exson: Fixed the bug that days of payment terms in the following month over 31 days can not be handled correctly in DateFunctions.inc. Modified Paths: -------------- trunk/includes/DateFunctions.inc Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2016-08-21 03:11:43 UTC (rev 7599) +++ trunk/includes/DateFunctions.inc 2016-08-24 09:03:08 UTC (rev 7600) @@ -752,8 +752,11 @@ $YearDue = $Date_Array[2]; } elseif($DayInFollowingMonth>=29) { //take the last day of month - - $DayDue = 0; + if ($DayInFollowingMonth <= 31) { + $DayDue = 0; + } else { + $DayDue = $DayInFollowingMonth-31; + } $MonthDue = $Date_Array[1]+2; $YearDue = $Date_Array[2]; } else { @@ -769,8 +772,11 @@ $YearDue = $Date_Array[2]; } elseif($DayInFollowingMonth>=29) { //take the last day of month - - $DayDue = 0; + if ($DayInFollowingMonth <= 31) { + $DayDue = 0; + } else { + $DayDue = $DayInFollowingMonth-31; + } $MonthDue = $Date_Array[0]+2; $YearDue = $Date_Array[2]; } else { @@ -786,7 +792,11 @@ } elseif($DayInFollowingMonth>=29) { //take the last day of month - $DayDue = 0; + if ($DayInFollowingMonth <= 31) { + $DayDue = 0; + } else { + $DayDue = $DayInFollowingMonth-31; + } $MonthDue = $Date_Array[1]+2; $YearDue = $Date_Array[0]; } else { @@ -1104,4 +1114,4 @@ return $myrow[0]; } -?> \ No newline at end of file +?> |
From: <rc...@us...> - 2016-08-21 03:11:46
|
Revision: 7599 http://sourceforge.net/p/web-erp/reponame/7599 Author: rchacon Date: 2016-08-21 03:11:43 +0000 (Sun, 21 Aug 2016) Log Message: ----------- Fix table html code. Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/doc/Change.log Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2016-08-20 04:00:54 UTC (rev 7598) +++ trunk/ConfirmDispatch_Invoice.php 2016-08-21 03:11:43 UTC (rev 7599) @@ -1,30 +1,30 @@ <?php - /* $Id$*/ +/* Creates sales invoices from entered sales orders based on the quantities dispatched that can be modified */ /* Session started in session.inc for password checking and authorisation level check */ include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); + include('includes/session.inc'); $Title = _('Confirm Dispatches and Invoice An Order'); - $ViewTopic= 'ARTransactions'; $BookMark = 'ConfirmInvoice'; +include('includes/header.inc'); -include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/FreightCalculation.inc'); include('includes/GetSalesTransGLCodes.inc'); -if (empty($_GET['identifier'])) { +if(empty($_GET['identifier'])) { /*unique session identifier to ensure that there is no conflict with other order entry sessions on the same machine */ $identifier=date('U'); } else { $identifier=$_GET['identifier']; } -if (!isset($_GET['OrderNumber']) AND !isset($_SESSION['ProcessingOrder'])) { +if(!isset($_GET['OrderNumber']) AND !isset($_SESSION['ProcessingOrder'])) { /* This page can only be called with an order number for invoicing*/ echo '<div class="centre"> <a href="' . $RootPath . '/SelectSalesOrder.php">' . _('Select a sales order to invoice'). '</a> @@ -34,7 +34,7 @@ prnMsg( _('This page can only be opened if an order has been selected Please select an order first from the delivery details screen click on Confirm for invoicing'), 'error' ); include ('includes/footer.inc'); exit; -} elseif (isset($_GET['OrderNumber']) and $_GET['OrderNumber']>0) { +} elseif(isset($_GET['OrderNumber']) and $_GET['OrderNumber']>0) { unset($_SESSION['Items'.$identifier]->LineItems); unset ($_SESSION['Items'.$identifier]); @@ -43,7 +43,7 @@ $_GET['OrderNumber']=(int)$_GET['OrderNumber']; $_SESSION['Items'.$identifier] = new cart; -/*read in all the guff from the selected order into the Items cart */ +/*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.orderno, salesorders.debtorno, @@ -83,10 +83,10 @@ ON debtorsmaster.currcode = currencies.currabrev INNER JOIN locations ON locations.loccode=salesorders.fromstkloc - INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE salesorders.orderno = '" . $_GET['OrderNumber']."'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $OrderHeaderSQL .= " AND salesorders.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -94,7 +94,7 @@ $DbgMsg = _('The SQL to get the order header was'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$ErrMsg,$DbgMsg); - if (DB_num_rows($GetOrdHdrResult)==1) { + if(DB_num_rows($GetOrdHdrResult)==1) { $myrow = DB_fetch_array($GetOrdHdrResult); @@ -110,8 +110,8 @@ $BestShipper = $myrow['shipvia']; $_SESSION['Items'.$identifier]->ShipVia = $myrow['shipvia']; - if (is_null($BestShipper)){ - $BestShipper=0; + if(is_null($BestShipper)) { + $BestShipper=0; } $_SESSION['Items'.$identifier]->DeliverTo = $myrow['deliverto']; $_SESSION['Items'.$identifier]->DeliveryDate = ConvertSQLDate($myrow['deliverydate']); @@ -172,7 +172,7 @@ $DbgMsg = _('The SQL that failed was'); $LineItemsResult = DB_query($LineItemsSQL,$ErrMsg,$DbgMsg); - if (DB_num_rows($LineItemsResult)>0) { + if(DB_num_rows($LineItemsResult)>0) { while ($myrow=DB_fetch_array($LineItemsResult)) { @@ -216,7 +216,7 @@ } //end of checks on returned data set DB_free_result($LineItemsResult); - } else { /*end if the order was returned sucessfully */ + } else {// End if the order was returned successfully. echo '<br />' . prnMsg( _('This order item could not be retrieved. Please select another order'), 'warn'); @@ -226,44 +226,44 @@ } else { /* if processing, a dispatch page has been called and ${$StkItm->LineNumber} would have been set from the post -set all the necessary session variables changed by the POST */ - if (isset($_POST['ShipVia'])){ +set all the necessary session variables changed by the POST */ + if(isset($_POST['ShipVia'])) { $_SESSION['Items'.$identifier]->ShipVia = $_POST['ShipVia']; } - if (isset($_POST['ChargeFreightCost'])){ + if(isset($_POST['ChargeFreightCost'])) { $_SESSION['Items'.$identifier]->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } $i=1; foreach ($_SESSION['Items'.$identifier]->FreightTaxes as $FreightTaxLine) { - if (isset($_POST['FreightTaxRate' . $i])){ - $_SESSION['Items'.$identifier]->FreightTaxes[$i]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $i])/100; + if(isset($_POST['FreightTaxRate' . $i])) { + $_SESSION['Items'.$identifier]->FreightTaxes[$i]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $i])/100; } $i++; } foreach ($_SESSION['Items'.$identifier]->LineItems as $Itm) { - if (sizeOf($Itm->SerialItems) > 0) { + if(sizeOf($Itm->SerialItems) > 0) { $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched = 0; //initialise QtyDispatched foreach ($Itm->SerialItems as $SerialItem) { //calculate QtyDispatched from bundle quantities $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched += $SerialItem->BundleQty; } //Preventing from dispatched more than ordered. Since it's controlled items, users must select the batch/lot again. - if($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched > ($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv)){ + if($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched > ($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv)) { prnMsg(_('Dispathed Quantity should not be more than order balanced quantity').'. '._('To dispatch quantity is').' '.$_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched.' '._('And the order balance is ').' '.($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv),'error'); include('includes/footer.inc'); exit; } - } else if (isset($_POST[$Itm->LineNumber . '_QtyDispatched' ])){ - if (is_numeric(filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched' ])) - AND filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']) <= ($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv)){ + } else if(isset($_POST[$Itm->LineNumber . '_QtyDispatched' ])) { + if(is_numeric(filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched' ])) + AND filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']) <= ($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv)) { - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched = round(filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']),$Itm->DecimalPlaces); + $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched = round(filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']),$Itm->DecimalPlaces); } } $i=1; foreach ($Itm->Taxes as $TaxLine) { - if (isset($_POST[$Itm->LineNumber . $i . '_TaxRate'])){ - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Taxes[$i]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $i . '_TaxRate'])/100; + if(isset($_POST[$Itm->LineNumber . $i . '_TaxRate'])) { + $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Taxes[$i]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $i . '_TaxRate'])/100; } $i++; } @@ -273,8 +273,8 @@ /* Always display dispatch quantities and recalc freight for items being dispatched */ -if ($_SESSION['Items'.$identifier]->SpecialInstructions) { - prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); +if($_SESSION['Items'.$identifier]->SpecialInstructions) { + prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Confirm Invoice') . '" alt="" />' . ' ' . _('Confirm Dispatch and Invoice'). '</p>'; @@ -296,10 +296,11 @@ /*************************************************************** Line Item Display ***************************************************************/ -echo '<table width="90%" cellpadding="2" class="selection"> +echo '<table class="selection"> + <thead> <tr> <th>' . _('Item Code') . '</th> - <th>' . _('Item Description' ) . '</th> + <th>' . _('Item Description') . '</th> <th>' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Sent') . '</th> @@ -309,9 +310,10 @@ <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> <th>' . _('Tax Authority') . '</th> <th>' . _('Tax %') . '</th> - <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Tax Amount') . '</th> <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> - </tr>'; + </tr> + </thead><tbody>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -326,37 +328,35 @@ $j=0; foreach ($_SESSION['Items'.$identifier]->LineItems as $LnItm) { $j++; - if ($k==1){ - $RowStarter = '<tr class="EvenTableRows">'; - $k=0; - } else { - $RowStarter = '<tr class="OddTableRows">'; - $k=1; - } - $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); - $_SESSION['Items'.$identifier]->total += $LineTotal; $_SESSION['Items'.$identifier]->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); $_SESSION['Items'.$identifier]->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); - echo $RowStarter; - echo '<td>' . $LnItm->StockID . '</td> - <td title="'. $LnItm->LongDescription . '">' .$LnItm->ItemDescription . '</td> - <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> - <td>' . $LnItm->Units . '</td> - <td class="number">' . locale_number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; + if($k==1) { + $RowStarter = '<tr class="EvenTableRows">'; + $k = 0; + } else { + $RowStarter = '<tr class="OddTableRows">'; + $k = 1; + } + echo $RowStarter, ' + <td>', $LnItm->StockID, '</td> + <td class="text" title="', $LnItm->LongDescription, '">', $LnItm->ItemDescription, '</td> + <td class="number">', locale_number_format($LnItm->Quantity, $LnItm->DecimalPlaces), '</td> + <td class="text">', $LnItm->Units, '</td> + <td class="number">', locale_number_format($LnItm->QtyInv, $LnItm->DecimalPlaces), '</td>'; - if ($LnItm->Controlled==1){ + if($LnItm->Controlled==1) { - if (isset($_POST['ProcessInvoice'])) { + if(isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input type="hidden" name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '" /><a href="' . $RootPath .'/ConfirmDispatchControlled_Invoice.php?identifier=' . $identifier . '&LineNo='. $LnItm->LineNumber.'">' .locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; + echo '<td class="number"><input type="hidden" name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '" /><a href="' . $RootPath .'/ConfirmDispatchControlled_Invoice.php?identifier=' . $identifier . '&LineNo='. $LnItm->LineNumber.'">' .locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; } } else { - if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; + if(isset($_POST['ProcessInvoice'])) { + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { echo '<td class="number"><input tabindex="'.$j.'" type="text" ' . ($j==1 ? 'autofocus="autofocus" ':'') . ' class="number" required="required" title="' . _('Enter the quantity to charge the customer for, that has been dispatched') . '" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength="12" size="12" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '" /></td>'; } @@ -372,33 +372,33 @@ echo '<td>'; $i=0; foreach ($_SESSION['Items'.$identifier]->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { - if ($i>0){ + if($i>0) { echo '<br />'; } echo $Tax->TaxAuthDescription; $i++; } - echo '</td>'; - echo '<td class="number">'; + echo '</td> + <td class="number">'; $i=1; // initialise the number of taxes iterated through $TaxLineTotal =0; //initialise tax total for the line foreach ($LnItm->Taxes AS $Tax) { - if (empty($TaxTotals[$Tax->TaxAuthID])) { + if(empty($TaxTotals[$Tax->TaxAuthID])) { $TaxTotals[$Tax->TaxAuthID]=0; } - if ($i>1){ + if($i>1) { echo '<br />'; } - if (isset($_POST['ProcessInvoice'])) { - echo $Tax->TaxRate*100; + if(isset($_POST['ProcessInvoice'])) { + echo $Tax->TaxRate*100; } else { echo '<input type="text" class="number" required="required" title="' . _('Enter the tax rate applicable as a number') . '" name="' . $LnItm->LineNumber . $i . '_TaxRate" maxlength="4" size="4" value="' . $Tax->TaxRate*100 . '" />'; } $i++; - if ($Tax->TaxOnTax ==1){ + if($Tax->TaxOnTax ==1) { $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); $TaxLineTotal += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); } else { @@ -418,10 +418,10 @@ echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td>'; - if ($LnItm->Controlled==1){ - if (!isset($_POST['ProcessInvoice'])) { + if($LnItm->Controlled==1) { + if(!isset($_POST['ProcessInvoice'])) { echo '<td><a href="' . $RootPath . '/ConfirmDispatchControlled_Invoice.php?identifier=' . $identifier . '&LineNo='. $LnItm->LineNumber.'">'; - if ($LnItm->Serialised==1){ + if($LnItm->Serialised==1) { echo _('Enter Serial Numbers'); } else { /*Just batch/roll/lot control */ echo _('Enter Batch/Roll/Lot #'); @@ -430,7 +430,7 @@ } } echo '</tr>'; - if (mb_strlen($LnItm->Narrative)>1){ + if(mb_strlen($LnItm->Narrative)>1) { $Narrative=str_replace('\r\n','<br />', $LnItm->Narrative); echo $RowStarter . '<td colspan="12">' . stripslashes($Narrative) . '</td></tr>'; } @@ -442,7 +442,7 @@ was not fully delivered the first time ?? */ if(!isset($_SESSION['Items'.$identifier]->FreightCost)) { - if ($_SESSION['DoFreightCalc']==True){ + if($_SESSION['DoFreightCalc']==True) { list ($FreightCost, $BestShipper) = CalcFreightCost($_SESSION['Items'.$identifier]->total, $_SESSION['Items'.$identifier]->BrAdd2, $_SESSION['Items'.$identifier]->BrAdd3, @@ -456,77 +456,76 @@ $db); $_SESSION['Items'.$identifier]->ShipVia = $BestShipper; } - if (is_numeric($FreightCost)){ + if(is_numeric($FreightCost)) { $FreightCost = $FreightCost / $_SESSION['CurrencyRate']; - } else { + } else { $FreightCost =0; - } - if (!is_numeric($BestShipper)){ - $SQL = "SELECT shipper_id FROM shippers WHERE shipper_id='" . $_SESSION['Default_Shipper'] . "'"; + } + if(!is_numeric($BestShipper)) { + $SQL = "SELECT shipper_id FROM shippers WHERE shipper_id='" . $_SESSION['Default_Shipper'] . "'"; $ErrMsg = _('There was a problem testing for a default shipper because'); $TestShipperExists = DB_query($SQL, $ErrMsg); - if (DB_num_rows($TestShipperExists)==1){ + if(DB_num_rows($TestShipperExists)==1) { $BestShipper = $_SESSION['Default_Shipper']; } else { - $SQL = "SELECT shipper_id FROM shippers"; + $SQL = "SELECT shipper_id FROM shippers"; $ErrMsg = _('There was a problem testing for a default shipper'); $TestShipperExists = DB_query($SQL, $ErrMsg); - if (DB_num_rows($TestShipperExists)>=1){ + if(DB_num_rows($TestShipperExists)>=1) { $ShipperReturned = DB_fetch_row($TestShipperExists); $BestShipper = $ShipperReturned[0]; } else { prnMsg( _('There are no shippers defined') . '. ' . _('Please use the link below to set up shipping freight companies, the system expects the shipping company to be selected or a default freight company to be used'),'error'); - echo '<a href="' . $RootPath . 'Shippers.php">' . _('Enter') . '/' . _('Amend Freight Companies'). '</a>'; + echo '<a href="' . $RootPath . 'Shippers.php">' . _('Enter') . '/' . _('Amend Freight Companies'). '</a>'; } } } } -if (isset($_POST['ChargeFreightCost']) AND !is_numeric(filter_number_format($_POST['ChargeFreightCost']))){ +if(isset($_POST['ChargeFreightCost']) AND !is_numeric(filter_number_format($_POST['ChargeFreightCost']))) { $_POST['ChargeFreightCost'] = 0; } echo '<tr> - <td colspan="5" class="number">' . _('Order Freight Cost'). '</td> - <td class="number">' . locale_number_format($_SESSION['Old_FreightCost'],$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + <td class="number" colspan="2">', _('Order Freight Cost'), '</td> + <td class="number">', locale_number_format($_SESSION['Old_FreightCost'], $_SESSION['Items'.$identifier]->CurrDecimalPlaces), '</td>'; -if ($_SESSION['DoFreightCalc']==True){ - echo '<td colspan="2" class="number">' ._('Recalculated Freight Cost'). '</td> - <td class="number">' . locale_number_format($FreightCost,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; +if($_SESSION['DoFreightCalc']==True) { + echo '<td class="number" colspan="2">', _('Recalculated Freight Cost'), '</td> + <td class="number">', locale_number_format($FreightCost, $_SESSION['Items'.$identifier]->CurrDecimalPlaces), '</td>'; } else { -// echo '<td colspan="1"></td>'; +// echo '<td colspan="1"></td>';// Should be?: echo '<td colspan="3"> </td>'; } $j++; -if (!isset($_POST['ChargeFreightCost'])) { +if(!isset($_POST['ChargeFreightCost'])) { $_POST['ChargeFreightCost']=0; } -if ($_SESSION['Items'.$identifier]->Any_Already_Delivered()==1 +echo '<td class="number" colspan="2">', _('Charge Freight Cost ex Tax'), '</td>'; +if($_SESSION['Items'.$identifier]->Any_Already_Delivered()==1 AND (!isset($_SESSION['Items'.$identifier]->FreightCost) OR $_POST['ChargeFreightCost']==0)) { - echo '<td colspan="2" class="number">' . _('Charge Freight Cost ex Tax') . '</td> - <td><input tabindex="'.$j.'" type="text" required="required" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="0" /></td>'; - $_SESSION['Items'.$identifier]->FreightCost=0; + echo '<td><input class="number" maxlength="12" name="ChargeFreightCost" required="required" size="10" tabindex="', $j, '" type="text" value="0" /></td>'; + $_SESSION['Items'.$identifier]->FreightCost = 0; } else { - echo '<td colspan="2" class="number">' . _('Charge Freight Cost ex Tax') . '</td>'; - if (isset($_POST['ProcessInvoice'])) { + if(isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . locale_number_format($_SESSION['Items'.$identifier]->FreightCost,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . locale_number_format($_SESSION['Items'.$identifier]->FreightCost,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" /></td>'; + echo '<td class="number"><input class="number" maxlength="12" name="ChargeFreightCost" size="10" tabindex="'. $j. '" type="text" value="'. locale_number_format($_SESSION['Items'.$identifier]->FreightCost,$_SESSION['Items'.$identifier]->CurrDecimalPlaces). '" /></td>'; } $_POST['ChargeFreightCost'] = locale_number_format($_SESSION['Items'.$identifier]->FreightCost,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); } -$FreightTaxTotal =0; //initialise tax total +$FreightTaxTotal = 0;// initialise tax total echo '<td>'; $i=0; // initialise the number of taxes iterated through foreach ($_SESSION['Items'.$identifier]->FreightTaxes as $FreightTaxLine) { - if ($i>0){ + if($i>0) { echo '<br />'; } - echo $FreightTaxLine->TaxAuthDescription; + echo $FreightTaxLine->TaxAuthDescription; $i++; } @@ -534,18 +533,17 @@ $i=0; foreach ($_SESSION['Items'.$identifier]->FreightTaxes as $FreightTaxLine) { - if ($i>0){ + if($i>0) { echo '<br />'; } - if (isset($_POST['ProcessInvoice'])) { - echo $FreightTaxLine->TaxRate * 100 ; + if(isset($_POST['ProcessInvoice'])) { + echo $FreightTaxLine->TaxRate * 100 ; } else { - echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . - '" maxlength="4" size="4" value="' . locale_number_format($FreightTaxLine->TaxRate * 100,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" />'; + echo '<input class="number" maxlength="4" name="FreightTaxRate'. $FreightTaxLine->TaxCalculationOrder. '" size="4" type="text" value="'. locale_number_format($FreightTaxLine->TaxRate * 100, $_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" />'; } - if ($FreightTaxLine->TaxOnTax ==1){ + if($FreightTaxLine->TaxOnTax ==1) { $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['Items'.$identifier]->FreightCost + $FreightTaxTotal)); $FreightTaxTotal += ($FreightTaxLine->TaxRate * ($_SESSION['Items'.$identifier]->FreightCost + $FreightTaxTotal)); } else { @@ -574,15 +572,15 @@ </tr>'; -if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ +if(! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])) { $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat'],CalcEarliestDispatchDate()); } else { $DefaultDispatchDate = $_POST['DispatchDate']; } -echo '</table><br />'; +echo '<tbody></table><br />'; -if (isset($_POST['ProcessInvoice']) AND $_POST['ProcessInvoice'] != ''){ +if(isset($_POST['ProcessInvoice']) AND $_POST['ProcessInvoice'] != '') { /* SQL to process the postings for sales invoices... @@ -592,23 +590,23 @@ $QuantityInvoicedIsPositive = false; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { - if ($OrderLine->QtyDispatched > 0){ + if($OrderLine->QtyDispatched > 0) { $QuantityInvoicedIsPositive =true; } } - if (! $QuantityInvoicedIsPositive){ + if(! $QuantityInvoicedIsPositive) { prnMsg( _('There are no lines on this order with a quantity to invoice') . '. ' . _('No further processing has been done'),'error'); include('includes/footer.inc'); exit; } - if ($_SESSION['ProhibitNegativeStock']==1){ // checks for negative stock after processing invoice + if($_SESSION['ProhibitNegativeStock']==1) { // checks for negative stock after processing invoice //sadly this check does not combine quantities occuring twice on and order and each line is considered individually :-( $NegativesFound = false; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $SQL = "SELECT stockmaster.description, - locstock.quantity, - stockmaster.mbflag + locstock.quantity, + stockmaster.mbflag FROM locstock INNER JOIN stockmaster ON stockmaster.stockid=locstock.stockid @@ -618,17 +616,17 @@ $ErrMsg = _('Could not retrieve the quantity left at the location once this order is invoiced (for the purposes of checking that stock will not go negative because)'); $Result = DB_query($SQL,$ErrMsg); $CheckNegRow = DB_fetch_array($Result); - if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND mb_substr($OrderLine->StockID,0,4)!='ASSET'){ - if ($CheckNegRow['quantity'] < $OrderLine->QtyDispatched){ + if(($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND mb_substr($OrderLine->StockID,0,4)!='ASSET') { + if($CheckNegRow['quantity'] < $OrderLine->QtyDispatched) { prnMsg( _('Invoicing the selected order would result in negative stock. The system parameters are set to prohibit negative stocks from occurring. This invoice cannot be created until the stock on hand is corrected.'),'error',$OrderLine->StockID . ' ' . $CheckNegRow['description'] . ' - ' . _('Negative Stock Prohibited')); $NegativesFound = true; } - } elseif ($CheckNegRow['mbflag']=='A') { + } elseif($CheckNegRow['mbflag']=='A') { /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, - stockmaster.description, - locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft + stockmaster.description, + locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft FROM bom INNER JOIN locstock ON bom.component=locstock.stockid @@ -636,13 +634,13 @@ ON stockmaster.stockid=bom.component WHERE bom.parent='" . $OrderLine->StockID . "' AND locstock.loccode='" . $_SESSION['Items'.$identifier]->Location . "' - AND bom.effectiveafter <= '" . date('Y-m-d') . "' - AND bom.effectiveto > '" . date('Y-m-d') . "'"; + AND bom.effectiveafter <= '" . date('Y-m-d') . "' + AND bom.effectiveto > '" . date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve the component quantity left at the location once the assembly item on this order is invoiced (for the purposes of checking that stock will not go negative because)'); $Result = DB_query($SQL,$ErrMsg); - while ($NegRow = DB_fetch_array($Result)){ - if ($NegRow['qtyleft']<0){ + while ($NegRow = DB_fetch_array($Result)) { + if($NegRow['qtyleft']<0) { prnMsg(_('Invoicing the selected order would result in negative stock for a component of an assembly item on the order. The system parameters are set to prohibit negative stocks from occurring. This invoice cannot be created until the stock on hand is corrected.'),'error',$NegRow['component'] . ' ' . $NegRow['description'] . ' - ' . _('Negative Stock Prohibited')); $NegativesFound = true; } // end if negative would result @@ -651,10 +649,10 @@ } //end of loop around items on the order for negative check - if ($NegativesFound){ - echo '</div>'; - echo '</form>'; - echo '<div class="centre"> + if($NegativesFound) { + echo '</div>'; + echo '</form>'; + echo '<div class="centre"> <input type="submit" name="Update" value="' . _('Update'). '" /></div>'; include('includes/footer.inc'); exit; @@ -680,7 +678,7 @@ /*company record read in on login with info on GL Links and debtors GL account*/ - if ($_SESSION['CompanyRecord']==0){ + if($_SESSION['CompanyRecord']==0) { /*The company data and preferences could not be retrieved for some reason */ prnMsg( _('The company information and preferences could not be retrieved') . ' - ' . _('see your system administrator'), 'error'); include('includes/footer.inc'); @@ -699,11 +697,11 @@ $Result = DB_query($SQL); - if (DB_num_rows($Result) != count($_SESSION['Items'.$identifier]->LineItems)){ + if(DB_num_rows($Result) != count($_SESSION['Items'.$identifier]->LineItems)) { - /*there should be the same number of items returned from this query as there are lines on the invoice - if not then someone has already invoiced or credited some lines */ + /*there should be the same number of items returned from this query as there are lines on the invoice - if not then someone has already invoiced or credited some lines */ - if ($debug==1){ + if($debug==1) { echo '<br />' . $SQL; echo '<br />' . _('Number of rows returned by SQL') . ':' . DB_num_rows($Result); echo '<br />' . _('Count of items in the session') . ' ' . count($_SESSION['Items'.$identifier]->LineItems); @@ -722,16 +720,16 @@ while ($myrow = DB_fetch_array($Result)) { - if ($_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] + if($_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] OR $_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { - echo '<br />' . _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->QtyInv; + echo '<br />' . _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items'.$identifier]->LineItems[$myrow['orderlineno']]->QtyInv; prnMsg( _('This order has been changed or invoiced since this delivery was started to be confirmed') . ' ' . _('Processing halted.') . ' ' . _('To enter and confirm this dispatch, it must be re-selected and re-read again to update the changes made by the other user'), 'error'); echo '<br />'; - echo '<div class="centre"><a href="'. $RootPath . '/SelectSalesOrder.php">' . _('Select a sales order for confirming deliveries and invoicing'). '</a></div>'; + echo '<div class="centre"><a href="'. $RootPath . '/SelectSalesOrder.php">' . _('Select a sales order for confirming deliveries and invoicing'). '</a></div>'; unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); @@ -756,7 +754,7 @@ DB_Txn_Begin(); - if ($DefaultShipVia != $_SESSION['Items'.$identifier]->ShipVia){ + if($DefaultShipVia != $_SESSION['Items'.$identifier]->ShipVia) { $SQL = "UPDATE custbranch SET defaultshipvia ='" . $_SESSION['Items'.$identifier]->ShipVia . "' WHERE debtorno='" . $_SESSION['Items'.$identifier]->DebtorNo . "' @@ -846,13 +844,13 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { /*Test to see if the item being sold is an asset */ - if (mb_substr($OrderLine->StockID,0,6)=='ASSET-'){ + if(mb_substr($OrderLine->StockID,0,6)=='ASSET-') { $IsAsset = true; $HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6); - if ($HyphenOccursAt == false){ - $AssetNumber = intval(mb_substr($OrderLine->StockID,6)); + if($HyphenOccursAt == false) { + $AssetNumber = intval(mb_substr($OrderLine->StockID,6)); } else { - $AssetNumber = intval(mb_substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1)); + $AssetNumber = intval(mb_substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1)); } prnMsg (_('The asset number being disposed of is:') . ' ' . $AssetNumber, 'info'); } else { @@ -860,7 +858,7 @@ $AssetNumber = 0; } - if ($_POST['BOPolicy']=='CAN'){ + if($_POST['BOPolicy']=='CAN') { $SQL = "UPDATE salesorderdetails SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched - $OrderLine->QtyInv) . " @@ -872,7 +870,7 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - if (($OrderLine->Quantity - $OrderLine->QtyDispatched)>0){ + if(($OrderLine->Quantity - $OrderLine->QtyDispatched)>0) { $SQL = "INSERT INTO orderdeliverydifferenceslog (orderno, invoiceno, @@ -885,7 +883,7 @@ '" . $_SESSION['ProcessingOrder'] . "', '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched - $OrderLine->QtyInv) . "', + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched - $OrderLine->QtyInv) . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', 'CAN')"; @@ -895,7 +893,7 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } - } elseif (($OrderLine->Quantity - $OrderLine->QtyDispatched)>0 + } elseif(($OrderLine->Quantity - $OrderLine->QtyDispatched)>0 AND DateDiff(ConvertSQLDate($DefaultDispatchDate),$_SESSION['Items'.$identifier]->DeliveryDate,'d')>0) { /*The order is being short delivered after the due date - need to insert a delivery differnce log */ @@ -912,33 +910,33 @@ '" . $_SESSION['ProcessingOrder'] . "', '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched - $OrderLine->QtyInv) . "', + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched - $OrderLine->QtyInv) . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', 'BO' )"; - $ErrMsg = '<br />' . _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); + $ErrMsg = '<br />' . _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The order delivery differences log record could not be inserted because'); $DbgMsg = _('The following SQL to insert the order delivery differences record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } /*end of order delivery differences log entries */ /*Now update SalesOrderDetails for the quantity invoiced and the actual dispatch dates. */ - if ($OrderLine->QtyDispatched !=0 AND $OrderLine->QtyDispatched!='' AND $OrderLine->QtyDispatched) { + if($OrderLine->QtyDispatched !=0 AND $OrderLine->QtyDispatched!='' AND $OrderLine->QtyDispatched) { // Test above to see if the line is completed or not - if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=='CAN'){ + if($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=='CAN') { $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", - actualdispatchdate = '" . $DefaultDispatchDate . "', + actualdispatchdate = '" . $DefaultDispatchDate . "', completed=1 WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; } else { $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", - actualdispatchdate = '" . $DefaultDispatchDate . "' + actualdispatchdate = '" . $DefaultDispatchDate . "' WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; @@ -958,21 +956,21 @@ $myrow = DB_fetch_row($Result); $MBFlag = $myrow[0]; - if ($MBFlag=='B' OR $MBFlag=='M') { + if($MBFlag=='B' OR $MBFlag=='M') { $Assembly = False; /* Need to get the current location quantity will need it later for the stock movement */ - $SQL="SELECT locstock.quantity + $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $OrderLine->StockID . "' AND loccode= '" . $_SESSION['Items'.$identifier]->Location . "'"; $ErrMsg = _('WARNING') . ': ' . _('Could not retrieve current location stock'); $Result = DB_query($SQL, $ErrMsg); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; + if(DB_num_rows($Result)==1) { + $LocQtyRow = DB_fetch_row($Result); + $QtyOnHandPrior = $LocQtyRow[0]; } else { /* There must be some error this should never happen */ $QtyOnHandPrior = 0; @@ -987,7 +985,7 @@ $DbgMsg = _('The following SQL to update the location stock record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - } else if ($MBFlag=='A'){ /* its an assembly */ + } else if($MBFlag=='A') { /* its an assembly */ /*Need to get the BOM for this part and make stock moves for the components then update the Location stock balances */ $Assembly=True; @@ -998,19 +996,19 @@ FROM bom INNER JOIN stockmaster ON bom.component=stockmaster.stockid WHERE bom.parent='" . $OrderLine->StockID . "' - AND bom.effectiveafter <= '" . date('Y-m-d') . "' - AND bom.effectiveto > '" . date('Y-m-d') . "'"; + AND bom.effectiveafter <= '" . date('Y-m-d') . "' + AND bom.effectiveto > '" . date('Y-m-d') . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not retrieve assembly components from the database for'). ' '. $OrderLine->StockID . _('because').' '; $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($SQL,$ErrMsg,$DbgMsg,true); - while ($AssParts = DB_fetch_array($AssResult)){ + while ($AssParts = DB_fetch_array($AssResult)) { $StandardCost += ($AssParts['standard'] * $AssParts['quantity']) ; /* Need to get the current location quantity will need it later for the stock movement */ - $SQL="SELECT locstock.quantity + $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $AssParts['component'] . "' AND loccode= '" . $_SESSION['Items'.$identifier]->Location . "'"; @@ -1018,14 +1016,14 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Can not retrieve assembly components location stock quantities because '); $DbgMsg = _('The SQL that failed was'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; + if(DB_num_rows($Result)==1) { + $LocQtyRow = DB_fetch_row($Result); + $QtyOnHandPrior = $LocQtyRow[0]; } else { /*There must be some error this should never happen */ $QtyOnHandPrior = 0; } - if (empty($AssParts['standard'])) { + if(empty($AssParts['standard'])) { $AssParts['standard']=0; } $SQL = "INSERT INTO stockmoves (stockid, @@ -1081,11 +1079,11 @@ //$LocalCurrencyPrice = round(($OrderLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); change decimalplaces to 5 to avoid price or lines total variance on invoice. And the decimal places should not be over 5 since the stockmoves table defined it as decimal(21,5) now. $LocalCurrencyPrice = round(($OrderLine->Price / $_SESSION['CurrencyRate']),5); - if (empty($OrderLine->StandardCost)) { + if(empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; } - if ($MBFlag=='B' OR $MBFlag=='M'){ - $SQL = "INSERT INTO stockmoves (stockid, + if($MBFlag=='B' OR $MBFlag=='M') { + $SQL = "INSERT INTO stockmoves (stockid, type, transno, loccode, @@ -1118,8 +1116,8 @@ '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { - // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil - if (empty($OrderLine->StandardCost)) { + // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil + if(empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; } $SQL = "INSERT INTO stockmoves (stockid, @@ -1182,11 +1180,11 @@ } -/*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ +/* Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ - if ($OrderLine->Controlled ==1){ - foreach($OrderLine->SerialItems as $Item){ - /*We need to add the StockSerialItem record and the StockSerialMoves as well */ + if($OrderLine->Controlled ==1) { + foreach($OrderLine->SerialItems as $Item) { + /*We need to add the StockSerialItem record and the StockSerialMoves as well */ $SQL = "UPDATE stockserialitems SET quantity= quantity - " . $Item->BundleQty . " WHERE stockid='" . $OrderLine->StockID . "' @@ -1217,7 +1215,7 @@ /*Insert Sales Analysis records */ $SalesValue = 0; - if ($_SESSION['CurrencyRate']>0){ + if($_SESSION['CurrencyRate']>0) { $SalesValue = $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']; } @@ -1254,12 +1252,12 @@ salesanalysis.budgetoractual"; $ErrMsg = _('The count of existing Sales analysis records could not run because'); - $DbgMsg = '<br />' . _('SQL to count the no of sales analysis records'); + $DbgMsg = '<br />' . _('SQL to count the no of sales analysis records'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); $myrow = DB_fetch_row($Result); - if ($myrow[0]>0){ /*Update the existing record that already exists */ + if($myrow[0]>0) { /*Update the existing record that already exists */ $SQL = "UPDATE salesanalysis SET amt=amt+" . round(($SalesValue),$_SESSION['CompanyRecord']['decimalplaces']) . ", cost=cost+" . round(($OrderLine->StandardCost * $OrderLine->QtyDispatched),$_SESSION['CompanyRecord']['decimalplaces']) . ", @@ -1315,9 +1313,9 @@ /* If GLLink_Stock then insert GLTrans to credit stock and debit cost of sales at standard cost*/ - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $OrderLine->StandardCost !=0 AND ! $IsAsset){ + if($_SESSION['CompanyRecord']['gllink_stock']==1 AND $OrderLine->StandardCost !=0 AND ! $IsAsset) { -/*first the cost of sales entry - GL accounts are retrieved using the function GetCOGSGLAccount from includes/GetSalesTransGLCodes.inc */ +/*first the cost of sales entry - GL accounts are retrieved using the function GetCOGSGLAccount from includes/GetSalesTransGLCodes.inc */ $SQL = "INSERT INTO gltrans (type, typeno, @@ -1361,11 +1359,11 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side of the cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - } /* end of if GL and stock integrated and standard cost !=0 and not an asset */ + } /* end of if GL and stock integrated and standard cost !=0 and not an asset */ - if ($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $OrderLine->Price !=0){ + if($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $OrderLine->Price !=0) { - if (!$IsAsset){ // its a normal stock item + if(!$IsAsset) { // its a normal stock item //Post sales transaction to GL credit sales $SalesGLAccounts = GetSalesGLAccount($Area, $OrderLine->StockID, $_SESSION['Items'.$identifier]->DefaultSalesType, $db); @@ -1389,7 +1387,7 @@ $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); - if ($OrderLine->DiscountPercent !=0){ + if($OrderLine->DiscountPercent !=0) { $SQL = "INSERT INTO gltrans (type, typeno, @@ -1429,14 +1427,14 @@ $DisposalResult = DB_query( $SQL,$ErrMsg,$DbgMsg); $DisposalRow = DB_fetch_array($DisposalResult); - /*Need to : - * 1.) debit accum depn account with whole amount of accum depn - * 2.) credit cost account with the whole amount of the cost - * 3.) debit the disposal account with the NBV - * 4.) credit the disposal account with the sale proceeds net of discounts */ + /*Need to : + * 1.) debit accum depn account with whole amount of accum depn + * 2.) credit cost account with the whole amount of the cost + * 3.) debit the disposal account with the NBV + * 4.) credit the disposal account with the sale proceeds net of discounts */ /* 1 debit accum depn */ - if ($DisposalRow['accumdepn']!=0){ + if($DisposalRow['accumdepn']!=0) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1457,8 +1455,8 @@ $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } - /* 2 credit cost */ - if($DisposalRow['cost']!=0){ + /* 2 credit cost */ + if($DisposalRow['cost']!=0) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1480,7 +1478,7 @@ $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } //3. Debit disposal account with NBV - if($DisposalRow['cost']-$DisposalRow['accumdepn']!=0){ + if($DisposalRow['cost']-$DisposalRow['accumdepn']!=0) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1494,7 +1492,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('net book value disposal') . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('net book value disposal') . "', '" . ($DisposalRow['cost']-$DisposalRow['accumdepn']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal net book value GL posting could not be inserted because'); @@ -1516,7 +1514,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('asset disposal proceeds') . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('asset disposal proceeds') . "', '" . (-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal proceeds GL posting could not be inserted because'); @@ -1526,7 +1524,7 @@ } // end if the item being sold was an asset } /*end of if sales integrated with debtors */ - if ($IsAsset) { + if($IsAsset) { /* then the item being sold is an asset disposal * need to create fixedassettrans * set disposal date and proceeds @@ -1565,10 +1563,10 @@ } /*end of OrderLine loop */ - if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ + if($_SESSION['CompanyRecord']['gllink_debtors']==1) { /*Post debtors transaction to GL debit debtors, credit freight re-charged and credit sales */ - if (($_SESSION['Items'.$identifier]->total + $_SESSION['Items'.$identifier]->FreightCost + $TaxTotal) !=0) { + if(($_SESSION['Items'.$identifier]->total + $_SESSION['Items'.$identifier]->FreightCost + $TaxTotal) !=0) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1592,7 +1590,7 @@ /*Could do with setting up a more flexible freight posting schema that looks at the sales type and area of the customer branch to determine where to post the freight recovery */ - if ($_SESSION['Items'.$identifier]->FreightCost !=0) { + if($_SESSION['Items'.$identifier]->FreightCost !=0) { $SQL = "INSERT INTO gltrans ( type, typeno, @@ -1614,8 +1612,8 @@ $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$ErrMsg,$DbgMsg,true); } - foreach ( $TaxTotals as $TaxAuthID => $TaxAmount){ - if ($TaxAmount !=0 ){ + foreach ( $TaxTotals as $TaxAuthID => $TaxAmount) { + if($TaxAmount !=0 ) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1639,8 +1637,8 @@ } } /*end of if Sales and GL integrated */ EnsureGLEntriesBalance(10,$InvoiceNo,$db); - + DB_Txn_Commit(); // ************************************************************************* // E N D O F I N V O I C E S Q L P R O C E S S I N G @@ -1654,25 +1652,25 @@ echo '<br /><div class="centre">'; - if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />'; + if($_SESSION['InvoicePortraitFormat']==0) { + echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />'; } else { - echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; + echo '<img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$RootPath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">' . _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; } - echo '<a href="'.$RootPath.'/SelectSalesOrder.php">' . _('Select another order for invoicing'). '</a><br /><br />'; + echo '<a href="'.$RootPath.'/SelectSalesOrder.php">' . _('Select another order for invoicing'). '</a><br /><br />'; echo '<a href="'.$RootPath.'/SelectOrderItems.php?NewOrder=Yes">' . _('Sales Order Entry') . '</a></div><br />'; /*end of process invoice */ } else { /*Process Invoice not set so allow input of invoice data */ - if (!isset($_POST['Consignment'])) { + if(!isset($_POST['Consignment'])) { $_POST['Consignment']=''; } - if (!isset($_POST['Packages'])) { + if(!isset($_POST['Packages'])) { $_POST['Packages']='1'; } - if (!isset($_POST['InvoiceText'])) { + if(!isset($_POST['InvoiceText'])) { $_POST['InvoiceText']=''; } $j++; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-20 04:00:54 UTC (rev 7598) +++ trunk/doc/Change.log 2016-08-21 03:11:43 UTC (rev 7599) @@ -1,5 +1,6 @@ webERP Change Log +20/08/16 RChacon: In ConfirmDispatch_Invoice.php, fix table html code. 18/08/16 RChacon: In PDFStatementPageHeader.inc, replace addJpegFromFile() and RoundRectangle() functions from class.pdf.php with Image() and RoundedRect() functions from tcpdf.php. 18/08/16 Exson: Add a Cancel button on SupplierAllocations.php to make user can return to previous page easily. 18/08/16 Exson: Add date format validation in PcClaimExpensesFromTab.php. |
From: <rc...@us...> - 2016-08-20 04:00:55
|
Revision: 7598 http://sourceforge.net/p/web-erp/reponame/7598 Author: rchacon Date: 2016-08-20 04:00:54 +0000 (Sat, 20 Aug 2016) Log Message: ----------- Replace addJpegFromFile() and RoundRectangle() functions from class.pdf.php with Image() and RoundedRect() functions from tcpdf.php. Modified Paths: -------------- trunk/doc/Change.log trunk/includes/PDFStatementPageHeader.inc Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-19 12:03:21 UTC (rev 7597) +++ trunk/doc/Change.log 2016-08-20 04:00:54 UTC (rev 7598) @@ -1,5 +1,6 @@ webERP Change Log +18/08/16 RChacon: In PDFStatementPageHeader.inc, replace addJpegFromFile() and RoundRectangle() functions from class.pdf.php with Image() and RoundedRect() functions from tcpdf.php. 18/08/16 Exson: Add a Cancel button on SupplierAllocations.php to make user can return to previous page easily. 18/08/16 Exson: Add date format validation in PcClaimExpensesFromTab.php. 17/8/16 RChacon committed for Tim: In CustWhereAlloc.php and SuppWhereAlloc.php, use the ConvertSQLDate() function for the dates. Modified: trunk/includes/PDFStatementPageHeader.inc =================================================================== --- trunk/includes/PDFStatementPageHeader.inc 2016-08-19 12:03:21 UTC (rev 7597) +++ trunk/includes/PDFStatementPageHeader.inc 2016-08-20 04:00:54 UTC (rev 7598) @@ -6,7 +6,16 @@ $YPos = $Page_Height - $Top_Margin; -$pdf->addJpegFromFile($_SESSION['LogoFile'],$Page_Width/2 -130,$YPos-80,0,60); +// Company Logo: +/*$pdf->addJpegFromFile($_SESSION['LogoFile'], $Page_Width/2-130, $YPos-80, 0, 60);*/ +$pdf->Image( + $_SESSION['LogoFile'],// Name of the file containing the image. + $Page_Width/2-130,// Abscissa from left border to the upper-left corner (LTR). + $Page_Height -($YPos-80) -(60),// Ordinate from top border to the upper-left corner (LTR). + 0,// Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + 60,// Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + ''// Image format. If not specified, the type is inferred from the file extension. +);// Public function Image() in ~/includes/tcpdf/tcpdf.php // Title $FontSize =15; @@ -121,46 +130,32 @@ //$YPos -= $line_height; $XPos = $Left_Margin; +// Draws a rounded rectangle around the statement details: +$pdf->RoundedRect( + ($Left_Margin),// Abscissa of upper-left corner from left border (LTR). + $Page_Height -($YPos),// Ordinate of upper-left corner from top border (LTR). + ($Perforation) -($Left_Margin),// Width. + ($YPos) -($Bottom_Margin),// Height. + 10,// The radius of the circle used to round off the corners of the rectangle. + '1111',// Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). + '',// Style of rendering. See the getPathPaintOperator() function for more information. Default value: empty (""). + array(),// Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). + array()// Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). +);// Public function RoundedRect() in ~/includes/tcpdf/tcpdf.php -/*draw a nice curved corner box around the statement details */ -/*from the top right */ -$pdf->partEllipse($Perforation-10,$YPos-10,0,90,10,10); -/*line to the top left */ -$pdf->line($Perforation-10, $YPos,$Left_Margin+10, $YPos); -/*Do top left corner */ -$pdf->partEllipse($Left_Margin+10, $YPos-10,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($Left_Margin, $YPos-10,$Left_Margin, $Bottom_Margin+10); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+10,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($Left_Margin+10, $Bottom_Margin,$Perforation-10, $Bottom_Margin); -/*Now do the bottom right corner */ -$pdf->partEllipse($Perforation-10, $Bottom_Margin+10,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($Perforation, $Bottom_Margin+10,$Perforation, $YPos-10); +// Draws a rounded rectangle around the remittance advice section: +$pdf->RoundedRect( + ($Perforation+1),// Abscissa of upper-left corner from left border (LTR). + $Page_Height -($YPos),// Ordinate of upper-left corner from top border (LTR). + ($Page_Width-$Right_Margin) -($Perforation+1),// Width. + ($YPos) -($Bottom_Margin),// Height. + 10,// The radius of the circle used to round off the corners of the rectangle. + '1111',// Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). + '',// Style of rendering. See the getPathPaintOperator() function for more information. Default value: empty (""). + array(),// Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). + array()// Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). +);// Public function RoundedRect() in ~/includes/tcpdf/tcpdf.php - -/*draw a nice curved corner box around the remittance advice section */ -$pdf->partEllipse($Page_Width-$Right_Margin-10,$YPos-10,0,90,10,10); -/*line to the top left */ -$pdf->line($Page_Width-$Right_Margin-10, $YPos, $Perforation + 11, $YPos); -/*Do top left corner */ -$pdf->partEllipse($Perforation+11, $YPos-10,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($Perforation+1, $YPos-10,$Perforation+1, $Bottom_Margin+10); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($Perforation+11, $Bottom_Margin+10,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($Perforation+11, $Bottom_Margin,$Page_Width-$Right_Margin-10, $Bottom_Margin); -/*Now do the bottom right corner */ -$pdf->partEllipse($Page_Width-$Right_Margin-10, $Bottom_Margin+10,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin+10,$Page_Width-$Right_Margin, $YPos-10); - - - - $YPos -= $line_height; $FontSize =10; /*Set up headings */ @@ -172,14 +167,12 @@ $pdf->addText($Left_Margin+459, $YPos,$FontSize, _('Allocated') ); $pdf->addText($Left_Margin+536, $YPos,$FontSize, _('Outstanding') ); - /*Set up remittance section headings */ $FontSize=8; $pdf->addText($Perforation+10, $YPos,$FontSize, _('Trans') ); $pdf->addText($Perforation+55, $YPos,$FontSize, _('Number') ); $pdf->addText($Perforation+100, $YPos,$FontSize, _('Outstanding') ); - $YPos -= $line_height; /*draw a line */ $pdf->line($Page_Width-$Right_Margin, $YPos,$XPos, $YPos); @@ -187,4 +180,4 @@ $YPos -= $line_height; $XPos = $Left_Margin; -?> +?> \ No newline at end of file |
From: <te...@us...> - 2016-08-19 12:03:23
|
Revision: 7597 http://sourceforge.net/p/web-erp/reponame/7597 Author: tehonu Date: 2016-08-19 12:03:21 +0000 (Fri, 19 Aug 2016) Log Message: ----------- Change in ORDER BY to show transactions in cronological order Modified Paths: -------------- trunk/CustomerInquiry.php Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2016-08-18 08:51:16 UTC (rev 7596) +++ trunk/CustomerInquiry.php 2016-08-19 12:03:21 UTC (rev 7597) @@ -231,7 +231,8 @@ ON salesorders.orderno=debtortrans.order_ WHERE debtortrans.debtorno = '" . $CustomerID . "' AND debtortrans.trandate >= '" . $DateAfterCriteria . "' - ORDER BY debtortrans.id"; + ORDER BY debtortrans.trandate, + debtortrans.id"; $ErrMsg = _('No transactions were returned by the SQL because'); $TransResult = DB_query($SQL, $ErrMsg); |
From: <ex...@us...> - 2016-08-18 08:51:18
|
Revision: 7596 http://sourceforge.net/p/web-erp/reponame/7596 Author: exsonqu Date: 2016-08-18 08:51:16 +0000 (Thu, 18 Aug 2016) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-18 08:50:28 UTC (rev 7595) +++ trunk/doc/Change.log 2016-08-18 08:51:16 UTC (rev 7596) @@ -1,5 +1,6 @@ webERP Change Log +18/08/16 Exson: Add a Cancel button on SupplierAllocations.php to make user can return to previous page easily. 18/08/16 Exson: Add date format validation in PcClaimExpensesFromTab.php. 17/8/16 RChacon committed for Tim: In CustWhereAlloc.php and SuppWhereAlloc.php, use the ConvertSQLDate() function for the dates. 14/8/16 RChacon:In SuppWhereAlloc.php, show transaction date in report. Improvements in HTML code and code documentation. |
From: <ex...@us...> - 2016-08-18 08:50:30
|
Revision: 7595 http://sourceforge.net/p/web-erp/reponame/7595 Author: exsonqu Date: 2016-08-18 08:50:28 +0000 (Thu, 18 Aug 2016) Log Message: ----------- 18/08/16 Exson: Add a Cancel button on SupplierAllocations.php to make user can return to previous page easily. Modified Paths: -------------- trunk/SupplierAllocations.php Modified: trunk/SupplierAllocations.php =================================================================== --- trunk/SupplierAllocations.php 2016-08-18 07:12:39 UTC (rev 7594) +++ trunk/SupplierAllocations.php 2016-08-18 08:50:28 UTC (rev 7595) @@ -517,6 +517,7 @@ <br /> <input type="submit" name="RefreshAllocTotal" value="' . _('Recalculate Total To Allocate') . '" /> <input type="submit" name="UpdateDatabase" value="' . _('Process Allocations') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> </div>'; } elseif(isset($_GET['SupplierID'])){ |
From: <ex...@us...> - 2016-08-18 07:12:41
|
Revision: 7594 http://sourceforge.net/p/web-erp/reponame/7594 Author: exsonqu Date: 2016-08-18 07:12:39 +0000 (Thu, 18 Aug 2016) Log Message: ----------- Modified Paths: -------------- trunk/doc/Change.log Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-18 07:09:07 UTC (rev 7593) +++ trunk/doc/Change.log 2016-08-18 07:12:39 UTC (rev 7594) @@ -1,5 +1,6 @@ webERP Change Log +18/08/16 Exson: Add date format validation in PcClaimExpensesFromTab.php. 17/8/16 RChacon committed for Tim: In CustWhereAlloc.php and SuppWhereAlloc.php, use the ConvertSQLDate() function for the dates. 14/8/16 RChacon:In SuppWhereAlloc.php, show transaction date in report. Improvements in HTML code and code documentation. 13/8/16 RChacon:In CustWhereAlloc.php, show transaction date in report. Standardise trandate in debtortrans. Improvements in HTML code and code documentation. |
From: <ex...@us...> - 2016-08-18 07:09:10
|
Revision: 7593 http://sourceforge.net/p/web-erp/reponame/7593 Author: exsonqu Date: 2016-08-18 07:09:07 +0000 (Thu, 18 Aug 2016) Log Message: ----------- 18/08/16 Exson: Add date format validation in PcClaimExpensesFromTab.php. Modified Paths: -------------- trunk/PcClaimExpensesFromTab.php Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2016-08-17 13:22:42 UTC (rev 7592) +++ trunk/PcClaimExpensesFromTab.php 2016-08-18 07:09:07 UTC (rev 7593) @@ -69,6 +69,10 @@ $InputError = 1; prnMsg( _('The amount must be greater than 0'),'error'); } + if (!is_date($_POST['Date'])) { + $InputError = 1; + prnMsg(_('The date input is not a right format'),'error'); + } if (isset($SelectedIndex) AND $InputError !=1) { $sql = "UPDATE pcashdetails @@ -430,4 +434,4 @@ } include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <rc...@us...> - 2016-08-17 13:22:44
|
Revision: 7592 http://sourceforge.net/p/web-erp/reponame/7592 Author: rchacon Date: 2016-08-17 13:22:42 +0000 (Wed, 17 Aug 2016) Log Message: ----------- In CustWhereAlloc.php and SuppWhereAlloc.php, use the ConvertSQLDate() function for the dates. Modified Paths: -------------- trunk/CustWhereAlloc.php trunk/SuppWhereAlloc.php trunk/doc/Change.log Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2016-08-16 13:33:08 UTC (rev 7591) +++ trunk/CustWhereAlloc.php 2016-08-17 13:22:42 UTC (rev 7592) @@ -8,7 +8,7 @@ $BookMark = 'WhereAllocated'; include('includes/header.inc'); -if (isset($_GET['TransNo']) AND isset($_GET['TransType'])) { +if(isset($_GET['TransNo']) AND isset($_GET['TransType'])) { $_POST['TransNo'] = (int)$_GET['TransNo']; $_POST['TransType'] = (int)$_GET['TransType']; $_POST['ShowResults'] = true; @@ -26,18 +26,18 @@ <td>' . _('Type') . ':</td> <td><select tabindex="1" name="TransType"> '; -if (!isset($_POST['TransType'])){ +if(!isset($_POST['TransType'])) { $_POST['TransType']='10'; } -if ($_POST['TransType']==10){ +if($_POST['TransType']==10) { echo '<option selected="selected" value="10">' . _('Invoice') . '</option> <option value="12">' . _('Receipt') . '</option> <option value="11">' . _('Credit Note') . '</option>'; -} elseif ($_POST['TransType'] == 12) { +} elseif($_POST['TransType'] == 12) { echo '<option selected="selected" value="12">' . _('Receipt') . '</option> <option value="10">' . _('Invoice') . '</option> <option value="11">' . _('Credit Note') . '</option>'; -} elseif ($_POST['TransType'] == 11) { +} elseif($_POST['TransType'] == 11) { echo '<option selected="selected" value="11">' . _('Credit Note') . '</option> <option value="10">' . _('Invoice') . '</option> <option value="12">' . _('Receipt') . '</option>'; @@ -45,7 +45,7 @@ echo '</select></td>'; -if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} +if(!isset($_POST['TransNo'])) {$_POST['TransNo']='';} echo '<td>' . _('Transaction Number').':</td> <td><input tabindex="2" type="text" class="number" name="TransNo" required="required" maxlength="10" size="10" value="'. $_POST['TransNo'] . '" /></td> </tr> @@ -55,7 +55,7 @@ <input tabindex="3" type="submit" name="ShowResults" value="' . _('Show How Allocated') . '" /> </div>'; -if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ +if(isset($_POST['ShowResults']) AND $_POST['TransNo']=='') { echo '<br />'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } @@ -74,12 +74,12 @@ WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; } $result = DB_query($sql ); - if (DB_num_rows($result)==1){ + if(DB_num_rows($result)==1) { $myrow = DB_fetch_array($result); $AllocToID = $myrow['id']; $CurrCode = $myrow['currcode']; @@ -94,7 +94,7 @@ custallocns.amt FROM debtortrans INNER JOIN custallocns "; - if ($_POST['TransType']==12 OR $_POST['TransType'] == 11){ + if($_POST['TransType']==12 OR $_POST['TransType'] == 11) { $TitleInfo = ($_POST['TransType'] == 12)?_('Receipt'):_('Credit Note'); $sql .= "ON debtortrans.id = custallocns.transid_allocto @@ -109,9 +109,9 @@ $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); $TransResult = DB_query($sql, $ErrMsg); - if (DB_num_rows($TransResult)==0){ + if(DB_num_rows($TransResult)==0) { - if ($myrow['totamt']<0 AND ($_POST['TransType']==12 OR $_POST['TransType'] == 11)){ + if($myrow['totamt']<0 AND ($_POST['TransType']==12 OR $_POST['TransType'] == 11)) { prnMsg(_('This transaction was a receipt of funds and there can be no allocations of receipts or credits to a receipt. This inquiry is meant to be used to see how a payment which is entered as a negative receipt is settled against credit notes or receipts'),'info'); } else { prnMsg(_('There are no allocations made against this transaction'),'info'); @@ -155,14 +155,14 @@ $k++; } - if ($myrow['type']==11){ + if($myrow['type']==11) { $TransType = _('Credit Note'); - } elseif ($myrow['type'] == 10){ + } elseif($myrow['type'] == 10) { $TransType = _('Invoice'); } else { $TransType = _('Receipt'); } - echo ' <td class="centre">' . $myrow['trandate'] . '</td> + echo ' <td class="centre">', ConvertSQLDate($myrow['trandate']), '</td> <td class="text">' . $TransType . '</td> <td class="number">' . $myrow['transno'] . '</td> <td class="text">' . $myrow['reference'] . '</td> @@ -172,7 +172,7 @@ </tr>'; $RowCounter++; - If ($RowCounter == 12){ + if($RowCounter == 12) { $RowCounter=1; echo $TableHeader; } @@ -181,7 +181,7 @@ } //end of while loop echo '<tr> - <td colspan="6" class="number">' . _('Total allocated') . '</td> + <td class="number" colspan="6">' . _('Total allocated') . '</td> <td class="number">' . locale_number_format($AllocsTotal,$CurrDecimalPlaces) . '</td> </tr> @@ -192,7 +192,7 @@ } echo '</div>'; echo '</form>'; -if (isset($Printer)) { +if(isset($Printer)) { echo '<div class="centre noprint"> <button onclick="javascript:window.print()" type="button"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/printer.png" /> ' . @@ -201,4 +201,4 @@ </div>';// "Print This" button. } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/SuppWhereAlloc.php =================================================================== --- trunk/SuppWhereAlloc.php 2016-08-16 13:33:08 UTC (rev 7591) +++ trunk/SuppWhereAlloc.php 2016-08-17 13:22:42 UTC (rev 7592) @@ -8,7 +8,7 @@ $BookMark = 'WhereAllocated'; include('includes/header.inc'); -if (isset($_GET['TransNo']) AND isset($_GET['TransType'])) { +if(isset($_GET['TransNo']) AND isset($_GET['TransType'])) { $_POST['TransNo'] = (int)$_GET['TransNo']; $_POST['TransType'] = (int)$_GET['TransType']; $_POST['ShowResults'] = true; @@ -26,18 +26,18 @@ <td>' . _('Type') . ':</td> <td><select tabindex="1" name="TransType"> '; -if (!isset($_POST['TransType'])){ +if(!isset($_POST['TransType'])) { $_POST['TransType']='20'; } -if ($_POST['TransType']==20){ +if($_POST['TransType']==20) { echo '<option selected="selected" value="20">' . _('Purchase Invoice') . '</option> <option value="22">' . _('Payment') . '</option> <option value="21">' . _('Debit Note') . '</option>'; -} elseif ($_POST['TransType'] == 22) { +} elseif($_POST['TransType'] == 22) { echo '<option selected="selected" value="22">' . _('Payment') . '</option> <option value="20">' . _('Purchase Invoice') . '</option> <option value="21">' . _('Debit Note') . '</option>'; -} elseif ($_POST['TransType'] == 21) { +} elseif($_POST['TransType'] == 21) { echo '<option selected="selected" value="21">' . _('Debit Note') . '</option> <option value="20">' . _('Purchase Invoice') . '</option> <option value="22">' . _('Payment') . '</option>'; @@ -45,7 +45,7 @@ echo '</select></td>'; -if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} +if(!isset($_POST['TransNo'])) {$_POST['TransNo']='';} echo '<td>' . _('Transaction Number').':</td> <td><input tabindex="2" type="text" class="number" name="TransNo" required="required" maxlength="20" size="20" value="'. $_POST['TransNo'] . '" /></td> </tr> @@ -55,12 +55,12 @@ <input tabindex="3" type="submit" name="ShowResults" value="' . _('Show How Allocated') . '" /> </div>'; -if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ +if(isset($_POST['ShowResults']) AND $_POST['TransNo']=='') { echo '<br />'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } -if (isset($_POST['ShowResults']) AND $_POST['TransNo']!=''){ +if(isset($_POST['ShowResults']) AND $_POST['TransNo']!='') { /*First off get the DebtorTransID of the transaction (invoice normally) selected */ $sql = "SELECT supptrans.id, @@ -74,12 +74,12 @@ WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; - if ($_SESSION['SalesmanLogin'] != '') { + if($_SESSION['SalesmanLogin'] != '') { $sql .= " AND supptrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; } $result = DB_query($sql); - if (DB_num_rows($result)==1){ + if(DB_num_rows($result)==1) { $myrow = DB_fetch_array($result); $AllocToID = $myrow['id']; $CurrCode = $myrow['currcode']; @@ -94,7 +94,7 @@ suppallocs.amt FROM supptrans INNER JOIN suppallocs "; - if ($_POST['TransType']==22 OR $_POST['TransType'] == 21){ + if($_POST['TransType']==22 OR $_POST['TransType'] == 21) { $TitleInfo = ($_POST['TransType'] == 22)?_('Payment'):_('Debit Note'); $sql .= "ON supptrans.id = suppallocs.transid_allocto @@ -109,9 +109,9 @@ $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); $TransResult = DB_query($sql, $ErrMsg); - if (DB_num_rows($TransResult)==0){ + if(DB_num_rows($TransResult)==0) { - if ($myrow['totamt']>0 AND ($_POST['TransType']==22 OR $_POST['TransType'] == 21)){ + if($myrow['totamt']>0 AND ($_POST['TransType']==22 OR $_POST['TransType'] == 21)) { prnMsg(_('This transaction was a receipt of funds and there can be no allocations of receipts or credits to a receipt. This inquiry is meant to be used to see how a payment which is entered as a negative receipt is settled against credit notes or receipts'),'info'); } else { prnMsg(_('There are no allocations made against this transaction'),'info'); @@ -154,14 +154,14 @@ $k++; } - if ($myrow['type']==21){ + if($myrow['type']==21) { $TransType = _('Debit Note'); - } elseif ($myrow['type'] == 20){ + } elseif($myrow['type'] == 20) { $TransType = _('Purchase Invoice'); } else { $TransType = _('Payment'); } - echo ' <td class="centre">' . $myrow['trandate'] . '</td> + echo ' <td class="centre">', ConvertSQLDate($myrow['trandate']), '</td> <td class="text">' . $TransType . '</td> <td class="number">' . $myrow['transno'] . '</td> <td class="text">' . $myrow['suppreference'] . '</td> @@ -171,7 +171,7 @@ </tr>'; $RowCounter++; - If ($RowCounter == 22){ + if($RowCounter == 22) { $RowCounter=1; echo $TableHeader; } @@ -190,7 +190,7 @@ } echo '</div>'; echo '</form>'; -if (isset($Printer)) { +if(isset($Printer)) { echo '<div class="centre noprint"> <button onclick="javascript:window.print()" type="button"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/printer.png" /> ' . @@ -199,4 +199,4 @@ </div>';// "Print This" button. } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-16 13:33:08 UTC (rev 7591) +++ trunk/doc/Change.log 2016-08-17 13:22:42 UTC (rev 7592) @@ -1,5 +1,6 @@ webERP Change Log +17/8/16 RChacon committed for Tim: In CustWhereAlloc.php and SuppWhereAlloc.php, use the ConvertSQLDate() function for the dates. 14/8/16 RChacon:In SuppWhereAlloc.php, show transaction date in report. Improvements in HTML code and code documentation. 13/8/16 RChacon:In CustWhereAlloc.php, show transaction date in report. Standardise trandate in debtortrans. Improvements in HTML code and code documentation. 11/8/16 Phil: committed falkoners fix for the upgrade script - was not adding the new field in customercontact required for the customer statements email address |
From: <te...@us...> - 2016-08-16 13:33:10
|
Revision: 7591 http://sourceforge.net/p/web-erp/reponame/7591 Author: tehonu Date: 2016-08-16 13:33:08 +0000 (Tue, 16 Aug 2016) Log Message: ----------- Fixed bug as did not populate Functional Exchange Rate (thanks to Tim) Modified Paths: -------------- trunk/CustomerReceipt.php Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2016-08-16 13:26:43 UTC (rev 7590) +++ trunk/CustomerReceipt.php 2016-08-16 13:33:08 UTC (rev 7591) @@ -912,7 +912,7 @@ } echo '<tr> <td>', _('Functional Exchange Rate'), ':</td> - <td><input class="number" maxlength="12" name="FunctionalExRate" pattern="[0-9\.,]*" required="required" size="14" tabindex="5" type="text" value="', $_POST['FunctionalExRate'], '" /> ', $SuggestedFunctionalExRateText, ' <i>', _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account'), '.</i></td> + <td><input class="number" maxlength="12" name="FunctionalExRate" pattern="[0-9\.,]*" required="required" size="14" tabindex="5" type="text" value="', $_SESSION['ReceiptBatch' . $identifier]->FunctionalExRate, '" /> ', $SuggestedFunctionalExRateText, ' <i>', _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account'), '.</i></td> </tr>'; } |
From: <te...@us...> - 2016-08-16 13:26:45
|
Revision: 7590 http://sourceforge.net/p/web-erp/reponame/7590 Author: tehonu Date: 2016-08-16 13:26:43 +0000 (Tue, 16 Aug 2016) Log Message: ----------- Fixed syntax error Modified Paths: -------------- trunk/PrintCustStatements.php Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2016-08-15 09:51:49 UTC (rev 7589) +++ trunk/PrintCustStatements.php 2016-08-16 13:26:43 UTC (rev 7590) @@ -514,11 +514,11 @@ include('includes/header.inc'); echo '<br /> <br /> - <br />' . prnMsg( _('There were no statements to print'); + <br />' . prnMsg( _('There were no statements to print')); } else { echo '<br /> <br /> - <br />' . prnMsg( _('There were no statements to email'); + <br />' . prnMsg( _('There were no statements to email')); } echo'<br /> <br /> |
From: <dai...@us...> - 2016-08-15 09:51:52
|
Revision: 7589 http://sourceforge.net/p/web-erp/reponame/7589 Author: daintree Date: 2016-08-15 09:51:49 +0000 (Mon, 15 Aug 2016) Log Message: ----------- fix customer statements and link to email from select customer script Modified Paths: -------------- trunk/PrintCustStatements.php trunk/SelectCustomer.php Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2016-08-14 13:26:17 UTC (rev 7588) +++ trunk/PrintCustStatements.php 2016-08-15 09:51:49 UTC (rev 7589) @@ -33,11 +33,14 @@ $_POST['ToCust'] = $_GET['ToCust']; } -If (isset($_POST['PrintPDF']) AND isset($_POST['FromCust']) AND $_POST['FromCust']!=''){ +if (isset($_GET['EmailOrPrint'])){ + $_POST['EmailOrPrint'] = $_GET['EmailOrPrint']; +} +if (isset($_POST['PrintPDF']) AND isset($_POST['FromCust']) AND $_POST['FromCust']!=''){ $_POST['FromCust'] = mb_strtoupper($_POST['FromCust']); - If (!isset($_POST['ToCust'])){ + if (!isset($_POST['ToCust'])){ $_POST['ToCust'] = $_POST['FromCust']; } else { $_POST['ToCust'] = mb_strtoupper($_POST['ToCust']); @@ -79,8 +82,7 @@ $Title = _('Print Statements') . ' - ' . _('No Customers Found'); require('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Customer Account Statements') . '</p>'; - prnMsg( _('There were no Customers matching your selection of '). $_POST['FromCust']. ' - '. - $_POST['ToCust'].'.' , 'error'); + prnMsg( _('There were no Customers matching your selection of ') . $_POST['FromCust'] . ' - ' . $_POST['ToCust'] . '.' , 'error'); include('includes/footer.inc'); exit(); } @@ -504,14 +506,24 @@ } /* end loop to print statements */ if (isset($pdf) AND $_POST['EmailOrPrint']=='print'){ - $pdf->OutputD($_SESSION['DatabaseName'] . '_CustStatements_' . date('Y-m-d') . '.pdf'); - $pdf->__destruct(); + $pdf->OutputD($_SESSION['DatabaseName'] . '_CustStatements_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } elseif (!isset($pdf)) { $Title = _('Print Statements') . ' - ' . _('No Statements Found'); - include('includes/header.inc'); - echo '<br /><br /><br />' . prnMsg( _('There were no statements to print') ); - echo '<br /><br /><br />'; - include('includes/footer.inc'); + if ($_POST['EmailOrPrint']=='print') { + include('includes/header.inc'); + echo '<br /> + <br /> + <br />' . prnMsg( _('There were no statements to print'); + } else { + echo '<br /> + <br /> + <br />' . prnMsg( _('There were no statements to email'); + } + echo'<br /> + <br /> + <br />'; + include('includes/footer.inc'); } } else { /*The option to print PDF was not hit */ @@ -527,8 +539,8 @@ echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr> + echo '<table class="selection"> + <tr> <td>' , _('Starting Customer statement to print (Customer code)') , '</td> <td><input type="text" maxlength="10" size="8" name="FromCust" value="0" /></td></tr> <tr> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2016-08-14 13:26:17 UTC (rev 7588) +++ trunk/SelectCustomer.php 2016-08-15 09:51:49 UTC (rev 7589) @@ -198,15 +198,15 @@ echo '<a href="', $RootPath, '/CustomerInquiry.php?CustomerID=', urlencode($_SESSION['CustomerID']), '">' . _('Customer Transaction Inquiries') . '</a><br />'; echo '<a href="', $RootPath, '/CustomerAccount.php?CustomerID=', urlencode($_SESSION['CustomerID']), '">' . _('Customer Account statement on screen') . '</a><br />'; echo '<a href="', $RootPath, '/Customers.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '&Modify=No">' . _('View Customer Details') . '</a><br />'; - echo '<a href="', $RootPath, '/PrintCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&PrintPDF=Yes">' . _('Print Customer Statement') . '</a><br />'; - echo '<a href="', $RootPath, '/EmailCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&PrintPDF=Yes">' . _('Email Customer Statement') . '</a><br />'; + echo '<a href="', $RootPath, '/PrintCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&EmailOrPrint=print&PrintPDF=Yes">' . _('Print Customer Statement') . '</a><br />'; + echo '<a title="' . _('One of the customer\'s contacts must have an email address and be flagged as the address to send the customer statement to for this function to work') . '" href="', $RootPath, '/PrintCustStatements.php?FromCust=', urlencode($_SESSION['CustomerID']), '&ToCust=', urlencode($_SESSION['CustomerID']), '&EmailOrPrint=email&PrintPDF=Yes">' . _('Email Customer Statement') . '</a><br />'; echo '<a href="', $RootPath, '/SelectCompletedOrder.php?SelectedCustomer=', urlencode($_SESSION['CustomerID']), '">' . _('Order Inquiries') . '</a><br />'; echo '<a href="', $RootPath, '/CustomerPurchases.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '">' . _('Show purchases from this customer') . '</a><br />'; wikiLink('Customer', $_SESSION['CustomerID']); echo '</td><td valign="top" class="select">'; // Customer transactions options: echo '<a href="', $RootPath, '/SelectSalesOrder.php?SelectedCustomer=', urlencode($_SESSION['CustomerID']), '">' . _('Modify Outstanding Sales Orders') . '</a><br />'; - echo '<a href="', $RootPath, '/CustomerAllocations.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '">' . _('Allocate Receipts OR Credit Notes') . '</a><br />'; + echo '<a title="' . _('This allows the deposits received from the customer to be matched against invoices') . '" href="', $RootPath, '/CustomerAllocations.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '">' . _('Allocate Receipts OR Credit Notes') . '</a><br />'; if(isset($_SESSION['CustomerID']) AND isset($_SESSION['BranchCode'])) { echo '<a href="', $RootPath, '/CounterSales.php?DebtorNo=', urlencode($_SESSION['CustomerID']), '&BranchNo=' . $_SESSION['BranchCode'] . '">' . _('Create a Counter Sale for this Customer') . '</a><br />'; } |
From: <rc...@us...> - 2016-08-14 13:26:19
|
Revision: 7588 http://sourceforge.net/p/web-erp/reponame/7588 Author: rchacon Date: 2016-08-14 13:26:17 +0000 (Sun, 14 Aug 2016) Log Message: ----------- Show transaction date in report. Improvements in HTML code and code documentation. Modified Paths: -------------- trunk/SuppWhereAlloc.php trunk/doc/Change.log Modified: trunk/SuppWhereAlloc.php =================================================================== --- trunk/SuppWhereAlloc.php 2016-08-13 19:29:57 UTC (rev 7587) +++ trunk/SuppWhereAlloc.php 2016-08-14 13:26:17 UTC (rev 7588) @@ -1,12 +1,13 @@ -<?php - +<?php +/* $Id: SuppWhereAlloc.php 7449 2016-01-14 10:08:51Z exsonqu $*/ +/* Suppliers Where allocated */ + include('includes/session.inc'); $Title = _('Supplier How Paid Inquiry'); - $ViewTopic = 'APInquiries'; -$BookMark = 'WhereAllocated'; +$BookMark = 'WhereAllocated'; +include('includes/header.inc'); -include('includes/header.inc'); if (isset($_GET['TransNo']) AND isset($_GET['TransType'])) { $_POST['TransNo'] = (int)$_GET['TransNo']; $_POST['TransType'] = (int)$_GET['TransType']; @@ -15,11 +16,12 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> <div> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> - <p class="page_title_text noprint"> - <img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Supplier Where Allocated'). '" alt="" />' . $Title . ' - </p> - <table class="selection noprint"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <p class="page_title_text noprint"><img alt="" src="'. $RootPath. '/css/'. $Theme. + '/images/money_add.png" title="',// Icon image. + _('Supplier Where Allocated'), '" /> ',// Icon title. + $Title. '</p>',// Page title. + '<table class="selection noprint"> <tr> <td>' . _('Type') . ':</td> <td><select tabindex="1" name="TransType"> '; @@ -60,7 +62,6 @@ if (isset($_POST['ShowResults']) AND $_POST['TransNo']!=''){ - /*First off get the DebtorTransID of the transaction (invoice normally) selected */ $sql = "SELECT supptrans.id, ovamount+ovgst AS totamt, @@ -116,35 +117,36 @@ prnMsg(_('There are no allocations made against this transaction'),'info'); } } else { - $Printer = true; - echo '<br /> - <div id="Report"> - <table class="selection">'; - - echo '<tr> - <th colspan="6"> - <div class="centre"> + $Printer = true; + echo '<br /> + <div id="Report"> + <table class="selection"> + <thead> + <tr> + <th class="centre" colspan="7"> <b>' . _('Allocations made against') . ' ' . $TitleInfo . ' ' . _('number') . ' ' . $_POST['TransNo'] . '<br />' . _('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</b> - </div> </th> - </tr>'; + </tr>'; + + $TableHeader = '<tr> + <th class="centre">' . _('Date') . '</th> + <th class="text">' . _('Type') . '</th> + <th class="number">' . _('Number') . '</th> + <th class="text">' . _('Reference') . '</th> + <th class="number">' . _('Ex Rate') . '</th> + <th class="number">' . _('Amount') . '</th> + <th class="number">' . _('Alloc') . '</th> + </tr>'; + echo $TableHeader, + '</thead> + <tbody>'; - $TableHeader = '<tr> - <th>' . _('Type') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Ex Rate') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Alloc') . '</th> - </tr>'; - echo $TableHeader; - $RowCounter = 1; $k = 0; //row colour counter $AllocsTotal = 0; - while ($myrow=DB_fetch_array($TransResult)) { - if ($k==1){ + while($myrow=DB_fetch_array($TransResult)) { + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -158,13 +160,14 @@ $TransType = _('Purchase Invoice'); } else { $TransType = _('Payment'); - } - echo '<td>' . $TransType . '</td> - <td>' . $myrow['transno'] . '</td> - <td>' . $myrow['suppreference'] . '</td> - <td>' . $myrow['rate'] . '</td> - <td class="number">' . locale_number_format($myrow['totalamt'],$CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($myrow['amt'],$CurrDecimalPlaces) . '</td> + } + echo ' <td class="centre">' . $myrow['trandate'] . '</td> + <td class="text">' . $TransType . '</td> + <td class="number">' . $myrow['transno'] . '</td> + <td class="text">' . $myrow['suppreference'] . '</td> + <td class="number">' . $myrow['rate'] . '</td> + <td class="number">' . locale_number_format($myrow['totalamt'], $CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($myrow['amt'], $CurrDecimalPlaces) . '</td> </tr>'; $RowCounter++; @@ -173,15 +176,15 @@ echo $TableHeader; } //end of page full new headings if - $AllocsTotal +=$myrow['amt']; + $AllocsTotal += $myrow['amt']; } //end of while loop echo '<tr> - <td colspan="5" class="number">' . _('Total allocated') . '</td> - <td class="number">' . locale_number_format($AllocsTotal,$CurrDecimalPlaces) . '</td> - </tr> - </table> - </div>'; + <td class="number" colspan="6">' . _('Total allocated') . '</td> + <td class="number">' . locale_number_format($AllocsTotal, $CurrDecimalPlaces) . '</td> + </tr> + </tbody></table> + </div>'; } // end if there are allocations against the transaction } //got the ID of the transaction to find allocations for } @@ -196,5 +199,4 @@ </div>';// "Print This" button. } include('includes/footer.inc'); - ?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-13 19:29:57 UTC (rev 7587) +++ trunk/doc/Change.log 2016-08-14 13:26:17 UTC (rev 7588) @@ -1,5 +1,6 @@ webERP Change Log +14/8/16 RChacon:In SuppWhereAlloc.php, show transaction date in report. Improvements in HTML code and code documentation. 13/8/16 RChacon:In CustWhereAlloc.php, show transaction date in report. Standardise trandate in debtortrans. Improvements in HTML code and code documentation. 11/8/16 Phil: committed falkoners fix for the upgrade script - was not adding the new field in customercontact required for the customer statements email address 11/8/16 Simon Kelly: Fix SQL for location users in SelectSalesOrder.php |
From: <rc...@us...> - 2016-08-13 19:29:59
|
Revision: 7587 http://sourceforge.net/p/web-erp/reponame/7587 Author: rchacon Date: 2016-08-13 19:29:57 +0000 (Sat, 13 Aug 2016) Log Message: ----------- Show transaction date in report. Standardise trandate in debtortrans. Improvements in HTML code and code documentation. Modified Paths: -------------- trunk/CustWhereAlloc.php trunk/doc/Change.log trunk/sql/mysql/upgrade4.13-4.13.1.sql Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2016-08-12 08:42:34 UTC (rev 7586) +++ trunk/CustWhereAlloc.php 2016-08-13 19:29:57 UTC (rev 7587) @@ -1,14 +1,13 @@ <?php - /* $Id$*/ +/* Shows to which invoices a receipt was allocated to */ include('includes/session.inc'); $Title = _('Customer How Paid Inquiry'); - $ViewTopic = 'ARInquiries'; $BookMark = 'WhereAllocated'; +include('includes/header.inc'); -include('includes/header.inc'); if (isset($_GET['TransNo']) AND isset($_GET['TransType'])) { $_POST['TransNo'] = (int)$_GET['TransNo']; $_POST['TransType'] = (int)$_GET['TransType']; @@ -18,10 +17,11 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> <div> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> - <p class="page_title_text noprint"> - <img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Customer Where Allocated'). '" alt="" />' . $Title . ' - </p> - <table class="selection noprint"> + <p class="page_title_text noprint"><img alt="" src="'. $RootPath. '/css/'. $Theme. + '/images/money_add.png" title="',// Icon image. + _('Customer Where Allocated'), '" /> ',// Icon title. + $Title. '</p>',// Page title. + '<table class="selection noprint"> <tr> <td>' . _('Type') . ':</td> <td><select tabindex="1" name="TransType"> '; @@ -60,9 +60,8 @@ prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } -if (isset($_POST['ShowResults']) AND $_POST['TransNo']!=''){ +if(isset($_POST['ShowResults']) AND $_POST['TransNo']!='') { - /*First off get the DebtorTransID of the transaction (invoice normally) selected */ $sql = "SELECT debtortrans.id, ovamount+ovgst AS totamt, @@ -74,7 +73,7 @@ ON debtorsmaster.currcode=currencies.currabrev WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; - + if ($_SESSION['SalesmanLogin'] != '') { $sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -98,7 +97,7 @@ if ($_POST['TransType']==12 OR $_POST['TransType'] == 11){ $TitleInfo = ($_POST['TransType'] == 12)?_('Receipt'):_('Credit Note'); - $sql .= "ON debtortrans.id = custallocns.transid_allocto + $sql .= "ON debtortrans.id = custallocns.transid_allocto WHERE custallocns.transid_allocfrom = '" . $AllocToID . "'"; } else { $TitleInfo = _('invoice'); @@ -120,33 +119,35 @@ } else { $Printer = true; echo '<br /> - <div id="Report"> - <table class="selection">'; - - echo '<tr> - <th colspan="6"> - <div class="centre"> - <b>' . _('Allocations made against') . ' ' . $TitleInfo . ' ' . _('number') . ' ' . $_POST['TransNo'] . '<br />' . _('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</b> - </div> + <div id="Report"> + <table class="selection"> + <thead> + <tr> + <th class="centre" colspan="7"> + <b>' . _('Allocations made against') . ' ' . $TitleInfo . ' ' . _('number') . ' ' . $_POST['TransNo'] . '<br />' . + _('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</b> </th> </tr>'; $TableHeader = '<tr> - <th>' . _('Type') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Ex Rate') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Alloc') . '</th> - </tr>'; - echo $TableHeader; + <th class="centre">' . _('Date') . '</th> + <th class="text">' . _('Type') . '</th> + <th class="number">' . _('Number') . '</th> + <th class="text">' . _('Reference') . '</th> + <th class="number">' . _('Ex Rate') . '</th> + <th class="number">' . _('Amount') . '</th> + <th class="number">' . _('Alloc') . '</th> + </tr>'; + echo $TableHeader, + '</thead> + <tbody>'; $RowCounter = 1; $k = 0; //row colour counter $AllocsTotal = 0; - while ($myrow=DB_fetch_array($TransResult)) { - if ($k==1){ + while($myrow=DB_fetch_array($TransResult)) { + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -161,12 +162,13 @@ } else { $TransType = _('Receipt'); } - echo '<td>' . $TransType . '</td> - <td>' . $myrow['transno'] . '</td> - <td>' . $myrow['reference'] . '</td> - <td>' . $myrow['rate'] . '</td> - <td class="number">' . locale_number_format($myrow['totalamt'],$CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($myrow['amt'],$CurrDecimalPlaces) . '</td> + echo ' <td class="centre">' . $myrow['trandate'] . '</td> + <td class="text">' . $TransType . '</td> + <td class="number">' . $myrow['transno'] . '</td> + <td class="text">' . $myrow['reference'] . '</td> + <td class="number">' . $myrow['rate'] . '</td> + <td class="number">' . locale_number_format($myrow['totalamt'], $CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($myrow['amt'], $CurrDecimalPlaces) . '</td> </tr>'; $RowCounter++; @@ -175,14 +177,15 @@ echo $TableHeader; } //end of page full new headings if - $AllocsTotal +=$myrow['amt']; + $AllocsTotal += $myrow['amt']; } //end of while loop echo '<tr> - <td colspan="5" class="number">' . _('Total allocated') . '</td> + <td colspan="6" class="number">' . _('Total allocated') . '</td> <td class="number">' . locale_number_format($AllocsTotal,$CurrDecimalPlaces) . '</td> </tr> - </table> + +</tbody></table> </div>'; } // end if there are allocations against the transaction } //got the ID of the transaction to find allocations for @@ -198,5 +201,4 @@ </div>';// "Print This" button. } include('includes/footer.inc'); - ?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-12 08:42:34 UTC (rev 7586) +++ trunk/doc/Change.log 2016-08-13 19:29:57 UTC (rev 7587) @@ -1,5 +1,6 @@ webERP Change Log +13/8/16 RChacon:In CustWhereAlloc.php, show transaction date in report. Standardise trandate in debtortrans. Improvements in HTML code and code documentation. 11/8/16 Phil: committed falkoners fix for the upgrade script - was not adding the new field in customercontact required for the customer statements email address 11/8/16 Simon Kelly: Fix SQL for location users in SelectSalesOrder.php 05/08/16 RChacon: In GLAccountInquiry.php, add noprint class to clean up printer output and improve code documentation. Modified: trunk/sql/mysql/upgrade4.13-4.13.1.sql =================================================================== --- trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-12 08:42:34 UTC (rev 7586) +++ trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-13 19:29:57 UTC (rev 7587) @@ -5,3 +5,7 @@ ALTER table custcontacts ADD statement tinyint(4) NOT NULL DEFAULT 0; INSERT INTO scripts VALUES ('PcTabExpensesList.php', '15', 'Creates excel with all movements of tab between dates'); +-- standardise transaction date to DATE type: +ALTER TABLE `debtortrans` CHANGE `trandate` `trandate` DATE NOT NULL DEFAULT '0000-00-00'; + + |
From: <te...@us...> - 2016-08-12 08:42:37
|
Revision: 7586 http://sourceforge.net/p/web-erp/reponame/7586 Author: tehonu Date: 2016-08-12 08:42:34 +0000 (Fri, 12 Aug 2016) Log Message: ----------- List of expenses of Petty cash Tab in Excel between dates Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.13-4.13.1.sql Added Paths: ----------- trunk/PcTabExpensesList.php Added: trunk/PcTabExpensesList.php =================================================================== --- trunk/PcTabExpensesList.php (rev 0) +++ trunk/PcTabExpensesList.php 2016-08-12 08:42:34 UTC (rev 7586) @@ -0,0 +1,236 @@ +<?php +require_once ('Classes/PHPExcel.php'); + +include('includes/session.inc'); +include('includes/SQL_CommonFunctions.inc'); + +if (isset($_POST['submit'])) { + submit($db, $_POST['Tabs'], $_POST['FromDate'], $_POST['ToDate']); +} else { + display($db); +} + +//####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### +function submit(&$db, $TabToShow, $FromDate, $ToDate) { + + //initialise no input errors + $InputError = 0; + + //first off validate inputs sensible + + if ($InputError == 0){ + // Search absic PC Tab information + $SQL = "SELECT pctabs.tabcode, + pctabs.usercode, + pctabs.typetabcode, + pctabs.currency, + pctabs.tablimit, + pctabs.assigner, + pctabs.authorizer + FROM pctabs + WHERE pctabs.tabcode = '" . $TabToShow . "'"; + $result = DB_query($SQL); + $myTab = DB_fetch_array($result); + + $SQL = "SELECT SUM(pcashdetails.amount) AS previous + FROM pcashdetails + WHERE pcashdetails.tabcode = '" . $TabToShow . "' + AND pcashdetails.date < '" . FormatDateForSQL($FromDate) . "'"; + $result = DB_query($SQL); + $myPreviousBalance = DB_fetch_array($result); + + $SQL = "SELECT pcashdetails.date, + pcashdetails.codeexpense, + pcashdetails.amount, + pcashdetails.authorized, + pcashdetails.notes, + pcashdetails.receipt + FROM pcashdetails + WHERE pcashdetails.tabcode = '" . $TabToShow . "' + AND pcashdetails.date >= '" . FormatDateForSQL($FromDate) . "' + AND pcashdetails.date <= '" . FormatDateForSQL($ToDate) . "' + ORDER BY pcashdetails.date, + pcashdetails.counterindex"; + $result = DB_query($SQL); + if (DB_num_rows($result) != 0){ + + // Create new PHPExcel object + $objPHPExcel = new PHPExcel(); + + // Set document properties + $objPHPExcel->getProperties()->setCreator("webERP") + ->setLastModifiedBy("webERP") + ->setTitle("PC Tab Expenses List") + ->setSubject("PC Tab Expenses List") + ->setDescription("PC Tab Expenses List") + ->setKeywords("") + ->setCategory(""); + + // Formatting + $objPHPExcel->getActiveSheet()->getStyle('A')->getAlignment()->setWrapText(true); + $objPHPExcel->getActiveSheet()->getStyle('A')->getNumberFormat()->setFormatCode('dd/mm/yyyy'); + $objPHPExcel->getActiveSheet()->getStyle('B5')->getNumberFormat()->setFormatCode('#,###'); + $objPHPExcel->getActiveSheet()->getStyle('C:D')->getNumberFormat()->setFormatCode('#,###'); + $objPHPExcel->getActiveSheet()->getStyle('E1:E2')->getNumberFormat()->setFormatCode('dd/mm/yyyy'); + $objPHPExcel->getActiveSheet()->getStyle('G')->getNumberFormat()->setFormatCode('dd/mm/yyyy'); + + // Add title data + $objPHPExcel->setActiveSheetIndex(0); + $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Tab Code'); + $objPHPExcel->getActiveSheet()->setCellValue('B1', $myTab['tabcode']); + $objPHPExcel->getActiveSheet()->setCellValue('A2', 'User Code'); + $objPHPExcel->getActiveSheet()->setCellValue('B2', $myTab['usercode']); + $objPHPExcel->getActiveSheet()->setCellValue('A3', 'Type of Tab'); + $objPHPExcel->getActiveSheet()->setCellValue('B3', $myTab['typetabcode']); + $objPHPExcel->getActiveSheet()->setCellValue('A4', 'Currency'); + $objPHPExcel->getActiveSheet()->setCellValue('B4', $myTab['currency']); + $objPHPExcel->getActiveSheet()->setCellValue('A5', 'Limit'); + $objPHPExcel->getActiveSheet()->setCellValue('B5', $myTab['tablimit']); + $objPHPExcel->getActiveSheet()->setCellValue('A6', 'Assigner'); + $objPHPExcel->getActiveSheet()->setCellValue('B6', $myTab['assigner']); + $objPHPExcel->getActiveSheet()->setCellValue('A7', 'Authorizer'); + $objPHPExcel->getActiveSheet()->setCellValue('B7', $myTab['authorizer']); + + $objPHPExcel->getActiveSheet()->setCellValue('D1', 'From'); + $objPHPExcel->getActiveSheet()->setCellValue('E1', $FromDate); + $objPHPExcel->getActiveSheet()->setCellValue('D2', 'To'); + $objPHPExcel->getActiveSheet()->setCellValue('E2', $ToDate); + + $objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date'); + $objPHPExcel->getActiveSheet()->setCellValue('B9', 'Expense Code'); + $objPHPExcel->getActiveSheet()->setCellValue('C9', 'Amount'); + $objPHPExcel->getActiveSheet()->setCellValue('D9', 'Balance'); + $objPHPExcel->getActiveSheet()->setCellValue('E9', 'Notes'); + $objPHPExcel->getActiveSheet()->setCellValue('F9', 'Receipt'); + $objPHPExcel->getActiveSheet()->setCellValue('G9', 'Authorized'); + + $objPHPExcel->getActiveSheet()->setCellValue('B10', 'Previous Balance'); + $objPHPExcel->getActiveSheet()->setCellValue('D10', $myPreviousBalance['previous']); + + // Add data + $i = 11; + while ($myrow = DB_fetch_array($result)) { + + $objPHPExcel->getActiveSheet()->setCellValue('A'.$i, ConvertSQLDate($myrow['date'])); + $objPHPExcel->getActiveSheet()->setCellValue('B'.$i, $myrow['codeexpense']); + $objPHPExcel->getActiveSheet()->setCellValue('C'.$i, $myrow['amount']); + $objPHPExcel->getActiveSheet()->setCellValue('D'.$i, '=D'.($i-1).'+C'.$i.''); + $objPHPExcel->getActiveSheet()->setCellValue('E'.$i, $myrow['notes']); + $objPHPExcel->getActiveSheet()->setCellValue('F'.$i, $myrow['receipt']); + $objPHPExcel->getActiveSheet()->setCellValue('G'.$i, ConvertSQLDate($myrow['authorized'])); + + $i++; + } + + // Freeze panes + $objPHPExcel->getActiveSheet()->freezePane('A10'); + + // Auto Size columns + foreach(range('A','G') as $columnID) { + $objPHPExcel->getActiveSheet()->getColumnDimension($columnID) + ->setAutoSize(true); + } + + // Rename worksheet + $objPHPExcel->getActiveSheet()->setTitle($TabToShow); + // Set active sheet index to the first sheet, so Excel opens this as the first sheet + $objPHPExcel->setActiveSheetIndex(0); + + // Redirect output to a client\x92s web browser (Excel2007) + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + $File = 'ExpensesList-' . $TabToShow. '.xlsx'; + header('Content-Disposition: attachment;filename="' . $File . '"'); + header('Cache-Control: max-age=0'); + // If you're serving to IE 9, then the following may be needed + header('Cache-Control: max-age=1'); + + // If you're serving to IE over SSL, then the following may be needed + header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified + header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 + header ('Pragma: public'); // HTTP/1.0 + + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); + $objWriter->save('php://output'); + + }else{ + $Title = _('Excel file for Petty Cash Tab Expenses List'); + include('includes/header.inc'); + prnMsg('No data to analyse'); + include('includes/footer.inc'); + } + } +} // End of function submit() + + +function display(&$db) //####DISPLAY_DISPLAY_DISPLAY_DISPLAY_DISPLAY_DISPLAY_##### +{ +// Display form fields. This function is called the first time +// the page is called. + $Title = _('Excel file for Petty Cash Tab Expenses List'); + + include('includes/header.inc'); + + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> + <div> + <br/>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<p class="page_title_text"> + <img src="' . $RootPath . '/css/' . $Theme . '/images/magnifier.png" title="' . _('Excel file for Petty Cash Tab Expenses List') . '" alt="" />' . ' ' . _('Excel file for Petty Cash Tab Expenses List') . ' + </p>'; + + # Sets default date range for current month + if (!isset($_POST['FromDate'])){ + $_POST['FromDate']=Date($_SESSION['DefaultDateFormat'], mktime(0,0,0,Date('m'),1,Date('Y'))); + } + if (!isset($_POST['ToDate'])){ + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } + + echo '<table class="selection"> + <tr> + <td>' . _('For Petty Cash Tab') . ':</td> + <td><select name="Tabs">'; + + $sql = "SELECT tabcode + FROM pctabs + ORDER BY tabcode"; + $CatResult=DB_query($sql); + + while ($myrow=DB_fetch_array($CatResult)){ + echo '<option value="' . $myrow['tabcode'] . '">' . $myrow['tabcode'] . '</option>'; + } + echo '</select> + </td> + </tr>'; + + echo '<tr> + <td>' . _('Date Range') . ':</td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '" /> + ' . _('To') . ':<input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '" /></td> + </tr>'; + + echo ' + <tr><td> </td></tr> + <tr> + <td> </td> + <td><input type="submit" name="submit" value="' . _('Create Petty Cash Tab Expenses List Excel File') . '" /></td> + </tr> + </table> + <br />'; + echo '</div> + </form>'; + include('includes/footer.inc'); + +} // End of function display() + +function beginning_of_month($date){ + $date2 = explode("-",$date); + $m = $date2[1]; + $y = $date2[0]; + $first_of_month = $y . '-' . $m . '-01'; + return $first_of_month; +} + +?> \ No newline at end of file Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2016-08-11 09:43:28 UTC (rev 7585) +++ trunk/includes/MainMenuLinksArray.php 2016-08-12 08:42:34 UTC (rev 7586) @@ -454,9 +454,11 @@ '/PcAuthorizeExpenses.php'); $MenuItems['PC']['Reports']['Caption'] = array(_('PC Tab General Report'), + _('PC Tab Expenses List'), _('PC Expenses Analysis')); $MenuItems['PC']['Reports']['URL'] = array('/PcReportTab.php', + '/PcTabExpensesList.php', '/PcAnalysis.php'); $MenuItems['PC']['Maintenance']['Caption'] = array( _('Types of PC Tabs'), Modified: trunk/sql/mysql/upgrade4.13-4.13.1.sql =================================================================== --- trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-11 09:43:28 UTC (rev 7585) +++ trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-12 08:42:34 UTC (rev 7586) @@ -3,5 +3,5 @@ INSERT INTO securitytokens VALUES (19,'Internal stock request fully access authority'); INSERT INTO scripts VALUES ('PDFGLJournalCN.php',1,'Print GL Journal Chinese version'); ALTER table custcontacts ADD statement tinyint(4) NOT NULL DEFAULT 0; +INSERT INTO scripts VALUES ('PcTabExpensesList.php', '15', 'Creates excel with all movements of tab between dates'); - |
From: <dai...@us...> - 2016-08-11 09:43:31
|
Revision: 7585 http://sourceforge.net/p/web-erp/reponame/7585 Author: daintree Date: 2016-08-11 09:43:28 +0000 (Thu, 11 Aug 2016) Log Message: ----------- Falkoner: fix to customer statements new field required in custcontacts to flag the contact that should receive the emailed statement Modified Paths: -------------- trunk/doc/Change.log trunk/sql/mysql/upgrade4.13-4.13.1.sql Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-11 09:31:30 UTC (rev 7584) +++ trunk/doc/Change.log 2016-08-11 09:43:28 UTC (rev 7585) @@ -1,5 +1,6 @@ webERP Change Log +11/8/16 Phil: committed falkoners fix for the upgrade script - was not adding the new field in customercontact required for the customer statements email address 11/8/16 Simon Kelly: Fix SQL for location users in SelectSalesOrder.php 05/08/16 RChacon: In GLAccountInquiry.php, add noprint class to clean up printer output and improve code documentation. 05/08/16 RChacon: Fix html code in SuppInvGRNs.php. Modified: trunk/sql/mysql/upgrade4.13-4.13.1.sql =================================================================== --- trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-11 09:31:30 UTC (rev 7584) +++ trunk/sql/mysql/upgrade4.13-4.13.1.sql 2016-08-11 09:43:28 UTC (rev 7585) @@ -2,5 +2,6 @@ ALTER table stockrequest ADD initiator varchar(20) NOT NULL DEFAULT ''; INSERT INTO securitytokens VALUES (19,'Internal stock request fully access authority'); INSERT INTO scripts VALUES ('PDFGLJournalCN.php',1,'Print GL Journal Chinese version'); +ALTER table custcontacts ADD statement tinyint(4) NOT NULL DEFAULT 0; |
From: <dai...@us...> - 2016-08-11 09:31:33
|
Revision: 7584 http://sourceforge.net/p/web-erp/reponame/7584 Author: daintree Date: 2016-08-11 09:31:30 +0000 (Thu, 11 Aug 2016) Log Message: ----------- Simon Kelly fix to SQL in SelectSalesOrder.php Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/doc/Change.log Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2016-08-09 07:17:19 UTC (rev 7583) +++ trunk/SelectSalesOrder.php 2016-08-11 09:31:30 UTC (rev 7584) @@ -171,7 +171,7 @@ contact FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 - WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + WHERE locations.loccode = '" .$_SESSION['UserStockLocation'] . "'"; $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); $DelAddResult = DB_query($sql,$ErrMsg); $DelAddRow = DB_fetch_array($DelAddResult); @@ -889,7 +889,7 @@ ON salesorderdetails.stkcode = stockmaster.stockid AND completed=0 INNER JOIN locstock ON stockmaster.stockid=locstock.stockid"; - if (isset($_POST['StockCat']) + if (isset($_POST['StockCat']) AND ((trim($_POST['StockCat']) == '') OR $_POST['StockCat'] == 'All')){ $WhereStockCat = ''; } else { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-09 07:17:19 UTC (rev 7583) +++ trunk/doc/Change.log 2016-08-11 09:31:30 UTC (rev 7584) @@ -1,4 +1,6 @@ webERP Change Log + +11/8/16 Simon Kelly: Fix SQL for location users in SelectSalesOrder.php 05/08/16 RChacon: In GLAccountInquiry.php, add noprint class to clean up printer output and improve code documentation. 05/08/16 RChacon: Fix html code in SuppInvGRNs.php. 02/08/16 Exson: Make account inquiry shown directly when GL Code selected or inquiry result is 1 in SelectGLAccount.php. @@ -12,12 +14,12 @@ 09/07/16 Exson: Fixed the utf8 character print incorrect of pdf file in class.pdf.php. 08/07/16 Exson: Fixed the transaction atomicity bug by change table lock to row lock in SQL_CommonFunctions.inc. 08/07/16 Exson: Fixed the bug that when bank account or currency changes the functional rate or exrate unchanged with suggested rate in Payments.php. -07/07/16: Exson: Fixed the bug of wrong original amount of payments to another bank accounts in GLAccountInquiry.php and wrong transaction link in DailyBankTransactions.php and add payment transaction no in bank transaction ref to make it traceable. +07/07/16: Exson: Fixed the bug of wrong original amount of payments to another bank accounts in GLAccountInquiry.php and wrong transaction link in DailyBankTransactions.php and add payment transaction no in bank transaction ref to make it traceable. 29/06/16 Exson: add identifier to avoid SESSION overwritten in CustomerReceipt.php. 29/06/16 Exson: Fixed the wrong balance of amount in bank account currency in DailyBankTransactions.php. 20/06/16 Exson: Fixed bom clone failure due to fields missing in CopyBom.php. Reported by shane. 20/06/16 Exson: Fixed the bug that # is not allowed as part of stockid in SelectProduct.php. -16/06/16 Exson: Make monthly payment term can be more than 30 days. +16/06/16 Exson: Make monthly payment term can be more than 30 days. 12/06/16 TurboPT: Fix syntax error in StockClone.php 08/06/16 Exson: add data label for SalesGraph.php. |
From: <te...@us...> - 2016-08-09 07:17:21
|
Revision: 7583 http://sourceforge.net/p/web-erp/reponame/7583 Author: tehonu Date: 2016-08-09 07:17:19 +0000 (Tue, 09 Aug 2016) Log Message: ----------- Fixed bug showing N rows instead of 1 when SepplierItemsOnly = on Modified Paths: -------------- trunk/PO_Items.php Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2016-08-06 21:44:43 UTC (rev 7582) +++ trunk/PO_Items.php 2016-08-09 07:17:19 UTC (rev 7583) @@ -871,9 +871,9 @@ AND stockmaster.discontinued<>1 AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid "; + GROUP BY stockmaster.stockid + ORDER BY stockmaster.stockid"; } else { // not just supplier purchdata items - $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units @@ -904,6 +904,7 @@ AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, @@ -942,6 +943,7 @@ AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.discontinued<>1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + GROUP BY stockmaster.stockid ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, @@ -974,6 +976,7 @@ and stockmaster.discontinued<>1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, @@ -1008,6 +1011,7 @@ AND stockmaster.mbflag<>'G' AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.discontinued<>1 + GROUP BY stockmaster.stockid ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, @@ -1038,6 +1042,7 @@ AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.discontinued<>1 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, |
From: <rc...@us...> - 2016-08-06 21:44:45
|
Revision: 7582 http://sourceforge.net/p/web-erp/reponame/7582 Author: rchacon Date: 2016-08-06 21:44:43 +0000 (Sat, 06 Aug 2016) Log Message: ----------- Add noprint class to clean up printer output and improve code documentation. Modified Paths: -------------- trunk/GLAccountInquiry.php trunk/doc/Change.log Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2016-08-06 11:40:10 UTC (rev 7581) +++ trunk/GLAccountInquiry.php 2016-08-06 21:44:43 UTC (rev 7582) @@ -1,11 +1,18 @@ <?php /* $Id$*/ +/* Shows the general ledger transactions for a specified account over a specified range of periods */ include ('includes/session.inc'); $Title = _('General Ledger Account Inquiry'); $ViewTopic = 'GeneralLedger'; $BookMark = 'GLAccountInquiry'; include('includes/header.inc'); + +echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme, + '/images/transactions.png" title="',// Icon image. + _('General Ledger Account Inquiry'), '" /> ',// Icon title. + _('General Ledger Account Inquiry'), '</p>';// Page title. + include('includes/GLPostings.inc'); if (isset($_POST['Account'])){ @@ -32,12 +39,10 @@ $LastPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); } -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="" />' . ' ' . _('General Ledger Account Inquiry') . '</p>'; +echo '<div class="page_help_text noprint">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br />'; -echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br />'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; -echo '<div>'; +echo '<div class="noprint">';// Begin input of criteria div. echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -49,7 +54,7 @@ <td>' . _('Account').':</td> <td><select name="Account">'; -$sql = "SELECT chartmaster.accountcode, +$sql = "SELECT chartmaster.accountcode, bankaccounts.accountcode AS bankact, bankaccounts.currcode, chartmaster.accountname @@ -114,8 +119,8 @@ <div class="centre"> <input type="submit" name="Show" value="'._('Show Account Transactions').'" /> </div> - </div> - </form>'; + </div>',// End input of criteria div. + '</form>'; /* End of the Form rest of script is what happens if the show button is hit*/ @@ -172,10 +177,9 @@ $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; $TransResult = DB_query($sql,$ErrMsg); $BankAccountInfo = isset($BankAccount)?'<th>' . _('Org Currency') . '</th> - <th>' . _('Amount in Org Currency') . '</th> + <th>' . _('Amount in Org Currency') . '</th> <th>' . _('Bank Ref') .'</th>':''; - echo '<br /> <table class="selection"> <thead> @@ -187,7 +191,7 @@ <th class="number">', _('Number'), '</th> <th class="centre">', ('Date'), '</th> <th class="number">', _('Debit'), '</th> - <th class="number">', _('Credit'), '</th>' . + <th class="number">', _('Credit'), '</th>' . $BankAccountInfo .' <th class="text">', _('Narrative'), '</th> <th class="number">', _('Balance'), '</th> @@ -286,7 +290,7 @@ $OrgAmt = ''; $Currency = ''; if ($myrow['type'] == 12 OR $myrow['type'] == 22 OR $myrow['type'] == 2 OR $myrow['type'] == 1) { - $banksql = "SELECT ref,currcode,amount FROM banktrans + $banksql = "SELECT ref,currcode,amount FROM banktrans WHERE type='" .$myrow['type']."' AND transno='" . $myrow['typeno'] . "' AND bankact='" . $SelectedAccount . "'"; $ErrMsg = _('Failed to retrieve bank data'); $bankresult = DB_query($banksql,$ErrMsg); @@ -297,7 +301,7 @@ $Currency = $bankrow['currcode']; } elseif ($myrow['type'] == 1) { //We should find out when transaction happens between bank accounts; - $bankreceivesql = "SELECT ref,type,transno,currcode,amount FROM banktrans + $bankreceivesql = "SELECT ref,type,transno,currcode,amount FROM banktrans WHERE ref LIKE '@%' AND transdate='" . $myrow['trandate'] . "' AND bankact='" . $SelectedAccount . "'"; $ErrMsg = _('Failed to retrieve bank receive data'); $bankresult = DB_query($bankreceivesql,$ErrMsg); @@ -323,7 +327,7 @@ $OrgAmt = $myrow['amount']; $Currency = $_SESSION['CompanyRecord']['currencydefault']; } - } + } $RunningTotal += $myrow['amount']; $PeriodTotal += $myrow['amount']; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2016-08-06 11:40:10 UTC (rev 7581) +++ trunk/doc/Change.log 2016-08-06 21:44:43 UTC (rev 7582) @@ -1,4 +1,5 @@ webERP Change Log +05/08/16 RChacon: In GLAccountInquiry.php, add noprint class to clean up printer output and improve code documentation. 05/08/16 RChacon: Fix html code in SuppInvGRNs.php. 02/08/16 Exson: Make account inquiry shown directly when GL Code selected or inquiry result is 1 in SelectGLAccount.php. 27/07/16 Exson: Add cost update date for material cost in WorkOrderCosting.php and WorkOrderIssue.php. |
From: <te...@us...> - 2016-08-06 11:40:13
|
Revision: 7581 http://sourceforge.net/p/web-erp/reponame/7581 Author: tehonu Date: 2016-08-06 11:40:10 +0000 (Sat, 06 Aug 2016) Log Message: ----------- Added ORDER BY in query Modified Paths: -------------- trunk/PcAuthorizeExpenses.php Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2016-08-05 18:05:50 UTC (rev 7580) +++ trunk/PcAuthorizeExpenses.php 2016-08-06 11:40:10 UTC (rev 7581) @@ -306,7 +306,8 @@ $SQL = "SELECT tabcode,authorizer FROM pctabs - WHERE authorizer LIKE '%" . $_SESSION['UserID'] . "%'"; + WHERE authorizer LIKE '%" . $_SESSION['UserID'] . "%' + ORDER BY tabcode"; $result = DB_query($SQL); |