From: <dai...@us...> - 2011-04-29 12:43:29
|
Revision: 4558 http://web-erp.svn.sourceforge.net/web-erp/?rev=4558&view=rev Author: daintree Date: 2011-04-29 12:43:19 +0000 (Fri, 29 Apr 2011) Log Message: ----------- quoting Modified Paths: -------------- trunk/PO_Header.php trunk/SpecialOrder.php trunk/StockCostUpdate.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/includes/GetConfig.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/PO_Header.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -805,7 +805,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Status Comment') . ':</td> - <td><input type=text name="StatusComments" size=50></td></tr> + <td><input type=text name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; //need to use single quotes as double quotes inside the string of StatusComments echo '<input type="hidden" name="StatusCommentsComplete" value="' . $_SESSION['PO'.$identifier]->StatusComments .'">'; Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/SpecialOrder.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 4; - include('includes/DefineSpecialOrderClass.php'); /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -13,7 +11,7 @@ include('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -22,15 +20,15 @@ } if (!isset($_SESSION['SupplierID'])){ - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('To set up a special') . ', ' . _('the supplier must first be selected from the Select Supplier page'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID . "'>" . _('Select the supplier now') . "</a>"; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select the supplier now') . '</a>'; include('includes/footer.inc'); exit; } if (!isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ - echo "<br><br>" . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . "<br><a href='$rootpath/SelectCustomer.php?" . SID . "'>" . _('Select the customer now') . "</a>"; + echo '<br /><br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . '<br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; include('includes/footer.inc'); exit; } @@ -110,9 +108,9 @@ } echo '<div class="centre">'; if (!isset($_SESSION['SPL']->BranchCode)){ - echo "<br><font size=4 color=BLUE>" . _('Purchase from') . " " . $_SESSION['SPL']->SupplierName . " " . _('in') . " " . $_SESSION['SPL']->SuppCurrCode . " " . _('for') . " " . $_SESSION['SPL']->CustomerName . " (" . $_SESSION['SPL']->CustCurrCode . ")"; + echo '<br /><font size=4 color=blue>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; } else { - echo '<br><font size=4 color=BLUE>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); + echo '<br /><font size=4 color=BLUE>' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); } echo '</div></font>'; /*if the branch details and delivery details have not been entered then select them from the list */ @@ -127,12 +125,13 @@ If (DB_num_rows($BranchResult)>0) { echo '<div class="centre">'; - echo '<br><br>' . _('Select the customer branch to deliver the special to from the list below'); + echo '<br /><br />' . _('Select the customer branch to deliver the special to from the list below'); - echo '</div><br><table cellpadding=3 colspan=2 BORDER=1>'; + echo '</div><br /><table cellpadding=3 colspan=2 BORDER=1>'; - $tableheader = "<tr><th>" ._('Code') . "</th> - <th>" . _('Branch Name') . "</th></tr>"; + $tableheader = '<tr><th>' ._('Code') . '</th> + <th>' . _('Branch Name') . '</th> + </tr>'; echo $tableheader; $j = 1; @@ -148,7 +147,11 @@ $k++; } - printf("<td><input type=submit name='SelectBranch' VALUE='%s'</td><td>%s</td></tr>", $myrow['branchcode'], $myrow['brname']); + printf('<td><input type="submit" name="SelectBranch" value="%s"</td> + <td>%s</td> + </tr>', + $myrow['branchcode'], + $myrow['brname']); //end of page full new headings if } @@ -189,32 +192,32 @@ if (!is_numeric($_POST['Qty'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The quantity of the order item must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'warn'); } if ($_POST['Qty']<0){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The quantity of the ordered item entered must be a positive amount'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'warn'); } if (!is_numeric($_POST['Price'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The price entered must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'warn'); } if (!is_numeric($_POST['Cost'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The cost entered must be numeric'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The cost entered must be numeric'),'warn'); } if ((($_POST['Price']/$_SESSION['SPL']->CustCurrExRate)-($_POST['Cost']/$_SESSION['SPL']->SuppCurrExRate))<0){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The sale is at a lower price than the cost'),'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The sale is at a lower price than the cost'),'warn'); } if (!Is_Date($_POST['ReqDelDate'])){ $AllowAdd = False; - prnMsg( _('Cannot Enter this order line') . '<br>' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); + prnMsg( _('Cannot Enter this order line') . '<br />' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); } If ($AllowAdd == True){ @@ -292,7 +295,7 @@ $sql = $sql . "'" . $_SESSION['SPL']->SupplierID . "', '" . $_SESSION['SPL']->Comments . "', - '" . Date("Y-m-d") . "', + '" . Date('Y-m-d') . "', '" . $_SESSION['SPL']->SuppCurrExRate . "', '" . $_SESSION['SPL']->Initiator . "', '" . $_SESSION['SPL']->QuotationRef . "', @@ -307,11 +310,9 @@ $ErrMsg = _('The purchase order header record could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was') . "<br>$sql"; + $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was') . '<br />' . $sql; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - /*Get the auto increment value of the order number created from the SQL above */ -// $_SESSION['SPL']->PurchOrderNo = DB_Last_Insert_ID($db,'purchorders','orderno'); $_SESSION['SPL']->PurchOrderNo = GetNextTransNo(18, $db); @@ -355,7 +356,7 @@ $ErrMsg = _('The item record for line') . " " . $SPLLine->LineNo . " " . _('could not be create because'); - $DbgMsg = _('The SQL statement used to insert the item and failed was') . "<br>$sql"; + $DbgMsg = _('The SQL statement used to insert the item and failed was') . "<br />$sql"; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -397,8 +398,8 @@ } /* end of the loop round the detail line items on the order */ - echo '<br><br>' . _('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created'); - echo "<br><a href='$rootpath/PO_PDFPurchOrder.php?" . SID . '&OrderNo=' . $_SESSION['SPL']->PurchOrderNo . "'>" . _('Print Purchase Order') . '</a>'; + echo '<br /><br />' . _('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created'); + echo '<br /><a href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['SPL']->PurchOrderNo . '">' . _('Print Purchase Order') . '</a>'; /*Now insert the sales order too */ @@ -448,7 +449,7 @@ '" . $_SESSION['SPL']->CustomerID . "', '" . $_SESSION['SPL']->BranchCode . "', '" . $_SESSION['SPL']->CustRef ."', - '" . Date("Y-m-d") . "', + '" . Date('Y-m-d') . "', '" . $BranchDetails['salestype'] . "', '" . $BranchDetails['defaultshipvia'] ."', '" . $BranchDetails['brname'] . "', @@ -466,9 +467,6 @@ $ErrMsg = _('The sales order cannot be added because'); $InsertQryResult = DB_query($HeaderSQL,$db,$ErrMsg, $DbMsg); -// $SalesOrderNo = DB_Last_Insert_ID($db,'salesorders','orderno'); -// $SalesOrderNo = GetNextTransNo(30, $db); - $StartOf_LineItemsSQL = "INSERT INTO salesorderdetails (orderno, stkcode, unitprice, @@ -486,20 +484,20 @@ } /* inserted line items into sales order details */ unset ($_SESSION['SPL']); - prnMsg(_('Sales Order Number') . ' ' . $SalesOrderNo . ' ' . _('has been entered') . '. <p>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '. <br><br>' . _('A freight charge may also be applicable'),'success'); + prnMsg(_('Sales Order Number') . ' ' . $SalesOrderNo . ' ' . _('has been entered') . '. <p>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '. <br /><br />' . _('A freight charge may also be applicable'),'success'); if (count($_SESSION['AllowedPageSecurityTokens'])>1){ /* Only allow print of packing slip for internal staff - customer logon's cannot go here */ - echo "<p><a href='$rootpath/PrintCustOrder.php?" . SID . "&TransNo=" . $SalesOrderNo . "'>" . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')</a>'; - echo "<p><a href='$rootpath/PrintCustOrder_generic.php?" . SID . '&TransNo=' . $SalesOrderNo . "'>" . _('Print packing slip') . ' (' . _('Laser') . ')</a>'; + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $SalesOrderNo . '">' . _('Print packing slip') . ' (' . _('Preprinted stationery') . ')</a>'; + echo '<p><a href="' . $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $SalesOrderNo . '">' . _('Print packing slip') . ' (' . _('Laser') . ')</a>'; } $Result = DB_Txn_Commit($db); unset($_SESSION['SPL']); /*Clear the PO data to allow a newy to be input*/ - echo "<br><br><a href='$rootpath/SpecialOrder.php?" . SID . "'>" . _('Enter A New Special Order') . "</a>"; + echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; exit; } /*end if there were no input errors trapped */ } /* end of the code to do transfer the SPL object to the database - user hit the place Order*/ @@ -507,56 +505,49 @@ /*Show the header information for modification */ -echo "<table><tr><td>" . _('Receive Purchase Into and Sell From') . ": <select name='StkLocation'>"; +echo '<table><tr><td>' . _('Receive Purchase Into and Sell From') . ': <select name="StkLocation">'; $sql = "SELECT loccode, locationname FROM locations"; $LocnResult = DB_query($sql,$db); -if (!isset($_SESSION['SPL']->StkLocation) OR $_SESSION['SPL']->StkLocation==""){ /*If this is the first time the form loaded set up defaults */ +if (!isset($_SESSION['SPL']->StkLocation) OR $_SESSION['SPL']->StkLocation==''){ /*If this is the first time the form loaded set up defaults */ $_SESSION['SPL']->StkLocation = $_SESSION['UserStockLocation']; } while ($LocnRow=DB_fetch_array($LocnResult)){ if ($_SESSION['SPL']->StkLocation == $LocnRow['loccode']){ - echo "<option selected Value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; + echo '<option selected value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { - echo "<option Value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; + echo '<option Value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } } -echo "</select></td>"; +echo '</select></td>'; -echo "<td>" . _('Initiated By') . ": <input type=TEXT name='Initiator' size=11 maxlength=10 VALUE=" . $_SESSION['SPL']->Initiator . "></td>"; -echo "<td>" . _('Special Ref') . ": <input type=TEXT name='QuotationRef' size=16 maxlength=15 VALUE=" . $_SESSION['SPL']->QuotationRef . "></td>"; -echo "<td>" . _('Customer Ref') . ": <input type=TEXT name='CustRef' size=11 maxlength=10 VALUE=" . $_SESSION['SPL']->CustRef . "></td></tr>"; +echo '<td>' . _('Initiated By') . ': <input type="text" name="Initiator" size=11 maxlength=10 value="' . $_SESSION['SPL']->Initiator . '"></td> + <td>' . _('Special Ref') . ': <input type="text" name="QuotationRef" size=16 maxlength=15 value="' . $_SESSION['SPL']->QuotationRef . '"></td> + <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size=11 maxlength=10 value="' . $_SESSION['SPL']->CustRef . '"></td></tr> + <tr><td valign=top colspan=2>' . _('Comments') . ': <textarea name="Comments" cols=70 rows=2>' . $_SESSION['SPL']->Comments . '</textarea></td></tr> +</table> +<hr>'; /* Rule off the header */ -echo "<tr><td VALIGN=TOP colspan=2>" . _('Comments') . ":"; -echo "<textarea name='Comments' cols=70 rows=2>" . $_SESSION['SPL']->Comments . "</textarea></td></tr></table>"; - -echo "<hr>"; /* Rule off the header */ - /*Now show the order so far */ if (count($_SESSION['SPL']->LineItems)>0){ - echo "<div class='centre'>><b>" . _('Special Order Summary') . "</b></div>"; - echo "<table cellpadding=2 colspan=7 border=1>"; + echo '<div class="centre">><b>' . _('Special Order Summary') . '</b></div>'; + echo '<table cellpadding=2 colspan=7 border=1>'; - $sql = 'select currencydefault from companies'; - $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); - $DefaultCurrency = $myrow[0]; + echo '<tr> + <th>' . _('Item Description') . '</th> + <th>' . _('Delivery') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Purchase Cost') . '<br />' . $_SESSION['SPL']->SuppCurrCode . '</th> + <th>' . _('Sell Price') . '<br />' . $_SESSION['SPL']->CustCurrCode . '</th> + <th>' . _('Total Cost') . '<br />' . $_SESSION['SPL']->SuppCurrCode . '</th> + <th>' . _('Total Price') . '<br />' . $_SESSION['SPL']->CustCurrCode . '</th> + <th>' . _('Total Cost') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th> + <th>' . _('Total Price') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th> + </tr>'; - echo "<tr> - <th>" . _('Item Description') . "</th> - <th>" . _('Delivery') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Purchase Cost') . '<br>' . $_SESSION['SPL']->SuppCurrCode . "</th> - <th>" . _('Sell Price') . '<br>' . $_SESSION['SPL']->CustCurrCode . "</th> - <th>" . _('Total Cost') . '<br>' . $_SESSION['SPL']->SuppCurrCode . "</th> - <th>" . _('Total Price') . '<br>' . $_SESSION['SPL']->CustCurrCode . "</th> - <th>" . _('Total Cost') . '<br>' . $DefaultCurrency . "</th> - <th>" . _('Total Price') . '<br>' . $DefaultCurrency . "</th> - </tr>"; - $_SESSION['SPL']->total = 0; $k = 0; //row colour counter foreach ($_SESSION['SPL']->LineItems as $SPLLine) { @@ -579,38 +570,41 @@ $k=1; } echo '<td>' . $SPLLine->ItemDescription . '</td> - <td>' . $SPLLine->ReqDelDate . "</td> - <td class=number>$DisplayQuantity</td> - <td class=number>$DisplayCost</td> - <td class=number>$DisplayPrice</td> - <td class=number>$DisplayLineCostTotal</td> - <td class=number>$DisplayLineTotal</td> - <td class=number>$DisplayLineCostTotalCurr</td> - <td class=number>$DisplayLineTotalCurr</td> - <td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID .'&Delete=' . $SPLLine->LineNo . "'>" . _('Delete') . '</a></td></tr>'; + <td>' . $SPLLine->ReqDelDate . '</td> + <td class=number>' . $DisplayQuantity . '</td> + <td class=number>' . $DisplayCost . '</td> + <td class=number>' . $DisplayPrice . '</td> + <td class=number>' . $DisplayLineCostTotal . '</td> + <td class=number>' . $DisplayLineTotal . '</td> + <td class=number>' . $DisplayLineCostTotalCurr . '</td> + <td class=number>' . $DisplayLineTotalCurr . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['SPL']->total = $_SESSION['SPL']->total + $DisplayLineTotalCurr; } $DisplayTotal = number_format($_SESSION['SPL']->total,2); echo '<tr> - <td colspan=8 class=number>' . _('TOTAL Excl Tax') . "</td> - <td class=number><b>$DisplayTotal</b></td> - </tr></table>"; + <td colspan=8 class=number>' . _('TOTAL Excl Tax') . '</td> + <td class=number><b>' . $DisplayTotal . '</b></td> + </tr> + </table>'; } /*Set up the form to enter new special items into */ -echo "<table>"; +echo '<table>'; -echo "<input type='hidden' name='LineNo' value=" . ($_SESSION['SPL']->LinesOnOrder + 1) .">"; +echo '<input type="hidden" name="LineNo" value="' . ($_SESSION['SPL']->LinesOnOrder + 1) .'" />'; if (!isset($_POST['ItemDescription'])) {$_POST['ItemDescription']='';} -echo '<tr><td>' . _('Ordered item Description') . ":</td><td><input type=TEXT name='ItemDescription' size=40 maxlength=40 VALUE='" . $_POST['ItemDescription'] . "'></td></tr>"; +echo '<tr><td>' . _('Ordered item Description') . ':</td> + <td><input type="text" name="ItemDescription" size=40 maxlength=40 value="' . $_POST['ItemDescription'] . '"></td></tr>'; -echo '<tr><td>' . _('Category') . ':</td><td><select name=StkCat>'; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name=StkCat>'; $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); @@ -619,9 +613,9 @@ while ($myrow=DB_fetch_array($result)){ if (isset($_POST['StkCat']) and $myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -630,30 +624,31 @@ /*default the order quantity to 1 unit */ $_POST['Qty'] = 1; -echo '<tr><td>' . _('Order Quantity') . ":</td> - <td><input type='Text' class='number' size=7 maxlength=6 name='Qty' value=" . $_POST['Qty'] . "></td></tr>"; +echo '<tr><td>' . _('Order Quantity') . ':</td> + <td><input type="text" class="number" size=7 maxlength=6 name="Qty" value="' . $_POST['Qty'] . '"></td> + </tr>'; if (!isset($_POST['Cost'])) {$_POST['Cost']='';} -echo '<tr><td>' . _('Unit Cost') . ":</td> - <td><input type='Text' class='number' size=15 maxlength=14 name='Cost' value=" . $_POST['Cost'] . "></td></tr>"; +echo '<tr><td>' . _('Unit Cost') . ':</td> + <td><input type="text" class="number" size=15 maxlength=14 name="Cost" value="' . $_POST['Cost'] . '"></td></tr>'; if (!isset($_POST['Price'])) { $_POST['Price']='';} -echo '<tr><td>' . _('Unit Price') . ":</td> - <td><input type='Text' class='number' size=15 maxlength=14 name='Price' value=" . $_POST['Price'] . "></td></tr>"; +echo '<tr><td>' . _('Unit Price') . ':</td> + <td><input type="text" class="number" size=15 maxlength=14 name="Price" value="' . $_POST['Price'] . '"></td></tr>'; /*Default the required delivery date to tomorrow as a starting point */ $_POST['ReqDelDate'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')+1,Date('y'))); -echo '<tr><td>' . _('Required Delivery Date') . ":</td> - <td><input type='Text' class='date' alt='".$_SESSION['DefaultDateFormat']."' size=12 maxlength=11 name='ReqDelDate' value=" . $_POST['ReqDelDate'] . "></td></tr>"; +echo '<tr><td>' . _('Required Delivery Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size=12 maxlength=11 name="ReqDelDate" value="' . $_POST['ReqDelDate'] . '"></td></tr>'; echo '</table>'; /* end of main table */ -echo "<div class='centre'><input type=submit Name='EnterLine' VALUE='" . _('Add Item to Order') . "'>"; +echo '<div class="centre"><input type="submit" name="EnterLine" value="' . _('Add Item to Order') . '">'; -echo "<br><br><input type=submit Name='Cancel' VALUE='" . _('Start Again') . "'>"; -echo "<br><br><input type=submit Name='Commit' VALUE='" . _('Process This Order') . "'>"; +echo '<br /><br /><input type="submit" name="Cancel" value="' . _('Start Again') . '">'; +echo '<br /><br /><input type="submit" name="Commit" value="' . _('Process This Order') . '">'; echo '</div></form>'; include('includes/footer.inc'); Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockCostUpdate.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -15,7 +15,7 @@ $StockID =trim(strtoupper($_POST['StockID'])); } -echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . '</p>'; @@ -23,21 +23,21 @@ if (isset($_POST['UpdateData'])){ $sql = "SELECT materialcost, - labourcost, - overheadcost, - mbflag, - sum(quantity) as totalqoh - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - WHERE stockmaster.stockid='".$StockID."' - GROUP BY description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag"; + labourcost, + overheadcost, + mbflag, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + WHERE stockmaster.stockid='".$StockID."' + GROUP BY description, + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag"; $ErrMsg = _('The entered item code does not exist'); $OldResult = DB_query($sql,$db,$ErrMsg); $OldRow = DB_fetch_array($OldResult); @@ -66,12 +66,11 @@ $Result = DB_Txn_Begin($db); ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']); - $SQL = "UPDATE stockmaster SET - materialcost='" . $_POST['MaterialCost'] . "', - labourcost='" . $_POST['LabourCost'] . "', - overheadcost='" . $_POST['OverheadCost'] . "', - lastcost='" . $OldCost . "' - WHERE stockid='" . $StockID . "'"; + $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', + labourcost='" . $_POST['LabourCost'] . "', + overheadcost='" . $_POST['OverheadCost'] . "', + lastcost='" . $OldCost . "' + WHERE stockid='" . $StockID . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); $DbgMsg = _('The SQL that failed was'); @@ -87,30 +86,30 @@ $DbgMsg = _('The SQL that failed was'); $result = DB_query("SELECT description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag, - stocktype, - sum(quantity) as totalqoh - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - INNER JOIN stockcategory - ON stockmaster.categoryid = stockcategory.categoryid - WHERE stockmaster.stockid='" . $StockID . "' - GROUP BY description, - units, - lastcost, - actualcost, - materialcost, - labourcost, - overheadcost, - mbflag, - stocktype", - $db,$ErrMsg,$DbgMsg); + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag, + stocktype, + sum(quantity) as totalqoh + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid = stockcategory.categoryid + WHERE stockmaster.stockid='" . $StockID . "' + GROUP BY description, + units, + lastcost, + actualcost, + materialcost, + labourcost, + overheadcost, + mbflag, + stocktype", + $db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); @@ -125,8 +124,8 @@ echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') - OR $myrow['mbflag']=='A' - OR $myrow['mbflag']=='K'){ + OR $myrow['mbflag']=='A' + OR $myrow['mbflag']=='K'){ echo '</form>'; // Close the form if ($myrow['mbflag']=='D'){ echo '<br>' . $StockID .' ' . _('is a service item'); @@ -164,11 +163,11 @@ echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" VALUE="' . _('Update') . '"><br /><br />'; } if ($myrow['mbflag']!='D'){ - echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockUsage.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Usage') .'</a>'; - echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') .'</a>'; + echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; } echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/StockLocMovements.php =================================================================== --- trunk/StockLocMovements.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockLocMovements.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,15 +1,13 @@ <?php /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('All Stock Movements By Location'); include('includes/header.inc'); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . @@ -18,20 +16,20 @@ echo '<table class=selection><tr><td>'; echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -43,7 +41,7 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))); } -echo ' ' . _('Show Movements before') . ': <input type=TEXT name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; +echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" size=12 maxlength=12 Value="' . $_POST['AfterDate'] . '">'; echo '</td></tr></table><br>'; echo '<div class=centre><input type=submit name="ShowMoves" VALUE="' . _('Show Stock Movements') . '"></div><br>'; @@ -77,7 +75,7 @@ $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because'); $MovtsResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=5 CELLSPACING=4 class=selection>'; +echo '<table cellpadding=5 cellspacing="4 "class="selection">'; $tableheader = '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Type') . '</th> @@ -108,29 +106,29 @@ $DisplayTranDate = ConvertSQLDate($myrow['trandate']); - printf("<td><a target='_blank' href='StockStatus.php?" . SID . "&StockID=%s'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>", - strtoupper($myrow['stockid']), - strtoupper($myrow['stockid']), - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - number_format($myrow['qty'], - $myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + </tr>', + strtoupper($myrow['stockid']), + strtoupper($myrow['stockid']), + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + number_format($myrow['qty'], + $myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); $j++; If ($j == 16){ $j=1; Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockLocStatus.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,8 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('All Stock Status By Location/Category'); @@ -16,7 +15,7 @@ } -echo '<form action="' . $_SERVER['PHP_SELF'] . '?'. SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, @@ -27,7 +26,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<table class=selection><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; +echo '<table class=selection> + <tr><td>' . _('From Stock Location') . ':</td> + <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ @@ -44,17 +45,21 @@ } echo '</select></td></tr>'; -$SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; +$SQL="SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ echo '</table><p>'; prnMsg(_('There are no stock categories currently defined please use the link below to set them up'),'warn'); - echo '<br><a href="' . $rootpath . '/StockCategories.php?' . SID .'">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; include ('includes/footer.inc'); exit; } -echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; +echo '<tr><td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -73,8 +78,8 @@ echo '</select></td></tr>'; - -echo '<tr><td>' . _('Shown Only Items Where') . ':</td><td><select name="BelowReorderQuantity">'; +echo '<tr><td>' . _('Shown Only Items Where') . ':</td> + <td><select name="BelowReorderQuantity">'; if (!isset($_POST['BelowReorderQuantity'])){ $_POST['BelowReorderQuantity']='All'; } @@ -94,7 +99,7 @@ echo '</td></tr></table>'; -echo '<br><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; +echo '<br /><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; if (isset($_POST['ShowStatus'])){ @@ -142,7 +147,7 @@ $DbgMsg = _('The SQL that failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); - echo '<br><table cellpadding=5 cellspacing=4 class=selection>'; + echo '<br /><table cellpadding=5 cellspacing=4 class="selection">'; $tableheader = '<tr> <th>' . _('StockID') . '</th> @@ -161,7 +166,7 @@ $StockID = $myrow['stockid']; - $sql = "SELECT Sum(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem + $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails, salesorders WHERE salesorders.orderno = salesorderdetails.orderno @@ -181,17 +186,17 @@ //Also need to add in the demand as a component of an assembly items if this items has any assembly parents. $sql = "SELECT Sum((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='A'"; + FROM salesorderdetails, + salesorders, + bom, + stockmaster + WHERE salesorderdetails.stkcode=bom.parent + AND salesorders.orderno = salesorderdetails.orderno + AND salesorders.fromstkloc='" . $myrow['loccode'] . "' + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockID . "' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='A'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db, $ErrMsg); @@ -201,12 +206,12 @@ $DemandQty += $DemandRow[0]; } $sql = "SELECT SUM((woitems.qtyreqd-woitems.qtyrecd)*bom.quantity) AS dem - FROM workorders, woitems, bom - WHERE woitems.wo = workorders.wo - AND woitems.stockid = bom.parent - AND workorders.closed=0 - AND bom.component = '". $StockID . "' - AND workorders.loccode='". $myrow['loccode'] ."'"; + FROM workorders, woitems, bom + WHERE woitems.wo = workorders.wo + AND woitems.stockid = bom.parent + AND workorders.closed=0 + AND bom.component = '". $StockID . "' + AND workorders.loccode='". $myrow['loccode'] ."'"; $DemandResult = DB_query($sql,$db, $ErrMsg); if (DB_num_rows($DemandResult)==1){ @@ -215,19 +220,15 @@ } - $sql = "SELECT SUM(purchorderdetails.quantityord*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END) - - purchorderdetails.quantityrecd*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END)) AS qoo - FROM purchorderdetails - INNER JOIN purchorders - ON purchorderdetails.orderno=purchorders.orderno - LEFT JOIN purchdata - ON purchorders.supplierno=purchdata.supplierno - AND purchorderdetails.itemcode=purchdata.stockid - WHERE purchorders.intostocklocation='" . $myrow['loccode'] . "' - AND purchorderdetails.itemcode='" . $StockID . "' - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + $sql = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) AS qoo + FROM purchorderdetails + INNER JOIN purchorders + ON purchorderdetails.orderno=purchorders.orderno + WHERE purchorders.intostocklocation='" . $myrow['loccode'] . "' + AND purchorderdetails.itemcode='" . $StockID . "' + AND purchorders.status <> 'Cancelled' + AND purchorders.status <> 'Rejected' + AND purchorders.status <> 'Pending'"; $ErrMsg = _('The quantity on order for this product to be received into') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $QOOResult = DB_query($sql,$db,$ErrMsg); @@ -251,27 +252,29 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf("<td><a target='_blank' href='StockStatus.php?StockID=%s'>%s</a></td> + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td class=number><a target='_blank' href='SelectProduct.php?StockID=%s'>%s</a></td> - <td class=number>%s</td></tr>", + <td class=number><a target="_blank" href="' . $rootpath . 'SelectProduct.php?StockID=%s">%s</a></td> + <td class=number>%s</td> + </tr>', strtoupper($myrow['stockid']), strtoupper($myrow['stockid']), $myrow['description'], number_format($myrow['quantity'],$myrow['decimalplaces']), number_format($myrow['reorderlevel'],$myrow['decimalplaces']), number_format($DemandQty,$myrow['decimalplaces']), - strtoupper($myrow['stockid']), + strtoupper($myrow['stockid']), number_format($myrow['quantity'] - $DemandQty,$myrow['decimalplaces']), number_format($QOO,$myrow['decimalplaces'])); + if ($myrow['serialised'] ==1){ /*The line is a serialised item*/ - echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?' . SID . '&Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>'; + echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>'; } elseif ($myrow['controlled']==1){ - echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?' . SID . '&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>'; + echo '<td><a target="_blank" href="' . $rootpath . '/StockSerialItems.php?Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>'; } } else if ($_POST['BelowReorderQuantity']!='NotZero') { if ($k==1){ @@ -281,13 +284,13 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf("<td><a target='_blank' href='StockStatus.php?StockID=%s'>%s</a></td> + printf('<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> - <td class=number><a target='_blank' href='SelectProduct.php?StockID=%s'>%s</a></td> - <td class=number>%s</td>", + <td class=number><a target="_blank" href="' . $rootpath . 'SelectProduct.php?StockID=%s">%s</a></td> + <td class=number>%s</td>', strtoupper($myrow['stockid']), strtoupper($myrow['stockid']), $myrow['description'], Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockMovements.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -2,13 +2,10 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Stock Movements'); include('includes/header.inc'); - if (isset($_GET['StockID'])){ $StockID = trim(strtoupper($_GET['StockID'])); } elseif (isset($_POST['StockID'])){ @@ -17,50 +14,46 @@ $StockID = ''; } - -// This is already linked from this page -//echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; - $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . '</b></p>'; -echo "<form action='". $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['BeforeDate']) OR !Is_Date($_POST['BeforeDate'])){ $_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']); } if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ - $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m")-3,Date("d"),Date("y"))); + $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } echo '<br /><table cellpadding=2 class=selection>'; -echo '<tr><th colspan=10>' . _('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; +echo '<tr><th colspan=10>' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20>'; -echo ' ' . _('From Stock Location') . ":<select name='StockLocation'> "; +echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></th></tr>'; echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type=text name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; -echo " <input type=submit name='ShowMoves' VALUE='" . _('Show Stock Movements') . "'></th></tr>"; +echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); @@ -93,14 +86,19 @@ $MovtsResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -$tableheader = "<tr> - <th>" . _('Type') . "</th><th>" . _('Number') . "</th> - <th>" . _('Date') . "</th><th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th><th>" . _('Quantity') . "</th> - <th>" . _('Reference') . "</th><th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th><th>" . _('New Qty') . "</th> - </tr>"; - +$tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('New Qty') . '</th> + </tr>'; + echo $tableheader; $j = 1; @@ -120,61 +118,59 @@ if ($myrow['type']==10){ /*its a sales invoice allow link to show invoice it was sold on*/ - printf("<td><a TARGET='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Invoice'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>", - $rootpath, - SID, - $myrow['transno'], - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - number_format($myrow['qty'], - $myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s%%</td> + <td class=number>%s</td> + </tr>', + $rootpath, + $myrow['transno'], + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + number_format($myrow['qty'], + $myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],2), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); } elseif ($myrow['type']==11){ - printf("<td><a TARGET='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Credit'>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>", - $rootpath, - SID, - $myrow['transno'], - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - number_format($myrow['qty'],$myrow['decimalplaces']), - $myrow['reference'], - number_format($myrow['price'],2), - number_format($myrow['discountpercent']*100,2), - number_format($myrow['newqoh'],$myrow['decimalplaces'])); + printf('<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s%%</td> + <td class=number>%s</td> + </tr>', + $rootpath, + $myrow['transno'], + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + number_format($myrow['qty'],$myrow['decimalplaces']), + $myrow['reference'], + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($myrow['discountpercent']*100,2), + number_format($myrow['newqoh'],$myrow['decimalplaces'])); } else { - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -184,7 +180,7 @@ <td class=number>%s</td> <td class=number>%s%%</td> <td class=number>%s</td> - </tr>", + </tr>', $myrow['typename'], $myrow['transno'], $DisplayTranDate, @@ -192,7 +188,7 @@ $myrow['branchcode'], number_format($myrow['qty'],$myrow['decimalplaces']), $myrow['reference'], - number_format($myrow['price'],2), + number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), number_format($myrow['discountpercent']*100,2), number_format($myrow['newqoh'],$myrow['decimalplaces'])); } @@ -201,10 +197,10 @@ //end of while loop echo '</table>'; -echo "<div class=centre><br /><a href='$rootpath/StockStatus.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Status') . '</a>'; -echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Show Stock Usage') . '</a>'; -echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +echo '<div class="centre"><br /><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>'; +echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">' . _('Show Stock Usage') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">' . _('Search Outstanding Sales Orders') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; echo '</form></div>'; Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2011-04-28 10:39:25 UTC (rev 4557) +++ trunk/StockQuantityByDate.php 2011-04-29 12:43:19 UTC (rev 4558) @@ -1,11 +1,7 @@ <?php /* $Id$ */ -/* Contributed by Chris Bice - gettext by Kitch*/ - -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Stock On Hand By Date'); include('includes/header.inc'); @@ -13,65 +9,65 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . "?". SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $resultStkLocs = DB_query($sql, $db); echo '<table class=selection><tr>'; -echo '<td>' . _('For Stock Category') . ":</td> - <td><select name='StockCategory'> "; +echo '<td>' . _('For Stock Category') . ':</td> + <td><select name="StockCategory"> '; echo '<option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockCategory']) AND $_POST['StockCategory']!='All'){ if ($myrow['categoryid'] == $_POST['StockCategory']){ - echo "<option selected VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } }else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td>'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql, $db); -echo '<td>' . _('For Stock Location') . ":</td> - <td><select name='StockLocation'> "; +echo '<td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td>'; if (!isset($_POST['OnHandDate'])){ - $_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m"),0,Date("y"))); + $_POST['OnHandDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),0,Date('y'))); } -echo '<td>' . _("On-Hand On Date") . ":</td> - <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OnHandDate' size=12 maxlength=12 VALUE='" . $_POST['OnHandDate'] . "'></td></tr>"; -echo "<tr><td colspan=6><div class='centre'><input type=submit n... [truncated message content] |