From: <tim...@us...> - 2011-02-08 15:48:08
|
Revision: 4488 http://web-erp.svn.sourceforge.net/web-erp/?rev=4488&view=rev Author: tim_schofield Date: 2011-02-08 15:48:02 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Rework CounterSales.php so that it is now possible to sell items that have sales/purchasing tax Modified Paths: -------------- trunk/CounterSales.php trunk/doc/Change.log.html trunk/includes/DefineCartClass.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-02-08 09:41:58 UTC (rev 4487) +++ trunk/CounterSales.php 2011-02-08 15:48:02 UTC (rev 4488) @@ -455,7 +455,6 @@ unset($NewItem); } /* end of if quick entry */ - /*Now do non-quick entry delete/edits/adds */ if ((isset($_SESSION['Items'.$identifier])) OR isset($NewItem)) { @@ -513,7 +512,47 @@ } } +if (isset($_POST['Recalculate'])) { + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { + $NewItem=$OrderLine->StockID; + $sql = "SELECT stockmaster.mbflag, stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $OrderLine->StockID."'"; + $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); + $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); + $KitResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); + if ($myrow=DB_fetch_array($KitResult)){ + if ($myrow['mbflag']=='K'){ /*It is a kit set item */ + $sql = "SELECT bom.component, + bom.quantity + FROM bom + WHERE bom.parent='" . $OrderLine->StockID. "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + + $ErrMsg = _('Could not retrieve kitset components from the database because'); + $KitResult = DB_query($sql,$db,$ErrMsg); + + $ParentQty = $NewItemQty; + while ($KitParts = DB_fetch_array($KitResult,$db)){ + $NewItem = $KitParts['component']; + $NewItemQty = $KitParts['quantity'] * $ParentQty; + $NewPOLine = 0; + $NewItemDue = date($_SESSION['DefaultDateFormat']); + $_SESSION['Items'.$identifier]->GetTaxes($OrderLine->LineNumber); + } + + } else { /*Its not a kit set item*/ + $NewItemDue = date($_SESSION['DefaultDateFormat']); + $NewPOLine = 0; + $_SESSION['Items'.$identifier]->GetTaxes($OrderLine->LineNumber); + } + } + unset($NewItem); + } /* end of if its a new item */ +} + if (isset($NewItem)){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart Now figure out if the item is a kit set - the field MBFlag='K' @@ -735,7 +774,8 @@ } $TaxTotal += $TaxLineTotal; - + $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; + $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; echo '<td class="number">' . number_format($TaxLineTotal ,2) . '</td>'; echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,2) . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'&identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; @@ -759,6 +799,7 @@ <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),2) . '</td> </tr> </table>'; + echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; echo '<table><tr><td>'; //nested table echo '<table><tr> @@ -784,7 +825,7 @@ echo '</td><th valign="bottom">'; //for the master table echo '<table class="selection">'; // a new nested table in the second column of master table //now the payment stuff in this column - $PaymentMethodsResult = DB_query('SELECT paymentid, paymentname FROM paymentmethods',$db); + $PaymentMethodsResult = DB_query("SELECT paymentid, paymentname FROM paymentmethods",$db); echo '<tr><td>' . _('Payment Type') . ':</td><td><select name="PaymentMethod">'; while ($PaymentMethodRow = DB_fetch_array($PaymentMethodsResult)){ @@ -796,7 +837,7 @@ } echo '</select></td></tr>'; - $BankAccountsResult = DB_query('SELECT bankaccountname, accountcode FROM bankaccounts',$db); + $BankAccountsResult = DB_query("SELECT bankaccountname, accountcode FROM bankaccounts",$db); echo '<tr><td>' . _('Banked to') . ':</td><td><select name="BankAccount">'; while ($BankAccountsRow = DB_fetch_array($BankAccountsResult)){ @@ -817,6 +858,7 @@ echo '</th></tr></table>'; //end of column/row/master table echo '<br /><div class="centre"><input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> <input type="submit" name="ProcessSale" value="' . _('Process The Sale') . '" /></div><hr />'; + } # end of if lines /* ********************************** @@ -831,7 +873,7 @@ prnMsg(_('There are no lines on this sale. Please enter lines to invoice first'),'error'); $InputError = true; } - if (abs($_POST['AmountPaid'] -($_SESSION['Items'.$identifier]->total+$TaxTotal))>=0.01) { + if (abs($_POST['AmountPaid'] -($_SESSION['Items'.$identifier]->total+$_POST['TaxTotal']))>=0.01) { prnMsg(_('The amount entered as payment does not equal the amount of the invoice. Please ensure the customer has paid the correct amount and re-enter'),'error'); $InputError = true; } @@ -963,7 +1005,7 @@ $ErrMsg = _('The order cannot be added because'); $InsertQryResult = DB_query($HeaderSQL,$db,$ErrMsg); - $StartOf_LineItemsSQL = 'INSERT INTO salesorderdetails (orderlineno, + $StartOf_LineItemsSQL = "INSERT INTO salesorderdetails (orderlineno, orderno, stkcode, unitprice, @@ -974,7 +1016,7 @@ actualdispatchdate, qtyinvoiced, completed) - VALUES ('; + VALUES ("; $DbgMsg = _('Trouble inserting a line of a sales order. The SQL that failed was'); foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { @@ -1103,7 +1145,7 @@ WoRealRequirements($db, $WONo, $_SESSION['DefaultFactoryLocation'], $StockItem->StockID); $FactoryManagerEmail = _('A new work order has been created for') . - ":\n" . $StockItem->StockID . ' - ' . $StockItem->Descr . ' x ' . $WOQuantity . ' ' . $StockItem->UOM . + ":\n" . $StockItem->StockID . ' - ' . $StockItem->ItemDescription . ' x ' . $WOQuantity . ' ' . $StockItem->Units . "\n" . _('These are for') . ' ' . $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('there order ref') . ': ' . $_SESSION['Items'.$identifier]->CustRef . ' ' ._('our order number') . ': ' . $OrderNo; if ($StockItem->Serialised AND $StockItem->NextSerialNo>0){ @@ -1199,11 +1241,11 @@ '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', '" . $OrderNo . "', '" . $_SESSION['Items'.$identifier]->total . "', - '" . $TaxTotal . "', + '" . $_POST['TaxTotal'] . "', '" . $ExRate . "', '" . $_SESSION['Items'.$identifier]->Comments . "', '" . $_SESSION['Items'.$identifier]->ShipVia . "', - '" . ($_SESSION['Items'.$identifier]->total + $TaxTotal) . "')"; + '" . ($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal']) . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -1212,7 +1254,7 @@ $DebtorTransID = DB_Last_Insert_ID($db,'debtortrans','id'); /* Insert the tax totals for each tax authority where tax was charged on the invoice */ - foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { + foreach ($_SESSION['Items'.$identifier]->TaxTotals AS $TaxAuthID => $TaxAmount) { $SQL = "INSERT INTO debtortranstaxes (debtortransid, taxauthid, @@ -1691,7 +1733,7 @@ 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 + $TaxTotal) !=0) { + if (($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal']) !=0) { $SQL = "INSERT INTO gltrans ( type, typeno, trandate, @@ -1705,7 +1747,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . (($_SESSION['Items'.$identifier]->total + $TaxTotal)/$ExRate) . "')"; + '" . (($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal'])/$ExRate) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the total debtors control GLTrans record was used'); @@ -1713,7 +1755,7 @@ } - foreach ( $TaxTotals as $TaxAuthID => $TaxAmount){ + foreach ( $_SESSION['Items'.$identifier]->TaxTotals as $TaxAuthID => $TaxAmount){ if ($TaxAmount !=0 ){ $SQL = "INSERT INTO gltrans ( type, typeno, @@ -1726,7 +1768,7 @@ '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', - '" . $TaxGLCodes[$TaxAuthID] . "', + '" . $_SESSION['Items'.$identifier]->TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . (-$TaxAmount/$ExRate) . "')"; @@ -1993,7 +2035,7 @@ AND purchorders.status<>'Cancelled' AND purchorders.status<>'Rejected' AND purchorderdetails.itemcode='" . $myrow['stockid'] . "'"; - + $ErrMsg = _('The order details for this product cannot be retrieved because'); $PurchResult = db_query($sql,$db,$ErrMsg); @@ -2140,7 +2182,7 @@ $QOHSql = "SELECT sum(quantity) AS QOH, stockmaster.decimalplaces FROM locstock INNER JOIN stockmaster - WHERE locstock.stockid='" .$myrow['stockid'] . "' + WHERE locstock.stockid='" .$myrow['stockid'] . "' AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; $QOHResult = DB_query($QOHSql,$db); $QOHRow = DB_fetch_array($QOHResult); @@ -2149,10 +2191,10 @@ // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails INNER JOIN salesorders - ON salesorders.orderno = salesorderdetails.orderno - WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . _('cannot be retrieved because'); @@ -2168,7 +2210,7 @@ // Find the quantity on purchase orders $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd) AS QOO FROM purchorderdetails INNER JOIN purchorders - WHERE purchorderdetails.completed=0 + WHERE purchorderdetails.completed=0 AND purchorders.status <>'Cancelled' AND purchorders.status <>'Rejected' AND purchorderdetails.itemcode='" . $myrow['stockid'] . "'"; @@ -2288,4 +2330,4 @@ } echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-08 09:41:58 UTC (rev 4487) +++ trunk/doc/Change.log.html 2011-02-08 15:48:02 UTC (rev 4488) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p <p></p> +<p>8/2/11: Tim Rework CounterSales.php so that it is now possible to sell items that have sales/purchasing tax</p> <p>8/2/11: Phil Fix InventoryPlanning and InventoryPlanningPrefSupplier to only show sales order demand - excluding quotations. Also fixed for conversionfactor as now all purchase order quantities are in our normal stock units</p> <p>8/2/11: Phil Fix incorrect layout of narrative on multiple lines of PDFQuotation.php as reported by Ricard Andreu</p> <p>8/2/11: Tim/Ricard StockLocTransfer.php can now transfer the same amount as on hand in the location - previously checked to see that the transfer was less than the quantity on hand (when checking for negative stock)</p> Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-02-08 09:41:58 UTC (rev 4487) +++ trunk/includes/DefineCartClass.php 2011-02-08 15:48:02 UTC (rev 4488) @@ -56,6 +56,8 @@ VAR $vtigerProductID; Var $DefaultPOLine; Var $DeliveryDays; + var $TaxTotals; + var $TaxGLCodes; function Cart(){ /*Constructor function initialises a new shopping cart */ @@ -338,7 +340,7 @@ $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($SQL,$db,$ErrMsg); - + unset($this->LineItems[$LineNumber]->Taxes); while ($myrow = DB_fetch_array($GetTaxRatesResult)){ $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-13 04:15:48
|
Revision: 4490 http://web-erp.svn.sourceforge.net/web-erp/?rev=4490&view=rev Author: daintree Date: 2011-02-13 04:15:38 +0000 (Sun, 13 Feb 2011) Log Message: ----------- pre 4.03RC1 Modified Paths: -------------- trunk/Contracts.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/PricesByCost.php trunk/SelectOrderItems.php trunk/StockSerialItems.php trunk/SuppInvGRNs.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/doc/INSTALL.txt trunk/includes/ConnectDB.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.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/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/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/Contracts.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -667,23 +667,37 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['SelectedCustomer'] = $myrow['debtorno'] . '-' . $myrow['branchcode']; + $SelectedCustomer = $myrow['debtorno'] . '-' . $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } } /*one of keywords or custcode was more than a zero length string */ } /*end of if search for customer codes/names */ +if (isset($_POST['JustSelectedACustomer'])){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + } +} -if (isset($_POST['SelectedCustomer'])) { +if (isset($SelectedCustomer)) { -/* will only be true if page called from customer selection form - * or set because only one customer record returned from a search - * so parse the $Select string into debtorno and branch code */ - $CustomerBranchArray = explode('-',$_POST['SelectedCustomer']); +/* will only be true if page called from customer selection + * or set because only one customer record returned from a search - isset($SelectedCustomer) + * so parse the returned SelectedCustomer string into debtorno and branch code */ + + $CustomerBranchArray = explode('-',$SelectedCustomer); $_SESSION['Contract'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); $_SESSION['Contract'.$identifier]->BranchCode = trim($CustomerBranchArray[1]); - + $sql = "SELECT debtorsmaster.name, custbranch.brname, debtorsmaster.currcode, @@ -699,8 +713,7 @@ WHERE debtorsmaster.debtorno='" . $_SESSION['Contract'.$identifier]->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['Contract'.$identifier]->BranchCode . "'" ; - $ErrMsg = _('The customer record selected') . ': ' . $_POST['SelectedCustomer'] . ' ' . - _('cannot be retrieved because'); + $ErrMsg = _('The customer record selected') . ': ' .$_SESSION['Contract'.$identifier]->DebtorNo. ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); @@ -783,8 +796,8 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit" value="'.htmlentities($myrow['brname']).'" /></td> - <input type="hidden" name="SelectedCustomer" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> + echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname']).'" /></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> <td>'.htmlentities($myrow['contactname']).'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> @@ -794,7 +807,8 @@ //end of page full new headings if } //end of while loop - + echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">'; + echo '</table></form>'; }//end if results to show Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/GoodsReceived.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -26,13 +26,13 @@ $title = _('Receive Purchase Orders'); include('includes/header.inc'); -echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Back to Purchase Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Back to Purchase Orders'). '</a><br />'; if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for invoicing*/ echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. _('Select a purchase order to receive').'</a></div>'; - echo '<br>'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); + echo '<br />'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); include ('includes/footer.inc'); exit; } elseif (isset($_GET['PONumber']) AND !isset($_POST['Update'])) { @@ -55,7 +55,7 @@ } if ($_SESSION['PO'.$identifier]->Status != 'Printed') { - prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br>'. + prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br />'. _('Order number') . ' ' . $_GET['PONumber'] . ' ' . _('has a status of') . ' ' . _($_SESSION['PO'.$identifier]->Status), 'warn'); include('includes/footer.inc'); exit; @@ -78,7 +78,7 @@ echo '<table class=selection><tr><td>'. _('Date Goods/Service Received'). ':</td><td><input type=text class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name=DefaultReceivedDate value="' . $_POST['DefaultReceivedDate'] . - '"></td></tr></table><br>'; + '"></td></tr></table><br />'; echo '<table cellpadding=2 class=selection> <tr><th colspan="2"></th> @@ -88,17 +88,17 @@ </tr> <tr><th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '<br>' . _('Ordered') . '</th> + <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> <th>' . _('Conversion') . '<br />' . _('Factor') . '</th> - <th>' . _('Quantity') . '<br>' . _('Ordered') . '</th> + <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th>'; if ($_SESSION['ShowValueOnGRN']==1) { - echo '<th>' . _('Price') . '</th><th>' . _('Total Value') . '<br>' . _('Received') . '</th>'; + echo '<th>' . _('Price') . '</th><th>' . _('Total Value') . '<br />' . _('Received') . '</th>'; } echo '<td> </td> @@ -156,7 +156,7 @@ if ($LnItm->Controlled == 1) { - echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; + echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { echo '<input type=text class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; @@ -170,10 +170,10 @@ if ($LnItm->Controlled == 1) { if ($LnItm->Serialised==1){ - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">'. _('Enter Serial Nos'). '</a></td>'; } else { - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">'. _('Enter Batches'). '</a></td>'; } } @@ -237,7 +237,7 @@ }elseif ($DeliveryQuantityTooLarge==1 AND isset($_POST['ProcessGoodsReceived'])){ prnMsg(_('Entered quantities cannot be greater than the quantity entered on the purchase invoice including the allowed over-receive percentage'). ' ' . '(' . $_SESSION['OverReceiveProportion'] .'%)','error'); - echo '<br>'; + echo '<br />'; prnMsg(_('Modify the ordered items on the purchase invoice if you wish to increase the quantities'),'info'); echo '<div class="centre"><input type=submit name=Update Value=' . _('Update') . '>'; @@ -314,9 +314,9 @@ <td>' . $myrow['quantityrecd'] . '</td></tr>'; echo '</table>'; } - echo "<div class='centre'><a href='$rootpath/PO_SelectOSPurchOrder.php?" . SID . "'>". + echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a different purchase order for receiving goods against').'</a></div>'; - echo "<div class='centre'><a href='$rootpath/GoodsReceived.php?" . SID . '&PONumber=' . + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; unset($_SESSION['PO'.$identifier]->LineItems); unset($_SESSION['PO'.$identifier]); @@ -681,8 +681,8 @@ unset($_SESSION['PO'.$identifier]); unset($_POST['ProcessGoodsReceived']); - echo '<br><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br>'; - echo '<br><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br><br>'; + echo '<br /><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br />'; + echo '<br /><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br /><br />'; echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Select a different purchase order for receiving goods against'). '</a></div>'; /*end of process goods received entry */ @@ -691,9 +691,9 @@ } else { /*Process Goods received not set so show a link to allow mod of line items on order and allow input of date goods received*/ - echo '<br><div class="centre"><a href="' . $rootpath . '/PO_Items.php?=' . SID . '">' . _('Modify Order Items'). '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php">' . _('Modify Order Items'). '</a></div>'; - echo '<br><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; + echo '<br /><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; echo '<input type=submit name="ProcessGoodsReceived" Value="' . _('Process Goods Received') . '"></div>'; } Modified: trunk/GoodsReceivedControlled.php =================================================================== --- trunk/GoodsReceivedControlled.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/GoodsReceivedControlled.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -12,21 +12,32 @@ /* Session started in header.inc for password checking and authorisation level check */ include('includes/header.inc'); -if (!isset($_SESSION['PO'])) { +if (empty($_GET['identifier'])) { + if (empty($_POST['identifier'])){ + $identifier=date('U'); + } else { + $identifier=$_POST['identifier']; + } +} else { + $identifier=$_GET['identifier']; +} + + +if (!isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for receiving*/ - echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a purchase order to receive'). '</a></div><br>'; prnMsg( _('This page can only be opened if a purchase order and line item has been selected') . '. ' . _('Please do that first'),'error'); include('includes/footer.inc'); exit; } -if ($_GET['LineNo']>0){ +if (isset($_GET['LineNo'])){ $LineNo = $_GET['LineNo']; -} else if ($_POST['LineNo']>0){ +} elseif (isset($_POST['LineNo'])){ $LineNo = $_POST['LineNo']; } else { - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php">'. _('Select a line Item to Receive').'</a></div>'; prnMsg( _('This page can only be opened if a Line Item on a PO has been selected') . '. ' . _('Please do that first'), 'error'); include( 'includes/footer.inc'); @@ -34,11 +45,11 @@ } global $LineItem; -$LineItem = &$_SESSION['PO']->LineItems[$LineNo]; +$LineItem = &$_SESSION['PO'.$identifier]->LineItems[$LineNo]; if ($LineItem->Controlled !=1 ){ /*This page only relavent for controlled items */ - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php">'. _('Back to the Purchase Order'). '</a></div>'; prnMsg( _('The line being received must be controlled as defined in the item definition'), 'error'); include('includes/footer.inc'); @@ -50,13 +61,13 @@ ********************************************/ echo '<div class="centre">'; -echo '<br><a href="'.$rootpath.'/GoodsReceived.php?' . SID . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO']->OrderNo . '</a>'; +echo '<br><a href="'.$rootpath.'/GoodsReceived.php?identifier=' .$identifier . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO'.$identifier]->OrderNo . '</a>'; echo '<br><font size=2><b>'. _('Receive controlled item'). ' '. $LineItem->StockID . ' - ' . $LineItem->ItemDescription . - ' ' . _('on order') . ' ' . $_SESSION['PO']->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO']->SupplierName . '</b></font></div>'; + ' ' . _('on order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ -$LocationOut = $_SESSION['PO']->Location; +$LocationOut = $_SESSION['PO'.$identifier]->Location; $ItemMustExist = false; $StockID = $LineItem->StockID; $InOutModifier=1; @@ -67,7 +78,7 @@ /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ -$_SESSION['PO']->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity; +$_SESSION['PO'.$identifier]->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity; include( 'includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/PricesByCost.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -95,7 +95,7 @@ $SalesTypeRow = DB_fetch_array($ResultType); if (isset($CategoryRow['categorgdescription'])) { - $CategoryText = _('the') . ' ' . $CategoryRow['categorgdescription'] . ' ' . _('category'); + $CategoryText = $CategoryRow['categorgdescription'] . ' ' . _('category'); } else { $CategoryText = _('all Categories'); } /*end of else Category */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/SelectOrderItems.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -238,7 +238,6 @@ $myrow['narrative'], 'No', /* Update DB */ $myrow['orderlineno'], - // ConvertSQLDate($myrow['itemdue']), 0, '', ConvertSQLDate($myrow['itemdue']), @@ -288,8 +287,7 @@ } } -$msg=''; - +//Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { @@ -371,22 +369,34 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['Select'] = $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer= $myrow['debtorno'] . ' - ' . $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } } /*one of keywords or custcode was more than a zero length string */ } /*end of if search for customer codes/names */ +if (isset($_POST['JustSelectedACustomer'])){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + } +} +/* will only be true if page called from customer selection form or set because only one customer + record returned from a search so parse the $SelectCustomer string into customer code and branch code */ +if (isset($SelectedCustomer)) { + + $CustomerBranchArray = explode('-',$SelectedCustomer); + $_SESSION['Items'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); + $_SESSION['Items'.$identifier]->Branch = trim($CustomerBranchArray[1]); -// will only be true if page called from customer selection form or set because only one customer -// record returned from a search so parse the $Select string into customer code and branch code */ -if (isset($_POST['Select']) AND $_POST['Select']!='') { - - $_SESSION['Items'.$identifier]->Branch = substr($_POST['Select'],strpos($_POST['Select'],' - ')+3); - - $_POST['Select'] = substr($_POST['Select'],0,strpos($_POST['Select'],' - ')); - // Now check to ensure this account is not on hold */ $sql = "SELECT debtorsmaster.name, holdreasons.dissallowinvoices, @@ -402,30 +412,29 @@ WHERE debtorsmaster.salestype=salestypes.typeabbrev AND debtorsmaster.holdreason=holdreasons.reasoncode AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_POST['Select'] . "'"; + AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo. "'"; - $ErrMsg = _('The details of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); if ($myrow[1] != 1){ if ($myrow[1]==2){ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); } - $_SESSION['Items'.$identifier]->DebtorNo=$_POST['Select']; $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow[0]; + $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; # the sales type determines the price list to be used by default the customer of the user is # defaulted from the entry of the userid and password. - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow[2]; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow[3]; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow[4]; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow[5]; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow[6]; + $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; + $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; + $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; + $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; + $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; # the branch was also selected from the customer selection so default the delivery details from the customer branches table CustBranch. The order process will ask for branch details later anyway @@ -449,24 +458,24 @@ INNER JOIN locations ON custbranch.defaultlocation=locations.loccode WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_POST['Select'] . "'"; + AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)==0){ - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); + prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + prnMsg( _('The SQL that failed to get the branch details was') . ':<br />' . $sql . 'warning'); } include('includes/footer.inc'); exit; } // add echo - echo '<br>'; + echo '<br />'; $myrow = DB_fetch_row($result); if ($_SESSION['SalesmanLogin']!='' AND $_SESSION['SalesmanLogin']!=$myrow[15]){ prnMsg(_('Your login is only set up for a particular salesperson. This customer has a different salesperson.'),'error'); @@ -494,7 +503,7 @@ prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ - $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_POST['Select'],$db); + $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently at or over their credit limit'),'warn'); @@ -524,12 +533,8 @@ WHERE debtorsmaster.holdreason=holdreasons.reasoncode AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - if (isset($_POST['Select'])) { - $ErrMsg = _('The details for the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - } else { - $ErrMsg = ''; - } - $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br>' . $sql; + $ErrMsg = _('The details for the customer selected') . ': ' .$_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); + $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br />' . $sql; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); @@ -568,11 +573,7 @@ WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - if (isset($_POST['Select'])) { - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - } else { - $ErrMsg = ''; - } + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was'); $result =DB_query($sql,$db,$ErrMsg, $DbgMsg); @@ -610,7 +611,6 @@ <?php echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; ?> - <b><?php echo '<p>' . $msg; ?></p> <table cellpadding=3 colspan=4 class=selection> <tr> <td><h5><?php echo _('Part of the Customer Branch Name'); ?>:</h5></td> @@ -623,7 +623,7 @@ <td><input tabindex=3 type="Text" name="CustPhone" size=15 maxlength=18></td> </tr> </table> - <br><div class="centre"><input tabindex=4 type=submit name="SearchCust" value="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input tabindex=4 type=submit name="SearchCust" value="<?php echo _('Search Now'); ?>"> <input tabindex=5 type=submit action=reset value="<?php echo _('Reset'); ?>"></div> <?php @@ -631,7 +631,7 @@ echo '<table cellpadding=2 colspan=7>'; - $TableHeader = '<br><tr> + $TableHeader = '<br /><tr> <th>' . _('Customer') . '</th> <th>' . _('Branch') . '</th> <th>' . _('Contact') . '</th> @@ -659,20 +659,20 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex='.number_format($j+5).' type=submit name="Submit" value="'.$myrow['brname'].'"</td> - <input type=hidden name="Select" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'"> + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname']) . '"></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> - </tr></form>'; + </tr>'; $LastCustomer=$myrow['name']; $j++; //end of page full new headings if } //end of while loop + echo '<input type="hidden" name="JustSel... [truncated message content] |
From: <dai...@us...> - 2011-02-13 04:15:48
|
Revision: 4490 http://web-erp.svn.sourceforge.net/web-erp/?rev=4490&view=rev Author: daintree Date: 2011-02-13 04:15:38 +0000 (Sun, 13 Feb 2011) Log Message: ----------- pre 4.03RC1 Modified Paths: -------------- trunk/Contracts.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/PricesByCost.php trunk/SelectOrderItems.php trunk/StockSerialItems.php trunk/SuppInvGRNs.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/doc/INSTALL.txt trunk/includes/ConnectDB.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.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/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/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/Contracts.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -667,23 +667,37 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['SelectedCustomer'] = $myrow['debtorno'] . '-' . $myrow['branchcode']; + $SelectedCustomer = $myrow['debtorno'] . '-' . $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } } /*one of keywords or custcode was more than a zero length string */ } /*end of if search for customer codes/names */ +if (isset($_POST['JustSelectedACustomer'])){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + } +} -if (isset($_POST['SelectedCustomer'])) { +if (isset($SelectedCustomer)) { -/* will only be true if page called from customer selection form - * or set because only one customer record returned from a search - * so parse the $Select string into debtorno and branch code */ - $CustomerBranchArray = explode('-',$_POST['SelectedCustomer']); +/* will only be true if page called from customer selection + * or set because only one customer record returned from a search - isset($SelectedCustomer) + * so parse the returned SelectedCustomer string into debtorno and branch code */ + + $CustomerBranchArray = explode('-',$SelectedCustomer); $_SESSION['Contract'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); $_SESSION['Contract'.$identifier]->BranchCode = trim($CustomerBranchArray[1]); - + $sql = "SELECT debtorsmaster.name, custbranch.brname, debtorsmaster.currcode, @@ -699,8 +713,7 @@ WHERE debtorsmaster.debtorno='" . $_SESSION['Contract'.$identifier]->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['Contract'.$identifier]->BranchCode . "'" ; - $ErrMsg = _('The customer record selected') . ': ' . $_POST['SelectedCustomer'] . ' ' . - _('cannot be retrieved because'); + $ErrMsg = _('The customer record selected') . ': ' .$_SESSION['Contract'.$identifier]->DebtorNo. ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); @@ -783,8 +796,8 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit" value="'.htmlentities($myrow['brname']).'" /></td> - <input type="hidden" name="SelectedCustomer" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> + echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname']).'" /></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> <td>'.htmlentities($myrow['contactname']).'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> @@ -794,7 +807,8 @@ //end of page full new headings if } //end of while loop - + echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">'; + echo '</table></form>'; }//end if results to show Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/GoodsReceived.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -26,13 +26,13 @@ $title = _('Receive Purchase Orders'); include('includes/header.inc'); -echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Back to Purchase Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Back to Purchase Orders'). '</a><br />'; if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for invoicing*/ echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. _('Select a purchase order to receive').'</a></div>'; - echo '<br>'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); + echo '<br />'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); include ('includes/footer.inc'); exit; } elseif (isset($_GET['PONumber']) AND !isset($_POST['Update'])) { @@ -55,7 +55,7 @@ } if ($_SESSION['PO'.$identifier]->Status != 'Printed') { - prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br>'. + prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br />'. _('Order number') . ' ' . $_GET['PONumber'] . ' ' . _('has a status of') . ' ' . _($_SESSION['PO'.$identifier]->Status), 'warn'); include('includes/footer.inc'); exit; @@ -78,7 +78,7 @@ echo '<table class=selection><tr><td>'. _('Date Goods/Service Received'). ':</td><td><input type=text class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name=DefaultReceivedDate value="' . $_POST['DefaultReceivedDate'] . - '"></td></tr></table><br>'; + '"></td></tr></table><br />'; echo '<table cellpadding=2 class=selection> <tr><th colspan="2"></th> @@ -88,17 +88,17 @@ </tr> <tr><th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '<br>' . _('Ordered') . '</th> + <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> <th>' . _('Conversion') . '<br />' . _('Factor') . '</th> - <th>' . _('Quantity') . '<br>' . _('Ordered') . '</th> + <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th>'; if ($_SESSION['ShowValueOnGRN']==1) { - echo '<th>' . _('Price') . '</th><th>' . _('Total Value') . '<br>' . _('Received') . '</th>'; + echo '<th>' . _('Price') . '</th><th>' . _('Total Value') . '<br />' . _('Received') . '</th>'; } echo '<td> </td> @@ -156,7 +156,7 @@ if ($LnItm->Controlled == 1) { - echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; + echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { echo '<input type=text class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; @@ -170,10 +170,10 @@ if ($LnItm->Controlled == 1) { if ($LnItm->Serialised==1){ - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">'. _('Enter Serial Nos'). '</a></td>'; } else { - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">'. _('Enter Batches'). '</a></td>'; } } @@ -237,7 +237,7 @@ }elseif ($DeliveryQuantityTooLarge==1 AND isset($_POST['ProcessGoodsReceived'])){ prnMsg(_('Entered quantities cannot be greater than the quantity entered on the purchase invoice including the allowed over-receive percentage'). ' ' . '(' . $_SESSION['OverReceiveProportion'] .'%)','error'); - echo '<br>'; + echo '<br />'; prnMsg(_('Modify the ordered items on the purchase invoice if you wish to increase the quantities'),'info'); echo '<div class="centre"><input type=submit name=Update Value=' . _('Update') . '>'; @@ -314,9 +314,9 @@ <td>' . $myrow['quantityrecd'] . '</td></tr>'; echo '</table>'; } - echo "<div class='centre'><a href='$rootpath/PO_SelectOSPurchOrder.php?" . SID . "'>". + echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a different purchase order for receiving goods against').'</a></div>'; - echo "<div class='centre'><a href='$rootpath/GoodsReceived.php?" . SID . '&PONumber=' . + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; unset($_SESSION['PO'.$identifier]->LineItems); unset($_SESSION['PO'.$identifier]); @@ -681,8 +681,8 @@ unset($_SESSION['PO'.$identifier]); unset($_POST['ProcessGoodsReceived']); - echo '<br><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br>'; - echo '<br><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br><br>'; + echo '<br /><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br />'; + echo '<br /><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br /><br />'; echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Select a different purchase order for receiving goods against'). '</a></div>'; /*end of process goods received entry */ @@ -691,9 +691,9 @@ } else { /*Process Goods received not set so show a link to allow mod of line items on order and allow input of date goods received*/ - echo '<br><div class="centre"><a href="' . $rootpath . '/PO_Items.php?=' . SID . '">' . _('Modify Order Items'). '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php">' . _('Modify Order Items'). '</a></div>'; - echo '<br><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; + echo '<br /><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; echo '<input type=submit name="ProcessGoodsReceived" Value="' . _('Process Goods Received') . '"></div>'; } Modified: trunk/GoodsReceivedControlled.php =================================================================== --- trunk/GoodsReceivedControlled.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/GoodsReceivedControlled.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -12,21 +12,32 @@ /* Session started in header.inc for password checking and authorisation level check */ include('includes/header.inc'); -if (!isset($_SESSION['PO'])) { +if (empty($_GET['identifier'])) { + if (empty($_POST['identifier'])){ + $identifier=date('U'); + } else { + $identifier=$_POST['identifier']; + } +} else { + $identifier=$_GET['identifier']; +} + + +if (!isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for receiving*/ - echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a purchase order to receive'). '</a></div><br>'; prnMsg( _('This page can only be opened if a purchase order and line item has been selected') . '. ' . _('Please do that first'),'error'); include('includes/footer.inc'); exit; } -if ($_GET['LineNo']>0){ +if (isset($_GET['LineNo'])){ $LineNo = $_GET['LineNo']; -} else if ($_POST['LineNo']>0){ +} elseif (isset($_POST['LineNo'])){ $LineNo = $_POST['LineNo']; } else { - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php">'. _('Select a line Item to Receive').'</a></div>'; prnMsg( _('This page can only be opened if a Line Item on a PO has been selected') . '. ' . _('Please do that first'), 'error'); include( 'includes/footer.inc'); @@ -34,11 +45,11 @@ } global $LineItem; -$LineItem = &$_SESSION['PO']->LineItems[$LineNo]; +$LineItem = &$_SESSION['PO'.$identifier]->LineItems[$LineNo]; if ($LineItem->Controlled !=1 ){ /*This page only relavent for controlled items */ - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php">'. _('Back to the Purchase Order'). '</a></div>'; prnMsg( _('The line being received must be controlled as defined in the item definition'), 'error'); include('includes/footer.inc'); @@ -50,13 +61,13 @@ ********************************************/ echo '<div class="centre">'; -echo '<br><a href="'.$rootpath.'/GoodsReceived.php?' . SID . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO']->OrderNo . '</a>'; +echo '<br><a href="'.$rootpath.'/GoodsReceived.php?identifier=' .$identifier . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO'.$identifier]->OrderNo . '</a>'; echo '<br><font size=2><b>'. _('Receive controlled item'). ' '. $LineItem->StockID . ' - ' . $LineItem->ItemDescription . - ' ' . _('on order') . ' ' . $_SESSION['PO']->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO']->SupplierName . '</b></font></div>'; + ' ' . _('on order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ -$LocationOut = $_SESSION['PO']->Location; +$LocationOut = $_SESSION['PO'.$identifier]->Location; $ItemMustExist = false; $StockID = $LineItem->StockID; $InOutModifier=1; @@ -67,7 +78,7 @@ /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ -$_SESSION['PO']->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity; +$_SESSION['PO'.$identifier]->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity; include( 'includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/PricesByCost.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -95,7 +95,7 @@ $SalesTypeRow = DB_fetch_array($ResultType); if (isset($CategoryRow['categorgdescription'])) { - $CategoryText = _('the') . ' ' . $CategoryRow['categorgdescription'] . ' ' . _('category'); + $CategoryText = $CategoryRow['categorgdescription'] . ' ' . _('category'); } else { $CategoryText = _('all Categories'); } /*end of else Category */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/SelectOrderItems.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -238,7 +238,6 @@ $myrow['narrative'], 'No', /* Update DB */ $myrow['orderlineno'], - // ConvertSQLDate($myrow['itemdue']), 0, '', ConvertSQLDate($myrow['itemdue']), @@ -288,8 +287,7 @@ } } -$msg=''; - +//Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { @@ -371,22 +369,34 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['Select'] = $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer= $myrow['debtorno'] . ' - ' . $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } } /*one of keywords or custcode was more than a zero length string */ } /*end of if search for customer codes/names */ +if (isset($_POST['JustSelectedACustomer'])){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + } +} +/* will only be true if page called from customer selection form or set because only one customer + record returned from a search so parse the $SelectCustomer string into customer code and branch code */ +if (isset($SelectedCustomer)) { + + $CustomerBranchArray = explode('-',$SelectedCustomer); + $_SESSION['Items'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); + $_SESSION['Items'.$identifier]->Branch = trim($CustomerBranchArray[1]); -// will only be true if page called from customer selection form or set because only one customer -// record returned from a search so parse the $Select string into customer code and branch code */ -if (isset($_POST['Select']) AND $_POST['Select']!='') { - - $_SESSION['Items'.$identifier]->Branch = substr($_POST['Select'],strpos($_POST['Select'],' - ')+3); - - $_POST['Select'] = substr($_POST['Select'],0,strpos($_POST['Select'],' - ')); - // Now check to ensure this account is not on hold */ $sql = "SELECT debtorsmaster.name, holdreasons.dissallowinvoices, @@ -402,30 +412,29 @@ WHERE debtorsmaster.salestype=salestypes.typeabbrev AND debtorsmaster.holdreason=holdreasons.reasoncode AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_POST['Select'] . "'"; + AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo. "'"; - $ErrMsg = _('The details of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); if ($myrow[1] != 1){ if ($myrow[1]==2){ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); } - $_SESSION['Items'.$identifier]->DebtorNo=$_POST['Select']; $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow[0]; + $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; # the sales type determines the price list to be used by default the customer of the user is # defaulted from the entry of the userid and password. - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow[2]; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow[3]; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow[4]; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow[5]; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow[6]; + $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; + $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; + $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; + $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; + $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; # the branch was also selected from the customer selection so default the delivery details from the customer branches table CustBranch. The order process will ask for branch details later anyway @@ -449,24 +458,24 @@ INNER JOIN locations ON custbranch.defaultlocation=locations.loccode WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_POST['Select'] . "'"; + AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)==0){ - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); + prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + prnMsg( _('The SQL that failed to get the branch details was') . ':<br />' . $sql . 'warning'); } include('includes/footer.inc'); exit; } // add echo - echo '<br>'; + echo '<br />'; $myrow = DB_fetch_row($result); if ($_SESSION['SalesmanLogin']!='' AND $_SESSION['SalesmanLogin']!=$myrow[15]){ prnMsg(_('Your login is only set up for a particular salesperson. This customer has a different salesperson.'),'error'); @@ -494,7 +503,7 @@ prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ - $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_POST['Select'],$db); + $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently at or over their credit limit'),'warn'); @@ -524,12 +533,8 @@ WHERE debtorsmaster.holdreason=holdreasons.reasoncode AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - if (isset($_POST['Select'])) { - $ErrMsg = _('The details for the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - } else { - $ErrMsg = ''; - } - $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br>' . $sql; + $ErrMsg = _('The details for the customer selected') . ': ' .$_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); + $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br />' . $sql; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); @@ -568,11 +573,7 @@ WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - if (isset($_POST['Select'])) { - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - } else { - $ErrMsg = ''; - } + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was'); $result =DB_query($sql,$db,$ErrMsg, $DbgMsg); @@ -610,7 +611,6 @@ <?php echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; ?> - <b><?php echo '<p>' . $msg; ?></p> <table cellpadding=3 colspan=4 class=selection> <tr> <td><h5><?php echo _('Part of the Customer Branch Name'); ?>:</h5></td> @@ -623,7 +623,7 @@ <td><input tabindex=3 type="Text" name="CustPhone" size=15 maxlength=18></td> </tr> </table> - <br><div class="centre"><input tabindex=4 type=submit name="SearchCust" value="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input tabindex=4 type=submit name="SearchCust" value="<?php echo _('Search Now'); ?>"> <input tabindex=5 type=submit action=reset value="<?php echo _('Reset'); ?>"></div> <?php @@ -631,7 +631,7 @@ echo '<table cellpadding=2 colspan=7>'; - $TableHeader = '<br><tr> + $TableHeader = '<br /><tr> <th>' . _('Customer') . '</th> <th>' . _('Branch') . '</th> <th>' . _('Contact') . '</th> @@ -659,20 +659,20 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex='.number_format($j+5).' type=submit name="Submit" value="'.$myrow['brname'].'"</td> - <input type=hidden name="Select" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'"> + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname']) . '"></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> - </tr></form>'; + </tr>'; $LastCustomer=$myrow['name']; $j++; //end of page full new headings if } //end of while loop + echo '<input type="hidden" name="JustSel... [truncated message content] |
From: <dai...@us...> - 2011-02-15 06:31:18
|
Revision: 4491 http://web-erp.svn.sourceforge.net/web-erp/?rev=4491&view=rev Author: daintree Date: 2011-02-15 06:31:08 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Pre 4.03RC2 Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/DeliveryDetails.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html 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/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/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/ConfirmDispatch_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -172,7 +172,7 @@ $myrow['controlled'], $myrow['serialised'], $myrow['decimalplaces'], - $myrow['narrative'], + htmlspecialchars_decode($myrow['narrative']), 'No', $myrow['orderlineno'], $myrow['taxcatid'], Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/DeliveryDetails.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -257,8 +257,8 @@ if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/RecurringSalesOrders.php?' . SID.'identifier='.$identifier . '&NewRecurringOrder=Yes">'; - prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/RecurringOrders.php?' . SID.'identifier='.$identifier . "&NewRecurringOrder=Yes'>". _('click here') .'</a> '. _('to continue'),'info'); + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; + prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/RecurringOrders.php?identifier='.$identifier . "&NewRecurringOrder=Yes'>". _('click here') .'</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; } @@ -266,8 +266,8 @@ if (isset($_POST['BackToLineDetails']) and $_POST['BackToLineDetails']==_('Modify Order Lines')){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SelectOrderItems.php?' . SID.'identifier='.$identifier . '">'; - prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/SelectOrderItems.php?' . SID.'identifier='.$identifier . "'>". _('click here') .'</a> '. _('to continue'),'info'); + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SelectOrderItems.php?identifier='.$identifier . '">'; + prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' .'<a href="' . $rootpath . '/SelectOrderItems.php?identifier='.$identifier . '">'. _('click here') .'</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; @@ -571,19 +571,19 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?' . SID .'identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?' . SID .'identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?' . SID .'identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; //Add option to Print Sales Orders or Proforma invoice - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?' . SID .'identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation') .'</a></td></tr></table>'; } - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?' . SID .'identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; } else { /*its a customer logon so thank them */ prnMsg(_('Thank you for your business'),'success'); @@ -747,10 +747,10 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?' . SID.'identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?' . SID.'identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?' . SID.'identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?' . SID.'identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; include('includes/footer.inc'); exit; } @@ -763,7 +763,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; echo '</b> ' . _('Customer Name') . ' :<b> ' . $_SESSION['Items'.$identifier]->CustomerName . '</p>'; //echo '<font size=4><b>'. _('Customer') .' : ' . $_SESSION['Items'.$identifier]->CustomerName . '</b></font>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID.'identifier='.$identifier . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/PrintCustTrans.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -261,7 +261,7 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x, $YPos,$FormDesign->Data->Column6->Length, $FormDesign->Data->Column6->FontSize, $DisplayDiscount, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x, $YPos,$FormDesign->Data->Column7->Length, $FormDesign->Data->Column7->FontSize, $DisplayNet, 'right'); $YPos-= ($line_height); - $lines = explode('\r\n', $myrow2['narrative']); + $lines = explode('\r\n', htmlspecialchars_decode($myrow2['narrative'])); for ($i = 0;$i < sizeOf($lines);$i++) { while (strlen($lines[$i]) > 1) { if ($YPos - $line_height <= $Bottom_Margin) { Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/PrintCustTransPortrait.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -360,7 +360,7 @@ } $YPos -= ($FontSize*$lines); - $lines=explode('\r\n',$myrow2['narrative']); + $lines=explode('\r\n',htmlspecialchars_decode($myrow2['narrative'])); for ($i=0;$i<sizeOf($lines);$i++) { while (strlen($lines[$i])>1){ if ($YPos-$line_height <= $Bottom_Margin){ @@ -391,10 +391,8 @@ /* check to see enough space left to print the 4 lines for the totals/footer */ if (($YPos-$Bottom_Margin)<(2*$line_height)){ - PrintLinesToBottom (); include ('includes/PDFTransPageHeaderPortrait.inc'); - } /*Print a column vertical line with enough space for the footer*/ /*draw the vertical column lines to 4 lines shy of the bottom @@ -426,9 +424,7 @@ $DisplayFreight = number_format($myrow['ovfreight'],2); $DisplayTax = number_format($myrow['ovgst'],2); $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); - } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); $DisplayFreight = number_format(-$myrow['ovfreight'],2); $DisplayTax = number_format(-$myrow['ovgst'],2); Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/SelectCustomer.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -316,7 +316,9 @@ } echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -prnMsg($msg,'info'); +if (strlen($msg)>1){ + prnMsg($msg,'info'); +} echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers').'</p>'; echo "<table cellpadding=3 colspan=4 class=selection>"; echo "<tr><td colspan=2>" . _('Enter a partial Name') . ":</td><td>"; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/SelectOrderItems.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -35,7 +35,8 @@ } -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']; @@ -1365,7 +1366,7 @@ echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/UpgradeDatabase.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -32,7 +32,7 @@ echo '<option value="3.11">' . _('Version 3.11 or 4.01 - 4.02') . '</option>'; echo '</select></td></tr></table>'; } else { - if ($_SESSION['VersionNumber']=='4.00-RC1'){ + if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; } prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'],'info'); @@ -97,7 +97,7 @@ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; break; } //end switch - if(isset($_SESSION['VersionNumber']) AND $_SESSION['VersionNumber']< '4.00') { /* VersionNumber is set to '4.00' when upgrade3.11.1-4.00.sql is run */ + if(isset($_SESSION['VersionNumber']) AND $_SESSION['VersionNumber']< '4.03') { /* VersionNumber is set to '4.03' when upgrade3.11.1-4.00.sql is run */ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; } } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/doc/Change.log.html 2011-02-15 06:31:08 UTC (rev 4491) @@ -1,5 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p <p /> +<p>15/2/11 Release 4.03RC2</p> +<p /> +<p>15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !!</p> +<p>15/2/11: Phil PrintCustTrans.php and PrintCustTransPortrait.php htmlspecialchars_decode($narrative) - conversion at the time of committing to DB needs to be unconverted. Also in ConfirmDispatch_Invoice.php</p> +<p>15/2/11: Phil SelectCustomer.php removed showing blank message when $msg was empty </p> +<p /> <p>13/2/11 Release 4.03RC1</p> <p /> <p>13/2/11:Phil GoodsReceivedControlled InputSerialItems and friends - now uses session identifier to ensure uniqueness is several people entering stock receipts</p> Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-02-15 06:31:08 UTC (rev 4491) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-13 17:03+1300\n" +"POT-Creation-Date: 2011-02-15 18:44+1200\n" "PO-Revision-Date: 2010-07-25 17:04+0000\n" "Last-Translator: Tim Schofield <ti...@we...>\n" "Language-Team: Czech <cs...@li...>\n" @@ -219,9 +219,9 @@ #: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 #: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 #: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 -#: SelectCreditItems.php:272 SelectCustomer.php:320 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:606 SelectOrderItems.php:1430 -#: SelectOrderItems.php:1554 SelectProduct.php:456 SelectSalesOrder.php:155 +#: SelectCreditItems.php:272 SelectCustomer.php:322 SelectGLAccount.php:19 +#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 +#: SelectOrderItems.php:1555 SelectProduct.php:456 SelectSalesOrder.php:155 #: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 #: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 @@ -342,9 +342,9 @@ #: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 #: Prices.php:227 PurchData.php:207 SalesCategories.php:263 #: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 -#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 -#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 +#: SalesTypes.php:206 SelectCustomer.php:609 SelectCustomer.php:625 +#: SelectCustomer.php:647 SelectCustomer.php:663 SelectCustomer.php:685 +#: SelectCustomer.php:701 Shippers.php:144 StockCategories.php:244 #: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 #: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 @@ -370,9 +370,9 @@ #: PO_Items.php:758 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 -#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 -#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1357 +#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:610 +#: SelectCustomer.php:626 SelectCustomer.php:648 SelectCustomer.php:664 +#: SelectCustomer.php:686 SelectCustomer.php:702 SelectOrderItems.php:1358 #: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 #: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 #: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:81 SuppInvGRNs.php:135 @@ -500,8 +500,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "Nepodařilo se získat požadovanou sekci prosím zkuste to znovu." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 -#: SelectCustomer.php:630 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:603 +#: SelectCustomer.php:632 msgid "Customer Contacts" msgstr "Zákazník Kontakty" @@ -550,7 +550,7 @@ #: AddCustomerContacts.php:112 CompanyPreferences.php:229 #: CustomerBranches.php:377 Customers.php:899 Customers.php:905 -#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 +#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:605 #: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 #: SupplierCredit.php:433 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 @@ -559,7 +559,7 @@ msgstr "Název" #: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 -#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 +#: Customers.php:906 Customers.php:972 SelectCustomer.php:606 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "Roli" @@ -572,7 +572,7 @@ #: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:316 +#: PcReportTab.php:348 SelectCustomer.php:608 SystemParameters.php:316 #: WOSerialNos.php:277 WOSerialNos.php:279 msgid "Notes" msgstr "Bere na vědomí" @@ -591,14 +591,14 @@ #: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 #: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 -#: SelectCustomer.php:461 SelectOrderItems.php:638 +#: SelectCustomer.php:463 SelectOrderItems.php:639 #: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "Telefon" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 -#: SelectCustomer.php:668 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:640 +#: SelectCustomer.php:670 msgid "Customer Notes" msgstr "Zákazník bere na vědomí" @@ -639,7 +639,7 @@ #: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 #: PaymentAllocations.php:77 PcAssignCashToTab.php:212 #: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:616 PrintCustTransPortrait.php:794 ReverseGRN.php:378 +#: PrintCustTrans.php:616 PrintCustTransPortrait.php:790 ReverseGRN.php:378 #: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 #: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 #: StockMovements.php:98 StockSerialItemResearch.php:79 @@ -685,7 +685,7 @@ msgid "Contact Note" msgstr "Kontakt Poznámka:" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:678 msgid "Customer Type (Group) Notes" msgstr "Typ zákazníka (Group) Poznámky" @@ -693,7 +693,7 @@ msgid "The Contact priority must be an integer." msgstr "Prioritou Kontakt musí být celé číslo." -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:708 msgid "Customer Group Notes" msgstr "Zákaznická skupina bere na vědomí" @@ -917,7 +917,7 @@ #: OutstandingGRNs.php:185 PDFCustomerList.php:412 PDFLowGP.php:168 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 #: PDFStockCheckComparison.php:379 PrintCustTrans.php:416 -#: PrintCustTransPortrait.php:564 ReorderLevel.php:229 StockDispatch.php:309 +#: PrintCustTransPortrait.php:560 ReorderLevel.php:229 StockDispatch.php:309 #: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:237 Tax.php:352 msgid "Print PDF" msgstr "Tisknout PDF" @@ -1108,7 +1108,7 @@ #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 #: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:98 #: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 -#: MRPReschedules.php:204 SelectCustomer.php:460 ShipmentCosting.php:501 +#: MRPReschedules.php:204 SelectCustomer.php:462 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1599,8 +1599,8 @@ #: CustomerInquiry.php:190 CustomerTransInquiry.php:86 CustWhereAlloc.php:88 #: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:378 #: PrintCustTrans.php:542 PrintCustTrans.php:696 PrintCustTrans.php:735 -#: PrintCustTransPortrait.php:508 PrintCustTransPortrait.php:708 -#: PrintCustTransPortrait.php:898 PrintCustTransPortrait.php:943 +#: PrintCustTransPortrait.php:504 PrintCustTransPortrait.php:704 +#: PrintCustTransPortrait.php:894 PrintCustTransPortrait.php:939 #: StockMovements.php:97 SupplierAllocations.php:463 #: SupplierAllocations.php:575 SupplierAllocations.php:645 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:60 @@ -1669,7 +1669,7 @@ "měny bankovního účtu" #: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1014 -#: SelectOrderItems.php:1368 Stocks.php:1033 WorkOrderCosting.php:512 +#: SelectOrderItems.php:1369 Stocks.php:1033 WorkOrderCosting.php:512 #: WorkOrderEntry.php:549 msgid "Are You Sure?" msgstr "Opravdu provést?" @@ -1747,14 +1747,14 @@ #: OffersReceived.php:196 OffersReceived.php:245 OrderDetails.php:155 #: PDFOrdersInvoiced.php:387 POReport.php:699 POReport.php:1365 #: PrintCustTrans.php:650 PrintCustTrans.php:713 PrintCustTrans.php:751 -#: PrintCustTransPortrait.php:833 PrintCustTransPortrait.php:916 -#: PrintCustTransPortrait.php:960 RecurringSalesOrders.php:322 +#: PrintCustTransPortrait.php:829 PrintCustTransPortrait.php:912 +#: PrintCustTransPortrait.php:956 RecurringSalesOrders.php:322 #: ReorderLevel.php:268 ReverseGRN.php:379 ReverseGRN.php:380 #: SalesAnalReptCols.php:18 SalesAnalReptCols.php:20 Sales... [truncated message content] |
From: <dai...@us...> - 2011-02-15 06:31:18
|
Revision: 4491 http://web-erp.svn.sourceforge.net/web-erp/?rev=4491&view=rev Author: daintree Date: 2011-02-15 06:31:08 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Pre 4.03RC2 Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/DeliveryDetails.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html 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/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/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/ConfirmDispatch_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -172,7 +172,7 @@ $myrow['controlled'], $myrow['serialised'], $myrow['decimalplaces'], - $myrow['narrative'], + htmlspecialchars_decode($myrow['narrative']), 'No', $myrow['orderlineno'], $myrow['taxcatid'], Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/DeliveryDetails.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -257,8 +257,8 @@ if(isset($_POST['MakeRecurringOrder']) AND ! $InputErrors){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/RecurringSalesOrders.php?' . SID.'identifier='.$identifier . '&NewRecurringOrder=Yes">'; - prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/RecurringOrders.php?' . SID.'identifier='.$identifier . "&NewRecurringOrder=Yes'>". _('click here') .'</a> '. _('to continue'),'info'); + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/RecurringSalesOrders.php?identifier='.$identifier . '&NewRecurringOrder=Yes">'; + prnMsg(_('You should automatically be forwarded to the entry of recurring order details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/RecurringOrders.php?identifier='.$identifier . "&NewRecurringOrder=Yes'>". _('click here') .'</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; } @@ -266,8 +266,8 @@ if (isset($_POST['BackToLineDetails']) and $_POST['BackToLineDetails']==_('Modify Order Lines')){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SelectOrderItems.php?' . SID.'identifier='.$identifier . '">'; - prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' ."<a href='" . $rootpath . '/SelectOrderItems.php?' . SID.'identifier='.$identifier . "'>". _('click here') .'</a> '. _('to continue'),'info'); + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SelectOrderItems.php?identifier='.$identifier . '">'; + prnMsg(_('You should automatically be forwarded to the entry of the order line details page') . '. ' . _('If this does not happen') . '(' . _('if the browser does not support META Refresh') . ') ' .'<a href="' . $rootpath . '/SelectOrderItems.php?identifier='.$identifier . '">'. _('click here') .'</a> '. _('to continue'),'info'); include('includes/footer.inc'); exit; @@ -571,19 +571,19 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?' . SID .'identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?' . SID .'identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?' . SID .'identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; //Add option to Print Sales Orders or Proforma invoice - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?' . SID .'identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation') .'</a></td></tr></table>'; } - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?' . SID .'identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; } else { /*its a customer logon so thank them */ prnMsg(_('Thank you for your business'),'success'); @@ -747,10 +747,10 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?' . SID.'identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?' . SID.'identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?' . SID.'identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?' . SID.'identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; include('includes/footer.inc'); exit; } @@ -763,7 +763,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; echo '</b> ' . _('Customer Name') . ' :<b> ' . $_SESSION['Items'.$identifier]->CustomerName . '</p>'; //echo '<font size=4><b>'. _('Customer') .' : ' . $_SESSION['Items'.$identifier]->CustomerName . '</b></font>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID.'identifier='.$identifier . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/PrintCustTrans.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -261,7 +261,7 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x, $YPos,$FormDesign->Data->Column6->Length, $FormDesign->Data->Column6->FontSize, $DisplayDiscount, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x, $YPos,$FormDesign->Data->Column7->Length, $FormDesign->Data->Column7->FontSize, $DisplayNet, 'right'); $YPos-= ($line_height); - $lines = explode('\r\n', $myrow2['narrative']); + $lines = explode('\r\n', htmlspecialchars_decode($myrow2['narrative'])); for ($i = 0;$i < sizeOf($lines);$i++) { while (strlen($lines[$i]) > 1) { if ($YPos - $line_height <= $Bottom_Margin) { Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/PrintCustTransPortrait.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -360,7 +360,7 @@ } $YPos -= ($FontSize*$lines); - $lines=explode('\r\n',$myrow2['narrative']); + $lines=explode('\r\n',htmlspecialchars_decode($myrow2['narrative'])); for ($i=0;$i<sizeOf($lines);$i++) { while (strlen($lines[$i])>1){ if ($YPos-$line_height <= $Bottom_Margin){ @@ -391,10 +391,8 @@ /* check to see enough space left to print the 4 lines for the totals/footer */ if (($YPos-$Bottom_Margin)<(2*$line_height)){ - PrintLinesToBottom (); include ('includes/PDFTransPageHeaderPortrait.inc'); - } /*Print a column vertical line with enough space for the footer*/ /*draw the vertical column lines to 4 lines shy of the bottom @@ -426,9 +424,7 @@ $DisplayFreight = number_format($myrow['ovfreight'],2); $DisplayTax = number_format($myrow['ovgst'],2); $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); - } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); $DisplayFreight = number_format(-$myrow['ovfreight'],2); $DisplayTax = number_format(-$myrow['ovgst'],2); Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/SelectCustomer.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -316,7 +316,9 @@ } echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -prnMsg($msg,'info'); +if (strlen($msg)>1){ + prnMsg($msg,'info'); +} echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers').'</p>'; echo "<table cellpadding=3 colspan=4 class=selection>"; echo "<tr><td colspan=2>" . _('Enter a partial Name') . ":</td><td>"; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/SelectOrderItems.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -35,7 +35,8 @@ } -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']; @@ -1365,7 +1366,7 @@ echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/UpgradeDatabase.php 2011-02-15 06:31:08 UTC (rev 4491) @@ -32,7 +32,7 @@ echo '<option value="3.11">' . _('Version 3.11 or 4.01 - 4.02') . '</option>'; echo '</select></td></tr></table>'; } else { - if ($_SESSION['VersionNumber']=='4.00-RC1'){ + if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; } prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'],'info'); @@ -97,7 +97,7 @@ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; break; } //end switch - if(isset($_SESSION['VersionNumber']) AND $_SESSION['VersionNumber']< '4.00') { /* VersionNumber is set to '4.00' when upgrade3.11.1-4.00.sql is run */ + if(isset($_SESSION['VersionNumber']) AND $_SESSION['VersionNumber']< '4.03') { /* VersionNumber is set to '4.03' when upgrade3.11.1-4.00.sql is run */ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; } } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/doc/Change.log.html 2011-02-15 06:31:08 UTC (rev 4491) @@ -1,5 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p <p /> +<p>15/2/11 Release 4.03RC2</p> +<p /> +<p>15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !!</p> +<p>15/2/11: Phil PrintCustTrans.php and PrintCustTransPortrait.php htmlspecialchars_decode($narrative) - conversion at the time of committing to DB needs to be unconverted. Also in ConfirmDispatch_Invoice.php</p> +<p>15/2/11: Phil SelectCustomer.php removed showing blank message when $msg was empty </p> +<p /> <p>13/2/11 Release 4.03RC1</p> <p /> <p>13/2/11:Phil GoodsReceivedControlled InputSerialItems and friends - now uses session identifier to ensure uniqueness is several people entering stock receipts</p> Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-02-13 04:15:38 UTC (rev 4490) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-02-15 06:31:08 UTC (rev 4491) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-13 17:03+1300\n" +"POT-Creation-Date: 2011-02-15 18:44+1200\n" "PO-Revision-Date: 2010-07-25 17:04+0000\n" "Last-Translator: Tim Schofield <ti...@we...>\n" "Language-Team: Czech <cs...@li...>\n" @@ -219,9 +219,9 @@ #: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 #: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 #: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 -#: SelectCreditItems.php:272 SelectCustomer.php:320 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:606 SelectOrderItems.php:1430 -#: SelectOrderItems.php:1554 SelectProduct.php:456 SelectSalesOrder.php:155 +#: SelectCreditItems.php:272 SelectCustomer.php:322 SelectGLAccount.php:19 +#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 +#: SelectOrderItems.php:1555 SelectProduct.php:456 SelectSalesOrder.php:155 #: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 #: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 @@ -342,9 +342,9 @@ #: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 #: Prices.php:227 PurchData.php:207 SalesCategories.php:263 #: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 -#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 -#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 +#: SalesTypes.php:206 SelectCustomer.php:609 SelectCustomer.php:625 +#: SelectCustomer.php:647 SelectCustomer.php:663 SelectCustomer.php:685 +#: SelectCustomer.php:701 Shippers.php:144 StockCategories.php:244 #: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 #: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 @@ -370,9 +370,9 @@ #: PO_Items.php:758 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 -#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 -#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1357 +#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:610 +#: SelectCustomer.php:626 SelectCustomer.php:648 SelectCustomer.php:664 +#: SelectCustomer.php:686 SelectCustomer.php:702 SelectOrderItems.php:1358 #: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 #: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 #: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:81 SuppInvGRNs.php:135 @@ -500,8 +500,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "Nepodařilo se získat požadovanou sekci prosím zkuste to znovu." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 -#: SelectCustomer.php:630 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:603 +#: SelectCustomer.php:632 msgid "Customer Contacts" msgstr "Zákazník Kontakty" @@ -550,7 +550,7 @@ #: AddCustomerContacts.php:112 CompanyPreferences.php:229 #: CustomerBranches.php:377 Customers.php:899 Customers.php:905 -#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 +#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:605 #: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 #: SupplierCredit.php:433 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 @@ -559,7 +559,7 @@ msgstr "Název" #: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 -#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 +#: Customers.php:906 Customers.php:972 SelectCustomer.php:606 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "Roli" @@ -572,7 +572,7 @@ #: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:316 +#: PcReportTab.php:348 SelectCustomer.php:608 SystemParameters.php:316 #: WOSerialNos.php:277 WOSerialNos.php:279 msgid "Notes" msgstr "Bere na vědomí" @@ -591,14 +591,14 @@ #: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 #: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 -#: SelectCustomer.php:461 SelectOrderItems.php:638 +#: SelectCustomer.php:463 SelectOrderItems.php:639 #: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "Telefon" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 -#: SelectCustomer.php:668 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:640 +#: SelectCustomer.php:670 msgid "Customer Notes" msgstr "Zákazník bere na vědomí" @@ -639,7 +639,7 @@ #: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 #: PaymentAllocations.php:77 PcAssignCashToTab.php:212 #: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:616 PrintCustTransPortrait.php:794 ReverseGRN.php:378 +#: PrintCustTrans.php:616 PrintCustTransPortrait.php:790 ReverseGRN.php:378 #: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 #: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 #: StockMovements.php:98 StockSerialItemResearch.php:79 @@ -685,7 +685,7 @@ msgid "Contact Note" msgstr "Kontakt Poznámka:" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:678 msgid "Customer Type (Group) Notes" msgstr "Typ zákazníka (Group) Poznámky" @@ -693,7 +693,7 @@ msgid "The Contact priority must be an integer." msgstr "Prioritou Kontakt musí být celé číslo." -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:708 msgid "Customer Group Notes" msgstr "Zákaznická skupina bere na vědomí" @@ -917,7 +917,7 @@ #: OutstandingGRNs.php:185 PDFCustomerList.php:412 PDFLowGP.php:168 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 #: PDFStockCheckComparison.php:379 PrintCustTrans.php:416 -#: PrintCustTransPortrait.php:564 ReorderLevel.php:229 StockDispatch.php:309 +#: PrintCustTransPortrait.php:560 ReorderLevel.php:229 StockDispatch.php:309 #: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:237 Tax.php:352 msgid "Print PDF" msgstr "Tisknout PDF" @@ -1108,7 +1108,7 @@ #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 #: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:98 #: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 -#: MRPReschedules.php:204 SelectCustomer.php:460 ShipmentCosting.php:501 +#: MRPReschedules.php:204 SelectCustomer.php:462 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1599,8 +1599,8 @@ #: CustomerInquiry.php:190 CustomerTransInquiry.php:86 CustWhereAlloc.php:88 #: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:378 #: PrintCustTrans.php:542 PrintCustTrans.php:696 PrintCustTrans.php:735 -#: PrintCustTransPortrait.php:508 PrintCustTransPortrait.php:708 -#: PrintCustTransPortrait.php:898 PrintCustTransPortrait.php:943 +#: PrintCustTransPortrait.php:504 PrintCustTransPortrait.php:704 +#: PrintCustTransPortrait.php:894 PrintCustTransPortrait.php:939 #: StockMovements.php:97 SupplierAllocations.php:463 #: SupplierAllocations.php:575 SupplierAllocations.php:645 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:60 @@ -1669,7 +1669,7 @@ "měny bankovního účtu" #: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1014 -#: SelectOrderItems.php:1368 Stocks.php:1033 WorkOrderCosting.php:512 +#: SelectOrderItems.php:1369 Stocks.php:1033 WorkOrderCosting.php:512 #: WorkOrderEntry.php:549 msgid "Are You Sure?" msgstr "Opravdu provést?" @@ -1747,14 +1747,14 @@ #: OffersReceived.php:196 OffersReceived.php:245 OrderDetails.php:155 #: PDFOrdersInvoiced.php:387 POReport.php:699 POReport.php:1365 #: PrintCustTrans.php:650 PrintCustTrans.php:713 PrintCustTrans.php:751 -#: PrintCustTransPortrait.php:833 PrintCustTransPortrait.php:916 -#: PrintCustTransPortrait.php:960 RecurringSalesOrders.php:322 +#: PrintCustTransPortrait.php:829 PrintCustTransPortrait.php:912 +#: PrintCustTransPortrait.php:956 RecurringSalesOrders.php:322 #: ReorderLevel.php:268 ReverseGRN.php:379 ReverseGRN.php:380 #: SalesAnalReptCols.php:18 SalesAnalReptCols.php:20 Sales... [truncated message content] |
From: <dai...@us...> - 2011-02-18 09:56:59
|
Revision: 4492 http://web-erp.svn.sourceforge.net/web-erp/?rev=4492&view=rev Author: daintree Date: 2011-02-18 09:56:52 +0000 (Fri, 18 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/Credit_Invoice.php trunk/FixedAssetItems.php trunk/PO_Items.php trunk/SelectAsset.php trunk/SelectCreditItems.php trunk/Z_DeleteInvoice.php trunk/doc/Change.log.html trunk/includes/DefineCartClass.php Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/CompanyPreferences.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -456,7 +456,7 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for stock transactions') . ' (' . _('at standard cost') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; +echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; if ($_POST['GLLink_Stock']==0){ echo '<option selected VALUE=0>' . _('No'); Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/ConfirmDispatch_Invoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -336,7 +336,7 @@ $i=0; foreach ($_SESSION['Items']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $Tax->TaxAuthDescription; $i++; @@ -353,7 +353,7 @@ $TaxTotals[$Tax->TaxAuthID]=0; } if ($i>0){ - echo '<br>'; + echo '<br />'; } if (isset($_POST['ProcessInvoice'])) { echo $Tax->TaxRate*100; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/Credit_Invoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -1,5 +1,4 @@ <?php -/* $Revision: 1.35 $ */ /* $Id$*/ //$PageSecurity =3; @@ -1447,9 +1446,9 @@ echo '<div class="centre">'._('Credit Note number') . ' ' . $CreditNo . ' ' . _('has been processed'); if ($_SESSION['InvoicePortraitFormat']==0){ - echo "<br><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo "<br /><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; } else { - echo "<br><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo "<br /><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; } echo '</div>'; /*end of process credit note */ @@ -1462,19 +1461,19 @@ echo '<tr><td>' . _('Credit Note Type') . "</td><td><select tabindex=".$j." name=CreditType>"; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=="Return"){ - echo "<option selected VALUE='Return'>" . _('Goods returned to store'); - echo "<option VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; + echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } elseif($_POST['CreditType']=='WriteOff') { - echo "<option selected VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='Return'>" . _('Goods returned to store'); - echo "<option VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } else { - echo "<option VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='Return'>" . _('Goods returned to store'); - echo "<option selected VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option selected value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } - echo "</select></td></tr>"; + echo '</select></td></tr>'; $j++; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ @@ -1483,7 +1482,7 @@ echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex='.$j.' name=Location>'; - $SQL="SELECT loccode, locationname FROM locations"; + $SQL='SELECT loccode, locationname FROM locations'; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -1504,23 +1503,23 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; - $SQL="SELECT accountcode, + $SQL='SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 ORDER BY chartmaster.accountcode"; + AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode'; $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { - if ($_POST['WriteOffGLCode']==$myrow["accountcode"]){ - echo "<option selected value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + if ($_POST['WriteOffGLCode']==$myrow['accountcode']){ + echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountname']. '</option>'; } else { - echo "<option value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } } - echo "</select></td></tr>"; + echo '</select></td></tr>'; } if (!isset($_POST['CreditText'])) { $_POST['CreditText'] = ''; @@ -1529,9 +1528,9 @@ echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex='.$j.' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; echo '</table><br><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; $j++; - echo "<input type=submit tabindex=".$j++." name='ProcessCredit' Value='" . _('Process Credit') ."'></div>"; + echo '<input type="submit" tabindex='.$j++.' name="ProcessCredit" Value="' . _('Process Credit') .'"></div>'; } -echo "</form>"; -include("includes/footer.inc"); +echo '</form>'; +include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/FixedAssetItems.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -101,6 +101,12 @@ $Errors[$i] = 'AssetCategoryID'; $i++; } + if (trim($_POST['AssetLocation'])==''){ + $InputError = 1; + prnMsg(_('There are no asset locations defined. All assets must belong to a valid location,'),'error'); + $Errors[$i] = 'AssetLocation'; + $i++; + } if (!is_numeric($_POST['DepnRate']) OR $_POST['DepnRate']>100 OR $_POST['DepnRate']<0){ $InputError = 1; prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); @@ -506,7 +512,7 @@ echo '<option value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; } } -echo '</select></td></tr>'; +echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td></tr>'; echo '<tr><td>' . _('Bar Code') . ':</td><td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BarCode" size=22 maxlength=20 value="' . $_POST['BarCode'] . '"></td></tr>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/PO_Items.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -35,21 +35,21 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['Commit'])) { foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted == false) { - if (!is_numeric($_POST['ConversionFactor'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'.$POLine->LineNo])))){ prnMsg(_('The conversion factor is expected to be numeric - the figure which converts from our units to the supplier units. e.g. if the supplier units is a tonne and our unit is a kilogram then the conversion factor that converts our unit to the suppliers unit is 1000'),'error'); $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = 1; } else { //a valid number for the conversion factor is entered - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = $_POST['ConversionFactor'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'.$POLine->LineNo])); } - if (!is_numeric($_POST['SuppQty'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppQty'.$POLine->LineNo])))){ prnMsg(_('The quantity in the supplier units is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=$_POST['SuppQty'.$POLine->LineNo]*$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppQty'.$POLine->LineNo]))*doubleval(str_replace($locale_info['thousands_sep'],'',$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } - if (!is_numeric($_POST['SuppPrice'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo])))){ prnMsg(_('The supplier price is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['SuppPrice'.$POLine->LineNo]/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/doubleval(str_replace($locale_info['thousands_sep'],'',$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; @@ -413,14 +413,14 @@ if ($_SESSION['PO'.$identifier]->AllowPrintPO==1 AND ($_SESSION['PO'.$identifier]->Status=='Authorised' OR $_SESSION['PO'.$identifier]->Status=='Printed')){ - echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; + echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; } } /*end of if its a new order or an existing one */ $Result = DB_Txn_Commit($db); unset($_SESSION['PO'.$identifier]); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Return To PO List') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Return To PO List') . '</a>'; include('includes/footer.inc'); exit; } /*end if there were no input errors trapped */ @@ -450,7 +450,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric($_POST['Price'])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -518,6 +518,9 @@ if ($AllowUpdate == true){ //adding the non-stock item + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); + $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', 0, /*Serialised */ @@ -549,7 +552,6 @@ $_POST['Qty'], ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); - include ('includes/PO_UnsetFormVbls.php'); } } Modified: trunk/SelectAsset.php =================================================================== --- trunk/SelectAsset.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/SelectAsset.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -171,6 +171,7 @@ $ErrMsg = _('No assets were returned by the SQL because'); $DbgMsg = _('The SQL that returned an error was'); $searchresult = DB_query($SQL, $db, $ErrMsg, $DbgMsg); + echo $SQL; if (DB_num_rows($searchresult) == 0) { prnMsg(_('No assets were returned by this search please re-enter alternative criteria to try again'), 'info'); Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/SelectCreditItems.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -72,7 +72,7 @@ //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = 'SELECT + $SQL = "SELECT custbranch.debtorno, custbranch.brname, custbranch.contactname, @@ -80,7 +80,7 @@ custbranch.faxno, custbranch.branchcode FROM custbranch - WHERE custbranch.brname ' . LIKE ."'$SearchString' + WHERE custbranch.brname " . LIKE . "'" . $SearchString . "' AND custbranch.disabletrans=0"; } elseif (strlen($_POST['CustCode'])>0){ Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/Z_DeleteInvoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -132,7 +132,7 @@ echo '<br><br>'; /* Delete any GL Transaction records*/ -$SQL = "DELETE FROM gltrans WHERE type=10 AND transno='" . $_GET['InvoiceNo'] . "'"; +$SQL = "DELETE FROM gltrans WHERE gltrans.type=10 AND gltrans.typeno='" . $_GET['InvoiceNo'] . "'"; $ErrMsg = _('The SQL to delete the general ledger journal records failed because'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('The GL journal records associated with the invoice have been deleted'),'info'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/doc/Change.log.html 2011-02-18 09:56:52 UTC (rev 4492) @@ -1,5 +1,11 @@ -<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p +<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> +<p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> +<p>16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson</p> +<p>16/2/11: SelectCreditItems.php formating/conventions lower case html and CreditInvoice.php</p> +<p>15/2/11: Phil Make invoicing warn the user when no taxes are defined for a tax group - i.e. there is a configuration error with taxes</p> +<p /> <p>15/2/11 Release 4.03RC2</p> <p /> <p>15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !!</p> Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/includes/DefineCartClass.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -341,15 +341,20 @@ $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($SQL,$db,$ErrMsg); unset($this->LineItems[$LineNumber]->Taxes); - while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - - $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], - $myrow['taxauthid'], - $myrow['description'], - $myrow['taxrate'], - $myrow['taxontax'], - $myrow['taxglcode']); - } + if (DB_num_rows($GetTaxRatesResult)==0){ + prnMsg(_('It appears that taxes are not defined correctly for this customer tax group') ,'error'); + } else { + + while ($myrow = DB_fetch_array($GetTaxRatesResult)){ + + $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], + $myrow['taxauthid'], + $myrow['description'], + $myrow['taxrate'], + $myrow['taxontax'], + $myrow['taxglcode']); + } //end loop around different taxes + } //end if there are some taxes defined } //end method GetTaxes function GetFreightTaxes () { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-18 09:56:59
|
Revision: 4492 http://web-erp.svn.sourceforge.net/web-erp/?rev=4492&view=rev Author: daintree Date: 2011-02-18 09:56:52 +0000 (Fri, 18 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/Credit_Invoice.php trunk/FixedAssetItems.php trunk/PO_Items.php trunk/SelectAsset.php trunk/SelectCreditItems.php trunk/Z_DeleteInvoice.php trunk/doc/Change.log.html trunk/includes/DefineCartClass.php Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/CompanyPreferences.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -456,7 +456,7 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for stock transactions') . ' (' . _('at standard cost') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; +echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; if ($_POST['GLLink_Stock']==0){ echo '<option selected VALUE=0>' . _('No'); Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/ConfirmDispatch_Invoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -336,7 +336,7 @@ $i=0; foreach ($_SESSION['Items']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $Tax->TaxAuthDescription; $i++; @@ -353,7 +353,7 @@ $TaxTotals[$Tax->TaxAuthID]=0; } if ($i>0){ - echo '<br>'; + echo '<br />'; } if (isset($_POST['ProcessInvoice'])) { echo $Tax->TaxRate*100; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/Credit_Invoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -1,5 +1,4 @@ <?php -/* $Revision: 1.35 $ */ /* $Id$*/ //$PageSecurity =3; @@ -1447,9 +1446,9 @@ echo '<div class="centre">'._('Credit Note number') . ' ' . $CreditNo . ' ' . _('has been processed'); if ($_SESSION['InvoicePortraitFormat']==0){ - echo "<br><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo "<br /><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; } else { - echo "<br><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo "<br /><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; } echo '</div>'; /*end of process credit note */ @@ -1462,19 +1461,19 @@ echo '<tr><td>' . _('Credit Note Type') . "</td><td><select tabindex=".$j." name=CreditType>"; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=="Return"){ - echo "<option selected VALUE='Return'>" . _('Goods returned to store'); - echo "<option VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; + echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } elseif($_POST['CreditType']=='WriteOff') { - echo "<option selected VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='Return'>" . _('Goods returned to store'); - echo "<option VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } else { - echo "<option VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='Return'>" . _('Goods returned to store'); - echo "<option selected VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option selected value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } - echo "</select></td></tr>"; + echo '</select></td></tr>'; $j++; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ @@ -1483,7 +1482,7 @@ echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex='.$j.' name=Location>'; - $SQL="SELECT loccode, locationname FROM locations"; + $SQL='SELECT loccode, locationname FROM locations'; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -1504,23 +1503,23 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; - $SQL="SELECT accountcode, + $SQL='SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 ORDER BY chartmaster.accountcode"; + AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode'; $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { - if ($_POST['WriteOffGLCode']==$myrow["accountcode"]){ - echo "<option selected value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + if ($_POST['WriteOffGLCode']==$myrow['accountcode']){ + echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountname']. '</option>'; } else { - echo "<option value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } } - echo "</select></td></tr>"; + echo '</select></td></tr>'; } if (!isset($_POST['CreditText'])) { $_POST['CreditText'] = ''; @@ -1529,9 +1528,9 @@ echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex='.$j.' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; echo '</table><br><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; $j++; - echo "<input type=submit tabindex=".$j++." name='ProcessCredit' Value='" . _('Process Credit') ."'></div>"; + echo '<input type="submit" tabindex='.$j++.' name="ProcessCredit" Value="' . _('Process Credit') .'"></div>'; } -echo "</form>"; -include("includes/footer.inc"); +echo '</form>'; +include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/FixedAssetItems.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -101,6 +101,12 @@ $Errors[$i] = 'AssetCategoryID'; $i++; } + if (trim($_POST['AssetLocation'])==''){ + $InputError = 1; + prnMsg(_('There are no asset locations defined. All assets must belong to a valid location,'),'error'); + $Errors[$i] = 'AssetLocation'; + $i++; + } if (!is_numeric($_POST['DepnRate']) OR $_POST['DepnRate']>100 OR $_POST['DepnRate']<0){ $InputError = 1; prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); @@ -506,7 +512,7 @@ echo '<option value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; } } -echo '</select></td></tr>'; +echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td></tr>'; echo '<tr><td>' . _('Bar Code') . ':</td><td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BarCode" size=22 maxlength=20 value="' . $_POST['BarCode'] . '"></td></tr>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/PO_Items.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -35,21 +35,21 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['Commit'])) { foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted == false) { - if (!is_numeric($_POST['ConversionFactor'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'.$POLine->LineNo])))){ prnMsg(_('The conversion factor is expected to be numeric - the figure which converts from our units to the supplier units. e.g. if the supplier units is a tonne and our unit is a kilogram then the conversion factor that converts our unit to the suppliers unit is 1000'),'error'); $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = 1; } else { //a valid number for the conversion factor is entered - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = $_POST['ConversionFactor'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'.$POLine->LineNo])); } - if (!is_numeric($_POST['SuppQty'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppQty'.$POLine->LineNo])))){ prnMsg(_('The quantity in the supplier units is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=$_POST['SuppQty'.$POLine->LineNo]*$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppQty'.$POLine->LineNo]))*doubleval(str_replace($locale_info['thousands_sep'],'',$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } - if (!is_numeric($_POST['SuppPrice'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo])))){ prnMsg(_('The supplier price is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['SuppPrice'.$POLine->LineNo]/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/doubleval(str_replace($locale_info['thousands_sep'],'',$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; @@ -413,14 +413,14 @@ if ($_SESSION['PO'.$identifier]->AllowPrintPO==1 AND ($_SESSION['PO'.$identifier]->Status=='Authorised' OR $_SESSION['PO'.$identifier]->Status=='Printed')){ - echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; + echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; } } /*end of if its a new order or an existing one */ $Result = DB_Txn_Commit($db); unset($_SESSION['PO'.$identifier]); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Return To PO List') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Return To PO List') . '</a>'; include('includes/footer.inc'); exit; } /*end if there were no input errors trapped */ @@ -450,7 +450,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric($_POST['Price'])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -518,6 +518,9 @@ if ($AllowUpdate == true){ //adding the non-stock item + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); + $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', 0, /*Serialised */ @@ -549,7 +552,6 @@ $_POST['Qty'], ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); - include ('includes/PO_UnsetFormVbls.php'); } } Modified: trunk/SelectAsset.php =================================================================== --- trunk/SelectAsset.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/SelectAsset.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -171,6 +171,7 @@ $ErrMsg = _('No assets were returned by the SQL because'); $DbgMsg = _('The SQL that returned an error was'); $searchresult = DB_query($SQL, $db, $ErrMsg, $DbgMsg); + echo $SQL; if (DB_num_rows($searchresult) == 0) { prnMsg(_('No assets were returned by this search please re-enter alternative criteria to try again'), 'info'); Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/SelectCreditItems.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -72,7 +72,7 @@ //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = 'SELECT + $SQL = "SELECT custbranch.debtorno, custbranch.brname, custbranch.contactname, @@ -80,7 +80,7 @@ custbranch.faxno, custbranch.branchcode FROM custbranch - WHERE custbranch.brname ' . LIKE ."'$SearchString' + WHERE custbranch.brname " . LIKE . "'" . $SearchString . "' AND custbranch.disabletrans=0"; } elseif (strlen($_POST['CustCode'])>0){ Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/Z_DeleteInvoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -132,7 +132,7 @@ echo '<br><br>'; /* Delete any GL Transaction records*/ -$SQL = "DELETE FROM gltrans WHERE type=10 AND transno='" . $_GET['InvoiceNo'] . "'"; +$SQL = "DELETE FROM gltrans WHERE gltrans.type=10 AND gltrans.typeno='" . $_GET['InvoiceNo'] . "'"; $ErrMsg = _('The SQL to delete the general ledger journal records failed because'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('The GL journal records associated with the invoice have been deleted'),'info'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/doc/Change.log.html 2011-02-18 09:56:52 UTC (rev 4492) @@ -1,5 +1,11 @@ -<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p +<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> +<p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> +<p>16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson</p> +<p>16/2/11: SelectCreditItems.php formating/conventions lower case html and CreditInvoice.php</p> +<p>15/2/11: Phil Make invoicing warn the user when no taxes are defined for a tax group - i.e. there is a configuration error with taxes</p> +<p /> <p>15/2/11 Release 4.03RC2</p> <p /> <p>15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !!</p> Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/includes/DefineCartClass.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -341,15 +341,20 @@ $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($SQL,$db,$ErrMsg); unset($this->LineItems[$LineNumber]->Taxes); - while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - - $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], - $myrow['taxauthid'], - $myrow['description'], - $myrow['taxrate'], - $myrow['taxontax'], - $myrow['taxglcode']); - } + if (DB_num_rows($GetTaxRatesResult)==0){ + prnMsg(_('It appears that taxes are not defined correctly for this customer tax group') ,'error'); + } else { + + while ($myrow = DB_fetch_array($GetTaxRatesResult)){ + + $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], + $myrow['taxauthid'], + $myrow['description'], + $myrow['taxrate'], + $myrow['taxontax'], + $myrow['taxglcode']); + } //end loop around different taxes + } //end if there are some taxes defined } //end method GetTaxes function GetFreightTaxes () { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-18 21:41:20
|
Revision: 4493 http://web-erp.svn.sourceforge.net/web-erp/?rev=4493&view=rev Author: daintree Date: 2011-02-18 21:41:14 +0000 (Fri, 18 Feb 2011) Log Message: ----------- Changed PageSecurityArray to avoid problems with register_globals Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/GetConfig.php trunk/includes/session.inc Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-18 09:56:52 UTC (rev 4492) +++ trunk/doc/Change.log.html 2011-02-18 21:41:14 UTC (rev 4493) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> -<p /> +<p> +<p>18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; </p> <p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> <p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> <p>16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson</p> Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-02-18 09:56:52 UTC (rev 4492) +++ trunk/includes/GetConfig.php 2011-02-18 21:41:14 UTC (rev 4493) @@ -31,9 +31,9 @@ if (DB_error_no($db)!=0){ // the table may not exist with the pagesecurity field in it if it is an older webERP database header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the VersionNumber is not in the config table } - //Populate the PageSecurity array for each script's PageSecurity value + //Populate the PageSecurityArray array for each script's PageSecurity value while ($myrow=DB_fetch_array($result)) { - $_SESSION['PageSecurity'][$myrow['script']]=$myrow['pagesecurity']; + $_SESSION['PageSecurityArray'][$myrow['script']]=$myrow['pagesecurity']; } Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-02-18 09:56:52 UTC (rev 4492) +++ trunk/includes/session.inc 2011-02-18 21:41:14 UTC (rev 4493) @@ -115,12 +115,12 @@ /*User is logged in so get configuration parameters - save in session*/ include($PathPrefix . 'includes/GetConfig.php'); -/*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurity'] array +/*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurityArray'] array * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) */ if (!isset($PageSecurity)){ //only hardcoded in the UpgradeDatabase script - so old versions that don't have the scripts.pagesecurity field do not choke - $PageSecurity = $_SESSION['PageSecurity'][basename($_SERVER['SCRIPT_NAME'])]; + $PageSecurity = $_SESSION['PageSecurityArray'][basename($_SERVER['SCRIPT_NAME'])]; } /*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-18 21:41:20
|
Revision: 4493 http://web-erp.svn.sourceforge.net/web-erp/?rev=4493&view=rev Author: daintree Date: 2011-02-18 21:41:14 +0000 (Fri, 18 Feb 2011) Log Message: ----------- Changed PageSecurityArray to avoid problems with register_globals Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/GetConfig.php trunk/includes/session.inc Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-18 09:56:52 UTC (rev 4492) +++ trunk/doc/Change.log.html 2011-02-18 21:41:14 UTC (rev 4493) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> -<p /> +<p> +<p>18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; </p> <p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> <p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> <p>16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson</p> Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-02-18 09:56:52 UTC (rev 4492) +++ trunk/includes/GetConfig.php 2011-02-18 21:41:14 UTC (rev 4493) @@ -31,9 +31,9 @@ if (DB_error_no($db)!=0){ // the table may not exist with the pagesecurity field in it if it is an older webERP database header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the VersionNumber is not in the config table } - //Populate the PageSecurity array for each script's PageSecurity value + //Populate the PageSecurityArray array for each script's PageSecurity value while ($myrow=DB_fetch_array($result)) { - $_SESSION['PageSecurity'][$myrow['script']]=$myrow['pagesecurity']; + $_SESSION['PageSecurityArray'][$myrow['script']]=$myrow['pagesecurity']; } Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-02-18 09:56:52 UTC (rev 4492) +++ trunk/includes/session.inc 2011-02-18 21:41:14 UTC (rev 4493) @@ -115,12 +115,12 @@ /*User is logged in so get configuration parameters - save in session*/ include($PathPrefix . 'includes/GetConfig.php'); -/*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurity'] array +/*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurityArray'] array * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) */ if (!isset($PageSecurity)){ //only hardcoded in the UpgradeDatabase script - so old versions that don't have the scripts.pagesecurity field do not choke - $PageSecurity = $_SESSION['PageSecurity'][basename($_SERVER['SCRIPT_NAME'])]; + $PageSecurity = $_SESSION['PageSecurityArray'][basename($_SERVER['SCRIPT_NAME'])]; } /*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-22 09:45:08
|
Revision: 4495 http://web-erp.svn.sourceforge.net/web-erp/?rev=4495&view=rev Author: daintree Date: 2011-02-22 09:45:01 +0000 (Tue, 22 Feb 2011) Log Message: ----------- PDF Languages in www_users - PDFTopItems rework - change PageSecurity array name to PageSecurityArray to avoid register globals issue Modified Paths: -------------- trunk/PDFTopItems.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/doc/Change.log.html trunk/doc/Manual/ManualCurrencies.html trunk/doc/Manual/ManualSecuritySchema.html trunk/includes/PDFTopItemsHeader.inc trunk/includes/class.pdf.php Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/PDFTopItems.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.2 $ */ /* $Id$*/ -//$PageSecurity = 2; + include ('includes/session.inc'); include ('includes/PDFStarter.php'); $FontSize = 10; @@ -10,79 +10,78 @@ $line_height = 12; include ('includes/PDFTopItemsHeader.inc'); $FontSize = 10; -$FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_POST['NumberOfDays'])); +$FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_GET['NumberOfDays'])); //the situation if the location and customer type selected "All" -if (($_GET["location"] == "All") and ($_GET["customers"] == "All")) { +if (($_GET['Location'] == 'All') and ($_GET['Customers'] == 'All')) { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorderdetails.ActualDispatchDate >='" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >='" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems'] ; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems'] ; } else { //the situation if only location type selected "All" - if ($_GET["location"] == "All") { + if ($_GET['Location'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.typeid = '" . $_GET["customers"] . "' + AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems']; } else { //the situation if the customer type selected "All" - if ($_GET["customers"] == "All") { - $SQL = " - SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + if ($_GET['Customers'] == 'All') { + $SQL = "SELECT salesorderdetails.stkcode, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_GET['location'] . "' + AND salesorders.fromstkloc = '" . $_GET['Location'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC + ORDER BY '" . $_GET['Sequence'] . "' DESC LIMIT 0," . $_GET['NumberOfTopItems']; } else { //the situation if the location and customer type not selected "All" - $SQL = " - SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + $SQL = "SELECT salesorderdetails.stkcode, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_GET['location'] . "' - AND debtorsmaster.typeid = '" . $_GET['customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorders.fromstkloc = '" . $_GET['Location'] . "' + AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems']; } } } $result = DB_query($SQL, $db); + $YPos = $YPos - 6; while ($myrow = DB_fetch_array($result)) { //find the quantity onhand item @@ -91,18 +90,12 @@ WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh, $db); $ohRow = db_fetch_row($oh); - $OnHand = $ohRow[0]; - $ValueSales = number_format($myrow['2'], 2); - $Code = $myrow['0']; //stkcode - $Desc = $myrow['3']; //desc - $TotalInvoice = $myrow['1']; //total invoice here - $Unit = $myrow['4']; //unit - $LeftOvers = $pdf->addTextWrap($Left_Margin + 1, $YPos, 300 - $Left_Margin, $FontSize, $Code); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 270 - $Left_Margin, $FontSize, $Desc); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, $TotalInvoice, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $Unit, 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, $ValueSales, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, $OnHand, 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 1, $YPos, 300 - $Left_Margin, $FontSize, $myrow['stkcode']); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 270 - $Left_Margin, $FontSize, $myrow['description']); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, $myrow['totalinvoiced'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $myrow['units'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, number_format($myrow['valuesales'], 2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, $ohRow[0], 'right'); if (strlen($LeftOvers) > 1) { $LeftOvers = $pdf->addTextWrap($Left_Margin + 1 + 94, $YPos - $line_height, 270, $FontSize, $LeftOvers, 'left'); $YPos-= $line_height; @@ -122,7 +115,7 @@ $title = _('Print Price List Error'); include ('includes/header.inc'); prnMsg(_('There were no records returned '), 'warn'); - echo '<br><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + echo '<br><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include ('includes/footer.inc'); exit; } else { Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/TopItems.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -7,11 +7,7 @@ $title = _('Top Items Searching'); include ('includes/header.inc'); //check if input already -if (!(isset($_POST['Location']) - AND isset($_POST['NumberOfDays']) - AND isset($_POST['Customers']) - AND isset($_POST['NumberOfTopItems']) - AND isset($_POST['Sequence']))) { +if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; @@ -44,8 +40,8 @@ echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name="Sequence">'; - echo ' <option value=TotalInvoiced>' . _('Total Pieces') . ''; - echo ' <option value=ValueSales>' . _('Value of Sales') . ''; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; + echo ' <option value="ValueSales">' . _('Value of Sales') . ''; echo ' </select></td> </tr>'; //View number of days @@ -61,8 +57,10 @@ <td></td> <td></td> </tr> - </form></table>'; - echo '<br /><div class=centre><input tabindex=5 type=submit value="' . _('Search') . '"></div>'; + </table> + <br /><div class=centre> + <input tabindex=5 type=submit name="Search" value="' . _('Search') . '"> + </div></form>'; } else { // everything below here to view NumberOfTopItems items sale on selected location $FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_POST['NumberOfDays'])); @@ -153,31 +151,32 @@ } } $result = DB_query($SQL, $db); + echo '<p class="page_title_text" align="center"><strong>' . _('Top Sales Items List') . '</strong></p>'; - echo "<form action=PDFTopItems.php method='GET'><table class='selection'>"; + echo '<form action="PDFTopItems.php" method="GET"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $TableHeader = '<tr><th><strong>' . _('#') . '</strong></th> - <th><strong>' . _('Code') . '</strong></th> - <th><strong>' . _('Description') . '</strong></th> - <th><strong>' . _('Total Invoiced') . '</strong></th> - <th><strong>' . _('Units') . '</strong></th> - <th><strong>' . _('Value Sales') . '</strong></th> - <th><strong>' . _('On Hand') . '</strong></th>'; + $TableHeader = '<tr><th>' . _('#') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Invoiced') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Value Sales') . '</th> + <th>' . _('On Hand') . '</th>'; echo $TableHeader; echo ' - <input type="hidden" value=' . $_POST['Location'] . ' name=location /> - <input type="hidden" value=' . $_POST['Sequence'] . ' name=Sequence /> - <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name=numberofdays /> - <input type="hidden" value=' . $_POST['Customers'] . ' name=customers /> - <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name=NumberOfTopItems /> + <input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> + <input type="hidden" value=' . $_POST['Sequence'] . ' name="Sequence" /> + <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name="NumberOfDays" /> + <input type="hidden" value=' . $_POST['Customers'] . ' name="Customers" /> + <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" /> '; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { //find the quantity onhand item $sqloh = "SELECT sum(quantity)as qty - FROM `locstock` - WHERE stockid='" . $myrow['0'] . "'"; + FROM `locstock` + WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh, $db); $ohRow = db_fetch_row($oh); if ($k == 1) { @@ -194,19 +193,20 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - </tr>', $i, $myrow['0'], $myrow['3'], $myrow['1'], //total invoice here - $myrow['4'], //unit - number_format($myrow['2']/$myrow['5'],2), //value sales here - number_format($ohRow[0], $myrow['7']) //on hand - ); - $i+= 1; + </tr>', + $i, + $myrow['0'], + $myrow['3'], + $myrow['1'], //total invoice here + $myrow['4'], //unit + number_format($myrow['2']/$myrow['5'],2), //value sales here + number_format($ohRow[0], $myrow['7']) //on hand + ); + $i++; } echo '</table>'; - // echo '<td style="text-align:center" colspan=6><a href="javascript:history.go(-1)" title="Return to previous page"><input type=Button Name="Back" Value="' . _('Back') . '"></a></font>   '; echo '<br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; echo '</form>'; - //end of the else statement - } include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/UserSettings.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=1; - include('includes/session.inc'); $title = _('User Settings'); include('includes/header.inc'); @@ -93,7 +91,7 @@ $_SESSION['Theme'] = trim($_POST['Theme']); /*already set by session.inc but for completeness */ $theme = $_SESSION['Theme']; $_SESSION['Language'] = trim($_POST['Language']); - + $_SESSION['PDFLanguage'] = $_POST['PDFLanguage']; include ('includes/LanguageSetup.php'); } @@ -137,9 +135,9 @@ AND $LanguageEntry!='.'){ if ($_SESSION['Language'] == $LanguageEntry){ - echo "<option selected VALUE='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } else { - echo "<option VALUE='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } } } @@ -159,9 +157,9 @@ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if ($_SESSION['Theme'] == $ThemeName){ - echo "<option selected VALUE='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; } else { - echo "<option VALUE='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName . '</option>'; } } } @@ -190,11 +188,11 @@ echo "<td><input type=text name='email' size=40 value='" . $_POST['email'] . "'></td></tr>"; if (!isset($_POST['PDFLanguage'])){ - $_POST['PDFLanguage']=0; + $_POST['PDFLanguage']=$_SESSION['PDFLanguage']; } echo '<tr><td>' . _('PDF Language Support') . ': </td><td><select name="PDFLanguage">'; -for($i=0;$i<=7;$i++){ +for($i=0;$i<count($PDFLanguages);$i++){ if ($_POST['PDFLanguage']==$i){ echo '<option selected value=' . $i .'>' . $PDFLanguages[$i] . '</option>'; } else { Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/WWW_Users.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -23,13 +23,8 @@ _('Setup')); $PDFLanguages = array(_('Latin Western Languages'), - _('Eastern European Russian Japanese'), - _('Chinese'), - _('Korean'), - _('Vietnamese'), - _('Hebrew'), - _('Arabic'), - _('Thai')); + _('Eastern European Russian Japanese Korean Vietnamese Hebrew Arabic Thai'), + _('Chinese')); $title = _('User Maintenance'); include('includes/header.inc'); @@ -620,7 +615,7 @@ } echo '<tr><td>' . _('PDF Language Support') . ': </td><td><select name="PDFLanguage">'; -for($i=0;$i<=7;$i++){ +for($i=0;$i<count($PDFLanguages);$i++){ if ($_POST['PDFLanguage']==$i){ echo '<option selected value=' . $i .'>' . $PDFLanguages[$i] . '</option>'; } else { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/doc/Change.log.html 2011-02-22 09:45:01 UTC (rev 4495) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> +<p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> <p>18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; </p> <p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> <p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> Modified: trunk/doc/Manual/ManualCurrencies.html =================================================================== --- trunk/doc/Manual/ManualCurrencies.html 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/doc/Manual/ManualCurrencies.html 2011-02-22 09:45:01 UTC (rev 4495) @@ -5,7 +5,7 @@ <br><br> Any number of currencies can be defined in webERP. Every currency that is transacted with either in sales (AR) or purchasing (AP) needs to be defined in the system. To define currencies go to the Setup tab -> General -> Currency Maintenance. Only a few fields are required to be completed for each currency defined: <ul> -<li>The ISO 4217 code for the currency - this is the international standard 3 character code that is used worldwide to represent the currency. If the code entered exists then it is possible for webERP to retrieve exchange rates from either the European Central Bank. webERP is capable of updating exchange rates daily from the ECB if set to do so under Setup->Configuration. +<li>The ISO 4217 code for the currency - this is the international standard 3 character code that is used worldwide to represent the currency. If the code entered exists then it is possible for webERP to retrieve exchange rates from either the European Central Bank or Oanda.com, if there is no rate maintained for the currency at the ECB. webERP is capable of updating exchange rates daily from the ECB if set to do so under Setup->Configuration ->Auto Update Exchange Rates Daily. If this is set to yes, then when the first user logs in for the day the exchange rates are updated automatically. If it is set to no then exchange rates will only be updated if the user does so manually. </li> <li>The name of the currency can be any description that describes the currency</li> <lI>The country of the currency can be entered</li> Modified: trunk/doc/Manual/ManualSecuritySchema.html =================================================================== --- trunk/doc/Manual/ManualSecuritySchema.html 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/doc/Manual/ManualSecuritySchema.html 2011-02-22 09:45:01 UTC (rev 4495) @@ -35,12 +35,9 @@ <br> </li><li> PageSecurity values:<br> -Each webERP page includes a Page Security value from 1 to 15.<br> -This is hard coded into each page; for example: $PageSecurity = 1;<br> -For user access Page Security values correspond to 'Security Token' values.<br> +Each webERP page is given a Page Security value from 1 to 15 in the table scripts. The system reads all the scripts and the PageSecurity value for each into a SESSION array - $_SESSION['PageSecurityArray'] - the key for each element is the script name and the value is the PageSecurity value for that script. The key - the script name is retrieved from the $_SERVER['SCRIPT_NAME'] variable. In this way every time a script is called, the PageSecurity is retrieved from the array. +++<br> -There is no webERP tool to change PageSecurity values.<br> -However, an administrator can edit the pages directly.<br> +There is a webERP tool to change PageSecurity values, for each script which is accessible from the Setup menu.<br> <br></ol> These parts work together as follows. The user name and password combination entered at log on enables the system to identify the 'Security Role' for the User. @@ -52,13 +49,11 @@ <u>A more comprehensive description of the security scheme follows:</u><br> <br> Each webERP page (script) is assigned a specific PageSecurity value. -This page security value is hard coded inside each script. At the time -of writing this is a number between 1 and 15. If more levels of security +This page security value is stored in the scripts table of the database and read into a SESSION array on login (from the GetConfig.php script). At the time of writing this is a number between 1 and 15. If more levels of security are necessary then this can be expanded by an administrator or developer. -The default PageSecurity values for each page are set out in the table -below.<br> +The default PageSecurity values for each page can be inspected by browsing the scripts table<br> <br> -The user is allowed access to a page if the PageSecurity value of the page +The user is allowed access to a page if the PageSecurity value of the page/script is a number contained in the SESSION AllowedPageSecurityTokens array as determined from the users access level (Security Role). The user access level Security Role) is an integer that represents the Security Role assigned to the user in the user set up page @@ -84,7 +79,7 @@ Tokens assigned to each Security Role the security access can be tailored for all users. When making these changes reference the default values in the tables below. PageSecurity values must also be known. -The value of the default settings can be modified as needed.<br> +The value of the default settings can be modified as needed from the Page Security script accessible from the Setup module<br> <br> <u>Security Scheme Tables:</u><br> <br> Modified: trunk/includes/PDFTopItemsHeader.inc =================================================================== --- trunk/includes/PDFTopItemsHeader.inc 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/includes/PDFTopItemsHeader.inc 2011-02-22 09:45:01 UTC (rev 4495) @@ -10,29 +10,24 @@ $XPos=0; $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/logo.jpg',$XPos+20,$YPos-50,0,60); -if ($_GET["customers"]!='All'){ -$SQL="SELECT typename - FROM `debtortype` - WHERE typeid=".$_GET["customers"].""; - -$result = DB_query($SQL,$db); -$myrow=DB_fetch_array($result); -$Customers=$myrow["0"]; +if ($_GET['Customers']!='All'){ + $SQL="SELECT typename + FROM `debtortype` + WHERE typeid='".$_GET['Customers']."'"; + + $result = DB_query($SQL,$db); + $myrow=DB_fetch_array($result); + $Customers=$myrow["0"]; }else{ -$Customers="All"; + $Customers='All'; } -//searching condition -$infoa=_('Search On Location')." : ".$_GET["location"].""; -$infob=_('Customers'). " : ".$Customers.""; -$infoc=_('Number Of Days')." : ".$_GET["numberofdays"]." "; -$infod=_('Number Of Items')." : ".$_GET['NumberOfTopItems'].""; -$infoe=_('Order By')." : ".$_GET['order'].""; - //Display the searching condition -$pdf->addTextWrap($XPos+40,$YPos-70,500,9,$infoa); $pdf->addTextWrap($XPos+240,$YPos-70,500,9,$infob); -$pdf->addTextWrap($XPos+40,$YPos-90,500,9,$infoc); $pdf->addTextWrap($XPos+240,$YPos-90,500,9,$infod); -$pdf->addTextWrap($XPos+40,$YPos-110,500,9,$infoe); +$pdf->addTextWrap($XPos+40,$YPos-70,500,9,_('Search On Location').' : '.$_GET['Location']); +$pdf->addTextWrap($XPos+240,$YPos-70,500,9,_('Customers'). ' : '.$Customers); +$pdf->addTextWrap($XPos+40,$YPos-90,500,9,_('Number Of Days')." : ".$_GET['NumberOfDays']." "); +$pdf->addTextWrap($XPos+240,$YPos-90,500,9,_('Number Of Items')." : ".$_GET['NumberOfTopItems']); +$pdf->addTextWrap($XPos+40,$YPos-110,500,9,_('Order By')." : ".$_GET['Sequence']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos-($line_height*1.5),550,$FontSize, _('Top Items Sales Search Result') ); @@ -63,6 +58,4 @@ $pdf->Rectangle($Left_Margin, $YPos-$line_height,$Page_Width-$Left_Margin-$Right_Margin,$YPos-$Bottom_Margin); $YPos -= (1.5 * $line_height); -//$PageNumber++; - ?> \ No newline at end of file Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/includes/class.pdf.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -39,9 +39,15 @@ $UserPdfLang = $_SESSION['PDFLanguage']; switch ($UserPdfLang) { - case 0: $UserPdfFont = 'times'; break; - case 1: $UserPdfFont = 'javierjp'; break; - case 2: $UserPdfFont = 'javiergb'; break; + case 0: + $UserPdfFont = 'times'; + break; + case 1: + $UserPdfFont = 'javierjp'; + break; + case 2: + $UserPdfFont = 'javiergb'; + break; } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-22 09:45:11
|
Revision: 4495 http://web-erp.svn.sourceforge.net/web-erp/?rev=4495&view=rev Author: daintree Date: 2011-02-22 09:45:01 +0000 (Tue, 22 Feb 2011) Log Message: ----------- PDF Languages in www_users - PDFTopItems rework - change PageSecurity array name to PageSecurityArray to avoid register globals issue Modified Paths: -------------- trunk/PDFTopItems.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/doc/Change.log.html trunk/doc/Manual/ManualCurrencies.html trunk/doc/Manual/ManualSecuritySchema.html trunk/includes/PDFTopItemsHeader.inc trunk/includes/class.pdf.php Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/PDFTopItems.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.2 $ */ /* $Id$*/ -//$PageSecurity = 2; + include ('includes/session.inc'); include ('includes/PDFStarter.php'); $FontSize = 10; @@ -10,79 +10,78 @@ $line_height = 12; include ('includes/PDFTopItemsHeader.inc'); $FontSize = 10; -$FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_POST['NumberOfDays'])); +$FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_GET['NumberOfDays'])); //the situation if the location and customer type selected "All" -if (($_GET["location"] == "All") and ($_GET["customers"] == "All")) { +if (($_GET['Location'] == 'All') and ($_GET['Customers'] == 'All')) { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorderdetails.ActualDispatchDate >='" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >='" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems'] ; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems'] ; } else { //the situation if only location type selected "All" - if ($_GET["location"] == "All") { + if ($_GET['Location'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.typeid = '" . $_GET["customers"] . "' + AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems']; } else { //the situation if the customer type selected "All" - if ($_GET["customers"] == "All") { - $SQL = " - SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + if ($_GET['Customers'] == 'All') { + $SQL = "SELECT salesorderdetails.stkcode, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_GET['location'] . "' + AND salesorders.fromstkloc = '" . $_GET['Location'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC + ORDER BY '" . $_GET['Sequence'] . "' DESC LIMIT 0," . $_GET['NumberOfTopItems']; } else { //the situation if the location and customer type not selected "All" - $SQL = " - SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + $SQL = "SELECT salesorderdetails.stkcode, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_GET['location'] . "' - AND debtorsmaster.typeid = '" . $_GET['customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorders.fromstkloc = '" . $_GET['Location'] . "' + AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems']; } } } $result = DB_query($SQL, $db); + $YPos = $YPos - 6; while ($myrow = DB_fetch_array($result)) { //find the quantity onhand item @@ -91,18 +90,12 @@ WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh, $db); $ohRow = db_fetch_row($oh); - $OnHand = $ohRow[0]; - $ValueSales = number_format($myrow['2'], 2); - $Code = $myrow['0']; //stkcode - $Desc = $myrow['3']; //desc - $TotalInvoice = $myrow['1']; //total invoice here - $Unit = $myrow['4']; //unit - $LeftOvers = $pdf->addTextWrap($Left_Margin + 1, $YPos, 300 - $Left_Margin, $FontSize, $Code); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 270 - $Left_Margin, $FontSize, $Desc); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, $TotalInvoice, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $Unit, 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, $ValueSales, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, $OnHand, 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 1, $YPos, 300 - $Left_Margin, $FontSize, $myrow['stkcode']); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 270 - $Left_Margin, $FontSize, $myrow['description']); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, $myrow['totalinvoiced'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $myrow['units'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, number_format($myrow['valuesales'], 2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, $ohRow[0], 'right'); if (strlen($LeftOvers) > 1) { $LeftOvers = $pdf->addTextWrap($Left_Margin + 1 + 94, $YPos - $line_height, 270, $FontSize, $LeftOvers, 'left'); $YPos-= $line_height; @@ -122,7 +115,7 @@ $title = _('Print Price List Error'); include ('includes/header.inc'); prnMsg(_('There were no records returned '), 'warn'); - echo '<br><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + echo '<br><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include ('includes/footer.inc'); exit; } else { Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/TopItems.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -7,11 +7,7 @@ $title = _('Top Items Searching'); include ('includes/header.inc'); //check if input already -if (!(isset($_POST['Location']) - AND isset($_POST['NumberOfDays']) - AND isset($_POST['Customers']) - AND isset($_POST['NumberOfTopItems']) - AND isset($_POST['Sequence']))) { +if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; @@ -44,8 +40,8 @@ echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name="Sequence">'; - echo ' <option value=TotalInvoiced>' . _('Total Pieces') . ''; - echo ' <option value=ValueSales>' . _('Value of Sales') . ''; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; + echo ' <option value="ValueSales">' . _('Value of Sales') . ''; echo ' </select></td> </tr>'; //View number of days @@ -61,8 +57,10 @@ <td></td> <td></td> </tr> - </form></table>'; - echo '<br /><div class=centre><input tabindex=5 type=submit value="' . _('Search') . '"></div>'; + </table> + <br /><div class=centre> + <input tabindex=5 type=submit name="Search" value="' . _('Search') . '"> + </div></form>'; } else { // everything below here to view NumberOfTopItems items sale on selected location $FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_POST['NumberOfDays'])); @@ -153,31 +151,32 @@ } } $result = DB_query($SQL, $db); + echo '<p class="page_title_text" align="center"><strong>' . _('Top Sales Items List') . '</strong></p>'; - echo "<form action=PDFTopItems.php method='GET'><table class='selection'>"; + echo '<form action="PDFTopItems.php" method="GET"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $TableHeader = '<tr><th><strong>' . _('#') . '</strong></th> - <th><strong>' . _('Code') . '</strong></th> - <th><strong>' . _('Description') . '</strong></th> - <th><strong>' . _('Total Invoiced') . '</strong></th> - <th><strong>' . _('Units') . '</strong></th> - <th><strong>' . _('Value Sales') . '</strong></th> - <th><strong>' . _('On Hand') . '</strong></th>'; + $TableHeader = '<tr><th>' . _('#') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Invoiced') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Value Sales') . '</th> + <th>' . _('On Hand') . '</th>'; echo $TableHeader; echo ' - <input type="hidden" value=' . $_POST['Location'] . ' name=location /> - <input type="hidden" value=' . $_POST['Sequence'] . ' name=Sequence /> - <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name=numberofdays /> - <input type="hidden" value=' . $_POST['Customers'] . ' name=customers /> - <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name=NumberOfTopItems /> + <input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> + <input type="hidden" value=' . $_POST['Sequence'] . ' name="Sequence" /> + <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name="NumberOfDays" /> + <input type="hidden" value=' . $_POST['Customers'] . ' name="Customers" /> + <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" /> '; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { //find the quantity onhand item $sqloh = "SELECT sum(quantity)as qty - FROM `locstock` - WHERE stockid='" . $myrow['0'] . "'"; + FROM `locstock` + WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh, $db); $ohRow = db_fetch_row($oh); if ($k == 1) { @@ -194,19 +193,20 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - </tr>', $i, $myrow['0'], $myrow['3'], $myrow['1'], //total invoice here - $myrow['4'], //unit - number_format($myrow['2']/$myrow['5'],2), //value sales here - number_format($ohRow[0], $myrow['7']) //on hand - ); - $i+= 1; + </tr>', + $i, + $myrow['0'], + $myrow['3'], + $myrow['1'], //total invoice here + $myrow['4'], //unit + number_format($myrow['2']/$myrow['5'],2), //value sales here + number_format($ohRow[0], $myrow['7']) //on hand + ); + $i++; } echo '</table>'; - // echo '<td style="text-align:center" colspan=6><a href="javascript:history.go(-1)" title="Return to previous page"><input type=Button Name="Back" Value="' . _('Back') . '"></a></font>   '; echo '<br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; echo '</form>'; - //end of the else statement - } include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/UserSettings.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=1; - include('includes/session.inc'); $title = _('User Settings'); include('includes/header.inc'); @@ -93,7 +91,7 @@ $_SESSION['Theme'] = trim($_POST['Theme']); /*already set by session.inc but for completeness */ $theme = $_SESSION['Theme']; $_SESSION['Language'] = trim($_POST['Language']); - + $_SESSION['PDFLanguage'] = $_POST['PDFLanguage']; include ('includes/LanguageSetup.php'); } @@ -137,9 +135,9 @@ AND $LanguageEntry!='.'){ if ($_SESSION['Language'] == $LanguageEntry){ - echo "<option selected VALUE='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } else { - echo "<option VALUE='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } } } @@ -159,9 +157,9 @@ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if ($_SESSION['Theme'] == $ThemeName){ - echo "<option selected VALUE='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; } else { - echo "<option VALUE='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName . '</option>'; } } } @@ -190,11 +188,11 @@ echo "<td><input type=text name='email' size=40 value='" . $_POST['email'] . "'></td></tr>"; if (!isset($_POST['PDFLanguage'])){ - $_POST['PDFLanguage']=0; + $_POST['PDFLanguage']=$_SESSION['PDFLanguage']; } echo '<tr><td>' . _('PDF Language Support') . ': </td><td><select name="PDFLanguage">'; -for($i=0;$i<=7;$i++){ +for($i=0;$i<count($PDFLanguages);$i++){ if ($_POST['PDFLanguage']==$i){ echo '<option selected value=' . $i .'>' . $PDFLanguages[$i] . '</option>'; } else { Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/WWW_Users.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -23,13 +23,8 @@ _('Setup')); $PDFLanguages = array(_('Latin Western Languages'), - _('Eastern European Russian Japanese'), - _('Chinese'), - _('Korean'), - _('Vietnamese'), - _('Hebrew'), - _('Arabic'), - _('Thai')); + _('Eastern European Russian Japanese Korean Vietnamese Hebrew Arabic Thai'), + _('Chinese')); $title = _('User Maintenance'); include('includes/header.inc'); @@ -620,7 +615,7 @@ } echo '<tr><td>' . _('PDF Language Support') . ': </td><td><select name="PDFLanguage">'; -for($i=0;$i<=7;$i++){ +for($i=0;$i<count($PDFLanguages);$i++){ if ($_POST['PDFLanguage']==$i){ echo '<option selected value=' . $i .'>' . $PDFLanguages[$i] . '</option>'; } else { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/doc/Change.log.html 2011-02-22 09:45:01 UTC (rev 4495) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> +<p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> <p>18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; </p> <p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> <p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> Modified: trunk/doc/Manual/ManualCurrencies.html =================================================================== --- trunk/doc/Manual/ManualCurrencies.html 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/doc/Manual/ManualCurrencies.html 2011-02-22 09:45:01 UTC (rev 4495) @@ -5,7 +5,7 @@ <br><br> Any number of currencies can be defined in webERP. Every currency that is transacted with either in sales (AR) or purchasing (AP) needs to be defined in the system. To define currencies go to the Setup tab -> General -> Currency Maintenance. Only a few fields are required to be completed for each currency defined: <ul> -<li>The ISO 4217 code for the currency - this is the international standard 3 character code that is used worldwide to represent the currency. If the code entered exists then it is possible for webERP to retrieve exchange rates from either the European Central Bank. webERP is capable of updating exchange rates daily from the ECB if set to do so under Setup->Configuration. +<li>The ISO 4217 code for the currency - this is the international standard 3 character code that is used worldwide to represent the currency. If the code entered exists then it is possible for webERP to retrieve exchange rates from either the European Central Bank or Oanda.com, if there is no rate maintained for the currency at the ECB. webERP is capable of updating exchange rates daily from the ECB if set to do so under Setup->Configuration ->Auto Update Exchange Rates Daily. If this is set to yes, then when the first user logs in for the day the exchange rates are updated automatically. If it is set to no then exchange rates will only be updated if the user does so manually. </li> <li>The name of the currency can be any description that describes the currency</li> <lI>The country of the currency can be entered</li> Modified: trunk/doc/Manual/ManualSecuritySchema.html =================================================================== --- trunk/doc/Manual/ManualSecuritySchema.html 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/doc/Manual/ManualSecuritySchema.html 2011-02-22 09:45:01 UTC (rev 4495) @@ -35,12 +35,9 @@ <br> </li><li> PageSecurity values:<br> -Each webERP page includes a Page Security value from 1 to 15.<br> -This is hard coded into each page; for example: $PageSecurity = 1;<br> -For user access Page Security values correspond to 'Security Token' values.<br> +Each webERP page is given a Page Security value from 1 to 15 in the table scripts. The system reads all the scripts and the PageSecurity value for each into a SESSION array - $_SESSION['PageSecurityArray'] - the key for each element is the script name and the value is the PageSecurity value for that script. The key - the script name is retrieved from the $_SERVER['SCRIPT_NAME'] variable. In this way every time a script is called, the PageSecurity is retrieved from the array. +++<br> -There is no webERP tool to change PageSecurity values.<br> -However, an administrator can edit the pages directly.<br> +There is a webERP tool to change PageSecurity values, for each script which is accessible from the Setup menu.<br> <br></ol> These parts work together as follows. The user name and password combination entered at log on enables the system to identify the 'Security Role' for the User. @@ -52,13 +49,11 @@ <u>A more comprehensive description of the security scheme follows:</u><br> <br> Each webERP page (script) is assigned a specific PageSecurity value. -This page security value is hard coded inside each script. At the time -of writing this is a number between 1 and 15. If more levels of security +This page security value is stored in the scripts table of the database and read into a SESSION array on login (from the GetConfig.php script). At the time of writing this is a number between 1 and 15. If more levels of security are necessary then this can be expanded by an administrator or developer. -The default PageSecurity values for each page are set out in the table -below.<br> +The default PageSecurity values for each page can be inspected by browsing the scripts table<br> <br> -The user is allowed access to a page if the PageSecurity value of the page +The user is allowed access to a page if the PageSecurity value of the page/script is a number contained in the SESSION AllowedPageSecurityTokens array as determined from the users access level (Security Role). The user access level Security Role) is an integer that represents the Security Role assigned to the user in the user set up page @@ -84,7 +79,7 @@ Tokens assigned to each Security Role the security access can be tailored for all users. When making these changes reference the default values in the tables below. PageSecurity values must also be known. -The value of the default settings can be modified as needed.<br> +The value of the default settings can be modified as needed from the Page Security script accessible from the Setup module<br> <br> <u>Security Scheme Tables:</u><br> <br> Modified: trunk/includes/PDFTopItemsHeader.inc =================================================================== --- trunk/includes/PDFTopItemsHeader.inc 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/includes/PDFTopItemsHeader.inc 2011-02-22 09:45:01 UTC (rev 4495) @@ -10,29 +10,24 @@ $XPos=0; $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/logo.jpg',$XPos+20,$YPos-50,0,60); -if ($_GET["customers"]!='All'){ -$SQL="SELECT typename - FROM `debtortype` - WHERE typeid=".$_GET["customers"].""; - -$result = DB_query($SQL,$db); -$myrow=DB_fetch_array($result); -$Customers=$myrow["0"]; +if ($_GET['Customers']!='All'){ + $SQL="SELECT typename + FROM `debtortype` + WHERE typeid='".$_GET['Customers']."'"; + + $result = DB_query($SQL,$db); + $myrow=DB_fetch_array($result); + $Customers=$myrow["0"]; }else{ -$Customers="All"; + $Customers='All'; } -//searching condition -$infoa=_('Search On Location')." : ".$_GET["location"].""; -$infob=_('Customers'). " : ".$Customers.""; -$infoc=_('Number Of Days')." : ".$_GET["numberofdays"]." "; -$infod=_('Number Of Items')." : ".$_GET['NumberOfTopItems'].""; -$infoe=_('Order By')." : ".$_GET['order'].""; - //Display the searching condition -$pdf->addTextWrap($XPos+40,$YPos-70,500,9,$infoa); $pdf->addTextWrap($XPos+240,$YPos-70,500,9,$infob); -$pdf->addTextWrap($XPos+40,$YPos-90,500,9,$infoc); $pdf->addTextWrap($XPos+240,$YPos-90,500,9,$infod); -$pdf->addTextWrap($XPos+40,$YPos-110,500,9,$infoe); +$pdf->addTextWrap($XPos+40,$YPos-70,500,9,_('Search On Location').' : '.$_GET['Location']); +$pdf->addTextWrap($XPos+240,$YPos-70,500,9,_('Customers'). ' : '.$Customers); +$pdf->addTextWrap($XPos+40,$YPos-90,500,9,_('Number Of Days')." : ".$_GET['NumberOfDays']." "); +$pdf->addTextWrap($XPos+240,$YPos-90,500,9,_('Number Of Items')." : ".$_GET['NumberOfTopItems']); +$pdf->addTextWrap($XPos+40,$YPos-110,500,9,_('Order By')." : ".$_GET['Sequence']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos-($line_height*1.5),550,$FontSize, _('Top Items Sales Search Result') ); @@ -63,6 +58,4 @@ $pdf->Rectangle($Left_Margin, $YPos-$line_height,$Page_Width-$Left_Margin-$Right_Margin,$YPos-$Bottom_Margin); $YPos -= (1.5 * $line_height); -//$PageNumber++; - ?> \ No newline at end of file Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2011-02-20 03:52:26 UTC (rev 4494) +++ trunk/includes/class.pdf.php 2011-02-22 09:45:01 UTC (rev 4495) @@ -39,9 +39,15 @@ $UserPdfLang = $_SESSION['PDFLanguage']; switch ($UserPdfLang) { - case 0: $UserPdfFont = 'times'; break; - case 1: $UserPdfFont = 'javierjp'; break; - case 2: $UserPdfFont = 'javiergb'; break; + case 0: + $UserPdfFont = 'times'; + break; + case 1: + $UserPdfFont = 'javierjp'; + break; + case 2: + $UserPdfFont = 'javiergb'; + break; } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-25 21:04:05
|
Revision: 4497 http://web-erp.svn.sourceforge.net/web-erp/?rev=4497&view=rev Author: daintree Date: 2011-02-25 21:03:52 +0000 (Fri, 25 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/MRPPlannedPurchaseOrders.php trunk/includes/SQL_CommonFunctions.inc trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_CN.utf8/Manual/ManualIntroduction.html trunk/locale/zh_CN.utf8/Manual/ManualRequirements.html trunk/locale/zh_CN.utf8/Manual/ManualSecuritySchema.html Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2011-02-23 09:12:32 UTC (rev 4496) +++ trunk/MRPPlannedPurchaseOrders.php 2011-02-25 21:03:52 UTC (rev 4497) @@ -3,16 +3,19 @@ /* $Id$*/ // MRPPlannedPurchaseOrders.php - Report of purchase parts that MRP has determined should have // purchase orders created for them -//$PageSecurity = 2; + include('includes/session.inc'); -$sql='show tables where Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; + +//maybe not ansi sql ?? +$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; + $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { - $title='MRP error'; + $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The MRP calculation must be run before you can run this report').'<br>'. - _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php?' . SID .'>'._('here').'</a>', 'error'); + _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php>'._('here').'</a>', 'error'); include('includes/footer.inc'); exit; } @@ -111,9 +114,9 @@ $title = _('MRP Planned Purchase Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-02-23 09:12:32 UTC (rev 4496) +++ trunk/includes/SQL_CommonFunctions.inc 2011-02-25 21:03:52 UTC (rev 4497) @@ -18,7 +18,7 @@ DB_query('LOCK TABLES systypes WRITE',$db); - $SQL = "SELECT typeno FROM systypes WHERE typeid = '" . $TransType . "'"; + $SQL = 'SELECT typeno FROM systypes WHERE typeid = ' . $TransType; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': <BR>' . _('The next transaction number could not be retrieved from the database because'); $DbgMsg = _('The following SQL to retrieve the transaction number was used'); @@ -26,7 +26,7 @@ $myrow = DB_fetch_row($GetTransNoResult); - $SQL = "UPDATE systypes SET typeno = '" . ($myrow[0] + 1) . "' WHERE typeid = '" . $TransType . "'"; + $SQL = 'UPDATE systypes SET typeno = ' . ($myrow[0] + 1) . ' WHERE typeid = ' . $TransType; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The transaction number could not be incremented'); $DbgMsg = _('The following SQL to increment the transaction number was used'); $UpdTransNoResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg); @@ -114,13 +114,13 @@ Function GetCreditAvailable($DebtorNo,&$db) { $sql = "SELECT debtorsmaster.debtorno, - debtorsmaster.creditlimit, - SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance - FROM debtorsmaster INNER JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtorsmaster.debtorno='" . $DebtorNo . "' - GROUP BY debtorsmaster.debtorno, - debtorsmaster.creditlimit"; + debtorsmaster.creditlimit, + SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance + FROM debtorsmaster INNER JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtorsmaster.debtorno='" . $DebtorNo . "' + GROUP BY debtorsmaster.debtorno, + debtorsmaster.creditlimit"; $ErrMsg = _('The current account balance of the customer could not be retrieved because'); $GetAccountBalanceResult = DB_query($sql, $db, $ErrMsg); @@ -131,8 +131,8 @@ $CreditAvailable = $myrow['creditlimit'] - $myrow['balance']; } else { $sql = "SELECT creditlimit - FROM debtorsmaster - WHERE debtorno='" . $DebtorNo . "'"; + FROM debtorsmaster + WHERE debtorno='" . $DebtorNo . "'"; $GetAccountBalanceResult = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($GetAccountBalanceResult); $CreditAvailable = $myrow['creditlimit']; @@ -162,7 +162,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $QOH!=0){ $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod($_SESSION['DefaultDateFormat'], $db); + $PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); $StockGLCode = GetStockGLCode($StockID,$db); $ValueOfChange = $QOH * ($NewCost - $OldCost); @@ -237,7 +237,7 @@ while ($MyRow=DB_fetch_array($result)){ $NewParent = $MyRow['parent']; $MaterialCost = BomMaterialCost($NewParent, $db); - $SQL = "UPDATE stockmaster SET materialcost='" . $MaterialCost . "' WHERE stockid='" . $NewParent . "'"; + $SQL = 'UPDATE stockmaster SET materialcost=' . $MaterialCost . " WHERE stockid='" . $NewParent . "'"; $result1 = DB_query($SQL,$db); if (DB_error_no($db)!=0) { return 1; Modified: trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po 2011-02-23 09:12:32 UTC (rev 4496) +++ trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po 2011-02-25 21:03:52 UTC (rev 4497) @@ -1,4 +1,4 @@ -# weberp 简体中文界面文件 +# weberp 簡體中文介面檔 # Copyright (C) 2007 Logic Works Ltd # This file is distributed under the same license as the webERP package. # FIRST AUTHOR <rom...@gm...>, 2006. @@ -7,472 +7,851 @@ msgstr "" "Project-Id-Version: WEBERP3.05 VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-15 18:44+1200\n" -"PO-Revision-Date: 2011-01-29 15:12+0000\n" -"Last-Translator: Exson qu <hex...@gm...>\n" -"Language-Team: WebERP Translation Team <web-erp-translation@lists." -"sourceforge.net>\n" +"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"PO-Revision-Date: 2011-02-25 18:22+0800\n" +"Last-Translator: Exson qu <hex...@ya...>\n" +"Language-Team: WebERP Translation Team <web...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2011-01-29 15:16+0000\n" "X-Generator: Launchpad (build 12274)\n" "X-Poedit-Country: CHINA\n" +"X-Poedit-Basepath: C:\\改過自新\\\n" "X-Poedit-SearchPath-0: webERPRC4\n" -"X-Poedit-Basepath: C:\\改过自新\\\n" -#: AccountGroups.php:9 index.php:1268 +#: AccountGroups.php:9 +#: index.php:1273 msgid "Account Groups" -msgstr "科目组" +msgstr "科目組" #: AccountGroups.php:19 -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "在递归检查中查询父账户组中的科目组发生错误" +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "在遞迴檢查中查詢父帳戶組中的科目組發生錯誤" #: AccountGroups.php:20 -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "用于查询父账户组的科目组失败的SQL是" +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "用於查詢父帳戶組的科目組失敗的SQL是" -#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:177 +#: AccountGroups.php:57 +#: AccountGroups.php:94 +#: AccountGroups.php:177 #: AccountGroups.php:187 msgid "The SQL that was used to retrieve the information was" -msgstr "用于查找交易数据的SQL是" +msgstr "用於查找交易資料的SQL是" #: AccountGroups.php:58 msgid "Could not check whether the group exists because" -msgstr "未能判定组别是否存在, 因为" +msgstr "未能判定組別是否存在, 因為" #: AccountGroups.php:65 msgid "The account group name already exists in the database" -msgstr "科目组名称已经存在在数据库中。" +msgstr "科目組名稱已經存在在資料庫中。" #: AccountGroups.php:71 msgid "The account group name cannot contain the character" -msgstr "科目组名称不能包含这个字符" +msgstr "科目組名稱不能包含這個字元" -#: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 +#: AccountGroups.php:71 +#: AccountSections.php:75 +#: PaymentMethods.php:41 +#: TaxCategories.php:33 +#: TaxProvinces.php:32 +#: UnitsOfMeasure.php:32 msgid "or the character" -msgstr "或这个字符" +msgstr "或這個字元" #: AccountGroups.php:77 msgid "The account group name must be at least one character long" -msgstr "科目组名称必须不少于 1 个字" +msgstr "科目組名稱必須不少於 1 個字" #: AccountGroups.php:84 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" -"所选的父账户组看来会导致一个递归的账户结构-选择一个另外的父账户组或者将此账户" -"组作为一个最顶层的账户组" +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "所選的父帳戶組看來會導致一個遞迴的帳戶結構-選擇一個另外的父帳戶組或者將此帳戶組作為一個最頂層的帳戶組" #: AccountGroups.php:95 msgid "Could not check whether the group is recursive because" -msgstr "未能检查此组是否递归, 因为" +msgstr "未能檢查此組是否遞迴, 因為" #: AccountGroups.php:107 msgid "The section in accounts must be an integer" -msgstr "会计科目类别必须是整数" +msgstr "會計科目類別必須是整數" #: AccountGroups.php:113 msgid "The sequence in the trial balance must be an integer" -msgstr "试算表内行号必须是整数" +msgstr "試算表內行號必須是整數" #: AccountGroups.php:119 msgid "The sequence in the TB must be numeric and less than" -msgstr "试算表内顺序必须是数字且小于" +msgstr "試算表內順序必須是數位且小於" #: AccountGroups.php:136 msgid "An error occurred in updating the account group" -msgstr "更新科目组是发生了错误" +msgstr "更新科目組是發生了錯誤" #: AccountGroups.php:137 msgid "The SQL that was used to update the account group was" -msgstr "用于更新科目组失败的 SQL 是" +msgstr "用於更新科目組失敗的 SQL 是" -#: AccountGroups.php:139 AccountSections.php:106 PaymentMethods.php:91 +#: AccountGroups.php:139 +#: AccountSections.php:106 +#: PaymentMethods.php:91 msgid "Record Updated" -msgstr "记录已更新" +msgstr "記錄已更新" #: AccountGroups.php:157 msgid "An error occurred in inserting the account group" -msgstr "插入科目组时发生错误, 因为" +msgstr "插入科目組時發生錯誤, 因為" #: AccountGroups.php:158 msgid "The SQL that was used to insert the account group was" -msgstr "用作插入科目组失败的 SQL 是" +msgstr "用作插入科目組失敗的 SQL 是" -#: AccountGroups.php:159 AccountSections.php:118 PaymentMethods.php:113 +#: AccountGroups.php:159 +#: AccountSections.php:118 +#: PaymentMethods.php:113 msgid "Record inserted" -msgstr "记录已新增" +msgstr "記錄已新增" #: AccountGroups.php:176 msgid "An error occurred in retrieving the group information from chartmaster" -msgstr "从主表中查找组信息时发生错误" +msgstr "從主表中查找組資訊時發生錯誤" #: AccountGroups.php:181 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "不能删除,已创建了属于这个科目组的会计科目" +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "不能刪除,已創建了屬於這個科目組的會計科目" -#: AccountGroups.php:182 AccountGroups.php:192 AccountSections.php:139 -#: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 -#: Currencies.php:144 Currencies.php:152 Currencies.php:159 -#: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 -#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 -#: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 -#: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 -#: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 -#: PaymentMethods.php:146 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:119 SalesCategories.php:127 SalesCategories.php:135 -#: SalesPeople.php:144 SalesPeople.php:151 SalesTypes.php:147 -#: SalesTypes.php:157 Shippers.php:82 Shippers.php:94 StockCategories.php:182 -#: Stocks.php:471 Stocks.php:480 Stocks.php:488 Stocks.php:496 Stocks.php:504 -#: Stocks.php:512 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 -#: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 -#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 +#: AccountGroups.php:182 +#: AccountGroups.php:192 +#: AccountSections.php:139 +#: Areas.php:117 +#: Areas.php:126 +#: BankAccounts.php:163 +#: CreditStatus.php:126 +#: Currencies.php:144 +#: Currencies.php:152 +#: Currencies.php:159 +#: CustomerBranches.php:296 +#: CustomerBranches.php:306 +#: CustomerBranches.php:316 +#: CustomerBranches.php:326 +#: Customers.php:317 +#: Customers.php:326 +#: Customers.php:334 +#: Customers.php:342 +#: CustomerTypes.php:149 +#: CustomerTypes.php:159 +#: Factors.php:136 +#: FixedAssetCategories.php:132 +#: GLAccounts.php:95 +#: GLAccounts.php:109 +#: Locations.php:247 +#: Locations.php:255 +#: Locations.php:264 +#: Locations.php:272 +#: Locations.php:280 +#: Locations.php:288 +#: Locations.php:296 +#: Locations.php:304 +#: MRPDemandTypes.php:89 +#: PaymentMethods.php:146 +#: PaymentTerms.php:147 +#: PaymentTerms.php:154 +#: PcExpenses.php:119 +#: SalesCategories.php:127 +#: SalesCategories.php:135 +#: SalesPeople.php:144 +#: SalesPeople.php:151 +#: SalesTypes.php:147 +#: SalesTypes.php:157 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:182 +#: Stocks.php:471 +#: Stocks.php:480 +#: Stocks.php:488 +#: Stocks.php:496 +#: Stocks.php:504 +#: Stocks.php:512 +#: Suppliers.php:613 +#: Suppliers.php:622 +#: Suppliers.php:630 +#: SupplierTypes.php:147 +#: TaxCategories.php:133 +#: TaxGroups.php:128 +#: TaxGroups.php:135 +#: TaxProvinces.php:127 +#: UnitsOfMeasure.php:142 +#: UnitsOfMeasure.php:149 +#: WorkCentres.php:90 +#: WorkCentres.php:96 #: WWW_Access.php:87 msgid "There are" msgstr "存在" #: AccountGroups.php:182 msgid "general ledger accounts that refer to this account group" -msgstr "属于此科目组的会计科目" +msgstr "屬於此科目組的會計科目" #: AccountGroups.php:186 msgid "An error occurred in retrieving the parent group information" -msgstr "查找父组信息时发生错误" +msgstr "查找父組資訊時發生錯誤" #: AccountGroups.php:191 -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "删除会计科目组失败, 由于它是其他账户组的父账户组。" +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "刪除會計科目組失敗, 由於它是其他帳戶組的父帳戶組。" #: AccountGroups.php:192 msgid "account groups that have this group as its/there parent account group" -msgstr "账户组将此账户作为他的/他们的父账户组" +msgstr "帳戶組將此帳戶作為他的/他們的父帳戶組" #: AccountGroups.php:195 msgid "An error occurred in deleting the account group" -msgstr "删除账户组是发生错误" +msgstr "刪除帳戶組是發生錯誤" #: AccountGroups.php:196 msgid "The SQL that was used to delete the account group was" -msgstr "用于账户组的 SQL 是" +msgstr "用於帳戶組的 SQL 是" #: AccountGroups.php:198 msgid "group has been deleted" -msgstr "科目组已删除" +msgstr "科目組已刪除" #: AccountGroups.php:223 msgid "The sql that was used to retrieve the account group information was " -msgstr "用于查询账户组信息的SQL是 " +msgstr "用於查詢帳戶組資訊的SQL是 " #: AccountGroups.php:224 msgid "Could not get account groups because" -msgstr "不能取得科目组, 由于" +msgstr "不能取得科目組, 由於" -#: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:97 -#: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 -#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 -#: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:257 -#: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 -#: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 -#: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:106 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:238 -#: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:374 -#: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 -#: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 -#: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 -#: PcAssignCashToTab.php:165 PDFPickingList.php:30 PDFPrintLabel.php:132 -#: PDFStockLocTransfer.php:21 PO_AuthorisationLevels.php:12 POReport.php:61 -#: POReport.php:65 POReport.php:69 PO_SelectOSPurchOrder.php:136 -#: PricesBasedOnMarkUp.php:11 Prices_Customer.php:45 Prices.php:32 -#: PurchData.php:141 PurchData.php:256 PurchData.php:275 -#: RecurringSalesOrders.php:311 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 -#: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 -#: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 -#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 -#: SelectCreditItems.php:272 SelectCustomer.php:322 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 -#: SelectOrderItems.php:1555 SelectProduct.php:456 SelectSalesOrder.php:155 -#: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 -#: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 -#: StockLocMovements.php:15 StockLocStatus.php:27 Suppliers.php:306 -#: SupplierTenders.php:261 SupplierTenders.php:318 SupplierTransInquiry.php:11 -#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 -#: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:38 Z_BottomUpCosts.php:51 +#: AccountGroups.php:226 +#: AccountSections.php:177 +#: AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 +#: AddCustomerNotes.php:97 +#: AddCustomerTypeNotes.php:94 +#: AgedDebtors.php:468 +#: AgedSuppliers.php:277 +#: Areas.php:145 +#: AuditTrail.php:13 +#: BOMExtendedQty.php:286 +#: BOMIndented.php:262 +#: BOMIndentedReverse.php:257 +#: BOMInquiry.php:165 +#: BOMListing.php:128 +#: BOMs.php:214 +#: BOMs.php:793 +#: COGSGLPostings.php:20 +#: CompanyPreferences.php:158 +#: CounterSales.php:1940 +#: CounterSales.php:2062 +#: Credit_Invoice.php:257 +#: CreditStatus.php:21 +#: Currencies.php:29 +#: CustEDISetup.php:19 +#: DailyBankTransactions.php:9 +#: DebtorsAtPeriodEnd.php:138 +#: DiscountCategories.php:12 +#: DiscountCategories.php:122 +#: DiscountMatrix.php:18 +#: EDIMessageFormat.php:106 +#: FixedAssetList.php:8 +#: FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 +#: FixedAssetRegister.php:232 +#: FixedAssetTransfer.php:31 +#: FormDesigner.php:132 +#: GLBalanceSheet.php:351 +#: GLBudgets.php:30 +#: GLJournal.php:243 +#: InventoryPlanning.php:369 +#: InventoryPlanningPrefSupplier.php:474 +#: Labels.php:117 +#: Labels.php:273 +#: MRPReport.php:536 +#: OutstandingGRNs.php:174 +#: PcAssignCashToTab.php:39 +#: PcAssignCashToTab.php:113 +#: PcAssignCashToTab.php:129 +#: PcAssignCashToTab.php:165 +#: PDFPickingList.php:30 +#: PDFPrintLabel.php:132 +#: PDFStockLocTransfer.php:21 +#: PO_AuthorisationLevels.php:12 +#: POReport.php:61 +#: POReport.php:65 +#: POReport.php:69 +#: PO_SelectOSPurchOrder.php:136 +#: PricesBasedOnMarkUp.php:11 +#: Prices_Customer.php:45 +#: Prices.php:32 +#: PurchData.php:141 +#: PurchData.php:231 +#: PurchData.php:250 +#: RecurringSalesOrders.php:307 +#: SalesAnalReptCols.php:51 +#: SalesAnalRepts.php:13 +#: SalesCategories.php:13 +#: SalesGLPostings.php:18 +#: SalesGraph.php:34 +#: SalesPeople.php:22 +#: SalesTypes.php:22 +#: SelectAsset.php:44 +#: SelectCompletedOrder.php:13 +#: SelectContract.php:81 +#: SelectCreditItems.php:204 +#: SelectCreditItems.php:272 +#: SelectCustomer.php:315 +#: SelectGLAccount.php:19 +#: SelectGLAccount.php:79 +#: SelectOrderItems.php:605 +#: SelectOrderItems.php:1436 +#: SelectOrderItems.php:1556 +#: SelectProduct.php:456 +#: SelectSalesOrder.php:155 +#: SelectSupplier.php:9 +#: SelectSupplier.php:198 +#: SelectWorkOrder.php:11 +#: SelectWorkOrder.php:147 +#: ShipmentCosting.php:13 +#: Shipments.php:18 +#: Shippers.php:123 +#: Shippers.php:159 +#: Shipt_Select.php:10 +#: StockLocMovements.php:15 +#: StockLocStatus.php:27 +#: Suppliers.php:306 +#: SupplierTenders.php:261 +#: SupplierTenders.php:318 +#: SupplierTransInquiry.php:11 +#: TaxGroups.php:16 +#: TaxProvinces.php:12 +#: TopItems.php:60 +#: WhereUsedInquiry.php:18 +#: WorkCentres.php:111 +#: WorkCentres.php:158 +#: WorkOrderCosting.php:14 +#: WorkOrderEntry.php:12 +#: WorkOrderIssue.php:22 +#: WorkOrderReceive.php:15 +#: WorkOrderStatus.php:43 +#: WWW_Access.php:13 +#: WWW_Users.php:38 +#: Z_BottomUpCosts.php:51 msgid "Search" msgstr "查找" #: AccountGroups.php:230 msgid "Group Name" -msgstr "科目组名称" +msgstr "科目組名稱" -#: AccountGroups.php:231 EDIMessageFormat.php:131 +#: AccountGroups.php:231 +#: EDIMessageFormat.php:131 msgid "Section" -msgstr "会计要素" +msgstr "會計要素" -#: AccountGroups.php:232 AccountGroups.php:396 +#: AccountGroups.php:232 +#: AccountGroups.php:396 msgid "Sequence In TB" -msgstr "试算表行次" +msgstr "試算表行次" -#: AccountGroups.php:233 AccountGroups.php:380 GLProfit_Loss.php:8 -#: GLProfit_Loss.php:105 GLProfit_Loss.php:106 GLProfit_Loss.php:157 -#: SelectGLAccount.php:45 SelectGLAccount.php:59 +#: AccountGroups.php:233 +#: AccountGroups.php:380 +#: GLProfit_Loss.php:8 +#: GLProfit_Loss.php:105 +#: GLProfit_Loss.php:106 +#: GLProfit_Loss.php:157 +#: SelectGLAccount.php:45 +#: SelectGLAccount.php:59 msgid "Profit and Loss" -msgstr "损益类" +msgstr "損益類" -#: AccountGroups.php:234 AccountGroups.php:341 +#: AccountGroups.php:234 +#: AccountGroups.php:341 msgid "Parent Group" -msgstr "父组" +msgstr "父組" -#: AccountGroups.php:250 AccountGroups.php:253 AccountGroups.php:384 -#: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 -#: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 -#: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:451 CompanyPreferences.php:453 -#: CompanyPreferences.php:463 CompanyPreferences.php:465 -#: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 -#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 -#: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: Locations.php:373 MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 -#: MRP.php:542 PaymentMethods.php:203 PaymentMethods.php:204 -#: PaymentMethods.php:264 PaymentMethods.php:270 PDFChequeListing.php:63 -#: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 -#: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:758 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 -#: PurchData.php:192 PurchData.php:494 PurchData.php:497 -#: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 -#: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 -#: SalesAnalReptCols.php:404 SalesAnalRepts.php:406 SalesAnalRepts.php:409 -#: SalesAnalRepts.php:432 SalesAnalRepts.php:435 SalesAnalRepts.php:458 -#: SalesAnalRepts.php:461 SelectProduct.php:351 ShipmentCosting.php:622 -#: Stocks.php:871 Stocks.php:873 Stocks.php:891 Stocks.php:893 -#: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:376 SystemParameters.php:399 SystemParameters.php:415 -#: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:598 SystemParameters.php:606 -#: SystemParameters.php:624 SystemParameters.php:631 SystemParameters.php:756 -#: SystemParameters.php:887 SystemParameters.php:889 SystemParameters.php:899 -#: SystemParameters.php:901 SystemParameters.php:955 SystemParameters.php:967 -#: SystemParameters.php:969 TaxGroups.php:292 TaxGroups.php:295 -#: TaxGroups.php:344 WWW_Users.php:610 WWW_Users.php:612 +#: AccountGroups.php:250 +#: AccountGroups.php:253 +#: AccountGroups.php:384 +#: AccountGroups.php:386 +#: BankAccounts.php:217 +#: BankAccounts.php:361 +#: BankAccounts.php:363 +#: BankAccounts.php:367 +#: BOMs.php:128 +#: BOMs.php:713 +#: BOMs.php:715 +#: CompanyPreferences.php:439 +#: CompanyPreferences.php:441 +#: CompanyPreferences.php:451 +#: CompanyPreferences.php:453 +#: CompanyPreferences.php:463 +#: CompanyPreferences.php:465 +#: ContractCosting.php:174 +#: CustLoginSetup.php:590 +#: CustLoginSetup.php:592 +#: CustomerBranches.php:420 +#: Customers.php:600 +#: Customers.php:857 +#: Customers.php:864 +#: Customers.php:867 +#: DeliveryDetails.php:1034 +#: DeliveryDetails.php:1074 +#: DeliveryDetails.php:1077 +#: GLTransInquiry.php:73 +#: Locations.php:373 +#: MRPCalendar.php:222 +#: MRP.php:530 +#: MRP.php:534 +#: MRP.php:538 +#: MRP.php:542 +#: PaymentMethods.php:203 +#: PaymentMethods.php:204 +#: PaymentMethods.php:264 +#: PaymentMethods.php:270 +#: PDFChequeListing.php:63 +#: PDFDeliveryDifferences.php:64 +#: PDFDIFOT.php:67 +#: PO_AuthorisationLevels.php:132 +#: PO_AuthorisationLevels.php:137 +#: PO_Header.php:758 +#: PO_PDFPurchOrder.php:367 +#: PO_PDFPurchOrder.php:370 +#: PurchData.php:189 +#: PurchData.php:469 +#: PurchData.php:472 +#: RecurringSalesOrders.php:479 +#: RecurringSalesOrders.php:482 +#: SalesAnalReptCols.php:279 +#: SalesAnalReptCols.php:401 +#: SalesAnalReptCols.php:404 +#: SalesAnalRepts.php:406 +#: SalesAnalRepts.php:409 +#: SalesAnalRepts.php:432 +#: SalesAnalRepts.php:435 +#: SalesAnalRepts.php:458 +#: SalesAnalRepts.php:461 +#: SelectProduct.php:351 +#: ShipmentCosting.php:622 +#: Stocks.php:867 +#: Stocks.php:869 +#: Stocks.php:887 +#: Stocks.php:889 +#: SuppContractChgs.php:83 +#: SuppLoginSetup.php:511 +#: SuppLoginSetup.php:513 +#: SystemParameters.php:373 +#: SystemParameters.php:405 +#: SystemParameters.php:450 +#: SystemParameters.php:468 +#: SystemParameters.php:476 +#: SystemParameters.php:516 +#: SystemParameters.php:589 +#: SystemParameters.php:597 +#: SystemParameters.php:615 +#: SystemParameters.php:622 +#: SystemParameters.php:746 +#: SystemParameters.php:877 +#: SystemParameters.php:879 +#: SystemParameters.php:889 +#: SystemParameters.php:891 +#: SystemParameters.php:945 +#: SystemParameters.php:957 +#: SystemParameters.php:959 +#: TaxGroups.php:292 +#: TaxGroups.php:295 +#: TaxGroups.php:344 +#: WWW_Users.php:610 +#: WWW_Users.php:612 msgid "Yes" msgstr "是" -#: AccountGroups.php:256 AccountGroups.php:389 AccountGroups.php:391 -#: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 -#: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 -#: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:450 CompanyPreferences.php:454 -#: CompanyPreferences.php:462 CompanyPreferences.php:466 -#: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 -#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 -#: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 -#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 -#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 -#: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 -#: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:757 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 -#: PurchData.php:195 PurchData.php:495 PurchData.php:498 -#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 -#: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 -#: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 -#: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 -#: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:866 Stocks.php:868 Stocks.php:886 Stocks.php:888 -#: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:377 SystemParameters.php:400 SystemParameters.php:416 -#: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:599 SystemParameters.php:607 -#: SystemParameters.php:625 SystemParameters.php:632 SystemParameters.php:757 -#: SystemParameters.php:886 SystemParameters.php:890 SystemParameters.php:898 -#: SystemParameters.php:902 SystemParameters.php:956 SystemParameters.php:966 -#: SystemParameters.php:970 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:346 WWW_Users.php:609 WWW_Users.php:613 -#: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 +#: AccountGroups.php:256 +#: AccountGroups.php:389 +#: AccountGroups.php:391 +#: BankAccounts.php:215 +#: BankAccounts.php:361 +#: BankAccounts.php:363 +#: BankAccounts.php:367 +#: BOMs.php:130 +#: BOMs.php:712 +#: BOMs.php:716 +#: CompanyPreferences.php:438 +#: CompanyPreferences.php:442 +#: Comp... [truncated message content] |
From: <dai...@us...> - 2011-02-25 21:04:09
|
Revision: 4497 http://web-erp.svn.sourceforge.net/web-erp/?rev=4497&view=rev Author: daintree Date: 2011-02-25 21:03:52 +0000 (Fri, 25 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/MRPPlannedPurchaseOrders.php trunk/includes/SQL_CommonFunctions.inc trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_CN.utf8/Manual/ManualIntroduction.html trunk/locale/zh_CN.utf8/Manual/ManualRequirements.html trunk/locale/zh_CN.utf8/Manual/ManualSecuritySchema.html Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2011-02-23 09:12:32 UTC (rev 4496) +++ trunk/MRPPlannedPurchaseOrders.php 2011-02-25 21:03:52 UTC (rev 4497) @@ -3,16 +3,19 @@ /* $Id$*/ // MRPPlannedPurchaseOrders.php - Report of purchase parts that MRP has determined should have // purchase orders created for them -//$PageSecurity = 2; + include('includes/session.inc'); -$sql='show tables where Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; + +//maybe not ansi sql ?? +$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; + $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { - $title='MRP error'; + $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The MRP calculation must be run before you can run this report').'<br>'. - _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php?' . SID .'>'._('here').'</a>', 'error'); + _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php>'._('here').'</a>', 'error'); include('includes/footer.inc'); exit; } @@ -111,9 +114,9 @@ $title = _('MRP Planned Purchase Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php?">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-02-23 09:12:32 UTC (rev 4496) +++ trunk/includes/SQL_CommonFunctions.inc 2011-02-25 21:03:52 UTC (rev 4497) @@ -18,7 +18,7 @@ DB_query('LOCK TABLES systypes WRITE',$db); - $SQL = "SELECT typeno FROM systypes WHERE typeid = '" . $TransType . "'"; + $SQL = 'SELECT typeno FROM systypes WHERE typeid = ' . $TransType; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': <BR>' . _('The next transaction number could not be retrieved from the database because'); $DbgMsg = _('The following SQL to retrieve the transaction number was used'); @@ -26,7 +26,7 @@ $myrow = DB_fetch_row($GetTransNoResult); - $SQL = "UPDATE systypes SET typeno = '" . ($myrow[0] + 1) . "' WHERE typeid = '" . $TransType . "'"; + $SQL = 'UPDATE systypes SET typeno = ' . ($myrow[0] + 1) . ' WHERE typeid = ' . $TransType; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The transaction number could not be incremented'); $DbgMsg = _('The following SQL to increment the transaction number was used'); $UpdTransNoResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg); @@ -114,13 +114,13 @@ Function GetCreditAvailable($DebtorNo,&$db) { $sql = "SELECT debtorsmaster.debtorno, - debtorsmaster.creditlimit, - SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance - FROM debtorsmaster INNER JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtorsmaster.debtorno='" . $DebtorNo . "' - GROUP BY debtorsmaster.debtorno, - debtorsmaster.creditlimit"; + debtorsmaster.creditlimit, + SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance + FROM debtorsmaster INNER JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtorsmaster.debtorno='" . $DebtorNo . "' + GROUP BY debtorsmaster.debtorno, + debtorsmaster.creditlimit"; $ErrMsg = _('The current account balance of the customer could not be retrieved because'); $GetAccountBalanceResult = DB_query($sql, $db, $ErrMsg); @@ -131,8 +131,8 @@ $CreditAvailable = $myrow['creditlimit'] - $myrow['balance']; } else { $sql = "SELECT creditlimit - FROM debtorsmaster - WHERE debtorno='" . $DebtorNo . "'"; + FROM debtorsmaster + WHERE debtorno='" . $DebtorNo . "'"; $GetAccountBalanceResult = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($GetAccountBalanceResult); $CreditAvailable = $myrow['creditlimit']; @@ -162,7 +162,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $QOH!=0){ $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod($_SESSION['DefaultDateFormat'], $db); + $PeriodNo = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); $StockGLCode = GetStockGLCode($StockID,$db); $ValueOfChange = $QOH * ($NewCost - $OldCost); @@ -237,7 +237,7 @@ while ($MyRow=DB_fetch_array($result)){ $NewParent = $MyRow['parent']; $MaterialCost = BomMaterialCost($NewParent, $db); - $SQL = "UPDATE stockmaster SET materialcost='" . $MaterialCost . "' WHERE stockid='" . $NewParent . "'"; + $SQL = 'UPDATE stockmaster SET materialcost=' . $MaterialCost . " WHERE stockid='" . $NewParent . "'"; $result1 = DB_query($SQL,$db); if (DB_error_no($db)!=0) { return 1; Modified: trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po 2011-02-23 09:12:32 UTC (rev 4496) +++ trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po 2011-02-25 21:03:52 UTC (rev 4497) @@ -1,4 +1,4 @@ -# weberp 简体中文界面文件 +# weberp 簡體中文介面檔 # Copyright (C) 2007 Logic Works Ltd # This file is distributed under the same license as the webERP package. # FIRST AUTHOR <rom...@gm...>, 2006. @@ -7,472 +7,851 @@ msgstr "" "Project-Id-Version: WEBERP3.05 VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-15 18:44+1200\n" -"PO-Revision-Date: 2011-01-29 15:12+0000\n" -"Last-Translator: Exson qu <hex...@gm...>\n" -"Language-Team: WebERP Translation Team <web-erp-translation@lists." -"sourceforge.net>\n" +"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"PO-Revision-Date: 2011-02-25 18:22+0800\n" +"Last-Translator: Exson qu <hex...@ya...>\n" +"Language-Team: WebERP Translation Team <web...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2011-01-29 15:16+0000\n" "X-Generator: Launchpad (build 12274)\n" "X-Poedit-Country: CHINA\n" +"X-Poedit-Basepath: C:\\改過自新\\\n" "X-Poedit-SearchPath-0: webERPRC4\n" -"X-Poedit-Basepath: C:\\改过自新\\\n" -#: AccountGroups.php:9 index.php:1268 +#: AccountGroups.php:9 +#: index.php:1273 msgid "Account Groups" -msgstr "科目组" +msgstr "科目組" #: AccountGroups.php:19 -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "在递归检查中查询父账户组中的科目组发生错误" +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "在遞迴檢查中查詢父帳戶組中的科目組發生錯誤" #: AccountGroups.php:20 -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "用于查询父账户组的科目组失败的SQL是" +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "用於查詢父帳戶組的科目組失敗的SQL是" -#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:177 +#: AccountGroups.php:57 +#: AccountGroups.php:94 +#: AccountGroups.php:177 #: AccountGroups.php:187 msgid "The SQL that was used to retrieve the information was" -msgstr "用于查找交易数据的SQL是" +msgstr "用於查找交易資料的SQL是" #: AccountGroups.php:58 msgid "Could not check whether the group exists because" -msgstr "未能判定组别是否存在, 因为" +msgstr "未能判定組別是否存在, 因為" #: AccountGroups.php:65 msgid "The account group name already exists in the database" -msgstr "科目组名称已经存在在数据库中。" +msgstr "科目組名稱已經存在在資料庫中。" #: AccountGroups.php:71 msgid "The account group name cannot contain the character" -msgstr "科目组名称不能包含这个字符" +msgstr "科目組名稱不能包含這個字元" -#: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 +#: AccountGroups.php:71 +#: AccountSections.php:75 +#: PaymentMethods.php:41 +#: TaxCategories.php:33 +#: TaxProvinces.php:32 +#: UnitsOfMeasure.php:32 msgid "or the character" -msgstr "或这个字符" +msgstr "或這個字元" #: AccountGroups.php:77 msgid "The account group name must be at least one character long" -msgstr "科目组名称必须不少于 1 个字" +msgstr "科目組名稱必須不少於 1 個字" #: AccountGroups.php:84 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" -"所选的父账户组看来会导致一个递归的账户结构-选择一个另外的父账户组或者将此账户" -"组作为一个最顶层的账户组" +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "所選的父帳戶組看來會導致一個遞迴的帳戶結構-選擇一個另外的父帳戶組或者將此帳戶組作為一個最頂層的帳戶組" #: AccountGroups.php:95 msgid "Could not check whether the group is recursive because" -msgstr "未能检查此组是否递归, 因为" +msgstr "未能檢查此組是否遞迴, 因為" #: AccountGroups.php:107 msgid "The section in accounts must be an integer" -msgstr "会计科目类别必须是整数" +msgstr "會計科目類別必須是整數" #: AccountGroups.php:113 msgid "The sequence in the trial balance must be an integer" -msgstr "试算表内行号必须是整数" +msgstr "試算表內行號必須是整數" #: AccountGroups.php:119 msgid "The sequence in the TB must be numeric and less than" -msgstr "试算表内顺序必须是数字且小于" +msgstr "試算表內順序必須是數位且小於" #: AccountGroups.php:136 msgid "An error occurred in updating the account group" -msgstr "更新科目组是发生了错误" +msgstr "更新科目組是發生了錯誤" #: AccountGroups.php:137 msgid "The SQL that was used to update the account group was" -msgstr "用于更新科目组失败的 SQL 是" +msgstr "用於更新科目組失敗的 SQL 是" -#: AccountGroups.php:139 AccountSections.php:106 PaymentMethods.php:91 +#: AccountGroups.php:139 +#: AccountSections.php:106 +#: PaymentMethods.php:91 msgid "Record Updated" -msgstr "记录已更新" +msgstr "記錄已更新" #: AccountGroups.php:157 msgid "An error occurred in inserting the account group" -msgstr "插入科目组时发生错误, 因为" +msgstr "插入科目組時發生錯誤, 因為" #: AccountGroups.php:158 msgid "The SQL that was used to insert the account group was" -msgstr "用作插入科目组失败的 SQL 是" +msgstr "用作插入科目組失敗的 SQL 是" -#: AccountGroups.php:159 AccountSections.php:118 PaymentMethods.php:113 +#: AccountGroups.php:159 +#: AccountSections.php:118 +#: PaymentMethods.php:113 msgid "Record inserted" -msgstr "记录已新增" +msgstr "記錄已新增" #: AccountGroups.php:176 msgid "An error occurred in retrieving the group information from chartmaster" -msgstr "从主表中查找组信息时发生错误" +msgstr "從主表中查找組資訊時發生錯誤" #: AccountGroups.php:181 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "不能删除,已创建了属于这个科目组的会计科目" +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "不能刪除,已創建了屬於這個科目組的會計科目" -#: AccountGroups.php:182 AccountGroups.php:192 AccountSections.php:139 -#: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 -#: Currencies.php:144 Currencies.php:152 Currencies.php:159 -#: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 -#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 -#: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 -#: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 -#: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 -#: PaymentMethods.php:146 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:119 SalesCategories.php:127 SalesCategories.php:135 -#: SalesPeople.php:144 SalesPeople.php:151 SalesTypes.php:147 -#: SalesTypes.php:157 Shippers.php:82 Shippers.php:94 StockCategories.php:182 -#: Stocks.php:471 Stocks.php:480 Stocks.php:488 Stocks.php:496 Stocks.php:504 -#: Stocks.php:512 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 -#: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 -#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 +#: AccountGroups.php:182 +#: AccountGroups.php:192 +#: AccountSections.php:139 +#: Areas.php:117 +#: Areas.php:126 +#: BankAccounts.php:163 +#: CreditStatus.php:126 +#: Currencies.php:144 +#: Currencies.php:152 +#: Currencies.php:159 +#: CustomerBranches.php:296 +#: CustomerBranches.php:306 +#: CustomerBranches.php:316 +#: CustomerBranches.php:326 +#: Customers.php:317 +#: Customers.php:326 +#: Customers.php:334 +#: Customers.php:342 +#: CustomerTypes.php:149 +#: CustomerTypes.php:159 +#: Factors.php:136 +#: FixedAssetCategories.php:132 +#: GLAccounts.php:95 +#: GLAccounts.php:109 +#: Locations.php:247 +#: Locations.php:255 +#: Locations.php:264 +#: Locations.php:272 +#: Locations.php:280 +#: Locations.php:288 +#: Locations.php:296 +#: Locations.php:304 +#: MRPDemandTypes.php:89 +#: PaymentMethods.php:146 +#: PaymentTerms.php:147 +#: PaymentTerms.php:154 +#: PcExpenses.php:119 +#: SalesCategories.php:127 +#: SalesCategories.php:135 +#: SalesPeople.php:144 +#: SalesPeople.php:151 +#: SalesTypes.php:147 +#: SalesTypes.php:157 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:182 +#: Stocks.php:471 +#: Stocks.php:480 +#: Stocks.php:488 +#: Stocks.php:496 +#: Stocks.php:504 +#: Stocks.php:512 +#: Suppliers.php:613 +#: Suppliers.php:622 +#: Suppliers.php:630 +#: SupplierTypes.php:147 +#: TaxCategories.php:133 +#: TaxGroups.php:128 +#: TaxGroups.php:135 +#: TaxProvinces.php:127 +#: UnitsOfMeasure.php:142 +#: UnitsOfMeasure.php:149 +#: WorkCentres.php:90 +#: WorkCentres.php:96 #: WWW_Access.php:87 msgid "There are" msgstr "存在" #: AccountGroups.php:182 msgid "general ledger accounts that refer to this account group" -msgstr "属于此科目组的会计科目" +msgstr "屬於此科目組的會計科目" #: AccountGroups.php:186 msgid "An error occurred in retrieving the parent group information" -msgstr "查找父组信息时发生错误" +msgstr "查找父組資訊時發生錯誤" #: AccountGroups.php:191 -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "删除会计科目组失败, 由于它是其他账户组的父账户组。" +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "刪除會計科目組失敗, 由於它是其他帳戶組的父帳戶組。" #: AccountGroups.php:192 msgid "account groups that have this group as its/there parent account group" -msgstr "账户组将此账户作为他的/他们的父账户组" +msgstr "帳戶組將此帳戶作為他的/他們的父帳戶組" #: AccountGroups.php:195 msgid "An error occurred in deleting the account group" -msgstr "删除账户组是发生错误" +msgstr "刪除帳戶組是發生錯誤" #: AccountGroups.php:196 msgid "The SQL that was used to delete the account group was" -msgstr "用于账户组的 SQL 是" +msgstr "用於帳戶組的 SQL 是" #: AccountGroups.php:198 msgid "group has been deleted" -msgstr "科目组已删除" +msgstr "科目組已刪除" #: AccountGroups.php:223 msgid "The sql that was used to retrieve the account group information was " -msgstr "用于查询账户组信息的SQL是 " +msgstr "用於查詢帳戶組資訊的SQL是 " #: AccountGroups.php:224 msgid "Could not get account groups because" -msgstr "不能取得科目组, 由于" +msgstr "不能取得科目組, 由於" -#: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:97 -#: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 -#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 -#: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:257 -#: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 -#: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 -#: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:106 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:238 -#: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:374 -#: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 -#: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 -#: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 -#: PcAssignCashToTab.php:165 PDFPickingList.php:30 PDFPrintLabel.php:132 -#: PDFStockLocTransfer.php:21 PO_AuthorisationLevels.php:12 POReport.php:61 -#: POReport.php:65 POReport.php:69 PO_SelectOSPurchOrder.php:136 -#: PricesBasedOnMarkUp.php:11 Prices_Customer.php:45 Prices.php:32 -#: PurchData.php:141 PurchData.php:256 PurchData.php:275 -#: RecurringSalesOrders.php:311 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 -#: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 -#: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 -#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 -#: SelectCreditItems.php:272 SelectCustomer.php:322 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 -#: SelectOrderItems.php:1555 SelectProduct.php:456 SelectSalesOrder.php:155 -#: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 -#: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 -#: StockLocMovements.php:15 StockLocStatus.php:27 Suppliers.php:306 -#: SupplierTenders.php:261 SupplierTenders.php:318 SupplierTransInquiry.php:11 -#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 -#: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:38 Z_BottomUpCosts.php:51 +#: AccountGroups.php:226 +#: AccountSections.php:177 +#: AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 +#: AddCustomerNotes.php:97 +#: AddCustomerTypeNotes.php:94 +#: AgedDebtors.php:468 +#: AgedSuppliers.php:277 +#: Areas.php:145 +#: AuditTrail.php:13 +#: BOMExtendedQty.php:286 +#: BOMIndented.php:262 +#: BOMIndentedReverse.php:257 +#: BOMInquiry.php:165 +#: BOMListing.php:128 +#: BOMs.php:214 +#: BOMs.php:793 +#: COGSGLPostings.php:20 +#: CompanyPreferences.php:158 +#: CounterSales.php:1940 +#: CounterSales.php:2062 +#: Credit_Invoice.php:257 +#: CreditStatus.php:21 +#: Currencies.php:29 +#: CustEDISetup.php:19 +#: DailyBankTransactions.php:9 +#: DebtorsAtPeriodEnd.php:138 +#: DiscountCategories.php:12 +#: DiscountCategories.php:122 +#: DiscountMatrix.php:18 +#: EDIMessageFormat.php:106 +#: FixedAssetList.php:8 +#: FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 +#: FixedAssetRegister.php:232 +#: FixedAssetTransfer.php:31 +#: FormDesigner.php:132 +#: GLBalanceSheet.php:351 +#: GLBudgets.php:30 +#: GLJournal.php:243 +#: InventoryPlanning.php:369 +#: InventoryPlanningPrefSupplier.php:474 +#: Labels.php:117 +#: Labels.php:273 +#: MRPReport.php:536 +#: OutstandingGRNs.php:174 +#: PcAssignCashToTab.php:39 +#: PcAssignCashToTab.php:113 +#: PcAssignCashToTab.php:129 +#: PcAssignCashToTab.php:165 +#: PDFPickingList.php:30 +#: PDFPrintLabel.php:132 +#: PDFStockLocTransfer.php:21 +#: PO_AuthorisationLevels.php:12 +#: POReport.php:61 +#: POReport.php:65 +#: POReport.php:69 +#: PO_SelectOSPurchOrder.php:136 +#: PricesBasedOnMarkUp.php:11 +#: Prices_Customer.php:45 +#: Prices.php:32 +#: PurchData.php:141 +#: PurchData.php:231 +#: PurchData.php:250 +#: RecurringSalesOrders.php:307 +#: SalesAnalReptCols.php:51 +#: SalesAnalRepts.php:13 +#: SalesCategories.php:13 +#: SalesGLPostings.php:18 +#: SalesGraph.php:34 +#: SalesPeople.php:22 +#: SalesTypes.php:22 +#: SelectAsset.php:44 +#: SelectCompletedOrder.php:13 +#: SelectContract.php:81 +#: SelectCreditItems.php:204 +#: SelectCreditItems.php:272 +#: SelectCustomer.php:315 +#: SelectGLAccount.php:19 +#: SelectGLAccount.php:79 +#: SelectOrderItems.php:605 +#: SelectOrderItems.php:1436 +#: SelectOrderItems.php:1556 +#: SelectProduct.php:456 +#: SelectSalesOrder.php:155 +#: SelectSupplier.php:9 +#: SelectSupplier.php:198 +#: SelectWorkOrder.php:11 +#: SelectWorkOrder.php:147 +#: ShipmentCosting.php:13 +#: Shipments.php:18 +#: Shippers.php:123 +#: Shippers.php:159 +#: Shipt_Select.php:10 +#: StockLocMovements.php:15 +#: StockLocStatus.php:27 +#: Suppliers.php:306 +#: SupplierTenders.php:261 +#: SupplierTenders.php:318 +#: SupplierTransInquiry.php:11 +#: TaxGroups.php:16 +#: TaxProvinces.php:12 +#: TopItems.php:60 +#: WhereUsedInquiry.php:18 +#: WorkCentres.php:111 +#: WorkCentres.php:158 +#: WorkOrderCosting.php:14 +#: WorkOrderEntry.php:12 +#: WorkOrderIssue.php:22 +#: WorkOrderReceive.php:15 +#: WorkOrderStatus.php:43 +#: WWW_Access.php:13 +#: WWW_Users.php:38 +#: Z_BottomUpCosts.php:51 msgid "Search" msgstr "查找" #: AccountGroups.php:230 msgid "Group Name" -msgstr "科目组名称" +msgstr "科目組名稱" -#: AccountGroups.php:231 EDIMessageFormat.php:131 +#: AccountGroups.php:231 +#: EDIMessageFormat.php:131 msgid "Section" -msgstr "会计要素" +msgstr "會計要素" -#: AccountGroups.php:232 AccountGroups.php:396 +#: AccountGroups.php:232 +#: AccountGroups.php:396 msgid "Sequence In TB" -msgstr "试算表行次" +msgstr "試算表行次" -#: AccountGroups.php:233 AccountGroups.php:380 GLProfit_Loss.php:8 -#: GLProfit_Loss.php:105 GLProfit_Loss.php:106 GLProfit_Loss.php:157 -#: SelectGLAccount.php:45 SelectGLAccount.php:59 +#: AccountGroups.php:233 +#: AccountGroups.php:380 +#: GLProfit_Loss.php:8 +#: GLProfit_Loss.php:105 +#: GLProfit_Loss.php:106 +#: GLProfit_Loss.php:157 +#: SelectGLAccount.php:45 +#: SelectGLAccount.php:59 msgid "Profit and Loss" -msgstr "损益类" +msgstr "損益類" -#: AccountGroups.php:234 AccountGroups.php:341 +#: AccountGroups.php:234 +#: AccountGroups.php:341 msgid "Parent Group" -msgstr "父组" +msgstr "父組" -#: AccountGroups.php:250 AccountGroups.php:253 AccountGroups.php:384 -#: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 -#: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 -#: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:451 CompanyPreferences.php:453 -#: CompanyPreferences.php:463 CompanyPreferences.php:465 -#: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 -#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 -#: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: Locations.php:373 MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 -#: MRP.php:542 PaymentMethods.php:203 PaymentMethods.php:204 -#: PaymentMethods.php:264 PaymentMethods.php:270 PDFChequeListing.php:63 -#: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 -#: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:758 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 -#: PurchData.php:192 PurchData.php:494 PurchData.php:497 -#: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 -#: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 -#: SalesAnalReptCols.php:404 SalesAnalRepts.php:406 SalesAnalRepts.php:409 -#: SalesAnalRepts.php:432 SalesAnalRepts.php:435 SalesAnalRepts.php:458 -#: SalesAnalRepts.php:461 SelectProduct.php:351 ShipmentCosting.php:622 -#: Stocks.php:871 Stocks.php:873 Stocks.php:891 Stocks.php:893 -#: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:376 SystemParameters.php:399 SystemParameters.php:415 -#: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:598 SystemParameters.php:606 -#: SystemParameters.php:624 SystemParameters.php:631 SystemParameters.php:756 -#: SystemParameters.php:887 SystemParameters.php:889 SystemParameters.php:899 -#: SystemParameters.php:901 SystemParameters.php:955 SystemParameters.php:967 -#: SystemParameters.php:969 TaxGroups.php:292 TaxGroups.php:295 -#: TaxGroups.php:344 WWW_Users.php:610 WWW_Users.php:612 +#: AccountGroups.php:250 +#: AccountGroups.php:253 +#: AccountGroups.php:384 +#: AccountGroups.php:386 +#: BankAccounts.php:217 +#: BankAccounts.php:361 +#: BankAccounts.php:363 +#: BankAccounts.php:367 +#: BOMs.php:128 +#: BOMs.php:713 +#: BOMs.php:715 +#: CompanyPreferences.php:439 +#: CompanyPreferences.php:441 +#: CompanyPreferences.php:451 +#: CompanyPreferences.php:453 +#: CompanyPreferences.php:463 +#: CompanyPreferences.php:465 +#: ContractCosting.php:174 +#: CustLoginSetup.php:590 +#: CustLoginSetup.php:592 +#: CustomerBranches.php:420 +#: Customers.php:600 +#: Customers.php:857 +#: Customers.php:864 +#: Customers.php:867 +#: DeliveryDetails.php:1034 +#: DeliveryDetails.php:1074 +#: DeliveryDetails.php:1077 +#: GLTransInquiry.php:73 +#: Locations.php:373 +#: MRPCalendar.php:222 +#: MRP.php:530 +#: MRP.php:534 +#: MRP.php:538 +#: MRP.php:542 +#: PaymentMethods.php:203 +#: PaymentMethods.php:204 +#: PaymentMethods.php:264 +#: PaymentMethods.php:270 +#: PDFChequeListing.php:63 +#: PDFDeliveryDifferences.php:64 +#: PDFDIFOT.php:67 +#: PO_AuthorisationLevels.php:132 +#: PO_AuthorisationLevels.php:137 +#: PO_Header.php:758 +#: PO_PDFPurchOrder.php:367 +#: PO_PDFPurchOrder.php:370 +#: PurchData.php:189 +#: PurchData.php:469 +#: PurchData.php:472 +#: RecurringSalesOrders.php:479 +#: RecurringSalesOrders.php:482 +#: SalesAnalReptCols.php:279 +#: SalesAnalReptCols.php:401 +#: SalesAnalReptCols.php:404 +#: SalesAnalRepts.php:406 +#: SalesAnalRepts.php:409 +#: SalesAnalRepts.php:432 +#: SalesAnalRepts.php:435 +#: SalesAnalRepts.php:458 +#: SalesAnalRepts.php:461 +#: SelectProduct.php:351 +#: ShipmentCosting.php:622 +#: Stocks.php:867 +#: Stocks.php:869 +#: Stocks.php:887 +#: Stocks.php:889 +#: SuppContractChgs.php:83 +#: SuppLoginSetup.php:511 +#: SuppLoginSetup.php:513 +#: SystemParameters.php:373 +#: SystemParameters.php:405 +#: SystemParameters.php:450 +#: SystemParameters.php:468 +#: SystemParameters.php:476 +#: SystemParameters.php:516 +#: SystemParameters.php:589 +#: SystemParameters.php:597 +#: SystemParameters.php:615 +#: SystemParameters.php:622 +#: SystemParameters.php:746 +#: SystemParameters.php:877 +#: SystemParameters.php:879 +#: SystemParameters.php:889 +#: SystemParameters.php:891 +#: SystemParameters.php:945 +#: SystemParameters.php:957 +#: SystemParameters.php:959 +#: TaxGroups.php:292 +#: TaxGroups.php:295 +#: TaxGroups.php:344 +#: WWW_Users.php:610 +#: WWW_Users.php:612 msgid "Yes" msgstr "是" -#: AccountGroups.php:256 AccountGroups.php:389 AccountGroups.php:391 -#: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 -#: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 -#: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:450 CompanyPreferences.php:454 -#: CompanyPreferences.php:462 CompanyPreferences.php:466 -#: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 -#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 -#: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 -#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 -#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 -#: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 -#: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:757 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 -#: PurchData.php:195 PurchData.php:495 PurchData.php:498 -#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 -#: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 -#: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 -#: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 -#: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:866 Stocks.php:868 Stocks.php:886 Stocks.php:888 -#: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:377 SystemParameters.php:400 SystemParameters.php:416 -#: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:599 SystemParameters.php:607 -#: SystemParameters.php:625 SystemParameters.php:632 SystemParameters.php:757 -#: SystemParameters.php:886 SystemParameters.php:890 SystemParameters.php:898 -#: SystemParameters.php:902 SystemParameters.php:956 SystemParameters.php:966 -#: SystemParameters.php:970 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:346 WWW_Users.php:609 WWW_Users.php:613 -#: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 +#: AccountGroups.php:256 +#: AccountGroups.php:389 +#: AccountGroups.php:391 +#: BankAccounts.php:215 +#: BankAccounts.php:361 +#: BankAccounts.php:363 +#: BankAccounts.php:367 +#: BOMs.php:130 +#: BOMs.php:712 +#: BOMs.php:716 +#: CompanyPreferences.php:438 +#: CompanyPreferences.php:442 +#: Comp... [truncated message content] |
From: <dai...@us...> - 2011-02-27 04:53:41
|
Revision: 4499 http://web-erp.svn.sourceforge.net/web-erp/?rev=4499&view=rev Author: daintree Date: 2011-02-27 04:53:34 +0000 (Sun, 27 Feb 2011) Log Message: ----------- Delete Units of measure fix as reported by Exson Modified Paths: -------------- trunk/UnitsOfMeasure.php trunk/doc/Change.log.html trunk/doc/Manual/ManualContributors.html Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-02-25 21:15:29 UTC (rev 4498) +++ trunk/UnitsOfMeasure.php 2011-02-27 04:53:34 UTC (rev 4499) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Units Of Measure'); @@ -141,19 +139,10 @@ prnMsg( _('Cannot delete this unit of measure because inventory items have been created using this unit of measure'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('inventory items that refer to this unit of measure') . '</font>'; } else { - $sql= "SELECT COUNT(*) FROM contracts WHERE units ".LIKE." '" . $OldMeasureName . "'"; + $sql="DELETE FROM unitsofmeasure WHERE unitname ".LIKE."'" . $OldMeasureName . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { - prnMsg( _('Cannot delete this unit of measure because contracts have been created using this unit of measure'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('contracts that refer to this unit of measure') . '</font>'; - } else { - $sql="DELETE FROM unitsofmeasure WHERE unitname ".LIKE."'" . $OldMeasureName . "'"; - $result = DB_query($sql,$db); - prnMsg( $OldMeasureName . ' ' . _('unit of measure has been deleted') . '!','success'); - } + prnMsg( $OldMeasureName . ' ' . _('unit of measure has been deleted') . '!','success'); } - } //end if account group used in GL accounts unset ($SelectedMeasureID); unset ($_GET['SelectedMeasureID']); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-25 21:15:29 UTC (rev 4498) +++ trunk/doc/Change.log.html 2011-02-27 04:53:34 UTC (rev 4499) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check</p> <p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> <p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> <p>18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; </p> Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2011-02-25 21:15:29 UTC (rev 4498) +++ trunk/doc/Manual/ManualContributors.html 2011-02-27 04:53:34 UTC (rev 4499) @@ -1,185 +1,187 @@ -<br><br> +<br /><br /> <a name="Contributors"><font size="+3"><b>Contributors - Acknowledgements</b></font></a> -<br><br> +<br /><br /> The following is a list of known contributors. Many of these people can usually be contacted by posting to the appropriate mailing list. -<br><br> +<br /><br /> <table width="100%"> <tr> <td width="50%" valign="top"> <b>Development (sorted by last name)</b> -<br><br> +<br /><br /> Nicola Asuni (TCPDF) -<br><br> +<br /><br /> Shane Barnaby -<br><br> +<br /><br /> Chris Bice -<br><br> +<br /><br /> Danie Brink -<br><br> +<br /><br /> Phil Daintree -<br><br> +<br /><br /> Murray Dancey -<br><br> +<br /><br /> Gilles Deacur -<br><br> +<br /><br /> Miguel de Benito Delgado (phplot) -<br><br> +<br /><br /> Javier de Lorenzo-Cáceres -<br><br> +<br /><br /> Janusz Dobrowolski -<br><br> +<br /><br /> Edd Dumbill (phpxmlrpc) -<br><br> +<br /><br /> Tom Fox -<br><br> +<br /><br /> Braian Gomez -<br><br> +<br /><br /> Lindsay Harris -<br><br> +<br /><br /> David Hawke -<br><br> +<br /><br /> Richard Heyes (html.mime.mail) -<br><br> +<br /><br /> Hindra Joshua -<br><br> +<br /><br /> Alan Jones -<br><br> +<br /><br /> Steve Kaill - bugfixes -<br><br> +<br /><br /> Nico Kaiser (php-gettext) -<br><br> +<br /><br /> Mo Kelly - due dates and customer po by sales order line -<br><br> +<br /><br /> Meraj Khattak - database diagram -<br><br> +<br /><br /> Steve Kitchen -<br><br> +<br /><br /> Ditesh Kumar -<br><br> +<br /><br /> David Luo -<br><br> +<br /><br /> Wayne McDougall -<br><br> +<br /><br /> Greg Morehead -<br><br> +<br /><br /> Clay Mokus -<br><br> +<br /><br /> Suren Naidu -<br><br> +<br /><br /> Hani Naguib -<br><br> +<br /><br /> Harold Naparst -<br><br> +<br /><br /> Sherif Omar -<br><br> +<br /><br /> Simon Peter Otandeka -<br><br> +<br /><br /> Afan Ottenheimer (phplot) -<br><br> +<br /><br /> Ricardo Pedroso -<br><br> +<br /><br /> Jesse Peterson -<br><br> +<br /><br /> Kalmer Piiskop -<br><br> +<br /><br /> Olivier Plathey (FPDF - from which TCPDF was derived) -<br><br> +<br /><br /> Renier du Plessis -<BR><BR> +<br /><br /> Dave Premo (report writer) -<BR><BR> +<br /><br /> +Exson Qu +<br /><br /> Pak Ricard -<BR><BR> +<br /><br /> Harald Ringehahn -<BR><BR> +<br /><br /> Gunnar Rikardsson -<BR><BR> +<br /><br /> Scott Rosa -<br><br> +<br /><br /> Tim Schofield -<br><br> +<br /><br /> Jurgen Schopenhouer -<br><br> +<br /><br /> Danilo Segan (php-gettext) -<BR><BR> +<br /><br /> Gjergj Sheldija -<br><br> +<br /><br /> Matthew Sibson -<BR><BR> +<br /><br /> Vitaliy Shevkunov -<br><br> +<br /><br /> Jake Stride -<br><br> +<br /><br /> Matt Taylor -<BR><BR> +<br /><br /> Paul Thursby -<br><br> +<br /><br /> Marcos Garcia Trejo -<br><br> +<br /><br /> Mark Yeager (MRP) -<br><br> +<br /><br /> Zhiguo Yuan </td> <td valign="top"> <b>Translation </b> -<br><br> +<br /><br /> Csillag Péter Hungarian -<br><br> +<br /><br /> Danu Satrio Pratomo Djojosoemarto and his cousin - Indonesian -<br><br> +<br /><br /> Janusz Dobrowolski - Polish -<br><br> +<br /><br /> Matt Elbrecht - Estonian -<br><br> +<br /><br /> Igor Felix - Portuguese Brazilian -<br><br> +<br /><br /> Karel van der Esch - Dutch -<br><br> +<br /><br /> Thiago Figueiredo - Portuguese -<br><br> +<br /><br /> Romel Den - Chinese Traditional - UTF-8 -<br><br> +<br /><br /> Thiago Mansinho de Lima - Portuguese Brazilian -<br><br> +<br /><br /> Roberto del Pino - Spanish -<br><br> +<br /><br /> Alejandro E Fernández E Spanish (Venezuelan) -<br><br> +<br /><br /> Javier de Lorenzo-Cáceres - Spanish -<br><br> +<br /><br /> Juan L Grassi - Spanish -<br><br> +<br /><br /> Tanya Komarova - Russian -<br><br> +<br /><br /> Eddie Molina - Spanish -<br><br> -Exson Qu - Chinese -<br><br> +<br /><br /> +Exson Qu - Chinese (and Manual) +<br /><br /> J. Hernán Ramírez R. - Spanish (Venezuelan) -<br><br> +<br /><br /> Harald Ringehahn - German -<br><br> +<br /><br /> Manel Sanchez Maulini - Spanish -<br><br> +<br /><br /> Melvin Sequera - Spanish -<br><br> +<br /><br /> Efren Yevale - Spanish -<br><br> +<br /><br /> Carlos F. Castillo - Spanish -<br><br> +<br /><br /> Wilson Almeida - Spanish -<br><br> +<br /><br /> Carlos Vera - Spanish -<BR><BR> +<br /><br /> Zhiguo Yuan - Chinese -<BR><BR> +<br /><br /> </td> </tr> </table> -<br> +<br /> Some Icons sourced via Creative Commons Attribution 2.5 License. http://www.famfamfam.com/lab/icons/silk/ -<br> -<br> +<br /> +<br /> If anyone has been overlooked or should have their entry modified please email in...@we... -<br><br> +<br /><br /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-27 04:53:41
|
Revision: 4499 http://web-erp.svn.sourceforge.net/web-erp/?rev=4499&view=rev Author: daintree Date: 2011-02-27 04:53:34 +0000 (Sun, 27 Feb 2011) Log Message: ----------- Delete Units of measure fix as reported by Exson Modified Paths: -------------- trunk/UnitsOfMeasure.php trunk/doc/Change.log.html trunk/doc/Manual/ManualContributors.html Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-02-25 21:15:29 UTC (rev 4498) +++ trunk/UnitsOfMeasure.php 2011-02-27 04:53:34 UTC (rev 4499) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Units Of Measure'); @@ -141,19 +139,10 @@ prnMsg( _('Cannot delete this unit of measure because inventory items have been created using this unit of measure'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('inventory items that refer to this unit of measure') . '</font>'; } else { - $sql= "SELECT COUNT(*) FROM contracts WHERE units ".LIKE." '" . $OldMeasureName . "'"; + $sql="DELETE FROM unitsofmeasure WHERE unitname ".LIKE."'" . $OldMeasureName . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { - prnMsg( _('Cannot delete this unit of measure because contracts have been created using this unit of measure'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('contracts that refer to this unit of measure') . '</font>'; - } else { - $sql="DELETE FROM unitsofmeasure WHERE unitname ".LIKE."'" . $OldMeasureName . "'"; - $result = DB_query($sql,$db); - prnMsg( $OldMeasureName . ' ' . _('unit of measure has been deleted') . '!','success'); - } + prnMsg( $OldMeasureName . ' ' . _('unit of measure has been deleted') . '!','success'); } - } //end if account group used in GL accounts unset ($SelectedMeasureID); unset ($_GET['SelectedMeasureID']); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-25 21:15:29 UTC (rev 4498) +++ trunk/doc/Change.log.html 2011-02-27 04:53:34 UTC (rev 4499) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check</p> <p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> <p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> <p>18/2/11: Phil/Don Change PageSecurity array variable name to PageSecurityArray - caused problems with conflict with PageSecurity variable where register_globals = on; </p> Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2011-02-25 21:15:29 UTC (rev 4498) +++ trunk/doc/Manual/ManualContributors.html 2011-02-27 04:53:34 UTC (rev 4499) @@ -1,185 +1,187 @@ -<br><br> +<br /><br /> <a name="Contributors"><font size="+3"><b>Contributors - Acknowledgements</b></font></a> -<br><br> +<br /><br /> The following is a list of known contributors. Many of these people can usually be contacted by posting to the appropriate mailing list. -<br><br> +<br /><br /> <table width="100%"> <tr> <td width="50%" valign="top"> <b>Development (sorted by last name)</b> -<br><br> +<br /><br /> Nicola Asuni (TCPDF) -<br><br> +<br /><br /> Shane Barnaby -<br><br> +<br /><br /> Chris Bice -<br><br> +<br /><br /> Danie Brink -<br><br> +<br /><br /> Phil Daintree -<br><br> +<br /><br /> Murray Dancey -<br><br> +<br /><br /> Gilles Deacur -<br><br> +<br /><br /> Miguel de Benito Delgado (phplot) -<br><br> +<br /><br /> Javier de Lorenzo-Cáceres -<br><br> +<br /><br /> Janusz Dobrowolski -<br><br> +<br /><br /> Edd Dumbill (phpxmlrpc) -<br><br> +<br /><br /> Tom Fox -<br><br> +<br /><br /> Braian Gomez -<br><br> +<br /><br /> Lindsay Harris -<br><br> +<br /><br /> David Hawke -<br><br> +<br /><br /> Richard Heyes (html.mime.mail) -<br><br> +<br /><br /> Hindra Joshua -<br><br> +<br /><br /> Alan Jones -<br><br> +<br /><br /> Steve Kaill - bugfixes -<br><br> +<br /><br /> Nico Kaiser (php-gettext) -<br><br> +<br /><br /> Mo Kelly - due dates and customer po by sales order line -<br><br> +<br /><br /> Meraj Khattak - database diagram -<br><br> +<br /><br /> Steve Kitchen -<br><br> +<br /><br /> Ditesh Kumar -<br><br> +<br /><br /> David Luo -<br><br> +<br /><br /> Wayne McDougall -<br><br> +<br /><br /> Greg Morehead -<br><br> +<br /><br /> Clay Mokus -<br><br> +<br /><br /> Suren Naidu -<br><br> +<br /><br /> Hani Naguib -<br><br> +<br /><br /> Harold Naparst -<br><br> +<br /><br /> Sherif Omar -<br><br> +<br /><br /> Simon Peter Otandeka -<br><br> +<br /><br /> Afan Ottenheimer (phplot) -<br><br> +<br /><br /> Ricardo Pedroso -<br><br> +<br /><br /> Jesse Peterson -<br><br> +<br /><br /> Kalmer Piiskop -<br><br> +<br /><br /> Olivier Plathey (FPDF - from which TCPDF was derived) -<br><br> +<br /><br /> Renier du Plessis -<BR><BR> +<br /><br /> Dave Premo (report writer) -<BR><BR> +<br /><br /> +Exson Qu +<br /><br /> Pak Ricard -<BR><BR> +<br /><br /> Harald Ringehahn -<BR><BR> +<br /><br /> Gunnar Rikardsson -<BR><BR> +<br /><br /> Scott Rosa -<br><br> +<br /><br /> Tim Schofield -<br><br> +<br /><br /> Jurgen Schopenhouer -<br><br> +<br /><br /> Danilo Segan (php-gettext) -<BR><BR> +<br /><br /> Gjergj Sheldija -<br><br> +<br /><br /> Matthew Sibson -<BR><BR> +<br /><br /> Vitaliy Shevkunov -<br><br> +<br /><br /> Jake Stride -<br><br> +<br /><br /> Matt Taylor -<BR><BR> +<br /><br /> Paul Thursby -<br><br> +<br /><br /> Marcos Garcia Trejo -<br><br> +<br /><br /> Mark Yeager (MRP) -<br><br> +<br /><br /> Zhiguo Yuan </td> <td valign="top"> <b>Translation </b> -<br><br> +<br /><br /> Csillag Péter Hungarian -<br><br> +<br /><br /> Danu Satrio Pratomo Djojosoemarto and his cousin - Indonesian -<br><br> +<br /><br /> Janusz Dobrowolski - Polish -<br><br> +<br /><br /> Matt Elbrecht - Estonian -<br><br> +<br /><br /> Igor Felix - Portuguese Brazilian -<br><br> +<br /><br /> Karel van der Esch - Dutch -<br><br> +<br /><br /> Thiago Figueiredo - Portuguese -<br><br> +<br /><br /> Romel Den - Chinese Traditional - UTF-8 -<br><br> +<br /><br /> Thiago Mansinho de Lima - Portuguese Brazilian -<br><br> +<br /><br /> Roberto del Pino - Spanish -<br><br> +<br /><br /> Alejandro E Fernández E Spanish (Venezuelan) -<br><br> +<br /><br /> Javier de Lorenzo-Cáceres - Spanish -<br><br> +<br /><br /> Juan L Grassi - Spanish -<br><br> +<br /><br /> Tanya Komarova - Russian -<br><br> +<br /><br /> Eddie Molina - Spanish -<br><br> -Exson Qu - Chinese -<br><br> +<br /><br /> +Exson Qu - Chinese (and Manual) +<br /><br /> J. Hernán Ramírez R. - Spanish (Venezuelan) -<br><br> +<br /><br /> Harald Ringehahn - German -<br><br> +<br /><br /> Manel Sanchez Maulini - Spanish -<br><br> +<br /><br /> Melvin Sequera - Spanish -<br><br> +<br /><br /> Efren Yevale - Spanish -<br><br> +<br /><br /> Carlos F. Castillo - Spanish -<br><br> +<br /><br /> Wilson Almeida - Spanish -<br><br> +<br /><br /> Carlos Vera - Spanish -<BR><BR> +<br /><br /> Zhiguo Yuan - Chinese -<BR><BR> +<br /><br /> </td> </tr> </table> -<br> +<br /> Some Icons sourced via Creative Commons Attribution 2.5 License. http://www.famfamfam.com/lab/icons/silk/ -<br> -<br> +<br /> +<br /> If anyone has been overlooked or should have their entry modified please email in...@we... -<br><br> +<br /><br /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-27 09:18:49
|
Revision: 4500 http://web-erp.svn.sourceforge.net/web-erp/?rev=4500&view=rev Author: daintree Date: 2011-02-27 09:18:42 +0000 (Sun, 27 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/GoodsReceived.php trunk/MRPShortages.php trunk/PDFQuotation.php trunk/StockUsage.php trunk/WorkOrderEntry.php trunk/doc/Change.log.html Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/GoodsReceived.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -4,8 +4,6 @@ /* $Revision: 1.44 $ */ -//$PageSecurity = 11; now stored in the database - /* Session started in header.inc for password checking and authorisation level check */ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); @@ -72,6 +70,7 @@ if (!isset($_POST['ProcessGoodsReceived'])) { if (!isset($_POST['DefaultReceivedDate'])){ + /* This is meant to be the date the goods are received - it does not make sense to set this to the date that we requested delivery in the purchase order - I have not applied your change here Tim for this reason - let me know if I have it wrong - Phil */ $_POST['DefaultReceivedDate'] = Date($_SESSION['DefaultDateFormat']); } Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/MRPShortages.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -1,20 +1,20 @@ <?php /*$Id$ */ - -/* $Revision: 1.7 $ */ // MRPShortages.php - Report of parts with demand greater than supply as determined by MRP -//$PageSecurity = 2; + include('includes/session.inc'); +//ANSI SQL??? $sql='show tables where Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; + $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { - $title='MRP error'; + $title=_('MRP error'); include('includes/header.inc'); echo '<br>'; - prnMsg( _('The MRP calculation must be run before you can run this report').'<br>'. - _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php?' . SID .'>'._('here').'</a>', 'error'); + prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. + _('To run the MRP calculation click').' '.'<a href="'.$rootpath .'/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); exit; } @@ -103,7 +103,14 @@ extcost HAVING demand > supply ORDER BY '" . $_POST['Sort']."'"; - $sql = "SELECT stockmaster.stockid, + + if ($_POST['CategoryID'] == 'All'){ + $SQLCategory = ' '; + }else{ + $SQLCategory = "WHERE stockmaster.categoryid = '" . $_POST['CategoryID'] . "'"; + } + + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, stockmaster.actualcost, @@ -117,8 +124,9 @@ stockmaster.overheadcost ) as extcost FROM stockmaster LEFT JOIN demandtotal ON stockmaster.stockid = demandtotal.part - LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part - GROUP BY stockmaster.stockid, + LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part " + . $SQLCategory . + "GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.mbflag, stockmaster.actualcost, @@ -137,9 +145,9 @@ $title = _('MRP Shortages') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP shortages could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "</br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br/><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "</br>$sql"; + echo '<br/>' . $sql; } include('includes/footer.inc'); exit; @@ -149,9 +157,9 @@ $title = _('MRP Shortages') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('No MRP shortages retrieved'), 'warn'); - echo "</br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "</br>$sql"; + echo "<br />$sql"; } include('includes/footer.inc'); exit; @@ -216,28 +224,7 @@ $pdf->addTextWrap(300,$YPos,180,$FontSize,_('Total Extended Shortage:'), 'right'); $DisplayTotalVal = number_format($Total_Shortage,2); $pdf->addTextWrap(510,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - $title = _('Print MRP Shortages Error'); - include('includes/header.inc'); - prnMsg(_('There were no items with demand greater than supply'),'error'); - echo "</br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=MRPShortages.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('MRPShortages.pdf', 'I'); - } -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');//UldisN $pdf->__destruct(); //UldisN } else { /*The option to print PDF was not hit so display form */ @@ -250,14 +237,24 @@ echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<table class=selection>"; + echo '<table class=selection>'; + echo '</select></td></tr>'; + echo '<tr><td>' . _('Inventory Category') . ':</td><td><select name="CategoryID">'; + echo '<option selected value="All">' . _('All Stock Categories'); + $sql = 'SELECT categoryid, + categorydescription + FROM stockcategory'; + $result = DB_query($sql,$db); + while ($myrow = DB_fetch_array($result)) { + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; + } //end while loop echo '<tr><td>' . _('Sort') . ":</td><td><select name='Sort'>"; - echo "<option selected value='extcost'>" . _('Extended Shortage Dollars')."</option>"; - echo "<option value='stockid'>" . _('Part Number')."</option>"; + echo "<option selected value='extcost'>" . _('Extended Shortage Dollars').'</option>'; + echo "<option value='stockid'>" . _('Part Number').'</option>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines')."</option>"; - echo "<option value='no'>" . _('Plain Print')."</option>"; + echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines').'</option>'; + echo "<option value='no'>" . _('Plain Print').'</option>'; echo '</select></td></tr>'; echo "</table><br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/PDFQuotation.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.11 $ */ -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/StockUsage.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); @@ -93,32 +92,38 @@ /*HideMovt ==1 if the movement was only created for the purpose of a transaction but is not a physical movement eg. A price credit will create a movement record for the purposes of display on a credit note but there is no physical stock movement - it makes sense honest ??? */ + +$CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + if (isset($_POST['ShowUsage'])){ if($_POST['StockLocation']=='All'){ $sql = "SELECT periods.periodno, periods.lastdate_in_period, - SUM(-stockmoves.qty) AS qtyused - FROM stockmoves INNER JOIN periods - ON stockmoves.prd=periods.periodno - WHERE (stockmoves.type=10 OR stockmoves.type=11 OR stockmoves.type=28) - AND stockmoves.hidemovt=0 - AND stockmoves.stockid = '" . $StockID . "' + SUM(CASE WHEN (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) + AND stockmoves.hidemovt=0 + AND stockmoves.stockid = '" . $StockID . "' + THEN -stockmoves.qty ELSE 0 END) AS qtyused + FROM periods LEFT JOIN stockmoves + ON periods.periodno=stockmoves.prd + WHERE periods.periodno <='" . $CurrentPeriod . "' GROUP BY periods.periodno, periods.lastdate_in_period ORDER BY periodno DESC LIMIT " . $_SESSION['NumberOfPeriodsOfStockUsage']; } else { $sql = "SELECT periods.periodno, periods.lastdate_in_period, - SUM(-stockmoves.qty) AS qtyused - FROM stockmoves INNER JOIN periods - ON stockmoves.prd=periods.periodno - WHERE (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) - AND stockmoves.hidemovt=0 - AND stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.stockid = '" . $StockID . "' + SUM(CASE WHEN (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) + AND stockmoves.hidemovt=0 + AND stockmoves.stockid = '" . $StockID . "' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "' + THEN -stockmoves.qty ELSE 0 END) AS qtyused + FROM periods LEFT JOIN stockmoves + ON periods.periodno=stockmoves.prd + WHERE periods.periodno <='" . $CurrentPeriod . "' GROUP BY periods.periodno, periods.lastdate_in_period ORDER BY periodno DESC LIMIT " . $_SESSION['NumberOfPeriodsOfStockUsage']; + } $MovtsResult = DB_query($sql, $db); if (DB_error_no($db) !=0) { Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/WorkOrderEntry.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Work Order Entry'); include('includes/header.inc'); @@ -252,9 +250,9 @@ if (isset($_POST['submit'])) { //The update button has been clicked - echo '<div class=centre><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter a new work order') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select an existing work order') . '</a>'; - echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; + echo '<div class=centre><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Enter a new work order') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing work order') . '</a>'; + echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; $Input_Error = false; //hope for the best for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ @@ -659,9 +657,6 @@ echo "<script>defaultControl(document.forms[0].OutputQty".$_GET['Line'].");</script>"; } - echo '</form>'; - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/doc/Change.log.html 2011-02-27 09:18:42 UTC (rev 4500) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php </p> <p>27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check</p> <p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> <p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-02-27 09:18:49
|
Revision: 4500 http://web-erp.svn.sourceforge.net/web-erp/?rev=4500&view=rev Author: daintree Date: 2011-02-27 09:18:42 +0000 (Sun, 27 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/GoodsReceived.php trunk/MRPShortages.php trunk/PDFQuotation.php trunk/StockUsage.php trunk/WorkOrderEntry.php trunk/doc/Change.log.html Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/GoodsReceived.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -4,8 +4,6 @@ /* $Revision: 1.44 $ */ -//$PageSecurity = 11; now stored in the database - /* Session started in header.inc for password checking and authorisation level check */ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); @@ -72,6 +70,7 @@ if (!isset($_POST['ProcessGoodsReceived'])) { if (!isset($_POST['DefaultReceivedDate'])){ + /* This is meant to be the date the goods are received - it does not make sense to set this to the date that we requested delivery in the purchase order - I have not applied your change here Tim for this reason - let me know if I have it wrong - Phil */ $_POST['DefaultReceivedDate'] = Date($_SESSION['DefaultDateFormat']); } Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/MRPShortages.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -1,20 +1,20 @@ <?php /*$Id$ */ - -/* $Revision: 1.7 $ */ // MRPShortages.php - Report of parts with demand greater than supply as determined by MRP -//$PageSecurity = 2; + include('includes/session.inc'); +//ANSI SQL??? $sql='show tables where Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; + $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { - $title='MRP error'; + $title=_('MRP error'); include('includes/header.inc'); echo '<br>'; - prnMsg( _('The MRP calculation must be run before you can run this report').'<br>'. - _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php?' . SID .'>'._('here').'</a>', 'error'); + prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. + _('To run the MRP calculation click').' '.'<a href="'.$rootpath .'/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); exit; } @@ -103,7 +103,14 @@ extcost HAVING demand > supply ORDER BY '" . $_POST['Sort']."'"; - $sql = "SELECT stockmaster.stockid, + + if ($_POST['CategoryID'] == 'All'){ + $SQLCategory = ' '; + }else{ + $SQLCategory = "WHERE stockmaster.categoryid = '" . $_POST['CategoryID'] . "'"; + } + + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, stockmaster.actualcost, @@ -117,8 +124,9 @@ stockmaster.overheadcost ) as extcost FROM stockmaster LEFT JOIN demandtotal ON stockmaster.stockid = demandtotal.part - LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part - GROUP BY stockmaster.stockid, + LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part " + . $SQLCategory . + "GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.mbflag, stockmaster.actualcost, @@ -137,9 +145,9 @@ $title = _('MRP Shortages') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP shortages could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "</br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br/><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "</br>$sql"; + echo '<br/>' . $sql; } include('includes/footer.inc'); exit; @@ -149,9 +157,9 @@ $title = _('MRP Shortages') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('No MRP shortages retrieved'), 'warn'); - echo "</br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "</br>$sql"; + echo "<br />$sql"; } include('includes/footer.inc'); exit; @@ -216,28 +224,7 @@ $pdf->addTextWrap(300,$YPos,180,$FontSize,_('Total Extended Shortage:'), 'right'); $DisplayTotalVal = number_format($Total_Shortage,2); $pdf->addTextWrap(510,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - if ($len<=20){ - $title = _('Print MRP Shortages Error'); - include('includes/header.inc'); - prnMsg(_('There were no items with demand greater than supply'),'error'); - echo "</br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=MRPShortages.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('MRPShortages.pdf', 'I'); - } -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');//UldisN $pdf->__destruct(); //UldisN } else { /*The option to print PDF was not hit so display form */ @@ -250,14 +237,24 @@ echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<table class=selection>"; + echo '<table class=selection>'; + echo '</select></td></tr>'; + echo '<tr><td>' . _('Inventory Category') . ':</td><td><select name="CategoryID">'; + echo '<option selected value="All">' . _('All Stock Categories'); + $sql = 'SELECT categoryid, + categorydescription + FROM stockcategory'; + $result = DB_query($sql,$db); + while ($myrow = DB_fetch_array($result)) { + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; + } //end while loop echo '<tr><td>' . _('Sort') . ":</td><td><select name='Sort'>"; - echo "<option selected value='extcost'>" . _('Extended Shortage Dollars')."</option>"; - echo "<option value='stockid'>" . _('Part Number')."</option>"; + echo "<option selected value='extcost'>" . _('Extended Shortage Dollars').'</option>'; + echo "<option value='stockid'>" . _('Part Number').'</option>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines')."</option>"; - echo "<option value='no'>" . _('Plain Print')."</option>"; + echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines').'</option>'; + echo "<option value='no'>" . _('Plain Print').'</option>'; echo '</select></td></tr>'; echo "</table><br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/PDFQuotation.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.11 $ */ -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/StockUsage.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); @@ -93,32 +92,38 @@ /*HideMovt ==1 if the movement was only created for the purpose of a transaction but is not a physical movement eg. A price credit will create a movement record for the purposes of display on a credit note but there is no physical stock movement - it makes sense honest ??? */ + +$CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + if (isset($_POST['ShowUsage'])){ if($_POST['StockLocation']=='All'){ $sql = "SELECT periods.periodno, periods.lastdate_in_period, - SUM(-stockmoves.qty) AS qtyused - FROM stockmoves INNER JOIN periods - ON stockmoves.prd=periods.periodno - WHERE (stockmoves.type=10 OR stockmoves.type=11 OR stockmoves.type=28) - AND stockmoves.hidemovt=0 - AND stockmoves.stockid = '" . $StockID . "' + SUM(CASE WHEN (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) + AND stockmoves.hidemovt=0 + AND stockmoves.stockid = '" . $StockID . "' + THEN -stockmoves.qty ELSE 0 END) AS qtyused + FROM periods LEFT JOIN stockmoves + ON periods.periodno=stockmoves.prd + WHERE periods.periodno <='" . $CurrentPeriod . "' GROUP BY periods.periodno, periods.lastdate_in_period ORDER BY periodno DESC LIMIT " . $_SESSION['NumberOfPeriodsOfStockUsage']; } else { $sql = "SELECT periods.periodno, periods.lastdate_in_period, - SUM(-stockmoves.qty) AS qtyused - FROM stockmoves INNER JOIN periods - ON stockmoves.prd=periods.periodno - WHERE (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) - AND stockmoves.hidemovt=0 - AND stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.stockid = '" . $StockID . "' + SUM(CASE WHEN (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) + AND stockmoves.hidemovt=0 + AND stockmoves.stockid = '" . $StockID . "' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "' + THEN -stockmoves.qty ELSE 0 END) AS qtyused + FROM periods LEFT JOIN stockmoves + ON periods.periodno=stockmoves.prd + WHERE periods.periodno <='" . $CurrentPeriod . "' GROUP BY periods.periodno, periods.lastdate_in_period ORDER BY periodno DESC LIMIT " . $_SESSION['NumberOfPeriodsOfStockUsage']; + } $MovtsResult = DB_query($sql, $db); if (DB_error_no($db) !=0) { Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/WorkOrderEntry.php 2011-02-27 09:18:42 UTC (rev 4500) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('Work Order Entry'); include('includes/header.inc'); @@ -252,9 +250,9 @@ if (isset($_POST['submit'])) { //The update button has been clicked - echo '<div class=centre><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter a new work order') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select an existing work order') . '</a>'; - echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; + echo '<div class=centre><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Enter a new work order') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing work order') . '</a>'; + echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; $Input_Error = false; //hope for the best for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ @@ -659,9 +657,6 @@ echo "<script>defaultControl(document.forms[0].OutputQty".$_GET['Line'].");</script>"; } - echo '</form>'; - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-27 04:53:34 UTC (rev 4499) +++ trunk/doc/Change.log.html 2011-02-27 09:18:42 UTC (rev 4500) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php </p> <p>27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check</p> <p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> <p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-03 09:13:19
|
Revision: 4501 http://web-erp.svn.sourceforge.net/web-erp/?rev=4501&view=rev Author: daintree Date: 2011-03-03 09:13:12 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Tim launchpad revisions to 4441 excluding price units stuff Modified Paths: -------------- trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/DeliveryDetails.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/SelectCompletedOrder.php trunk/SelectCustomer.php trunk/SelectSupplier.php trunk/StockCheck.php trunk/StockSerialItems.php trunk/SupplierCredit.php trunk/Suppliers.php trunk/doc/Change.log.html trunk/includes/Add_SerialItems.php trunk/includes/Add_SerialItemsOut.php trunk/includes/DefineSerialItems.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/PDFStockCheckPageHeader.inc Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -66,7 +66,7 @@ $InOutModifier=1; $ShowExisting=false; -include ('includes/InputSerialItems.php'); +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/ConfirmDispatch_Invoice.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -219,18 +219,24 @@ } foreach ($_SESSION['Items']->LineItems as $Itm) { - if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ + if (sizeOf($Itm->SerialItems) > 0) { + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = 0; //initialise QtyDispatched + foreach ($Itm->SerialItems as $SerialItem) { //calculate QtyDispatched from bundle quantities + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched += $SerialItem->BundleQty; + } + } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = $_POST[$Itm->LineNumber . '_QtyDispatched']; } + + foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; } } + } //end foreach lineitem - } - } /* Always display dispatch quantities and recalc freight for items being dispatched */ @@ -382,15 +388,15 @@ echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; if ($LnItm->Controlled==1){ - - echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">'; - - if ($LnItm->Serialised==1){ - echo _("Enter Serial Numbers"); - } else { /*Just batch/roll/lot control */ - echo _('Enter Batch/Roll/Lot #'); + if (!isset($_POST['ProcessInvoice'])) { + echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">'; + if ($LnItm->Serialised==1){ + echo _('Enter Serial Numbers'); + } else { /*Just batch/roll/lot control */ + echo _('Enter Batch/Roll/Lot #'); + } + echo '</a></td>'; } - echo '</a></td>'; } echo '</tr>'; if (strlen($LnItm->Narrative)>1){ @@ -717,7 +723,7 @@ /*Start an SQL transaction */ -DB_Txn_Begin($db); + DB_Txn_Begin($db); if ($DefaultShipVia != $_SESSION['Items']->ShipVia){ $SQL = "UPDATE custbranch Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/DeliveryDetails.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -580,8 +580,8 @@ } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation') .'</a></td></tr></table>'; - + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td></tr></table>'; } echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; } else { Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/GoodsReceived.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -516,11 +516,13 @@ loccode, serialno, qualitytext, + expirationdate, quantity) VALUES ('" . $OrderLine->StockID . "', '" . $_SESSION['PO'.$identifier]->Location . "', '" . $Item->BundleRef . "', '', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; } Modified: trunk/GoodsReceivedControlled.php =================================================================== --- trunk/GoodsReceivedControlled.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/GoodsReceivedControlled.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -4,8 +4,6 @@ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Receive Controlled Items'); @@ -32,7 +30,7 @@ exit; } -if (isset($_GET['LineNo'])){ +if (isset($_GET['LineNo']) AND $_GET['LineNo']>0){ $LineNo = $_GET['LineNo']; } elseif (isset($_POST['LineNo'])){ $LineNo = $_POST['LineNo']; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SelectCompletedOrder.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -64,8 +64,16 @@ if (isset($OrderNumber)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales Order') . '" alt="" />' . ' ' . _('Order Number') . ' - ' . $OrderNumber . '</p>'; + if (strlen($_SESSION['UserBranch'])>1){ + echo _('For customer') . ': ' . $SelectedCustomer; + echo "<input type=hidden name='SelectedCustomer' value='".$SelectedCustomer."'>"; + } } elseif (isset($CustomerRef)) { echo _('Customer Ref') . ' - ' . $CustomerRef; + if (strlen($_SESSION['UserBranch'])>1){ + echo ' ' . _('and for customer') . ': ' . $SelectedCustomer .' ' . _('and') . ' '; + echo "<input type=hidden name='SelectedCustomer' value='".$SelectedCustomer."'>"; + } } else { if (isset($SelectedCustomer)) { echo _('For customer') . ': ' . $SelectedCustomer .' ' . _('and') . ' '; @@ -212,13 +220,42 @@ $SelectedStockItem = $myrow[0]; $_POST['SearchOrders']='True'; unset($StockItemsResult); - echo '<br>' . _('For the part') . ': ' . $SelectedStockItem . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='$SelectedStockItem'>"; + echo '<br />' . _('For the part') . ': ' . $SelectedStockItem . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='$SelectedStockItem'>"; } } } else if (isset($_POST['SearchOrders']) AND Is_Date($_POST['OrdersAfterDate'])==1) { //figure out the SQL required from the inputs available if (isset($OrderNumber)) { + if (isset($SelectedCustomer)) { + $SQL = "SELECT salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue + FROM salesorders, + salesorderdetails, + debtorsmaster, + custbranch + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.branchcode = custbranch.branchcode + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.debtorno='" . $SelectedCustomer ."' + AND salesorders.orderno='". $OrderNumber ."' + AND salesorders.quotation=0 + AND salesorderdetails.completed".$completed." + GROUP BY salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto + ORDER BY salesorders.orderno"; + } else { //Set order number and SelectedCustomer not set $SQL = "SELECT salesorders.orderno, debtorsmaster.name, custbranch.brname, @@ -245,7 +282,9 @@ salesorders.deliverydate, salesorders.deliverto ORDER BY salesorders.orderno"; + } } elseif (isset($CustomerRef)) { + if (isset($SelectedCustomer)) { $SQL = "SELECT salesorders.orderno, debtorsmaster.name, custbranch.brname, @@ -261,6 +300,7 @@ AND salesorders.branchcode = custbranch.branchcode AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.debtorno='" . $SelectedCustomer ."' AND salesorders.customerref like '%". $CustomerRef."%' AND salesorders.quotation=0 AND salesorderdetails.completed".$completed." @@ -272,6 +312,34 @@ salesorders.deliverydate, salesorders.deliverto ORDER BY salesorders.orderno"; + } else { //customer not selected + $SQL = "SELECT salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue + FROM salesorders, + salesorderdetails, + debtorsmaster, + custbranch + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.branchcode = custbranch.branchcode + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.customerref like '%". $CustomerRef."%' + AND salesorders.quotation=0 + AND salesorderdetails.completed".$completed." + GROUP BY salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto + ORDER BY salesorders.orderno"; + } } else { $DateAfterCriteria = FormatDateforSQL($_POST['OrdersAfterDate']); @@ -399,8 +467,8 @@ $SalesOrdersResult = DB_query($SQL,$db); if (DB_error_no($db) !=0) { - echo '<br>' . _('No orders were returned by the SQL because') . ' ' . DB_error_msg($db); - echo "<br>$SQL"; + echo '<br />' . _('No orders were returned by the SQL because') . ' ' . DB_error_msg($db); + echo "<br />$SQL"; } }//end of which button clicked options @@ -416,22 +484,22 @@ echo "<tr><td></td>"; } -if (!isset($OrderNumber) or $OrderNumber==''){ - echo '<td>' . _('Order Number') . ':</td><td>' . "<input type='text' name='OrderNumber' maxlength =8 size=9></td><td>" . _('for all orders placed after') . - ": </td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OrdersAfterDate' maxlength =10 size=11 value=" . $_POST['OrdersAfterDate'] . "></td><td>" . - "<input type='submit' name='SearchOrders' value='" . _('Search Orders') . "'></td></tr>"; - echo '<tr><td></td><td>' . _('Customer Ref') . ':</td><td>' . "<input type='text' name='CustomerRef' maxlength =8 size=9></td> +echo '<td>' . _('Order Number') . ':</td> + <td>' . "<input type='text' name='OrderNumber' maxlength =8 size=9 value ='" . $_POST['OrderNumber'] . "'></td> + <td>" . _('for all orders placed after') . ": </td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OrdersAfterDate' maxlength =10 size=11 value=" . $_POST['OrdersAfterDate'] . "></td> + <td>" . "<input type='submit' name='SearchOrders' value='" . _('Search Orders') . "'></td></tr>"; +echo '<tr><td></td><td>' . _('Customer Ref') . ':</td><td>' . "<input type='text' name='CustomerRef' maxlength =8 size=9></td> <td></td><td colspan=2><input type='checkbox' ".$ShowChecked." name='completed' />"._('Show Completed orders only') . "</td></tr>"; -} + echo '</table>'; if (!isset($SelectedStockItem)) { $SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; $result1 = DB_query($SQL,$db); - echo '<br>'; + echo '<br />'; echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><td><font size=1>' . _('Select a stock category') . ':</font>'; echo '<select name="StockCat">'; @@ -461,7 +529,7 @@ If (isset($StockItemsResult)) { - echo '<br><table cellpadding=2 colspan=7 class=selection>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeadings = "<tr><th>" . _('Code') . "</th>" . "<th>" . _('Description') . "</th>" . @@ -511,7 +579,7 @@ /*show a table of the orders returned by the SQL */ - echo '<br><table cellpadding=2 colspan=6 width=90% class=selection>'; + echo '<br /><table cellpadding=2 colspan=6 width=90% class=selection>'; $tableheader = "<tr><th>" . _('Order') . " #</th> <th>" . _('Customer') . "</th> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SelectCustomer.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 2; + include ('includes/session.inc'); $title = _('Search Customers'); include ('includes/header.inc'); @@ -119,8 +119,9 @@ custbranch.phoneno, custbranch.faxno FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.typeid = debtortype.typeid"; + ON debtorsmaster.debtorno = custbranch.debtorno + INNER JOIN debtortype + ON debtorsmaster.typeid = debtortype.typeid"; } else { if (strlen($_POST['Keywords']) > 0) { //using the customer name Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SelectSupplier.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -166,7 +166,7 @@ echo '</td><td valign=top class="select">'; /* Supplier Transactions */ echo "<a href=\"$rootpath/PO_Header.php?" . SID . '&NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Purchase Order for This Supplier') . '</a><br>'; echo "<a href=\"$rootpath/SupplierInvoice.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Invoice') . '</a><br>'; - echo "<a href=\"$rootpath/SupplierCredit.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Credit Note') . '</a><br>'; + echo "<a href=\"$rootpath/SupplierCredit.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . '&New=True' . "\">" . _('Enter a Suppliers Credit Note') . '</a><br>'; echo "<a href=\"$rootpath/Payments.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br>'; echo '<br>'; echo "<br><a href='$rootpath/ReverseGRN.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "'>" . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/StockCheck.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -175,8 +175,9 @@ $FontSize=10; $YPos -=$line_height; - if ($_POST['ShowInfo']==true){ + if (isset($_POST['ShowInfo']) and $_POST['ShowInfo']==true){ + $SQL = "SELECT SUM(salesorderdetails.quantity - salesorderdetails.qtyinvoiced) AS qtydemand FROM salesorderdetails, salesorders Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/StockSerialItems.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -1,8 +1,8 @@ <?php /* $Id$*/ -//$PageSecurity = 2; + include('includes/session.inc'); $title = _('Stock Of Controlled Items'); include('includes/header.inc'); @@ -28,21 +28,23 @@ mbflag, decimalplaces, serialised, - controlled + controlled, + perishable FROM stockmaster WHERE stockid='".$StockID."'", $db, _('Could not retrieve the requested item because')); -$myrow = DB_fetch_row($result); +$myrow = DB_fetch_array($result); -$Description = $myrow[0]; -$UOM = $myrow[1]; -$DecimalPlaces = $myrow[3]; -$Serialised = $myrow[4]; -$Controlled = $myrow[5]; +$Description = $myrow['description']; +$UOM = $myrow['units']; +$DecimalPlaces = $myrow['decimalplaces']; +$Serialised = $myrow['serialised']; +$Controlled = $myrow['controlled']; +$Perishable = $myrow['perishable']; -if ($myrow[2]=='K' OR $myrow[2]=='A' OR $myrow[2]=='D'){ +if ($myrow['mbflag']=='K' OR $myrow['mbflag']=='A' OR $myrow['mbflag']=='D'){ prnMsg(_('This item is either a kitset or assembly or a dummy part and cannot have a stock holding') . '. ' . _('This page cannot be displayed') . '. ' . _('Only serialised or controlled items can be displayed in this page'),'error'); include('includes/footer.inc'); @@ -59,7 +61,8 @@ $myrow = DB_fetch_row($result); $sql = "SELECT serialno, - quantity + quantity, + expirationdate FROM stockserialitems WHERE loccode='" . $_GET['Location'] . "' AND stockid = '" . $StockID . "' @@ -72,30 +75,48 @@ echo '<table cellpadding=2 class=selection>'; if ($Serialised==1){ - echo '<tr<th colspan=3><font color=navy size=2>' . _('Serialised items in') . ' '; + echo '<tr><th colspan="5"><font color=navy size=2>' . _('Serialised items in') . ' '; } else { - echo '<tr<th colspan=3><font color=navy size=2>' . _('Controlled items in') . ' '; + echo '<tr><th colspan="11"><font color=navy size=2>' . _('Controlled items in') . ' '; } echo $myrow[0]. '</font></th></tr>'; -echo "<tr><th colspan=3><font color=navy size=2>".$StockID ."-". $Description ."</b> (" . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; +echo "<tr><th colspan=11><font color=navy size=2>".$StockID ."-". $Description ."</b> (" . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; if ($Serialised == 1){ - $tableheader = "<tr> - <th>" . _('Serial Number') . "</th> - <th>" . _('Serial Number') . "</th> - <th>" . _('Serial Number') . "</th> - </tr>"; -} else { - $tableheader = "<tr> - <th>" . _('Batch/Bundle Ref') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Batch/Bundle Ref') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Batch/Bundle Ref') . "</th> - <th>" . _('Quantity On Hand') . "</th> + $tableheader = '<tr> + <th>' . _('Serial Number') . '</th> + <th></th> + <th>' . _('Serial Number') . '</th> + <th></th> + <th>' . _('Serial Number') . '</th> + </tr>'; +} else if ($Serialised == 0 and $Perishable==0){ + $tableheader = '<tr> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> </tr>"; +} else if ($Serialised == 0 and $Perishable==1){ + $tableheader = '<tr> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Expiry Date') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Expiry Date') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Expiry Date') . '</th> + </tr>'; } echo $tableheader; $TotalQuantity =0; @@ -115,15 +136,17 @@ $TotalQuantity += $myrow['quantity']; if ($Serialised == 1){ - printf('<td>%s</td>', - $myrow['serialno'] - ); - } else { - printf("<td>%s</td> - <td class=number>%s</td>", - $myrow['serialno'], - number_format($myrow['quantity'],$DecimalPlaces) - ); + echo '<td>'.$myrow['serialno'].'/td>'; + echo '<th></th>'; + } else if ($Serialised == 0 and $Perishable==0) { + echo '<td>'.$myrow['serialno'].'</td> + <td class="number">'.number_format($myrow['quantity'],$DecimalPlaces).'</td>'; + echo '<th></th>'; + } else if ($Serialised == 0 and $Perishable==1){ + echo '<td>'.$myrow['serialno'].'</td> + <td class="number">'.number_format($myrow['quantity'],$DecimalPlaces). '</td> + <td>' . ConvertSQLDate($myrow['expirationdate']). '</td>'; + echo '<th></th>'; } $j++; If ($j == 36){ @@ -144,5 +167,4 @@ echo '</form>'; include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SupplierCredit.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -35,6 +35,10 @@ //this is available from the menu on this page already //echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +if (isset($_GET['New'])) { + unset($_SESSION['SuppTrans']); +} + if (!isset($_SESSION['SuppTrans']->SupplierName)) { $sql='SELECT suppname FROM suppliers WHERE supplierid="'.$_GET['SupplierID'].'"'; $result = DB_query($sql,$db); Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/Suppliers.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -444,11 +444,11 @@ } if (!isset($_POST['New'])) { - $supptranssql = "SELECT COUNT(supplierno) - FROM supptrans - WHERE supplierno='".$SupplierID ."'"; + $supptranssql = "SELECT supplierno + FROM supptrans + WHERE supplierno='".$SupplierID ."'"; $suppresult = DB_query($supptranssql, $db); - $supptrans = DB_fetch_row($suppresult); + $supptrans = DB_num_rows($suppresult); $suppcurrssql = "SELECT currcode FROM suppliers @@ -481,7 +481,7 @@ WHERE supplierid = '".$SupplierID."'"; } else { if ($suppcurr[0] != $_POST['CurrCode']) { - prnMsg( _('Cannot change currency code as transactions already exist'), info); + prnMsg( _('Cannot change currency code as transactions already exist'), 'info'); } $sql = "UPDATE suppliers SET suppname='" . $_POST['SuppName'] . "', address1='" . $_POST['Address1'] . "', Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/doc/Change.log.html 2011-03-03 09:13:12 UTC (rev 4501) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> -<p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php </p> +<p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> +<p>3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive</p> +<p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry</p> +<p>27/2/11: Phil StockUsage.php now totals usage each month even in months where there was none - average now includes months with no usage</p> <p>27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check</p> <p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> <p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/includes/Add_SerialItems.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -66,7 +66,7 @@ } if (!$SerialError){ - $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty); + $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $_POST['ExpiryDate' . $i]); } } } /* end if posted Serialno . i is not blank */ @@ -75,7 +75,8 @@ if (!isset($_POST['Bundles'])) { $_POST['Bundles']=0; } - for ($i=0;$i < count($_POST['Bundles']);$i++){ /*there is an entry in the multi select list box */ + echo count($_POST['Bundles']); + for ($i=0;$i < count($_POST['Bundles'])-1;$i++){ /*there is an entry in the multi select list box */ if ($LineItem->Serialised==1){ /*only if the item is serialised */ $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0?1:-1) ); } else { Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/includes/Add_SerialItemsOut.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -3,11 +3,10 @@ /*ProcessSerialItems.php takes the posted variables and adds to the SerialItems array in either the cartclass->LineItems->SerialItems or the POClass->LineItems->SerialItems */ - if (isset($_POST['AddBatches'])){ for ($i=0;$i < 10;$i++){ - if(strlen($_POST['SerialNo' . $i])>0){ + if(isset($_POST['SerialNo' . $i]) and strlen($_POST['SerialNo' . $i])>0){ $ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]); if ($ExistingBundleQty >0){ $AddThisBundle = true; @@ -15,30 +14,31 @@ the first entered one - no warning given though ? */ if ($_POST['Qty' . $i] > $ExistingBundleQty){ if ($LineItem->Serialised ==1){ - echo "<BR>" . $_POST['SerialNo' . $i] . " " . _('has already been sold'); + echo "<br />" . $_POST['SerialNo' . $i] . " " . _('has already been sold'); $AddThisBundle = false; } elseif ($ExistingBundleQty==0) { /* and its a batch */ - echo "<BR>There is none of " . $_POST['SerialNo' . $i] . " left."; + echo "<br />There is none of " . $_POST['SerialNo' . $i] . " left."; $AddThisBundle = false; } else { - echo '<BR>' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); + echo '<br />' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . + ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); $_POST['Qty' . $i] = $ExistingBundleQty; $AddThisBundle = true; } } - if ($AddThisBundle==true){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], $_POST['Qty' . $i]); + if ($AddThisBundle==true and $_POST['Qty' . $i]>0){ + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], $_POST['Qty' . $i], $_POST['E... [truncated message content] |
From: <dai...@us...> - 2011-03-03 09:13:19
|
Revision: 4501 http://web-erp.svn.sourceforge.net/web-erp/?rev=4501&view=rev Author: daintree Date: 2011-03-03 09:13:12 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Tim launchpad revisions to 4441 excluding price units stuff Modified Paths: -------------- trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/DeliveryDetails.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/SelectCompletedOrder.php trunk/SelectCustomer.php trunk/SelectSupplier.php trunk/StockCheck.php trunk/StockSerialItems.php trunk/SupplierCredit.php trunk/Suppliers.php trunk/doc/Change.log.html trunk/includes/Add_SerialItems.php trunk/includes/Add_SerialItemsOut.php trunk/includes/DefineSerialItems.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/PDFStockCheckPageHeader.inc Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -66,7 +66,7 @@ $InOutModifier=1; $ShowExisting=false; -include ('includes/InputSerialItems.php'); +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/ConfirmDispatch_Invoice.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -219,18 +219,24 @@ } foreach ($_SESSION['Items']->LineItems as $Itm) { - if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ + if (sizeOf($Itm->SerialItems) > 0) { + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = 0; //initialise QtyDispatched + foreach ($Itm->SerialItems as $SerialItem) { //calculate QtyDispatched from bundle quantities + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched += $SerialItem->BundleQty; + } + } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = $_POST[$Itm->LineNumber . '_QtyDispatched']; } + + foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; } } + } //end foreach lineitem - } - } /* Always display dispatch quantities and recalc freight for items being dispatched */ @@ -382,15 +388,15 @@ echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; if ($LnItm->Controlled==1){ - - echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">'; - - if ($LnItm->Serialised==1){ - echo _("Enter Serial Numbers"); - } else { /*Just batch/roll/lot control */ - echo _('Enter Batch/Roll/Lot #'); + if (!isset($_POST['ProcessInvoice'])) { + echo '<td><a href="' . $rootpath . '/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">'; + if ($LnItm->Serialised==1){ + echo _('Enter Serial Numbers'); + } else { /*Just batch/roll/lot control */ + echo _('Enter Batch/Roll/Lot #'); + } + echo '</a></td>'; } - echo '</a></td>'; } echo '</tr>'; if (strlen($LnItm->Narrative)>1){ @@ -717,7 +723,7 @@ /*Start an SQL transaction */ -DB_Txn_Begin($db); + DB_Txn_Begin($db); if ($DefaultShipVia != $_SESSION['Items']->ShipVia){ $SQL = "UPDATE custbranch Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/DeliveryDetails.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -580,8 +580,8 @@ } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation') .'</a></td></tr></table>'; - + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td></tr></table>'; + echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td></tr></table>'; } echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; } else { Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/GoodsReceived.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -516,11 +516,13 @@ loccode, serialno, qualitytext, + expirationdate, quantity) VALUES ('" . $OrderLine->StockID . "', '" . $_SESSION['PO'.$identifier]->Location . "', '" . $Item->BundleRef . "', '', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; } Modified: trunk/GoodsReceivedControlled.php =================================================================== --- trunk/GoodsReceivedControlled.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/GoodsReceivedControlled.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -4,8 +4,6 @@ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Receive Controlled Items'); @@ -32,7 +30,7 @@ exit; } -if (isset($_GET['LineNo'])){ +if (isset($_GET['LineNo']) AND $_GET['LineNo']>0){ $LineNo = $_GET['LineNo']; } elseif (isset($_POST['LineNo'])){ $LineNo = $_POST['LineNo']; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SelectCompletedOrder.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -64,8 +64,16 @@ if (isset($OrderNumber)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales Order') . '" alt="" />' . ' ' . _('Order Number') . ' - ' . $OrderNumber . '</p>'; + if (strlen($_SESSION['UserBranch'])>1){ + echo _('For customer') . ': ' . $SelectedCustomer; + echo "<input type=hidden name='SelectedCustomer' value='".$SelectedCustomer."'>"; + } } elseif (isset($CustomerRef)) { echo _('Customer Ref') . ' - ' . $CustomerRef; + if (strlen($_SESSION['UserBranch'])>1){ + echo ' ' . _('and for customer') . ': ' . $SelectedCustomer .' ' . _('and') . ' '; + echo "<input type=hidden name='SelectedCustomer' value='".$SelectedCustomer."'>"; + } } else { if (isset($SelectedCustomer)) { echo _('For customer') . ': ' . $SelectedCustomer .' ' . _('and') . ' '; @@ -212,13 +220,42 @@ $SelectedStockItem = $myrow[0]; $_POST['SearchOrders']='True'; unset($StockItemsResult); - echo '<br>' . _('For the part') . ': ' . $SelectedStockItem . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='$SelectedStockItem'>"; + echo '<br />' . _('For the part') . ': ' . $SelectedStockItem . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='$SelectedStockItem'>"; } } } else if (isset($_POST['SearchOrders']) AND Is_Date($_POST['OrdersAfterDate'])==1) { //figure out the SQL required from the inputs available if (isset($OrderNumber)) { + if (isset($SelectedCustomer)) { + $SQL = "SELECT salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue + FROM salesorders, + salesorderdetails, + debtorsmaster, + custbranch + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.branchcode = custbranch.branchcode + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.debtorno='" . $SelectedCustomer ."' + AND salesorders.orderno='". $OrderNumber ."' + AND salesorders.quotation=0 + AND salesorderdetails.completed".$completed." + GROUP BY salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto + ORDER BY salesorders.orderno"; + } else { //Set order number and SelectedCustomer not set $SQL = "SELECT salesorders.orderno, debtorsmaster.name, custbranch.brname, @@ -245,7 +282,9 @@ salesorders.deliverydate, salesorders.deliverto ORDER BY salesorders.orderno"; + } } elseif (isset($CustomerRef)) { + if (isset($SelectedCustomer)) { $SQL = "SELECT salesorders.orderno, debtorsmaster.name, custbranch.brname, @@ -261,6 +300,7 @@ AND salesorders.branchcode = custbranch.branchcode AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.debtorno='" . $SelectedCustomer ."' AND salesorders.customerref like '%". $CustomerRef."%' AND salesorders.quotation=0 AND salesorderdetails.completed".$completed." @@ -272,6 +312,34 @@ salesorders.deliverydate, salesorders.deliverto ORDER BY salesorders.orderno"; + } else { //customer not selected + $SQL = "SELECT salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue + FROM salesorders, + salesorderdetails, + debtorsmaster, + custbranch + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.branchcode = custbranch.branchcode + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.customerref like '%". $CustomerRef."%' + AND salesorders.quotation=0 + AND salesorderdetails.completed".$completed." + GROUP BY salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverydate, + salesorders.deliverto + ORDER BY salesorders.orderno"; + } } else { $DateAfterCriteria = FormatDateforSQL($_POST['OrdersAfterDate']); @@ -399,8 +467,8 @@ $SalesOrdersResult = DB_query($SQL,$db); if (DB_error_no($db) !=0) { - echo '<br>' . _('No orders were returned by the SQL because') . ' ' . DB_error_msg($db); - echo "<br>$SQL"; + echo '<br />' . _('No orders were returned by the SQL because') . ' ' . DB_error_msg($db); + echo "<br />$SQL"; } }//end of which button clicked options @@ -416,22 +484,22 @@ echo "<tr><td></td>"; } -if (!isset($OrderNumber) or $OrderNumber==''){ - echo '<td>' . _('Order Number') . ':</td><td>' . "<input type='text' name='OrderNumber' maxlength =8 size=9></td><td>" . _('for all orders placed after') . - ": </td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OrdersAfterDate' maxlength =10 size=11 value=" . $_POST['OrdersAfterDate'] . "></td><td>" . - "<input type='submit' name='SearchOrders' value='" . _('Search Orders') . "'></td></tr>"; - echo '<tr><td></td><td>' . _('Customer Ref') . ':</td><td>' . "<input type='text' name='CustomerRef' maxlength =8 size=9></td> +echo '<td>' . _('Order Number') . ':</td> + <td>' . "<input type='text' name='OrderNumber' maxlength =8 size=9 value ='" . $_POST['OrderNumber'] . "'></td> + <td>" . _('for all orders placed after') . ": </td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OrdersAfterDate' maxlength =10 size=11 value=" . $_POST['OrdersAfterDate'] . "></td> + <td>" . "<input type='submit' name='SearchOrders' value='" . _('Search Orders') . "'></td></tr>"; +echo '<tr><td></td><td>' . _('Customer Ref') . ':</td><td>' . "<input type='text' name='CustomerRef' maxlength =8 size=9></td> <td></td><td colspan=2><input type='checkbox' ".$ShowChecked." name='completed' />"._('Show Completed orders only') . "</td></tr>"; -} + echo '</table>'; if (!isset($SelectedStockItem)) { $SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; $result1 = DB_query($SQL,$db); - echo '<br>'; + echo '<br />'; echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><td><font size=1>' . _('Select a stock category') . ':</font>'; echo '<select name="StockCat">'; @@ -461,7 +529,7 @@ If (isset($StockItemsResult)) { - echo '<br><table cellpadding=2 colspan=7 class=selection>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeadings = "<tr><th>" . _('Code') . "</th>" . "<th>" . _('Description') . "</th>" . @@ -511,7 +579,7 @@ /*show a table of the orders returned by the SQL */ - echo '<br><table cellpadding=2 colspan=6 width=90% class=selection>'; + echo '<br /><table cellpadding=2 colspan=6 width=90% class=selection>'; $tableheader = "<tr><th>" . _('Order') . " #</th> <th>" . _('Customer') . "</th> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SelectCustomer.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 2; + include ('includes/session.inc'); $title = _('Search Customers'); include ('includes/header.inc'); @@ -119,8 +119,9 @@ custbranch.phoneno, custbranch.faxno FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.typeid = debtortype.typeid"; + ON debtorsmaster.debtorno = custbranch.debtorno + INNER JOIN debtortype + ON debtorsmaster.typeid = debtortype.typeid"; } else { if (strlen($_POST['Keywords']) > 0) { //using the customer name Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SelectSupplier.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -166,7 +166,7 @@ echo '</td><td valign=top class="select">'; /* Supplier Transactions */ echo "<a href=\"$rootpath/PO_Header.php?" . SID . '&NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Purchase Order for This Supplier') . '</a><br>'; echo "<a href=\"$rootpath/SupplierInvoice.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Invoice') . '</a><br>'; - echo "<a href=\"$rootpath/SupplierCredit.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Credit Note') . '</a><br>'; + echo "<a href=\"$rootpath/SupplierCredit.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . '&New=True' . "\">" . _('Enter a Suppliers Credit Note') . '</a><br>'; echo "<a href=\"$rootpath/Payments.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br>'; echo '<br>'; echo "<br><a href='$rootpath/ReverseGRN.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "'>" . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/StockCheck.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -175,8 +175,9 @@ $FontSize=10; $YPos -=$line_height; - if ($_POST['ShowInfo']==true){ + if (isset($_POST['ShowInfo']) and $_POST['ShowInfo']==true){ + $SQL = "SELECT SUM(salesorderdetails.quantity - salesorderdetails.qtyinvoiced) AS qtydemand FROM salesorderdetails, salesorders Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/StockSerialItems.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -1,8 +1,8 @@ <?php /* $Id$*/ -//$PageSecurity = 2; + include('includes/session.inc'); $title = _('Stock Of Controlled Items'); include('includes/header.inc'); @@ -28,21 +28,23 @@ mbflag, decimalplaces, serialised, - controlled + controlled, + perishable FROM stockmaster WHERE stockid='".$StockID."'", $db, _('Could not retrieve the requested item because')); -$myrow = DB_fetch_row($result); +$myrow = DB_fetch_array($result); -$Description = $myrow[0]; -$UOM = $myrow[1]; -$DecimalPlaces = $myrow[3]; -$Serialised = $myrow[4]; -$Controlled = $myrow[5]; +$Description = $myrow['description']; +$UOM = $myrow['units']; +$DecimalPlaces = $myrow['decimalplaces']; +$Serialised = $myrow['serialised']; +$Controlled = $myrow['controlled']; +$Perishable = $myrow['perishable']; -if ($myrow[2]=='K' OR $myrow[2]=='A' OR $myrow[2]=='D'){ +if ($myrow['mbflag']=='K' OR $myrow['mbflag']=='A' OR $myrow['mbflag']=='D'){ prnMsg(_('This item is either a kitset or assembly or a dummy part and cannot have a stock holding') . '. ' . _('This page cannot be displayed') . '. ' . _('Only serialised or controlled items can be displayed in this page'),'error'); include('includes/footer.inc'); @@ -59,7 +61,8 @@ $myrow = DB_fetch_row($result); $sql = "SELECT serialno, - quantity + quantity, + expirationdate FROM stockserialitems WHERE loccode='" . $_GET['Location'] . "' AND stockid = '" . $StockID . "' @@ -72,30 +75,48 @@ echo '<table cellpadding=2 class=selection>'; if ($Serialised==1){ - echo '<tr<th colspan=3><font color=navy size=2>' . _('Serialised items in') . ' '; + echo '<tr><th colspan="5"><font color=navy size=2>' . _('Serialised items in') . ' '; } else { - echo '<tr<th colspan=3><font color=navy size=2>' . _('Controlled items in') . ' '; + echo '<tr><th colspan="11"><font color=navy size=2>' . _('Controlled items in') . ' '; } echo $myrow[0]. '</font></th></tr>'; -echo "<tr><th colspan=3><font color=navy size=2>".$StockID ."-". $Description ."</b> (" . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; +echo "<tr><th colspan=11><font color=navy size=2>".$StockID ."-". $Description ."</b> (" . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; if ($Serialised == 1){ - $tableheader = "<tr> - <th>" . _('Serial Number') . "</th> - <th>" . _('Serial Number') . "</th> - <th>" . _('Serial Number') . "</th> - </tr>"; -} else { - $tableheader = "<tr> - <th>" . _('Batch/Bundle Ref') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Batch/Bundle Ref') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Batch/Bundle Ref') . "</th> - <th>" . _('Quantity On Hand') . "</th> + $tableheader = '<tr> + <th>' . _('Serial Number') . '</th> + <th></th> + <th>' . _('Serial Number') . '</th> + <th></th> + <th>' . _('Serial Number') . '</th> + </tr>'; +} else if ($Serialised == 0 and $Perishable==0){ + $tableheader = '<tr> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> </tr>"; +} else if ($Serialised == 0 and $Perishable==1){ + $tableheader = '<tr> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Expiry Date') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Expiry Date') . '</th> + <th></th> + <th>' . _('Batch/Bundle Ref') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Expiry Date') . '</th> + </tr>'; } echo $tableheader; $TotalQuantity =0; @@ -115,15 +136,17 @@ $TotalQuantity += $myrow['quantity']; if ($Serialised == 1){ - printf('<td>%s</td>', - $myrow['serialno'] - ); - } else { - printf("<td>%s</td> - <td class=number>%s</td>", - $myrow['serialno'], - number_format($myrow['quantity'],$DecimalPlaces) - ); + echo '<td>'.$myrow['serialno'].'/td>'; + echo '<th></th>'; + } else if ($Serialised == 0 and $Perishable==0) { + echo '<td>'.$myrow['serialno'].'</td> + <td class="number">'.number_format($myrow['quantity'],$DecimalPlaces).'</td>'; + echo '<th></th>'; + } else if ($Serialised == 0 and $Perishable==1){ + echo '<td>'.$myrow['serialno'].'</td> + <td class="number">'.number_format($myrow['quantity'],$DecimalPlaces). '</td> + <td>' . ConvertSQLDate($myrow['expirationdate']). '</td>'; + echo '<th></th>'; } $j++; If ($j == 36){ @@ -144,5 +167,4 @@ echo '</form>'; include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/SupplierCredit.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -35,6 +35,10 @@ //this is available from the menu on this page already //echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +if (isset($_GET['New'])) { + unset($_SESSION['SuppTrans']); +} + if (!isset($_SESSION['SuppTrans']->SupplierName)) { $sql='SELECT suppname FROM suppliers WHERE supplierid="'.$_GET['SupplierID'].'"'; $result = DB_query($sql,$db); Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/Suppliers.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -444,11 +444,11 @@ } if (!isset($_POST['New'])) { - $supptranssql = "SELECT COUNT(supplierno) - FROM supptrans - WHERE supplierno='".$SupplierID ."'"; + $supptranssql = "SELECT supplierno + FROM supptrans + WHERE supplierno='".$SupplierID ."'"; $suppresult = DB_query($supptranssql, $db); - $supptrans = DB_fetch_row($suppresult); + $supptrans = DB_num_rows($suppresult); $suppcurrssql = "SELECT currcode FROM suppliers @@ -481,7 +481,7 @@ WHERE supplierid = '".$SupplierID."'"; } else { if ($suppcurr[0] != $_POST['CurrCode']) { - prnMsg( _('Cannot change currency code as transactions already exist'), info); + prnMsg( _('Cannot change currency code as transactions already exist'), 'info'); } $sql = "UPDATE suppliers SET suppname='" . $_POST['SuppName'] . "', address1='" . $_POST['Address1'] . "', Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/doc/Change.log.html 2011-03-03 09:13:12 UTC (rev 4501) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> -<p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php </p> +<p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> +<p>3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive</p> +<p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry</p> +<p>27/2/11: Phil StockUsage.php now totals usage each month even in months where there was none - average now includes months with no usage</p> <p>27/2/11: Phil fix units deletion issue reported by Exson in UnitsOfMeasure.php script - checked for none existant units field in contracts table - removed the check</p> <p>22/2/11: Phil fix PDFTopItems.php for changed variable names - now using CamelCase tried to rework to conform</p> <p>22/2/11: Phil remove options for PDFLanguage that are not unique in WWW_Users.php - make it default to the users settings in the SESSION for UserSettings.php</p> Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/includes/Add_SerialItems.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -66,7 +66,7 @@ } if (!$SerialError){ - $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty); + $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $_POST['ExpiryDate' . $i]); } } } /* end if posted Serialno . i is not blank */ @@ -75,7 +75,8 @@ if (!isset($_POST['Bundles'])) { $_POST['Bundles']=0; } - for ($i=0;$i < count($_POST['Bundles']);$i++){ /*there is an entry in the multi select list box */ + echo count($_POST['Bundles']); + for ($i=0;$i < count($_POST['Bundles'])-1;$i++){ /*there is an entry in the multi select list box */ if ($LineItem->Serialised==1){ /*only if the item is serialised */ $LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], ($InOutModifier>0?1:-1) ); } else { Modified: trunk/includes/Add_SerialItemsOut.php =================================================================== --- trunk/includes/Add_SerialItemsOut.php 2011-02-27 09:18:42 UTC (rev 4500) +++ trunk/includes/Add_SerialItemsOut.php 2011-03-03 09:13:12 UTC (rev 4501) @@ -3,11 +3,10 @@ /*ProcessSerialItems.php takes the posted variables and adds to the SerialItems array in either the cartclass->LineItems->SerialItems or the POClass->LineItems->SerialItems */ - if (isset($_POST['AddBatches'])){ for ($i=0;$i < 10;$i++){ - if(strlen($_POST['SerialNo' . $i])>0){ + if(isset($_POST['SerialNo' . $i]) and strlen($_POST['SerialNo' . $i])>0){ $ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]); if ($ExistingBundleQty >0){ $AddThisBundle = true; @@ -15,30 +14,31 @@ the first entered one - no warning given though ? */ if ($_POST['Qty' . $i] > $ExistingBundleQty){ if ($LineItem->Serialised ==1){ - echo "<BR>" . $_POST['SerialNo' . $i] . " " . _('has already been sold'); + echo "<br />" . $_POST['SerialNo' . $i] . " " . _('has already been sold'); $AddThisBundle = false; } elseif ($ExistingBundleQty==0) { /* and its a batch */ - echo "<BR>There is none of " . $_POST['SerialNo' . $i] . " left."; + echo "<br />There is none of " . $_POST['SerialNo' . $i] . " left."; $AddThisBundle = false; } else { - echo '<BR>' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); + echo '<br />' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . + ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll'); $_POST['Qty' . $i] = $ExistingBundleQty; $AddThisBundle = true; } } - if ($AddThisBundle==true){ - $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], $_POST['Qty' . $i]); + if ($AddThisBundle==true and $_POST['Qty' . $i]>0){ + $LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i], $_POST['Qty' . $i], $_POST['E... [truncated message content] |
From: <dai...@us...> - 2011-03-03 09:14:52
|
Revision: 4502 http://web-erp.svn.sourceforge.net/web-erp/?rev=4502&view=rev Author: daintree Date: 2011-03-03 09:14:45 +0000 (Thu, 03 Mar 2011) Log Message: ----------- New Portrait quotation OutputSerialItems Added Paths: ----------- trunk/PDFQuotationPortrait.php trunk/includes/OutputSerialItems.php trunk/includes/PDFQuotationPortraitPageHeader.inc Added: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php (rev 0) +++ trunk/PDFQuotationPortrait.php 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,252 @@ +<?php + +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ + + +include('includes/session.inc'); +include('includes/SQL_CommonFunctions.inc'); + +//Get Out if we have no order number to work with +If (!isset($_GET['QuotationNo']) || $_GET['QuotationNo']==""){ + $title = _('Select Quotation To Print'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Select a Quotation to Print before calling this page') , 'error'); + echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Quotations') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit(); +} + +/*retrieve the order details from the database to print */ +$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); + +$sql = "SELECT salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + +$result=DB_query($sql,$db, $ErrMsg); + +//If there are no rows, there's a problem. +if (DB_num_rows($result)==0){ + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ + + $myrow = DB_fetch_array($result); +} + +/*retrieve the order details from the database to print */ + +/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; +) +LETS GO */ +$PaperSize = 'A4'; +include('includes/PDFStarter.php'); +$pdf->addInfo('Title', _('Customer Quotation') ); +$pdf->addInfo('Subject', _('Quotation') . ' ' . $_GET['QuotationNo']); +$FontSize=12; +$PageNumber = 1; +$line_height=24; +// $pdf->selectFont('./fonts/Helvetica.afm'); + +/* Now ... Has the order got any line items still outstanding to be invoiced */ + +$ErrMsg = _('There was a problem retrieving the quotation line details for quotation Number') . ' ' . + $_GET['QuotationNo'] . ' ' . _('from the database'); + +$sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.discountpercent, + stockmaster.taxcatid, + salesorderdetails.narrative + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno='" . $_GET['QuotationNo'] . "'"; + +$result=DB_query($sql,$db, $ErrMsg); + +$ListCount = 0; // UldisN + +if (DB_num_rows($result)>0){ + /*Yes there are line items to start the ball rolling with a page header */ + include('includes/PDFQuotationPortraitPageHeader.inc'); + + $QuotationTotal =0; + $QuotationTotalEx=0; + $TaxTotal=0; + + while ($myrow2=DB_fetch_array($result)){ + + $ListCount ++; + + if ((strlen($myrow2['narrative']) >200 AND $YPos-$line_height <= 75) + OR (strlen($myrow2['narrative']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); + + } //end if need a new page headed up + + $DisplayQty = number_format($myrow2['quantity'],2); + $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); + $DisplayPrice = number_format($myrow2['unitprice'],2); + $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; + $SubTot = $myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['discountpercent']); + $TaxProv = $myrow['taxprovinceid']; + $TaxCat = $myrow2['taxcatid']; + $Branch = $myrow['branchcode']; + $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $result3=DB_query($sql3,$db, $ErrMsg); + while ($myrow3=DB_fetch_array($result3)){ + $TaxAuth = $myrow3['taxauthid']; + } + + $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $result4=DB_query($sql4,$db, $ErrMsg); + while ($myrow4=DB_fetch_array($result4)){ + $TaxClass = 100 * $myrow4['taxrate']; + } + + $DisplayTaxClass = $TaxClass . "%"; + $TaxAmount = (($SubTot/100)*(100+$TaxClass))-$SubTot; + $DisplayTaxAmount = number_format($TaxAmount,2); + + $LineTotal = $SubTot + $TaxAmount; + $DisplayTotal = number_format($LineTotal,2); + + $FontSize=10; + + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,100,$FontSize,$myrow2['stkcode']); + $LeftOvers = $pdf->addTextWrap(120,$YPos,295,$FontSize,$myrow2['description']); + $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,$DisplayPrice,'right'); + if ($DisplayDiscount > 0){ + $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); + } + $LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize,$DisplayTaxClass,'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,85,$FontSize,$DisplayTaxAmount,'center'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,90,$FontSize,$DisplayTotal,'right'); + if (strlen($myrow2['narrative'])>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,750,10,$myrow2['narrative']); + if (strlen($LeftOvers>1)){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,750,10,$LeftOvers); + } + } + $QuotationTotal +=$LineTotal; + $QuotationTotalEx +=$SubTot; + $TaxTotal +=$TaxAmount; + + /*increment a line down for the next line item */ + $YPos -= ($line_height); + + } //end while there are line items to print out + if ((strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) + OR (strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); + + } //end if need a new page headed up + + $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); + $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); + + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + } + } + } + } + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + +} /*end if there are line details to show on the quotation*/ + + +//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); +//$len = strlen($pdfcode); +if ($ListCount == 0){ + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). + '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; +} else { +/* + header('Content-type: application/pdf'); + header('Content-Length: ' . $len); + header('Content-Disposition: inline; filename=Quotation.pdf'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); +//echo 'here'; + $pdf->Output('PDFQuotation.pdf', 'I'); +*/ + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->__destruct(); //UldisN +} +?> Added: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php (rev 0) +++ trunk/includes/OutputSerialItems.php 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,210 @@ +<?php +/* $Id$*/ +/*Input Serial Items - used for inputing serial numbers or batch/roll/bundle references +for controlled items - used in: +- ConfirmDispatchControlledInvoice.php +- GoodsReceivedControlled.php +- StockAdjustments.php +- StockTransfers.php +- CreditItemsControlled.php + +*/ + +//we start with a batch or serial no header and need to display something for verification... +global $tableheader; + +include ('includes/Add_SerialItemsOut.php'); + +global $tableheader; +/* Link to clear the list and start from scratch */ +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . + '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . + '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; +$sql="SELECT perishable + FROM stockmaster + WHERE stockid='".$StockID."'"; +$result=DB_query($sql, $db); +$myrow=DB_fetch_array($result); +$Perishable=$myrow['perishable']; +if ($LineItem->Serialised==1){ + $tableheader .= '<tr> + <th>'. _('Serial No').'</th> + </tr>'; + $listtableheader=$tableheader; +} else if ($LineItem->Serialised==0 and $Perishable==1){ + $tableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; + $listtableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; +} else { + $tableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; + $listtableheader=$tableheader; +} + +echo $EditLink . $RemoveLink; + +if (isset($_GET['LineNo'])){ + $LineNo = $_GET['LineNo']; +} elseif (isset($_POST['LineNo'])){ + $LineNo = $_POST['LineNo']; +} + +/*Display the batches already entered with quantities if not serialised */ + +echo '<table class=selection><tr><td valign=top><table class=selection>'; +echo $listtableheader; + +$TotalQuantity = 0; /*Variable to accumulate total quantity received */ +$RowCounter =0; + +$k=0; +foreach ($LineItem->SerialItems as $Bundle){ + + if ($RowCounter == 10){ + echo $listtableheader; + $RowCounter =0; + } else { + $RowCounter++; + } + + if ($k==1){ + echo '<tr bgcolor="#CCCCCC">'; + $k=0; + } else { + echo '<tr bgcolor="#EEEEEE">'; + $k=1; + } + + echo '<td>' . $Bundle->BundleRef . '</td>'; + + if ($LineItem->Serialised==0 and $Perishable==0){ + echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + } else if ($LineItem->Serialised==0 and $Perishable==1){ + echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + } + + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $TotalQuantity += $Bundle->BundleQty; +} + + +/*Display the totals and rule off before allowing new entries */ +if ($LineItem->Serialised==1){ + echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; +} else { + echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; +} + +/*Close off old table */ +echo '</table></td><td valign=top>'; + +/*Start a new table for the Serial/Batch ref input in one column (as a sub table +then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ +//echo '<TABLE><TR><TD valign=TOP>'; + +/*in the first column add a table for the input of newies */ +echo '<table class=selection>'; +echo $tableheader; + + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> + <input type=hidden name=LineNo value="' . $LineNo . '"> + <input type=hidden name=StockID value="' . $StockID . '"> + <input type=hidden name=EntryType value="KEYED">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if ( isset($_GET['EditControlled']) ) { + $EditControlled = isset($_GET['EditControlled'])?$_GET['EditControlled']:false; +} elseif ( isset($_POST['EditControlled']) ){ + $EditControlled = isset($_POST['EditControlled'])?$_POST['EditControlled']:false; +} else { + $EditControlled=false; +} +$TotalQuantity = 0; /*Variable to accumulate total quantity received */ +$RowCounter =0; + +$k=0; + +$StartAddingAt = 0; +if ($EditControlled){ + foreach ($LineItem->SerialItems as $Bundle){ + + echo '<tr><td valign=top><input type=text name="SerialNo'. $StartAddingAt .'" + value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + + /*if the item is controlled not serialised - batch quantity required so just enter bundle refs + into the form for entry of quantities manually */ + + if ($LineItem->Serialised==1){ + echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>'; + } else if ($LineItem->Serialised==0 and $Perishable==1) { + echo '<td><input type=text class="number" name="Qty' . $StartAddingAt .'" size=11 + value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + } else { + echo '<td><input type=text class="number" name="Qty' . $StartAddingAt .'" size=11 + value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + } + + $StartAddingAt++; + } +} + +$sql="SELECT serialno, + quantity, + expirationdate + FROM stockserialitems + WHERE stockid='".$StockID."' + AND loccode='".$_SESSION['Items']->Location."'"; +$result=DB_query($sql, $db); + +$RowNumber=0; +while ($myrow=DB_fetch_array($result)){ + + echo '<tr><td valign=top>'.$myrow['serialno'].'<input type=hidden name="SerialNo'. ($RowNumber) .'" size=21 value="'.$myrow['serialno'].'" maxlength=20></td>'; + + /*if the item is controlled not serialised - batch quantity required so just enter bundle refs + into the form for entry of quantities manually */ + + if ($LineItem->Serialised==1){ + echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" Value=1></tr>'; + } else if ($LineItem->Serialised==0 and $Perishable==1) { + if (isset($LineItem->SerialItems[$myrow['serialno']])) { + echo '<td class=number>'.number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; + } else { + echo '<td class=number>'.number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; + } + echo '<td><input type=text class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength=10></td>'; + echo '<td><input type=hidden class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size=11 + value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10>'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; + } else { + echo '<td><input type=text class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'.$myrow['quantity'].'" maxlength=10></tr>'; + } + $RowNumber++; +} + +echo '</table>'; +echo '<br><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; +echo '</form></td><td valign=top>'; +$ShowExisting=True; +$_POST['EntryType']='Sequential'; +if ($ShowExisting){ + include('includes/InputSerialItemsExisting.php'); +} +echo '</td></tr></table><script type="text/javascript"> +//<![CDATA[ +document.Ga6uF5Wa.SerialNo0.focus(); +//]]> +</script>'; /*end of nested table */ +?> \ No newline at end of file Added: trunk/includes/PDFQuotationPortraitPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPortraitPageHeader.inc (rev 0) +++ trunk/includes/PDFQuotationPortraitPageHeader.inc 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,136 @@ +<?php +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$XPos = $Page_Width/2 - 140; +$pdf->addJpegFromFile($_SESSION['LogoFile'],$XPos+90,720,0,60); + +$XPos = $XPos + 130; + +$FontSize=18; +$pdf->addText($XPos,820,$FontSize, _('Quotation')); +$FontSize=12; +$YPos = 720; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize =10; +$pdf->addText($XPos, $YPos-12,$FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($XPos, $YPos-21,$FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($XPos, $YPos-30,$FontSize, $_SESSION['CompanyRecord']['regoffice3'] . ' ' . $_SESSION['CompanyRecord']['regoffice4'] . ' ' . $_SESSION['CompanyRecord']['regoffice5']); +$pdf->addText($XPos, $YPos-39,$FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($XPos, $YPos-48,$FontSize, $_SESSION['CompanyRecord']['email']); + + +$XPos = 46; +$YPos = 770; + +$FontSize=12; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Delivery To').':' ); +$pdf->addText($XPos, $YPos- 3,$FontSize, $myrow['deliverto']); +$pdf->addText($XPos, $YPos-15,$FontSize, $myrow['deladd1']); +$pdf->addText($XPos, $YPos-30,$FontSize, $myrow['deladd2']); +$pdf->addText($XPos, $YPos-45,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); + +$YPos -= 80; + +$pdf->addText($XPos, $YPos,$FontSize, _('Quotation For').':'); +$pdf->addText($XPos, $YPos-15,$FontSize, $myrow['name']); +$pdf->addText($XPos, $YPos-30,$FontSize, $myrow['address1']); +$pdf->addText($XPos, $YPos-45,$FontSize, $myrow['address2']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); + + +$XPos= 50; +$YPos += 25; +/*draw a nice curved corner box around the delivery details */ +/*from the top right */ +$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); +/*Dow top left corner */ +$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); + + +$YPos -= 90; +/*draw a nice curved corner box around the billing details */ +/*from the top right */ +$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); +/*Dow top left corner */ +$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); + + +$pdf->addText(490, 790,$FontSize, _('Number'). ':'); +$pdf->addText(535, 790,$FontSize, $_GET['QuotationNo']); +$pdf->addText(490, 790-15,$FontSize, _('Your Ref'). ':'); +$pdf->addText(520, 790-15,$FontSize, $myrow['customerref']); +$pdf->addText(490, 790-30,$FontSize, _('Date'). ':'); +$pdf->addText(520, 790-30,$FontSize, ConvertSQLDate($myrow['orddate'])); +$pdf->addText(490, 790-45,$FontSize, _('Page'). ':'); +$pdf->addText(520, 790-45,$FontSize, $PageNumber); + +$YPos -= 45; +$XPos = 40; + +$FontSize=10; +$LeftOvers = $pdf->addTextWrap($XPos+2,$YPos,100,$FontSize, _('Item Code'),'left'); +$LeftOvers = $pdf->addTextWrap(120,$YPos,235,$FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize, _('Quantity'),'right'); +$LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,_('Price'),'right'); +$LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize, _('Discount'),'right'); +$LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize, _('Tax Class'),'right'); +$LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize, _('Tax Amount'),'right'); +$LeftOvers = $pdf->addTextWrap(450,$YPos,90,$FontSize, _('Total'),'right'); + + +/*draw a box with nice round corner for entering line items */ +/*90 degree arc at top right of box 0 degrees starts a bottom */ +$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+560,0,90,10,10); +/*line to the top left */ +$pdf->line($Page_Width-$Right_Margin-0, $Bottom_Margin+570,$Left_Margin+10, $Bottom_Margin+570); + +/*line under headings to top left */ +$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+538,$Left_Margin, $Bottom_Margin+538); + + +/*Dow top left corner */ +$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+560,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($Left_Margin, $Bottom_Margin+560,$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,$Page_Width-$Right_Margin-0, $Bottom_Margin); +/*Now do the bottom right corner */ +$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+10,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+10,$Page_Width-$Right_Margin+10, $Bottom_Margin+560); + +$YPos -= $line_height; + +$FontSize =12; + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-03 09:14:52
|
Revision: 4502 http://web-erp.svn.sourceforge.net/web-erp/?rev=4502&view=rev Author: daintree Date: 2011-03-03 09:14:45 +0000 (Thu, 03 Mar 2011) Log Message: ----------- New Portrait quotation OutputSerialItems Added Paths: ----------- trunk/PDFQuotationPortrait.php trunk/includes/OutputSerialItems.php trunk/includes/PDFQuotationPortraitPageHeader.inc Added: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php (rev 0) +++ trunk/PDFQuotationPortrait.php 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,252 @@ +<?php + +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ + + +include('includes/session.inc'); +include('includes/SQL_CommonFunctions.inc'); + +//Get Out if we have no order number to work with +If (!isset($_GET['QuotationNo']) || $_GET['QuotationNo']==""){ + $title = _('Select Quotation To Print'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Select a Quotation to Print before calling this page') , 'error'); + echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Quotations') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit(); +} + +/*retrieve the order details from the database to print */ +$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); + +$sql = "SELECT salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + +$result=DB_query($sql,$db, $ErrMsg); + +//If there are no rows, there's a problem. +if (DB_num_rows($result)==0){ + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ + + $myrow = DB_fetch_array($result); +} + +/*retrieve the order details from the database to print */ + +/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; +) +LETS GO */ +$PaperSize = 'A4'; +include('includes/PDFStarter.php'); +$pdf->addInfo('Title', _('Customer Quotation') ); +$pdf->addInfo('Subject', _('Quotation') . ' ' . $_GET['QuotationNo']); +$FontSize=12; +$PageNumber = 1; +$line_height=24; +// $pdf->selectFont('./fonts/Helvetica.afm'); + +/* Now ... Has the order got any line items still outstanding to be invoiced */ + +$ErrMsg = _('There was a problem retrieving the quotation line details for quotation Number') . ' ' . + $_GET['QuotationNo'] . ' ' . _('from the database'); + +$sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.discountpercent, + stockmaster.taxcatid, + salesorderdetails.narrative + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno='" . $_GET['QuotationNo'] . "'"; + +$result=DB_query($sql,$db, $ErrMsg); + +$ListCount = 0; // UldisN + +if (DB_num_rows($result)>0){ + /*Yes there are line items to start the ball rolling with a page header */ + include('includes/PDFQuotationPortraitPageHeader.inc'); + + $QuotationTotal =0; + $QuotationTotalEx=0; + $TaxTotal=0; + + while ($myrow2=DB_fetch_array($result)){ + + $ListCount ++; + + if ((strlen($myrow2['narrative']) >200 AND $YPos-$line_height <= 75) + OR (strlen($myrow2['narrative']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); + + } //end if need a new page headed up + + $DisplayQty = number_format($myrow2['quantity'],2); + $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); + $DisplayPrice = number_format($myrow2['unitprice'],2); + $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; + $SubTot = $myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['discountpercent']); + $TaxProv = $myrow['taxprovinceid']; + $TaxCat = $myrow2['taxcatid']; + $Branch = $myrow['branchcode']; + $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $result3=DB_query($sql3,$db, $ErrMsg); + while ($myrow3=DB_fetch_array($result3)){ + $TaxAuth = $myrow3['taxauthid']; + } + + $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $result4=DB_query($sql4,$db, $ErrMsg); + while ($myrow4=DB_fetch_array($result4)){ + $TaxClass = 100 * $myrow4['taxrate']; + } + + $DisplayTaxClass = $TaxClass . "%"; + $TaxAmount = (($SubTot/100)*(100+$TaxClass))-$SubTot; + $DisplayTaxAmount = number_format($TaxAmount,2); + + $LineTotal = $SubTot + $TaxAmount; + $DisplayTotal = number_format($LineTotal,2); + + $FontSize=10; + + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,100,$FontSize,$myrow2['stkcode']); + $LeftOvers = $pdf->addTextWrap(120,$YPos,295,$FontSize,$myrow2['description']); + $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,$DisplayPrice,'right'); + if ($DisplayDiscount > 0){ + $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); + } + $LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize,$DisplayTaxClass,'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,85,$FontSize,$DisplayTaxAmount,'center'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,90,$FontSize,$DisplayTotal,'right'); + if (strlen($myrow2['narrative'])>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,750,10,$myrow2['narrative']); + if (strlen($LeftOvers>1)){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,750,10,$LeftOvers); + } + } + $QuotationTotal +=$LineTotal; + $QuotationTotalEx +=$SubTot; + $TaxTotal +=$TaxAmount; + + /*increment a line down for the next line item */ + $YPos -= ($line_height); + + } //end while there are line items to print out + if ((strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) + OR (strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); + + } //end if need a new page headed up + + $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); + $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); + + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + } + } + } + } + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + +} /*end if there are line details to show on the quotation*/ + + +//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); +//$len = strlen($pdfcode); +if ($ListCount == 0){ + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). + '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; +} else { +/* + header('Content-type: application/pdf'); + header('Content-Length: ' . $len); + header('Content-Disposition: inline; filename=Quotation.pdf'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); +//echo 'here'; + $pdf->Output('PDFQuotation.pdf', 'I'); +*/ + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->__destruct(); //UldisN +} +?> Added: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php (rev 0) +++ trunk/includes/OutputSerialItems.php 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,210 @@ +<?php +/* $Id$*/ +/*Input Serial Items - used for inputing serial numbers or batch/roll/bundle references +for controlled items - used in: +- ConfirmDispatchControlledInvoice.php +- GoodsReceivedControlled.php +- StockAdjustments.php +- StockTransfers.php +- CreditItemsControlled.php + +*/ + +//we start with a batch or serial no header and need to display something for verification... +global $tableheader; + +include ('includes/Add_SerialItemsOut.php'); + +global $tableheader; +/* Link to clear the list and start from scratch */ +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . + '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . + '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; +$sql="SELECT perishable + FROM stockmaster + WHERE stockid='".$StockID."'"; +$result=DB_query($sql, $db); +$myrow=DB_fetch_array($result); +$Perishable=$myrow['perishable']; +if ($LineItem->Serialised==1){ + $tableheader .= '<tr> + <th>'. _('Serial No').'</th> + </tr>'; + $listtableheader=$tableheader; +} else if ($LineItem->Serialised==0 and $Perishable==1){ + $tableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; + $listtableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; +} else { + $tableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; + $listtableheader=$tableheader; +} + +echo $EditLink . $RemoveLink; + +if (isset($_GET['LineNo'])){ + $LineNo = $_GET['LineNo']; +} elseif (isset($_POST['LineNo'])){ + $LineNo = $_POST['LineNo']; +} + +/*Display the batches already entered with quantities if not serialised */ + +echo '<table class=selection><tr><td valign=top><table class=selection>'; +echo $listtableheader; + +$TotalQuantity = 0; /*Variable to accumulate total quantity received */ +$RowCounter =0; + +$k=0; +foreach ($LineItem->SerialItems as $Bundle){ + + if ($RowCounter == 10){ + echo $listtableheader; + $RowCounter =0; + } else { + $RowCounter++; + } + + if ($k==1){ + echo '<tr bgcolor="#CCCCCC">'; + $k=0; + } else { + echo '<tr bgcolor="#EEEEEE">'; + $k=1; + } + + echo '<td>' . $Bundle->BundleRef . '</td>'; + + if ($LineItem->Serialised==0 and $Perishable==0){ + echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + } else if ($LineItem->Serialised==0 and $Perishable==1){ + echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + } + + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $TotalQuantity += $Bundle->BundleQty; +} + + +/*Display the totals and rule off before allowing new entries */ +if ($LineItem->Serialised==1){ + echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; +} else { + echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; +} + +/*Close off old table */ +echo '</table></td><td valign=top>'; + +/*Start a new table for the Serial/Batch ref input in one column (as a sub table +then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ +//echo '<TABLE><TR><TD valign=TOP>'; + +/*in the first column add a table for the input of newies */ +echo '<table class=selection>'; +echo $tableheader; + + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> + <input type=hidden name=LineNo value="' . $LineNo . '"> + <input type=hidden name=StockID value="' . $StockID . '"> + <input type=hidden name=EntryType value="KEYED">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if ( isset($_GET['EditControlled']) ) { + $EditControlled = isset($_GET['EditControlled'])?$_GET['EditControlled']:false; +} elseif ( isset($_POST['EditControlled']) ){ + $EditControlled = isset($_POST['EditControlled'])?$_POST['EditControlled']:false; +} else { + $EditControlled=false; +} +$TotalQuantity = 0; /*Variable to accumulate total quantity received */ +$RowCounter =0; + +$k=0; + +$StartAddingAt = 0; +if ($EditControlled){ + foreach ($LineItem->SerialItems as $Bundle){ + + echo '<tr><td valign=top><input type=text name="SerialNo'. $StartAddingAt .'" + value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + + /*if the item is controlled not serialised - batch quantity required so just enter bundle refs + into the form for entry of quantities manually */ + + if ($LineItem->Serialised==1){ + echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>'; + } else if ($LineItem->Serialised==0 and $Perishable==1) { + echo '<td><input type=text class="number" name="Qty' . $StartAddingAt .'" size=11 + value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + } else { + echo '<td><input type=text class="number" name="Qty' . $StartAddingAt .'" size=11 + value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + } + + $StartAddingAt++; + } +} + +$sql="SELECT serialno, + quantity, + expirationdate + FROM stockserialitems + WHERE stockid='".$StockID."' + AND loccode='".$_SESSION['Items']->Location."'"; +$result=DB_query($sql, $db); + +$RowNumber=0; +while ($myrow=DB_fetch_array($result)){ + + echo '<tr><td valign=top>'.$myrow['serialno'].'<input type=hidden name="SerialNo'. ($RowNumber) .'" size=21 value="'.$myrow['serialno'].'" maxlength=20></td>'; + + /*if the item is controlled not serialised - batch quantity required so just enter bundle refs + into the form for entry of quantities manually */ + + if ($LineItem->Serialised==1){ + echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" Value=1></tr>'; + } else if ($LineItem->Serialised==0 and $Perishable==1) { + if (isset($LineItem->SerialItems[$myrow['serialno']])) { + echo '<td class=number>'.number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; + } else { + echo '<td class=number>'.number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; + } + echo '<td><input type=text class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength=10></td>'; + echo '<td><input type=hidden class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size=11 + value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10>'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; + } else { + echo '<td><input type=text class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'.$myrow['quantity'].'" maxlength=10></tr>'; + } + $RowNumber++; +} + +echo '</table>'; +echo '<br><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; +echo '</form></td><td valign=top>'; +$ShowExisting=True; +$_POST['EntryType']='Sequential'; +if ($ShowExisting){ + include('includes/InputSerialItemsExisting.php'); +} +echo '</td></tr></table><script type="text/javascript"> +//<![CDATA[ +document.Ga6uF5Wa.SerialNo0.focus(); +//]]> +</script>'; /*end of nested table */ +?> \ No newline at end of file Added: trunk/includes/PDFQuotationPortraitPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPortraitPageHeader.inc (rev 0) +++ trunk/includes/PDFQuotationPortraitPageHeader.inc 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,136 @@ +<?php +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$XPos = $Page_Width/2 - 140; +$pdf->addJpegFromFile($_SESSION['LogoFile'],$XPos+90,720,0,60); + +$XPos = $XPos + 130; + +$FontSize=18; +$pdf->addText($XPos,820,$FontSize, _('Quotation')); +$FontSize=12; +$YPos = 720; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize =10; +$pdf->addText($XPos, $YPos-12,$FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($XPos, $YPos-21,$FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($XPos, $YPos-30,$FontSize, $_SESSION['CompanyRecord']['regoffice3'] . ' ' . $_SESSION['CompanyRecord']['regoffice4'] . ' ' . $_SESSION['CompanyRecord']['regoffice5']); +$pdf->addText($XPos, $YPos-39,$FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($XPos, $YPos-48,$FontSize, $_SESSION['CompanyRecord']['email']); + + +$XPos = 46; +$YPos = 770; + +$FontSize=12; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Delivery To').':' ); +$pdf->addText($XPos, $YPos- 3,$FontSize, $myrow['deliverto']); +$pdf->addText($XPos, $YPos-15,$FontSize, $myrow['deladd1']); +$pdf->addText($XPos, $YPos-30,$FontSize, $myrow['deladd2']); +$pdf->addText($XPos, $YPos-45,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); + +$YPos -= 80; + +$pdf->addText($XPos, $YPos,$FontSize, _('Quotation For').':'); +$pdf->addText($XPos, $YPos-15,$FontSize, $myrow['name']); +$pdf->addText($XPos, $YPos-30,$FontSize, $myrow['address1']); +$pdf->addText($XPos, $YPos-45,$FontSize, $myrow['address2']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); + + +$XPos= 50; +$YPos += 25; +/*draw a nice curved corner box around the delivery details */ +/*from the top right */ +$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); +/*Dow top left corner */ +$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); + + +$YPos -= 90; +/*draw a nice curved corner box around the billing details */ +/*from the top right */ +$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); +/*Dow top left corner */ +$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); + + +$pdf->addText(490, 790,$FontSize, _('Number'). ':'); +$pdf->addText(535, 790,$FontSize, $_GET['QuotationNo']); +$pdf->addText(490, 790-15,$FontSize, _('Your Ref'). ':'); +$pdf->addText(520, 790-15,$FontSize, $myrow['customerref']); +$pdf->addText(490, 790-30,$FontSize, _('Date'). ':'); +$pdf->addText(520, 790-30,$FontSize, ConvertSQLDate($myrow['orddate'])); +$pdf->addText(490, 790-45,$FontSize, _('Page'). ':'); +$pdf->addText(520, 790-45,$FontSize, $PageNumber); + +$YPos -= 45; +$XPos = 40; + +$FontSize=10; +$LeftOvers = $pdf->addTextWrap($XPos+2,$YPos,100,$FontSize, _('Item Code'),'left'); +$LeftOvers = $pdf->addTextWrap(120,$YPos,235,$FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize, _('Quantity'),'right'); +$LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,_('Price'),'right'); +$LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize, _('Discount'),'right'); +$LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize, _('Tax Class'),'right'); +$LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize, _('Tax Amount'),'right'); +$LeftOvers = $pdf->addTextWrap(450,$YPos,90,$FontSize, _('Total'),'right'); + + +/*draw a box with nice round corner for entering line items */ +/*90 degree arc at top right of box 0 degrees starts a bottom */ +$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+560,0,90,10,10); +/*line to the top left */ +$pdf->line($Page_Width-$Right_Margin-0, $Bottom_Margin+570,$Left_Margin+10, $Bottom_Margin+570); + +/*line under headings to top left */ +$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+538,$Left_Margin, $Bottom_Margin+538); + + +/*Dow top left corner */ +$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+560,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($Left_Margin, $Bottom_Margin+560,$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,$Page_Width-$Right_Margin-0, $Bottom_Margin); +/*Now do the bottom right corner */ +$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+10,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+10,$Page_Width-$Right_Margin+10, $Bottom_Margin+560); + +$YPos -= $line_height; + +$FontSize =12; + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-04 19:40:53
|
Revision: 4503 http://web-erp.svn.sourceforge.net/web-erp/?rev=4503&view=rev Author: daintree Date: 2011-03-04 19:40:47 +0000 (Fri, 04 Mar 2011) Log Message: ----------- Kovacs Attila fixes GROUP BY clauses in SQL and laguage binding always UTF-8 Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/Stocks.php 2011-03-04 19:40:47 UTC (rev 4503) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Item Maintenance'); include('includes/header.inc'); @@ -19,7 +17,7 @@ } if (isset($StockID) and !isset($_POST['UpdateCategories'])) { - $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."'"; + $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -48,7 +46,7 @@ } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check prnMsg(_('The file size is over the maximum allowed. The maximum size allowed in KB is') . ' ' . $_SESSION['MaxImageSize'],'warn'); $UploadTheFile ='No'; - } elseif ( $_FILES['ItemPicture']['type'] == "text/plain" ) { //File Type Check + } elseif ( $_FILES['ItemPicture']['type'] == 'text/plain' ) { //File Type Check prnMsg( _('Only graphics files can be uploaded'),'warn'); $UploadTheFile ='No'; } elseif (file_exists($filename)){ @@ -219,7 +217,7 @@ $OldControlled = $myrow[1]; $OldSerialised = $myrow[2]; - $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."'"; + $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $stkqtychk = DB_fetch_row($result); @@ -268,7 +266,7 @@ /*now check that if it was a Manufactured, Kitset, Phantom or Assembly and is being changed to a purchased or dummy - that no BOM exists */ if (($OldMBFlag=='M' OR $OldMBFlag =='K' OR $OldMBFlag=='A' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='B' OR $_POST['MBFlag']=='D')) { - $sql = "SELECT COUNT(*) FROM bom WHERE parent = '".$StockID."'"; + $sql = "SELECT COUNT(*) FROM bom WHERE parent = '".$StockID."' GROUP BY parent"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -279,7 +277,7 @@ /*now check that if it was Manufac, Phantom or Purchased and is being changed to assembly or kitset, it is not a component on an existing BOM */ if (($OldMBFlag=='M' OR $OldMBFlag =='B' OR $OldMBFlag=='D' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K')) { - $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."'"; + $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."' GROUP BY component"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -462,7 +460,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMoves' - $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockid='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -471,7 +469,7 @@ echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock movements that refer to this item'); } else { - $sql= "SELECT COUNT(*) FROM bom WHERE component='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM bom WHERE component='".$StockID."' GROUP BY component"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -479,7 +477,7 @@ prnMsg( _('Cannot delete this item record because there are bills of material that require this part as a component'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bills of material that require this part as a component'); } else { - $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -487,7 +485,7 @@ prnMsg( _('Cannot delete this item record because there are existing sales orders for this part'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales order items against this part'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE stockid='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM salesanalysis WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -495,7 +493,7 @@ prnMsg(_('Cannot delete this item because sales analysis records exist for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this part'); } else { - $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -503,7 +501,7 @@ prnMsg(_('Cannot delete this item because there are existing purchase order items for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('purchase order item record relating to this part'); } else { - $sql = "SELECT SUM(quantity) AS qoh FROM locstock WHERE stockid='".$StockID."'"; + $sql = "SELECT SUM(quantity) AS qoh FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/doc/Change.log.html 2011-03-04 19:40:47 UTC (rev 4503) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL</p> +<p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF- now as no dynamic changing of character set required all translations are utf-8</p> <p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> <p>3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive</p> <p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry</p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/includes/LanguageSetup.php 2011-03-04 19:40:47 UTC (rev 4503) @@ -37,7 +37,7 @@ //putenv('LANG=$Language_Country'); bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); - bind_textdomain_codeset('messages', _('ISO-8859-1')); + bind_textdomain_codeset('messages', 'UTF-8'); $locale_info = localeconv(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-04 19:40:54
|
Revision: 4503 http://web-erp.svn.sourceforge.net/web-erp/?rev=4503&view=rev Author: daintree Date: 2011-03-04 19:40:47 +0000 (Fri, 04 Mar 2011) Log Message: ----------- Kovacs Attila fixes GROUP BY clauses in SQL and laguage binding always UTF-8 Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/Stocks.php 2011-03-04 19:40:47 UTC (rev 4503) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Item Maintenance'); include('includes/header.inc'); @@ -19,7 +17,7 @@ } if (isset($StockID) and !isset($_POST['UpdateCategories'])) { - $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."'"; + $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -48,7 +46,7 @@ } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check prnMsg(_('The file size is over the maximum allowed. The maximum size allowed in KB is') . ' ' . $_SESSION['MaxImageSize'],'warn'); $UploadTheFile ='No'; - } elseif ( $_FILES['ItemPicture']['type'] == "text/plain" ) { //File Type Check + } elseif ( $_FILES['ItemPicture']['type'] == 'text/plain' ) { //File Type Check prnMsg( _('Only graphics files can be uploaded'),'warn'); $UploadTheFile ='No'; } elseif (file_exists($filename)){ @@ -219,7 +217,7 @@ $OldControlled = $myrow[1]; $OldSerialised = $myrow[2]; - $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."'"; + $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $stkqtychk = DB_fetch_row($result); @@ -268,7 +266,7 @@ /*now check that if it was a Manufactured, Kitset, Phantom or Assembly and is being changed to a purchased or dummy - that no BOM exists */ if (($OldMBFlag=='M' OR $OldMBFlag =='K' OR $OldMBFlag=='A' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='B' OR $_POST['MBFlag']=='D')) { - $sql = "SELECT COUNT(*) FROM bom WHERE parent = '".$StockID."'"; + $sql = "SELECT COUNT(*) FROM bom WHERE parent = '".$StockID."' GROUP BY parent"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -279,7 +277,7 @@ /*now check that if it was Manufac, Phantom or Purchased and is being changed to assembly or kitset, it is not a component on an existing BOM */ if (($OldMBFlag=='M' OR $OldMBFlag =='B' OR $OldMBFlag=='D' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K')) { - $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."'"; + $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."' GROUP BY component"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -462,7 +460,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMoves' - $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockid='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -471,7 +469,7 @@ echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock movements that refer to this item'); } else { - $sql= "SELECT COUNT(*) FROM bom WHERE component='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM bom WHERE component='".$StockID."' GROUP BY component"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -479,7 +477,7 @@ prnMsg( _('Cannot delete this item record because there are bills of material that require this part as a component'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bills of material that require this part as a component'); } else { - $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -487,7 +485,7 @@ prnMsg( _('Cannot delete this item record because there are existing sales orders for this part'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales order items against this part'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE stockid='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM salesanalysis WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -495,7 +493,7 @@ prnMsg(_('Cannot delete this item because sales analysis records exist for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this part'); } else { - $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -503,7 +501,7 @@ prnMsg(_('Cannot delete this item because there are existing purchase order items for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('purchase order item record relating to this part'); } else { - $sql = "SELECT SUM(quantity) AS qoh FROM locstock WHERE stockid='".$StockID."'"; + $sql = "SELECT SUM(quantity) AS qoh FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/doc/Change.log.html 2011-03-04 19:40:47 UTC (rev 4503) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL</p> +<p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF- now as no dynamic changing of character set required all translations are utf-8</p> <p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> <p>3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive</p> <p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry</p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/includes/LanguageSetup.php 2011-03-04 19:40:47 UTC (rev 4503) @@ -37,7 +37,7 @@ //putenv('LANG=$Language_Country'); bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); - bind_textdomain_codeset('messages', _('ISO-8859-1')); + bind_textdomain_codeset('messages', 'UTF-8'); $locale_info = localeconv(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-08 07:38:52
|
Revision: 4504 http://web-erp.svn.sourceforge.net/web-erp/?rev=4504&view=rev Author: daintree Date: 2011-03-08 07:38:45 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Sales Analysis fix Modified Paths: -------------- trunk/SalesAnalysis_UserDefined.php trunk/doc/Change.log.html trunk/includes/PDFSalesAnalysis.inc Modified: trunk/SalesAnalysis_UserDefined.php =================================================================== --- trunk/SalesAnalysis_UserDefined.php 2011-03-04 19:40:47 UTC (rev 4503) +++ trunk/SalesAnalysis_UserDefined.php 2011-03-08 07:38:45 UTC (rev 4504) @@ -2,7 +2,7 @@ /* $Id$ */ -//$PageSecurity = 2; + include('includes/session.inc'); if (!in_array($PageSecurity,$_SESSION['AllowedPageSecurityTokens'])){ @@ -18,9 +18,9 @@ if ($Counter >0) { $pdf->OutputD('SalesAnalysis_' . date('Y-m-d') . '.pdf'); - $pdf-> __destruct(); + $pdf->__destruct(); } else { - $pdf-> __destruct(); + $pdf->__destruct(); $title = _('User Defined Sales Analysis Problem'); include('includes/header.inc'); echo '<p>' . _('The report did not have any none zero lines of information to show and so it has not been created'); @@ -46,5 +46,4 @@ echo '<p>' . _('You should automatically be forwarded to the CSV Sales Analysis file when it is ready') . '. ' . _('If this does not happen') . ' <a href="' . $rootpath . '/' . $_SESSION['reports_dir'] . '/SalesAnalysis.csv">' . _('click here') . '</a> ' . _('to continue') . '<br />'; include('includes/footer.inc'); } - -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-04 19:40:47 UTC (rev 4503) +++ trunk/doc/Change.log.html 2011-03-08 07:38:45 UTC (rev 4504) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>8/3/11:Phil fix SalesAnalysis reports for TCPDF as reported by Joe Zhou</p> <p>5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL</p> <p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF- now as no dynamic changing of character set required all translations are utf-8</p> <p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> Modified: trunk/includes/PDFSalesAnalysis.inc =================================================================== --- trunk/includes/PDFSalesAnalysis.inc 2011-03-04 19:40:47 UTC (rev 4503) +++ trunk/includes/PDFSalesAnalysis.inc 2011-03-08 07:38:45 UTC (rev 4504) @@ -4,23 +4,23 @@ include ('includes/class.pdf.php'); -/* A4_Landscape */ +/* A4_Landscape */ +$DocumentPaper = 'A4'; +$DocumentOrientation ='L'; $Page_Width=842; $Page_Height=595; -$Top_Margin=20; -$Bottom_Margin=20; -$Left_Margin=25; -$Right_Margin=22; +$Top_Margin=30; +$Bottom_Margin=30; +$Left_Margin=40; +$Right_Margin=30; -// Javier: now I use the native constructor -// $PageSize = array(0,0,$Page_Width,$Page_Height); +$pdf = new Cpdf($DocumentOrientation, 'pt', $DocumentPaper); +$pdf->SetAutoPageBreak(true, 0); +$pdf->SetPrintHeader(false); +$pdf->AddPage(); +$pdf->cMargin = 0; -// Javier: better to not use references -// $pdf = & new Cpdf($PageSize); - $pdf = new Cpdf('L', 'pt', 'A4'); - - /* Standard PDF file creation header stuff */ $pdf->addInfo('Author','webERP ' . $Version); @@ -41,278 +41,269 @@ /*Make an array to hold accumulators for */ $AccumLvl1 = array(); +$AccumLvl2 = array(); +$AccumLvl3 = array(); +$AccumLvl4 = array(); + for ($i=0;$i<=10;$i++){ -$AccumLvl1[$i]=0; + $AccumLvl1[$i]=0; + $AccumLvl2[$i]=0; + $AccumLvl3[$i]=0; + $AccumLvl4[$i]=0; } -$AccumLvl2= array(); -for ($i=0;$i<=10;$i++){ -$AccumLvl2[$i]=0; -} -$AccumLvl3=array(); -for ($i=0;$i<=10;$i++){ -$AccumLvl3[$i]=0; -} -$AccumLvl4=array(); -for ($i=0;$i<=10;$i++){ -$AccumLvl4[$i]=0; -} While ($myrow = DB_fetch_array($result)){ /*First off check that at least one of the columns of data has some none zero amounts */ -DB_data_seek($ColsResult,0); /*go back to the beginning */ -$ThisLineHasOutput=False; /*assume no output to start with */ -while ($Cols = DB_fetch_array($ColsResult)){ - $ColumnNo ='col' . ((int) $Cols['colno'] + 8); - if (abs($myrow[$ColumnNo])>0.5){ - $ThisLineHasOutput = True; + DB_data_seek($ColsResult,0); /*go back to the beginning */ + $ThisLineHasOutput=False; /*assume no output to start with */ + while ($Cols = DB_fetch_array($ColsResult)){ + $ColumnNo ='col' . ((int) $Cols['colno'] + 8); + if (abs($myrow[$ColumnNo])>0.5){ + $ThisLineHasOutput = True; + } } -} -if ($ThisLineHasOutput==True){ + if ($ThisLineHasOutput==True){ - if ($myrow['col5']!=$GrpData3 && $myrow['col5']!='0' && $myrow['col7']!='0'){ - /*Totals only relevant to GrpByLevel 3 if GrpByLevel 4 also used */ - if ($Counter > 0){ /*Dont want to print totals if this is the first record */ - $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col5'] . ' - ' . $LastLine['col6'],0,33); - $LeftOvers = $pdf->addTextWrap(40,$Ypos,180,$FontSize,$TotalText); + if ($myrow['col5']!=$GrpData3 && $myrow['col5']!='0' && $myrow['col7']!='0'){ + /*Totals only relevant to GrpByLevel 3 if GrpByLevel 4 also used */ + if ($Counter > 0){ /*Dont want to print totals if this is the first record */ + $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col5'] . ' - ' . $LastLine['col6'],0,33); + $LeftOvers = $pdf->addTextWrap(40,$Ypos,180,$FontSize,$TotalText); - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + $Cols['colno']*60; - if ($Cols['calculation']==0){ - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, number_format($AccumLvl3[$Cols['colno']]),'right'); - } else { /* its a calculation need to re-perform on the totals*/ + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + $Cols['colno']*60; + if ($Cols['calculation']==0){ + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, number_format($AccumLvl3[$Cols['colno']]),'right'); + } else { /* its a calculation need to re-perform on the totals*/ - switch ($Cols['calcoperator']) { - case '/': - if ($AccumLvl3[$Cols['coldenominator']]==0){ - $TotalCalculation = 0; + switch ($Cols['calcoperator']) { + case '/': + if ($AccumLvl3[$Cols['coldenominator']]==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $AccumLvl3[$Cols['coldenominator']]; + } + break; + case '+': + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; + break; + case '-': + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; + break; + case '*': + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] * $Cols['constant']; + break; + case 'C': + if ($Cols['constant']==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $Cols['constant']; + } + break; + } /*end of switch stmt block*/ + if ($Cols['valformat']=='P'){ + $TotalCalculation = number_format($TotalCalculation * 100) . '%'; } else { - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $AccumLvl3[$Cols['coldenominator']]; + $TotalCalculation = number_format($TotalCalculation); } - break; - case '+': - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; - break; - case '-': - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; - break; - case '*': - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] * $Cols['constant']; - break; - case 'C': - if ($Cols['constant']==0){ - $TotalCalculation = 0; - } else { - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $Cols['constant']; - } - break; - } /*end of switch stmt block*/ - if ($Cols['valformat']=='P'){ - $TotalCalculation = number_format($TotalCalculation * 100) . '%'; - } else { - $TotalCalculation = number_format($TotalCalculation); + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); } + $Ypos -=(2*$line_height); + /*reset the accumulators to 0 */ + for ($i=0;$i<=10;$i++){ + $AccumLvl3[$i]=0; + } } - $Ypos -=(2*$line_height); - /*reset the accumulators to 0 */ - for ($i=0;$i<=10;$i++){ - $AccumLvl3[$i]=0; - } } - } - - if ($myrow['col3']!=$GrpData2 && $myrow['col3']!='0' && $myrow['col5']!='0'){ + if ($myrow['col3']!=$GrpData2 && $myrow['col3']!='0' && $myrow['col5']!='0'){ /*Totals only relevant to GrpByLevel 2 if GrpByLevel 3 also used */ - if ($Counter > 0){ /*Dont want to print totals if this is the first record */ - $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col3'] . ' - ' . $LastLine['col4'],0,43); - $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$TotalText); - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + $Cols['colno']*60; - if ($Cols['calculation']==0){ - $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl2[$Cols['colno']]),'right'); - } else { /* its a calculation need to re-perform on the totals*/ + if ($Counter > 0){ /*Dont want to print totals if this is the first record */ + $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col3'] . ' - ' . $LastLine['col4'],0,43); + $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$TotalText); + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + $Cols['colno']*60; + if ($Cols['calculation']==0){ + $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl2[$Cols['colno']]),'right'); + } else { /* its a calculation need to re-perform on the totals*/ - switch ($Cols['calcoperator']) { - case '/': - if ($AccumLvl2[$Cols['coldenominator']]==0){ - $TotalCalculation = 0; + switch ($Cols['calcoperator']) { + case '/': + if ($AccumLvl2[$Cols['coldenominator']]==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $AccumLvl2[$Cols['coldenominator']]; + } + break; + case '+': + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; + break; + case '-': + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; + break; + case '*': + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] * $Cols['constant']; + break; + case 'C': + if ($Cols['constant']==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $Cols['constant']; + } + break; + } /*end of switch stmt block*/ + if ($Cols['valformat']=='P'){ + $TotalCalculation = number_format($TotalCalculation * 100) . '%'; } else { - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $AccumLvl2[$Cols['coldenominator']]; + $TotalCalculation = number_format($TotalCalculation); } - break; - case '+': - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; - break; - case '-': - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; - break; - case '*': - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] * $Cols['constant']; - break; - case 'C': - if ($Cols['constant']==0){ - $TotalCalculation = 0; - } else { - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $Cols['constant']; - } - break; - } /*end of switch stmt block*/ - if ($Cols['valformat']=='P'){ - $TotalCalculation = number_format($TotalCalculation * 100) . '%'; - } else { - $TotalCalculation = number_format($TotalCalculation); - } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + }/*end if not a calculation column*/ + }/*end while loop through column definitions */ + $Ypos -=(2*$line_height); + /*reset the accumulators to 0 */ + for ($i=0;$i<=10;$i++){ + $AccumLvl2[$i]=0; } - - } - $Ypos -=(2*$line_height); - /*reset the accumulators to 0 */ - for ($i=0;$i<=10;$i++){ - $AccumLvl2[$i]=0; - } + }/*end if Counter > 0 */ } - } - if ($myrow['col1']!=$GrpData1 && $myrow['col3']!='0'){ - /*Totals only relevant to GrpByLevel 1 if GrpByLevel 2 also used */ - if ($Counter > 0){ /*Dont want to print totals if this is the first record */ - $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col1'] . ' - ' . $LastLine['col2'],0,46); - $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$TotalText); - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + $Cols['colno']*60; - if ($Cols['calculation']==0){ - $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl1[$Cols['colno']]),'right'); - } else { /* its a calculation need to re-perform on the totals*/ - - switch ($Cols['calcoperator']) { - Case '/': - if ($AccumLvl1[$Cols['coldenominator']]==0){ - $TotalCalculation = 0; + if ($myrow['col1']!=$GrpData1 && $myrow['col3']!='0'){ + /*Totals only relevant to GrpByLevel 1 if GrpByLevel 2 also used */ + if ($Counter > 0){ /*Dont want to print totals if this is the first record */ + $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col1'] . ' - ' . $LastLine['col2'],0,46); + $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$TotalText); + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + $Cols['colno']*60; + if ($Cols['calculation']==0){ + $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl1[$Cols['colno']]),'right'); + } else { /* its a calculation need to re-perform on the totals*/ + + switch ($Cols['calcoperator']) { + Case '/': + if ($AccumLvl1[$Cols['coldenominator']]==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $AccumLvl1[$Cols['coldenominator']]; + } + break; + Case '+': + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; + break; + Case '-': + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; + break; + Case '*': + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] * $Cols['constant']; + break; + Case 'C': + if ($Cols['constant']==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $Cols['constant']; + } + break; + } /*end of switch stmt block*/ + if ($Cols['valformat']=='P'){ + $TotalCalculation = number_format($TotalCalculation * 100) . '%'; } else { - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $AccumLvl1[$Cols['coldenominator']]; + $TotalCalculation = number_format($TotalCalculation); } - break; - Case '+': - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; - break; - Case '-': - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; - break; - Case '*': - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] * $Cols['constant']; - break; - Case 'C': - if ($Cols['constant']==0){ - $TotalCalculation = 0; - } else { - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $Cols['constant']; - } - break; - } /*end of switch stmt block*/ - if ($Cols['valformat']=='P'){ - $TotalCalculation = number_format($TotalCalculation * 100) . '%'; - } else { - $TotalCalculation = number_format($TotalCalculation); - } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + }/*end if its not a calculation */ + } /* end loop around column defintions */ + $Ypos -=(2*$line_height); + + /*reset the accumulators to 0 */ + for ($i=0;$i<=10;$i++){ + $AccumLvl1[$i]=0; } + }/* end if counter>0 */ + } + + $NewHeading =0; + if ($myrow['col1']!=$GrpData1){ /*Need a new heading for Level 1 */ + $NewHeading = 1; + if ($ReportSpec['newpageafter1']==1){ + include ('includes/PDFSalesAnalPageHeader.inc'); } - $Ypos -=(2*$line_height); + $GroupHeadingText = substr($myrow['col1'] . ' - ' . $myrow['col2'],0,50); + $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$GroupHeadingText); - /*reset the accumulators to 0 */ - for ($i=0;$i<=10;$i++){ - $AccumLvl1[$i]=0; + if ($myrow['col3']!='0'){ + $Ypos-=$line_height; } } - } - $NewHeading =0; + if (($myrow['col3']!=$GrpData2 OR $NewHeading ==1) AND $myrow['col3']!='0'){ + /*Need a new heading for Level 2 */ + $NewHeading = 1; + if ($ReportSpec['newpageafter2']==1){ + include ('includes/PDFSalesAnalPageHeader.inc'); + } + $GroupHeadingText = substr($myrow['col3'] . ' - ' . $myrow['col4'],0,46); + $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); - if ($myrow['col1']!=$GrpData1){ /*Need a new heading for Level 1 */ - $NewHeading = 1; - if ($ReportSpec['newpageafter1']==1){ - include ('includes/PDFSalesAnalPageHeader.inc'); - } - $GroupHeadingText = substr($myrow['col1'] . ' - ' . $myrow['col2'],0,50); - $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$GroupHeadingText); - - if ($myrow['col3']!='0'){ + if ($myrow['col5']!='0'){ $Ypos-=$line_height; + } } - } + if (($myrow['col5']!=$GrpData3 OR $NewHeading ==1) AND $myrow['col5']!='0'){ + /*Need a new heading for Level 3 */ - if (($myrow['col3']!=$GrpData2 OR $NewHeading ==1) AND $myrow['col3']!='0'){ - /*Need a new heading for Level 2 */ - $NewHeading = 1; - if ($ReportSpec['newpageafter2']==1){ - include ('includes/PDFSalesAnalPageHeader.inc'); - } - $GroupHeadingText = substr($myrow['col3'] . ' - ' . $myrow['col4'],0,46); - $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); + if ($ReportSpec['newpageafter3']==1){ + include ('includes/PDFSalesAnalPageHeader.inc'); + } + $GroupHeadingText = substr($myrow['col5'] . ' - ' . $myrow['col6'],0,46); + $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); - if ($myrow['col5']!='0'){ - $Ypos-=$line_height; + if ($myrow['col7']!='0'){ + $Ypos-=$line_height; + } } - } - if (($myrow['col5']!=$GrpData3 OR $NewHeading ==1) AND $myrow['col5']!='0'){ - /*Need a new heading for Level 3 */ - if ($ReportSpec['newpageafter3']==1){ - include ('includes/PDFSalesAnalPageHeader.inc'); - } - $GroupHeadingText = substr($myrow['col5'] . ' - ' . $myrow['col6'],0,46); - $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); - if ($myrow['col7']!='0'){ - $Ypos-=$line_height; + /*show titles */ + $GroupHeadingText = substr($myrow['col7'] . ' - ' . $myrow['col8'], 0, 40); + $LeftOvers = $pdf->addTextWrap(55,$Ypos,135,$FontSize,$GroupHeadingText); + } - } - if ($myrow['col7']!='0'){ - /*show titles */ - $GroupHeadingText = substr($myrow['col7'] . ' - ' . $myrow['col8'], 0, 40); - $LeftOvers = $pdf->addTextWrap(55,$Ypos,135,$FontSize,$GroupHeadingText); + /*NOW SHOW THE LINE OF DATA */ + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + ($Cols['colno']*60); + $ColumnNo = 'col' . (string) (($Cols['colno']) +8); + if ($Cols['valformat']=='P'){ + $DisplayValue = number_format($myrow[$ColumnNo] *100) . '%'; + } else { + $DisplayValue = number_format($myrow[$ColumnNo]); + } + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize,$DisplayValue, 'right'); - } - - /*NOW SHOW THE LINE OF DATA */ - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + ($Cols['colno']*60); - $ColumnNo = 'col' . (string) (($Cols['colno']) +8); - if ($Cols['valformat']=='P'){ - $DisplayValue = number_format($myrow[$ColumnNo] *100) . '%'; - } else { - $DisplayValue = number_format($myrow[$ColumnNo]); + $AccumLvl1[$Cols['colno']] += $myrow[$ColumnNo]; + $AccumLvl2[$Cols['colno']] += $myrow[$ColumnNo]; + $AccumLvl3[$Cols['colno']] += $myrow[$ColumnNo]; + $AccumLvl4[$Cols['colno']] += $myrow[$ColumnNo]; } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize,$DisplayValue, 'right'); - $AccumLvl1[$Cols['colno']] += $myrow[$ColumnNo]; - $AccumLvl2[$Cols['colno']] += $myrow[$ColumnNo]; - $AccumLvl3[$Cols['colno']] += $myrow[$ColumnNo]; - $AccumLvl4[$Cols['colno']] += $myrow[$ColumnNo]; - } + $Ypos -=$line_height; - $Ypos -=$line_height; - - if ($Ypos - (2*$line_height) < $Bottom_Margin){ - include ('includes/PDFSalesAnalPageHeader.inc'); - }//end if need a new page headed up - $GrpData1 = $myrow['col1']; - $GrpData2 = $myrow['col3']; - $GrpData3 = $myrow['col5']; - $Counter++; - $LastLine = $myrow; /*remember the last line that had some output in an array called last line*/ + if ($Ypos - (2*$line_height) < $Bottom_Margin){ + include ('includes/PDFSalesAnalPageHeader.inc'); + }//end if need a new page headed up + $GrpData1 = $myrow['col1']; + $GrpData2 = $myrow['col3']; + $GrpData3 = $myrow['col5']; + $Counter++; + $LastLine = $myrow; /*remember the last line that had some output in an array called last line*/ } /*The line has some positive amount on it */ - } /*end of the data loop to print lines */ if ($LastLine['col5']!='0' && $LastLine['col7']!='0'){ @@ -514,8 +505,6 @@ } - - if ($_GET['ProduceCVSFile']==True){ function stripcomma($str) { //because we're using comma as a delimiter This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-08 07:38:52
|
Revision: 4504 http://web-erp.svn.sourceforge.net/web-erp/?rev=4504&view=rev Author: daintree Date: 2011-03-08 07:38:45 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Sales Analysis fix Modified Paths: -------------- trunk/SalesAnalysis_UserDefined.php trunk/doc/Change.log.html trunk/includes/PDFSalesAnalysis.inc Modified: trunk/SalesAnalysis_UserDefined.php =================================================================== --- trunk/SalesAnalysis_UserDefined.php 2011-03-04 19:40:47 UTC (rev 4503) +++ trunk/SalesAnalysis_UserDefined.php 2011-03-08 07:38:45 UTC (rev 4504) @@ -2,7 +2,7 @@ /* $Id$ */ -//$PageSecurity = 2; + include('includes/session.inc'); if (!in_array($PageSecurity,$_SESSION['AllowedPageSecurityTokens'])){ @@ -18,9 +18,9 @@ if ($Counter >0) { $pdf->OutputD('SalesAnalysis_' . date('Y-m-d') . '.pdf'); - $pdf-> __destruct(); + $pdf->__destruct(); } else { - $pdf-> __destruct(); + $pdf->__destruct(); $title = _('User Defined Sales Analysis Problem'); include('includes/header.inc'); echo '<p>' . _('The report did not have any none zero lines of information to show and so it has not been created'); @@ -46,5 +46,4 @@ echo '<p>' . _('You should automatically be forwarded to the CSV Sales Analysis file when it is ready') . '. ' . _('If this does not happen') . ' <a href="' . $rootpath . '/' . $_SESSION['reports_dir'] . '/SalesAnalysis.csv">' . _('click here') . '</a> ' . _('to continue') . '<br />'; include('includes/footer.inc'); } - -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-04 19:40:47 UTC (rev 4503) +++ trunk/doc/Change.log.html 2011-03-08 07:38:45 UTC (rev 4504) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>8/3/11:Phil fix SalesAnalysis reports for TCPDF as reported by Joe Zhou</p> <p>5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL</p> <p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF- now as no dynamic changing of character set required all translations are utf-8</p> <p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> Modified: trunk/includes/PDFSalesAnalysis.inc =================================================================== --- trunk/includes/PDFSalesAnalysis.inc 2011-03-04 19:40:47 UTC (rev 4503) +++ trunk/includes/PDFSalesAnalysis.inc 2011-03-08 07:38:45 UTC (rev 4504) @@ -4,23 +4,23 @@ include ('includes/class.pdf.php'); -/* A4_Landscape */ +/* A4_Landscape */ +$DocumentPaper = 'A4'; +$DocumentOrientation ='L'; $Page_Width=842; $Page_Height=595; -$Top_Margin=20; -$Bottom_Margin=20; -$Left_Margin=25; -$Right_Margin=22; +$Top_Margin=30; +$Bottom_Margin=30; +$Left_Margin=40; +$Right_Margin=30; -// Javier: now I use the native constructor -// $PageSize = array(0,0,$Page_Width,$Page_Height); +$pdf = new Cpdf($DocumentOrientation, 'pt', $DocumentPaper); +$pdf->SetAutoPageBreak(true, 0); +$pdf->SetPrintHeader(false); +$pdf->AddPage(); +$pdf->cMargin = 0; -// Javier: better to not use references -// $pdf = & new Cpdf($PageSize); - $pdf = new Cpdf('L', 'pt', 'A4'); - - /* Standard PDF file creation header stuff */ $pdf->addInfo('Author','webERP ' . $Version); @@ -41,278 +41,269 @@ /*Make an array to hold accumulators for */ $AccumLvl1 = array(); +$AccumLvl2 = array(); +$AccumLvl3 = array(); +$AccumLvl4 = array(); + for ($i=0;$i<=10;$i++){ -$AccumLvl1[$i]=0; + $AccumLvl1[$i]=0; + $AccumLvl2[$i]=0; + $AccumLvl3[$i]=0; + $AccumLvl4[$i]=0; } -$AccumLvl2= array(); -for ($i=0;$i<=10;$i++){ -$AccumLvl2[$i]=0; -} -$AccumLvl3=array(); -for ($i=0;$i<=10;$i++){ -$AccumLvl3[$i]=0; -} -$AccumLvl4=array(); -for ($i=0;$i<=10;$i++){ -$AccumLvl4[$i]=0; -} While ($myrow = DB_fetch_array($result)){ /*First off check that at least one of the columns of data has some none zero amounts */ -DB_data_seek($ColsResult,0); /*go back to the beginning */ -$ThisLineHasOutput=False; /*assume no output to start with */ -while ($Cols = DB_fetch_array($ColsResult)){ - $ColumnNo ='col' . ((int) $Cols['colno'] + 8); - if (abs($myrow[$ColumnNo])>0.5){ - $ThisLineHasOutput = True; + DB_data_seek($ColsResult,0); /*go back to the beginning */ + $ThisLineHasOutput=False; /*assume no output to start with */ + while ($Cols = DB_fetch_array($ColsResult)){ + $ColumnNo ='col' . ((int) $Cols['colno'] + 8); + if (abs($myrow[$ColumnNo])>0.5){ + $ThisLineHasOutput = True; + } } -} -if ($ThisLineHasOutput==True){ + if ($ThisLineHasOutput==True){ - if ($myrow['col5']!=$GrpData3 && $myrow['col5']!='0' && $myrow['col7']!='0'){ - /*Totals only relevant to GrpByLevel 3 if GrpByLevel 4 also used */ - if ($Counter > 0){ /*Dont want to print totals if this is the first record */ - $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col5'] . ' - ' . $LastLine['col6'],0,33); - $LeftOvers = $pdf->addTextWrap(40,$Ypos,180,$FontSize,$TotalText); + if ($myrow['col5']!=$GrpData3 && $myrow['col5']!='0' && $myrow['col7']!='0'){ + /*Totals only relevant to GrpByLevel 3 if GrpByLevel 4 also used */ + if ($Counter > 0){ /*Dont want to print totals if this is the first record */ + $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col5'] . ' - ' . $LastLine['col6'],0,33); + $LeftOvers = $pdf->addTextWrap(40,$Ypos,180,$FontSize,$TotalText); - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + $Cols['colno']*60; - if ($Cols['calculation']==0){ - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, number_format($AccumLvl3[$Cols['colno']]),'right'); - } else { /* its a calculation need to re-perform on the totals*/ + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + $Cols['colno']*60; + if ($Cols['calculation']==0){ + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, number_format($AccumLvl3[$Cols['colno']]),'right'); + } else { /* its a calculation need to re-perform on the totals*/ - switch ($Cols['calcoperator']) { - case '/': - if ($AccumLvl3[$Cols['coldenominator']]==0){ - $TotalCalculation = 0; + switch ($Cols['calcoperator']) { + case '/': + if ($AccumLvl3[$Cols['coldenominator']]==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $AccumLvl3[$Cols['coldenominator']]; + } + break; + case '+': + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; + break; + case '-': + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; + break; + case '*': + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] * $Cols['constant']; + break; + case 'C': + if ($Cols['constant']==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $Cols['constant']; + } + break; + } /*end of switch stmt block*/ + if ($Cols['valformat']=='P'){ + $TotalCalculation = number_format($TotalCalculation * 100) . '%'; } else { - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $AccumLvl3[$Cols['coldenominator']]; + $TotalCalculation = number_format($TotalCalculation); } - break; - case '+': - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; - break; - case '-': - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] + $AccumLvl3[$Cols['coldenominator']]; - break; - case '*': - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] * $Cols['constant']; - break; - case 'C': - if ($Cols['constant']==0){ - $TotalCalculation = 0; - } else { - $TotalCalculation = $AccumLvl3[$Cols['colnumerator']] / $Cols['constant']; - } - break; - } /*end of switch stmt block*/ - if ($Cols['valformat']=='P'){ - $TotalCalculation = number_format($TotalCalculation * 100) . '%'; - } else { - $TotalCalculation = number_format($TotalCalculation); + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); } + $Ypos -=(2*$line_height); + /*reset the accumulators to 0 */ + for ($i=0;$i<=10;$i++){ + $AccumLvl3[$i]=0; + } } - $Ypos -=(2*$line_height); - /*reset the accumulators to 0 */ - for ($i=0;$i<=10;$i++){ - $AccumLvl3[$i]=0; - } } - } - - if ($myrow['col3']!=$GrpData2 && $myrow['col3']!='0' && $myrow['col5']!='0'){ + if ($myrow['col3']!=$GrpData2 && $myrow['col3']!='0' && $myrow['col5']!='0'){ /*Totals only relevant to GrpByLevel 2 if GrpByLevel 3 also used */ - if ($Counter > 0){ /*Dont want to print totals if this is the first record */ - $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col3'] . ' - ' . $LastLine['col4'],0,43); - $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$TotalText); - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + $Cols['colno']*60; - if ($Cols['calculation']==0){ - $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl2[$Cols['colno']]),'right'); - } else { /* its a calculation need to re-perform on the totals*/ + if ($Counter > 0){ /*Dont want to print totals if this is the first record */ + $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col3'] . ' - ' . $LastLine['col4'],0,43); + $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$TotalText); + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + $Cols['colno']*60; + if ($Cols['calculation']==0){ + $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl2[$Cols['colno']]),'right'); + } else { /* its a calculation need to re-perform on the totals*/ - switch ($Cols['calcoperator']) { - case '/': - if ($AccumLvl2[$Cols['coldenominator']]==0){ - $TotalCalculation = 0; + switch ($Cols['calcoperator']) { + case '/': + if ($AccumLvl2[$Cols['coldenominator']]==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $AccumLvl2[$Cols['coldenominator']]; + } + break; + case '+': + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; + break; + case '-': + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; + break; + case '*': + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] * $Cols['constant']; + break; + case 'C': + if ($Cols['constant']==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $Cols['constant']; + } + break; + } /*end of switch stmt block*/ + if ($Cols['valformat']=='P'){ + $TotalCalculation = number_format($TotalCalculation * 100) . '%'; } else { - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $AccumLvl2[$Cols['coldenominator']]; + $TotalCalculation = number_format($TotalCalculation); } - break; - case '+': - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; - break; - case '-': - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] + $AccumLvl2[$Cols['coldenominator']]; - break; - case '*': - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] * $Cols['constant']; - break; - case 'C': - if ($Cols['constant']==0){ - $TotalCalculation = 0; - } else { - $TotalCalculation = $AccumLvl2[$Cols['colnumerator']] / $Cols['constant']; - } - break; - } /*end of switch stmt block*/ - if ($Cols['valformat']=='P'){ - $TotalCalculation = number_format($TotalCalculation * 100) . '%'; - } else { - $TotalCalculation = number_format($TotalCalculation); - } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + }/*end if not a calculation column*/ + }/*end while loop through column definitions */ + $Ypos -=(2*$line_height); + /*reset the accumulators to 0 */ + for ($i=0;$i<=10;$i++){ + $AccumLvl2[$i]=0; } - - } - $Ypos -=(2*$line_height); - /*reset the accumulators to 0 */ - for ($i=0;$i<=10;$i++){ - $AccumLvl2[$i]=0; - } + }/*end if Counter > 0 */ } - } - if ($myrow['col1']!=$GrpData1 && $myrow['col3']!='0'){ - /*Totals only relevant to GrpByLevel 1 if GrpByLevel 2 also used */ - if ($Counter > 0){ /*Dont want to print totals if this is the first record */ - $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col1'] . ' - ' . $LastLine['col2'],0,46); - $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$TotalText); - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + $Cols['colno']*60; - if ($Cols['calculation']==0){ - $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl1[$Cols['colno']]),'right'); - } else { /* its a calculation need to re-perform on the totals*/ - - switch ($Cols['calcoperator']) { - Case '/': - if ($AccumLvl1[$Cols['coldenominator']]==0){ - $TotalCalculation = 0; + if ($myrow['col1']!=$GrpData1 && $myrow['col3']!='0'){ + /*Totals only relevant to GrpByLevel 1 if GrpByLevel 2 also used */ + if ($Counter > 0){ /*Dont want to print totals if this is the first record */ + $TotalText = substr(_('TOTAL') . ' ' . $LastLine['col1'] . ' - ' . $LastLine['col2'],0,46); + $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$TotalText); + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + $Cols['colno']*60; + if ($Cols['calculation']==0){ + $LeftOvers = $pdf->addTextWrap($Xpos, $Ypos,60,$FontSize, number_format($AccumLvl1[$Cols['colno']]),'right'); + } else { /* its a calculation need to re-perform on the totals*/ + + switch ($Cols['calcoperator']) { + Case '/': + if ($AccumLvl1[$Cols['coldenominator']]==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $AccumLvl1[$Cols['coldenominator']]; + } + break; + Case '+': + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; + break; + Case '-': + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; + break; + Case '*': + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] * $Cols['constant']; + break; + Case 'C': + if ($Cols['constant']==0){ + $TotalCalculation = 0; + } else { + $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $Cols['constant']; + } + break; + } /*end of switch stmt block*/ + if ($Cols['valformat']=='P'){ + $TotalCalculation = number_format($TotalCalculation * 100) . '%'; } else { - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $AccumLvl1[$Cols['coldenominator']]; + $TotalCalculation = number_format($TotalCalculation); } - break; - Case '+': - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; - break; - Case '-': - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] + $AccumLvl1[$Cols['coldenominator']]; - break; - Case '*': - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] * $Cols['constant']; - break; - Case 'C': - if ($Cols['constant']==0){ - $TotalCalculation = 0; - } else { - $TotalCalculation = $AccumLvl1[$Cols['colnumerator']] / $Cols['constant']; - } - break; - } /*end of switch stmt block*/ - if ($Cols['valformat']=='P'){ - $TotalCalculation = number_format($TotalCalculation * 100) . '%'; - } else { - $TotalCalculation = number_format($TotalCalculation); - } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize, $TotalCalculation,'right'); + }/*end if its not a calculation */ + } /* end loop around column defintions */ + $Ypos -=(2*$line_height); + + /*reset the accumulators to 0 */ + for ($i=0;$i<=10;$i++){ + $AccumLvl1[$i]=0; } + }/* end if counter>0 */ + } + + $NewHeading =0; + if ($myrow['col1']!=$GrpData1){ /*Need a new heading for Level 1 */ + $NewHeading = 1; + if ($ReportSpec['newpageafter1']==1){ + include ('includes/PDFSalesAnalPageHeader.inc'); } - $Ypos -=(2*$line_height); + $GroupHeadingText = substr($myrow['col1'] . ' - ' . $myrow['col2'],0,50); + $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$GroupHeadingText); - /*reset the accumulators to 0 */ - for ($i=0;$i<=10;$i++){ - $AccumLvl1[$i]=0; + if ($myrow['col3']!='0'){ + $Ypos-=$line_height; } } - } - $NewHeading =0; + if (($myrow['col3']!=$GrpData2 OR $NewHeading ==1) AND $myrow['col3']!='0'){ + /*Need a new heading for Level 2 */ + $NewHeading = 1; + if ($ReportSpec['newpageafter2']==1){ + include ('includes/PDFSalesAnalPageHeader.inc'); + } + $GroupHeadingText = substr($myrow['col3'] . ' - ' . $myrow['col4'],0,46); + $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); - if ($myrow['col1']!=$GrpData1){ /*Need a new heading for Level 1 */ - $NewHeading = 1; - if ($ReportSpec['newpageafter1']==1){ - include ('includes/PDFSalesAnalPageHeader.inc'); - } - $GroupHeadingText = substr($myrow['col1'] . ' - ' . $myrow['col2'],0,50); - $LeftOvers = $pdf->addTextWrap(15,$Ypos,205,$FontSize,$GroupHeadingText); - - if ($myrow['col3']!='0'){ + if ($myrow['col5']!='0'){ $Ypos-=$line_height; + } } - } + if (($myrow['col5']!=$GrpData3 OR $NewHeading ==1) AND $myrow['col5']!='0'){ + /*Need a new heading for Level 3 */ - if (($myrow['col3']!=$GrpData2 OR $NewHeading ==1) AND $myrow['col3']!='0'){ - /*Need a new heading for Level 2 */ - $NewHeading = 1; - if ($ReportSpec['newpageafter2']==1){ - include ('includes/PDFSalesAnalPageHeader.inc'); - } - $GroupHeadingText = substr($myrow['col3'] . ' - ' . $myrow['col4'],0,46); - $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); + if ($ReportSpec['newpageafter3']==1){ + include ('includes/PDFSalesAnalPageHeader.inc'); + } + $GroupHeadingText = substr($myrow['col5'] . ' - ' . $myrow['col6'],0,46); + $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); - if ($myrow['col5']!='0'){ - $Ypos-=$line_height; + if ($myrow['col7']!='0'){ + $Ypos-=$line_height; + } } - } - if (($myrow['col5']!=$GrpData3 OR $NewHeading ==1) AND $myrow['col5']!='0'){ - /*Need a new heading for Level 3 */ - if ($ReportSpec['newpageafter3']==1){ - include ('includes/PDFSalesAnalPageHeader.inc'); - } - $GroupHeadingText = substr($myrow['col5'] . ' - ' . $myrow['col6'],0,46); - $LeftOvers = $pdf->addTextWrap(30,$Ypos,190,$FontSize,$GroupHeadingText); - if ($myrow['col7']!='0'){ - $Ypos-=$line_height; + /*show titles */ + $GroupHeadingText = substr($myrow['col7'] . ' - ' . $myrow['col8'], 0, 40); + $LeftOvers = $pdf->addTextWrap(55,$Ypos,135,$FontSize,$GroupHeadingText); + } - } - if ($myrow['col7']!='0'){ - /*show titles */ - $GroupHeadingText = substr($myrow['col7'] . ' - ' . $myrow['col8'], 0, 40); - $LeftOvers = $pdf->addTextWrap(55,$Ypos,135,$FontSize,$GroupHeadingText); + /*NOW SHOW THE LINE OF DATA */ + DB_data_seek($ColsResult,0); + while ($Cols = DB_fetch_array($ColsResult)){ + $Xpos = 160 + ($Cols['colno']*60); + $ColumnNo = 'col' . (string) (($Cols['colno']) +8); + if ($Cols['valformat']=='P'){ + $DisplayValue = number_format($myrow[$ColumnNo] *100) . '%'; + } else { + $DisplayValue = number_format($myrow[$ColumnNo]); + } + $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize,$DisplayValue, 'right'); - } - - /*NOW SHOW THE LINE OF DATA */ - DB_data_seek($ColsResult,0); - while ($Cols = DB_fetch_array($ColsResult)){ - $Xpos = 160 + ($Cols['colno']*60); - $ColumnNo = 'col' . (string) (($Cols['colno']) +8); - if ($Cols['valformat']=='P'){ - $DisplayValue = number_format($myrow[$ColumnNo] *100) . '%'; - } else { - $DisplayValue = number_format($myrow[$ColumnNo]); + $AccumLvl1[$Cols['colno']] += $myrow[$ColumnNo]; + $AccumLvl2[$Cols['colno']] += $myrow[$ColumnNo]; + $AccumLvl3[$Cols['colno']] += $myrow[$ColumnNo]; + $AccumLvl4[$Cols['colno']] += $myrow[$ColumnNo]; } - $LeftOvers = $pdf->addTextWrap($Xpos,$Ypos,60,$FontSize,$DisplayValue, 'right'); - $AccumLvl1[$Cols['colno']] += $myrow[$ColumnNo]; - $AccumLvl2[$Cols['colno']] += $myrow[$ColumnNo]; - $AccumLvl3[$Cols['colno']] += $myrow[$ColumnNo]; - $AccumLvl4[$Cols['colno']] += $myrow[$ColumnNo]; - } + $Ypos -=$line_height; - $Ypos -=$line_height; - - if ($Ypos - (2*$line_height) < $Bottom_Margin){ - include ('includes/PDFSalesAnalPageHeader.inc'); - }//end if need a new page headed up - $GrpData1 = $myrow['col1']; - $GrpData2 = $myrow['col3']; - $GrpData3 = $myrow['col5']; - $Counter++; - $LastLine = $myrow; /*remember the last line that had some output in an array called last line*/ + if ($Ypos - (2*$line_height) < $Bottom_Margin){ + include ('includes/PDFSalesAnalPageHeader.inc'); + }//end if need a new page headed up + $GrpData1 = $myrow['col1']; + $GrpData2 = $myrow['col3']; + $GrpData3 = $myrow['col5']; + $Counter++; + $LastLine = $myrow; /*remember the last line that had some output in an array called last line*/ } /*The line has some positive amount on it */ - } /*end of the data loop to print lines */ if ($LastLine['col5']!='0' && $LastLine['col7']!='0'){ @@ -514,8 +505,6 @@ } - - if ($_GET['ProduceCVSFile']==True){ function stripcomma($str) { //because we're using comma as a delimiter This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |