From: <ice...@us...> - 2012-06-25 13:27:14
|
Revision: 5459 http://web-erp.svn.sourceforge.net/web-erp/?rev=5459&view=rev Author: icedlava Date: 2012-06-25 13:27:02 +0000 (Mon, 25 Jun 2012) Log Message: ----------- Add a few bookmarks for webERP manual. Modified Paths: -------------- trunk/CustomerBranches.php trunk/Customers.php trunk/Stocks.php trunk/SupplierContacts.php trunk/SupplierInvoice.php trunk/Suppliers.php trunk/doc/Manual/ManualAccountsPayable.html trunk/doc/Manual/ManualAccountsReceivable.html Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/CustomerBranches.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -4,8 +4,10 @@ include('includes/session.inc'); $title = _('Customer Branches'); +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsReceivable'; +$BookMark = 'NewCustomerBranch'; include('includes/header.inc'); - if (isset($_GET['DebtorNo'])) { $DebtorNo = mb_strtoupper($_GET['DebtorNo']); } else if (isset($_POST['DebtorNo'])){ @@ -112,7 +114,7 @@ // Format: Longitude, Latitude, Altitude $Latitude = $coordinatesSplit[1]; $Longitude = $coordinatesSplit[0]; - + $status = $xml->Response->Status->code; if (strcmp($status, '200') == 0) { // Successful geocode @@ -417,11 +419,11 @@ $DebtorNo, urlencode($myrow[1]), _('Delete Branch')); - - if ($myrow[11]){ - $TotalDisable++; - }else { - $TotalEnable++; + + if ($myrow[11]){ + $TotalDisable++; + }else { + $TotalEnable++; } } while ($myrow = DB_fetch_row($result)); @@ -536,7 +538,7 @@ echo '<input type="hidden" name="SelectedBranch" value="' . $SelectedBranch . '" />'; echo '<input type="hidden" name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; - + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { @@ -673,9 +675,9 @@ //SQL to poulate account selection boxes - $sql = "SELECT salesmanname, - salesmancode - FROM salesman + $sql = "SELECT salesmanname, + salesmancode + FROM salesman WHERE current = 1"; $result = DB_query($sql,$db); @@ -799,7 +801,7 @@ echo '<tr> <td>'._('Tax Group').':</td> <td><select tabindex="19" name="TaxGroup">'; - + while ($myrow = DB_fetch_array($TaxGroupResults)) { if (isset($_POST['TaxGroup']) and $myrow['taxgroupid']==$_POST['TaxGroup']) { echo '<option selected="selected" value="'; @@ -825,7 +827,7 @@ echo ' </select></td></tr>'; - + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL,$db); if (DB_num_rows($ShipperResults)==0){ @@ -862,7 +864,7 @@ echo '<option selected="selected" value="1">' . _('Show company details and logo') . '</option> <option value="2">' . _('Hide company details and logo') . '</option>'; } - + echo '</select></td> </tr>'; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/Customers.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -5,7 +5,9 @@ include('includes/session.inc'); $title = _('Customer Maintenance'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsReceivable'; +$BookMark = 'NewCustomer'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -500,7 +502,7 @@ $DateString = Date($_SESSION['DefaultDateFormat']); echo '<tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td><input tabindex="10" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" value="' . $DateString . '" size="12" maxlength="10" /></td></tr>'; - + echo '</table></td> <td><table class="selection"> <tr> @@ -611,7 +613,7 @@ <div class="centre"> <input tabindex="20" type="submit" name="submit" value="' . _('Add New Customer') . '" /> <input tabindex="21" type="submit" value="' . _('Reset') . '" /> </div>'; - + } echo '</div>'; echo '</form>'; @@ -650,7 +652,7 @@ typeid FROM debtorsmaster WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; - + $ErrMsg = _('The customer details could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -675,9 +677,9 @@ $_POST['ClientSince'] = ConvertSQLDate($myrow['clientsince']); $_POST['HoldReason'] = $myrow['holdreason']; $_POST['PaymentTerms'] = $myrow['paymentterms']; - $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); + $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); $_POST['DiscountCode'] = $myrow['discountcode']; - $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); + $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); $_POST['CreditLimit'] = locale_number_format($myrow['creditlimit'],0); $_POST['InvAddrBranch'] = $myrow['invaddrbranch']; $_POST['TaxRef'] = $myrow['taxref']; @@ -759,7 +761,7 @@ <td>' . _('Address Line 6') . ':</td> <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address6" size="42" maxlength="40" value="' . $_POST['Address6'] . '" /></td> </tr>'; - + } // Select sales types for drop down list if (isset($_GET['Modify'])) { @@ -808,10 +810,10 @@ echo '</select></td></tr> <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td>' . $_POST['ClientSince'] . '</td></tr>'; - + echo '</table></td> <td><table class="selection">'; - + echo '<tr> <td>' . _('Discount Percent') . ':</td> <td>' . $_POST['Discount'] . '</td> @@ -841,7 +843,7 @@ </tr> </table></td> <td><table class="selection">'; - + echo '<tr> <td>' . _('Discount Percent') . ':</td> <td><input type="text" name="Discount" class="number" size="5" maxlength="4" value="' . $_POST['Discount'] . '" /></td> @@ -995,7 +997,7 @@ if (isset($_GET['delete'])) { //User hit delete link on customer contacts /*Process this first before showing remaining contacts */ - $resultupcc = DB_query("DELETE FROM custcontacts + $resultupcc = DB_query("DELETE FROM custcontacts WHERE debtorno='".$DebtorNo."' AND contid='".$ID."'", $db); @@ -1008,9 +1010,9 @@ role, phoneno, notes, - email - FROM custcontacts - WHERE debtorno='".$DebtorNo."' + email + FROM custcontacts + WHERE debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); @@ -1081,7 +1083,7 @@ } }//END WHILE LIST LOOP echo '</table>'; - + echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { @@ -1096,7 +1098,7 @@ <input type="submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> </div>'; } - + echo '</div> </form>'; } // end of main ifs Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/Stocks.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -4,7 +4,6 @@ include('includes/session.inc'); $title = _('Item Maintenance'); -$title = _('Item Maintenance'); /* webERP manual links before header.inc */ $ViewTopic= 'Inventory'; $BookMark = 'InventoryAddingItems'; Modified: trunk/SupplierContacts.php =================================================================== --- trunk/SupplierContacts.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/SupplierContacts.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -4,7 +4,9 @@ include('includes/session.inc'); $title = _('Supplier Contacts'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsPayable'; +$BookMark = 'SupplierContact'; include('includes/header.inc'); if (isset($_GET['SupplierID'])){ @@ -64,7 +66,7 @@ fax='" . $_POST['Fax'] . "', email='" . $_POST['Email'] . "', mobile = '". $_POST['Mobile'] . "' - WHERE contact='".$SelectedContact."' + WHERE contact='".$SelectedContact."' AND supplierid='".$SupplierID."'"; $msg = _('The supplier contact information has been updated'); @@ -136,16 +138,16 @@ AND suppliercontacts.supplierid = '".$SupplierID."'"; $result = DB_query($sql, $db); - + if (DB_num_rows($result)>0){ - + $myrow = DB_fetch_array($result); - + echo '<table class="selection"> <tr> <th colspan="7"><h3>' . _('Contacts Defined for') . ' - ' . $myrow['suppname'] . '</h3></th> </tr>'; - + echo '<tr> <th>' . _('Name') . '</th> <th>' . _('Position') . '</th> @@ -153,7 +155,7 @@ <th>' . _('Fax No') . '</th> <th>' . _('Email') . '</th> </tr>'; - + do { printf('<tr><td>%s</td> <td>%s</td> @@ -210,7 +212,7 @@ FROM suppliercontacts WHERE contact='" . $SelectedContact . "' AND supplierid='" . $SupplierID . "'"; - + $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/SupplierInvoice.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -12,7 +12,9 @@ include('includes/session.inc'); $title = _('Enter Supplier Invoice'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsPayable'; +$BookMark = 'SupplierInvoice'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -182,7 +184,7 @@ if (!isset($_POST['PostInvoice'])){ - if (isset($_POST['GRNS']) + if (isset($_POST['GRNS']) AND $_POST['GRNS'] == _('Purchase Orders')){ /*This ensures that any changes in the page are stored in the session before calling the grn page */ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppInvGRNs.php">'; @@ -217,7 +219,7 @@ <br />'; exit; } - if (isset($_POST['FixedAssets']) + if (isset($_POST['FixedAssets']) AND $_POST['FixedAssets'] == _('Fixed Assets')){ /*This ensures that any changes in the page are stored in the session before calling the shipments page */ echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppFixedAssetChgs.php">'; @@ -268,8 +270,8 @@ echo '<br /> <div class="centre"> - <input type="submit" name="GRNS" value="' . _('Purchase Orders') . '" /> - <input type="submit" name="Shipts" value="' . _('Shipments') . '" /> + <input type="submit" name="GRNS" value="' . _('Purchase Orders') . '" /> + <input type="submit" name="Shipts" value="' . _('Shipments') . '" /> <input type="submit" name="Contracts" value="' . _('Contracts') . '" /> '; if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ @@ -279,7 +281,7 @@ </div>'; $TotalGRNValue = 0; - + if (count( $_SESSION['SuppTrans']->GRNs)>0){ /*if there are any GRNs selected for invoicing then */ /*Show all the selected GRNs so far from the SESSION['SuppInv']->GRNs array */ @@ -334,9 +336,9 @@ <th>' . _('Amount') . '</th> </tr>'; echo $TableHeader; - + $i=0; //row counter - + foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ echo '<tr> @@ -416,7 +418,7 @@ </tr>'; echo $TableHeader; - + $i=0; foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ @@ -443,7 +445,7 @@ } $TotalGLValue = 0; - + if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ if (count($_SESSION['SuppTrans']->GLCodes) > 0){ @@ -526,7 +528,7 @@ /*If a tax rate is entered that is not the same as it was previously then recalculate automatically the tax amounts */ - if (!isset($_POST['OverRideTax']) + if (!isset($_POST['OverRideTax']) OR $_POST['OverRideTax']=='Auto'){ echo ' <input type="text" class="number" name="TaxRate' . $Tax->TaxCalculationOrder . '" maxlength="4" size="4" value="' . locale_number_format($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100,$_SESSION['SuppTrans']->CurrDecimalPlaces) . '" />%'; @@ -619,43 +621,43 @@ $InputError = False; if ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount < 0){ - + $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); echo '<p>' . _('The tax total is') . ' : ' . locale_number_format($TaxTotal,$_SESSION['SuppTrans']->CurrDecimalPlaces); echo '<p>' . _('The ovamount is') . ' : ' . locale_number_format($_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces); - + } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ - + prnMsg(_('The invoice as entered will be processed but be warned the amount of the invoice is zero!') . '. ' . _('Invoices are normally expected to have a positive charge'),'warn'); - + } elseif (mb_strlen( $_SESSION['SuppTrans']->SuppReference)<1){ - + $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the there is no suppliers invoice number or reference entered') . '. ' . _('The supplier invoice number must be entered'),'error'); } elseif (!Is_date( $_SESSION['SuppTrans']->TranDate)){ - + $InputError = True; prnMsg( _('The invoice as entered cannot be processed because the invoice date entered is not in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); } elseif (DateDiff(Date($_SESSION['DefaultDateFormat']), $_SESSION['SuppTrans']->TranDate, 'd') < 0){ - + $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the invoice date is after today') . '. ' . _('Purchase invoices are expected to have a date prior to or today'),'error'); }elseif ( $_SESSION['SuppTrans']->ExRate <= 0){ - + $InputError = True; prnMsg( _('The invoice as entered cannot be processed because the exchange rate for the invoice has been entered as a negative or zero number') . '. ' . _('The exchange rate is expected to show how many of the suppliers currency there are in 1 of the local currency'),'error'); - + } elseif ( $_SESSION['SuppTrans']->OvAmount < round($_SESSION['SuppTrans']->Total_Shipts_Value() + $_SESSION['SuppTrans']->Total_GL_Value() + $_SESSION['SuppTrans']->Total_Contracts_Value()+ $_SESSION['SuppTrans']->Total_Assets_Value()+$_SESSION['SuppTrans']->Total_GRN_Value(),$_SESSION['SuppTrans']->CurrDecimalPlaces)){ - + prnMsg( _('The invoice total as entered is less than the sum of the shipment charges, the general ledger entries (if any), the charges for goods received, contract charges and fixed asset charges. There must be a mistake somewhere, the invoice as entered will not be processed'),'error'); $InputError = True; } else { - + $sql = "SELECT count(*) FROM supptrans WHERE supplierno='" . $_SESSION['SuppTrans']->SupplierID . "' @@ -782,7 +784,7 @@ account, narrative, amount) - VALUES ('20', + VALUES ('20', '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', '" . $PeriodNo . "', @@ -814,7 +816,7 @@ account, narrative, amount) - VALUES ('20', + VALUES ('20', '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', '" . $PeriodNo . "', @@ -829,7 +831,7 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - if (mb_strlen($EnteredGRN->ShiptRef) == 0 + if (mb_strlen($EnteredGRN->ShiptRef) == 0 OR $EnteredGRN->ShiptRef == 0){ /*so its not a GRN shipment item enter the GL entry to reverse the GRN suspense entry created on delivery @@ -845,7 +847,7 @@ account, narrative, amount) - VALUES ('20', + VALUES ('20', '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', '" . $PeriodNo . "', @@ -870,7 +872,7 @@ /*need to get the stock category record for this stock item - this is function in SQL_CommonFunctions.inc */ $StockGLCode = GetStockGLCode($EnteredGRN->ItemCode,$db); - + /*We have stock item and a purchase price variance need to see whether we are using Standard or WeightedAverageCosting */ if ($_SESSION['WeightedAverageCosting']==1){ /*Weighted Average costing */ @@ -900,11 +902,11 @@ if ($EnteredGRN->This_QuantityInv > $TotalQuantityOnHand){ /*So we need to write off some of the variance to variances and only the balance of the quantity in stock to go to stock value */ - + /*if the TotalQuantityOnHand is negative then this variance to write off is inflated by the negative quantity - which makes sense */ - + $WriteOffToVariances = ($EnteredGRN->This_QuantityInv - $TotalQuantityOnHand) * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); - + $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -926,7 +928,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); } // end if the quantity being invoiced here is greater than the current stock on hand - + /*Now post any remaining price variance to stock rather than price variances */ $SQL = "INSERT INTO gltrans (type, @@ -1093,7 +1095,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the control total could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - + EnsureGLEntriesBalance(20, $InvoiceNo, $db); } /*Thats the end of the GL postings */ @@ -1147,12 +1149,12 @@ /* Now update the GRN and PurchOrderDetails records for amounts invoiced - can't use the other loop through the GRNs as this was only where the GL link to credtors is active */ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - + //in local currency - $ActualCost = $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate; + $ActualCost = $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate; $PurchPriceVar = $EnteredGRN->This_QuantityInv * ($ActualCost - $EnteredGRN->StdCostUnit); - - $SQL = "UPDATE purchorderdetails + + $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced + " . $EnteredGRN->This_QuantityInv .", actprice = '" . $EnteredGRN->ChgPrice . "' WHERE podetailitem = '" . $EnteredGRN->PODetailItem . "'"; @@ -1163,8 +1165,8 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - $SQL = "UPDATE grns - SET quantityinv = quantityinv + " . $EnteredGRN->This_QuantityInv . " + $SQL = "UPDATE grns + SET quantityinv = quantityinv + " . $EnteredGRN->This_QuantityInv . " WHERE grnno = '" . $EnteredGRN->GRNNo . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity invoiced off the goods received record could not be updated because'); @@ -1193,35 +1195,35 @@ } //end of adding GRN shipment charges else { /*so its not a GRN shipment item its a plain old stock item */ - + if ($PurchPriceVar !=0){ /* don't bother with any of this lot if there is no difference ! */ - + if (mb_strlen($EnteredGRN->ItemCode)>0 OR $EnteredGRN->ItemCode != ''){ /*so it is a stock item */ - /*We need to: + /*We need to: * * a) update the stockmove for the delivery to reflect the actual cost of the delivery * * b) If a WeightedAverageCosting system and the stock quantity on hand now is negative then the cost that has gone to sales analysis and the cost of sales stock movement records will have been incorrect ... attempt to fix it retrospectively */ /*Get the location that the stock was booked into */ - $result = DB_query("SELECT intostocklocation - FROM purchorders + $result = DB_query("SELECT intostocklocation + FROM purchorders WHERE orderno='" . $EnteredGRN->PONo . "'", $db); $LocRow = DB_fetch_array($result); $LocCode = $LocRow['intostocklocation']; - + /* First update the stockmoves delivery cost */ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the delivery could not have the cost updated to the actual cost'); - $SQL = "UPDATE stockmoves SET price = '" . $ActualCost . "' - WHERE stockid='" .$EnteredGRN->ItemCode . "' + $SQL = "UPDATE stockmoves SET price = '" . $ActualCost . "' + WHERE stockid='" .$EnteredGRN->ItemCode . "' AND type=25 - AND loccode='" . $LocCode . "' + AND loccode='" . $LocCode . "' AND transno='" . $EnteredGRN->GRNBatchNo . "'"; - + $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,True); - + if ($_SESSION['WeightedAverageCosting']==1){ /* * How many in stock now? @@ -1230,9 +1232,9 @@ * here then some items sold will not have had this cost factored in * The cost of these items = $ActualCost */ - - $sql ="SELECT quantity - FROM locstock + + $sql ="SELECT quantity + FROM locstock WHERE loccode='" . $LocCode . "' AND stockid='" . $EnteredGRN->ItemCode . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity on hand could not be retrieved from the database'); @@ -1240,23 +1242,23 @@ $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); $QtyRow = DB_fetch_row($Result); $TotalQuantityOnHand = $QtyRow[0]; - + /* If the quantity on hand is less the quantity charged on this invoice then some must have been sold and the price variance should be reflected in the cost of sales*/ - + if ($EnteredGRN->This_QuantityInv > $TotalQuantityOnHand){ - - /* The variance to the extent of the quantity invoiced should also be written off against the sales analysis cost - as sales analysis would have been created using the cost at the time the sale was made... this was incorrect as hind-sight has shown here. However, how to determine when these were last sold? To update the sales analysis cost. Work through the last 6 months sales analysis from the latest period in which this invoice is being posted and prior. - + + /* The variance to the extent of the quantity invoiced should also be written off against the sales analysis cost - as sales analysis would have been created using the cost at the time the sale was made... this was incorrect as hind-sight has shown here. However, how to determine when these were last sold? To update the sales analysis cost. Work through the last 6 months sales analysis from the latest period in which this invoice is being posted and prior. + The assumption here is that the goods have been sold prior to the purchase invoice being entered so it is necessary to back track on the sales analysis cost. * Note that this will mean that posting to GL COGS will not agree to the cost of sales from the sales analysis * Of course the price variances will need to be included in COGS as well * */ - + $QuantityVarianceAllocated = $EnteredGRN->This_QuantityInv; $CostVarPerUnit = $ActualCost - $EnteredGRN->StdCostUnit; $PeriodAllocated = $PeriodNo; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales analysis records could not be updated for the cost variances on this purchase invoice'); - + while ($QuantityVarianceAllocated >0) { $SalesAnalResult=DB_query("SELECT cust, custbranch, @@ -1301,9 +1303,9 @@ break; } } /*end loop around different periods to see which sales analysis records to update */ - + /*now we need to work back through the sales stockmoves up to the quantity on this purchase invoice to update costs - * Only go back up to 6 months looking for stockmoves and + * Only go back up to 6 months looking for stockmoves and * Only in the stock location where the purchase order was received * into - if the stock was transferred to another location then * we cannot adjust for this */ @@ -1311,7 +1313,7 @@ type, qty, standardcost - FROM stockmoves + FROM stockmoves WHERE loccode='" . $LocCode . "' AND qty < 0 AND stockid='" . $EnteredGRN->ItemCode . "' @@ -1330,9 +1332,9 @@ } } else { //Only $QuantityVarianceAllocated left to allocate so need need to apportion cost using weighted average if ($StkMoveRow['type']==10) { //its a sales invoice - + $WACost = (((-$StkMoveRow['qty']- $QuantityVarianceAllocated)*$StkMoveRow['standardcost'])+($QuantityVarianceAllocated*$ActualCost))/-$StkMoveRow['qty']; - + $UpdStkMovesResult = DB_query("UPDATE stockmoves SET standardcost = '" . $WACost . "' WHERE stkmoveno = '" . $StkMoveRow['stkmoveno'] . "'", @@ -1344,27 +1346,27 @@ } // end if the quantity being invoiced here is greater than the current stock on hand /*Now to update the stock cost with the new weighted average */ - + /*Need to consider what to do if the cost has been changed manually between receiving the stock and entering the invoice - this code assumes there has been no cost updates made manually and all the price variance is posted to stock. - + A nicety or important?? */ - - + + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost could not be updated because'); $DbgMsg = _('The following SQL to update the cost was used'); - + if ($TotalQuantityOnHand>0) { - + $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; - - $sql = "UPDATE stockmaster + + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . $CostIncrement . " + materialcost=materialcost+" . $CostIncrement . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); - } else { + } else { /* if stock is negative then update the cost to this cost */ - $sql = "UPDATE stockmaster + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, materialcost='" . $ActualCost . "' WHERE stockid='" . $EnteredGRN->ItemCode . "'"; @@ -1397,11 +1399,11 @@ $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - + /*Now update the asset cost in fixedassets table */ - $SQL = "UPDATE fixedassets SET cost = cost + " . ($PurchPriceVar) . " + $SQL = "UPDATE fixedassets SET cost = cost + " . ($PurchPriceVar) . " WHERE assetid = '" . $EnteredGRN->AssetID . "'"; - + $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost could not be updated because:'); $DbgMsg = _('The following SQL was used to attempt the update of the asset cost:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/Suppliers.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -5,7 +5,9 @@ include('includes/session.inc'); $title = _('Supplier Maintenance'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsPayable'; +$BookMark = 'NewSupplier'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -324,10 +326,10 @@ $Errors[$i] = 'ID'; $i++; } - if (mb_strlen($_POST['SuppName']) > 40 - OR mb_strlen($_POST['SuppName']) == 0 + if (mb_strlen($_POST['SuppName']) > 40 + OR mb_strlen($_POST['SuppName']) == 0 OR $_POST['SuppName'] == '') { - + $InputError = 1; prnMsg(_('The supplier name must be entered and be forty characters or less long'),'error'); $Errors[$i]='Name'; Modified: trunk/doc/Manual/ManualAccountsPayable.html =================================================================== --- trunk/doc/Manual/ManualAccountsPayable.html 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/doc/Manual/ManualAccountsPayable.html 2012-06-25 13:27:02 UTC (rev 5459) @@ -23,7 +23,7 @@ <!-- Help Begin: Suppliers --> <div class="floatright"><a class="minitext" href="#top">⬆ Top</a></div> -<h2>Entering Supplier (Vendors)</h2> +<h2><a id="NewSupplier">Entering Supplier (Vendors)</a></h2> <p> From the menu Payables tab, under Maintenance, click on "Add A New Supplier". The new details entered are only committed to the database as a new supplier once the user clicks on the button to "Insert New Supplier". If the user moves to another screen without clicking this button any entries are lost.</p> <h3>Supplier Code</h3> @@ -89,7 +89,7 @@ <!-- Help End: SelectSupplier --> <!-- Help Begin: SupplierContacts --> <div class="floatright"><a class="minitext" href="#top">⬆ Top</a></div> -<h2>Supplier Contacts</h2> +<h2><a id="SupplierContact">Supplier Contacts</a></h2> <p> Any number of supplier contacts can be defined. This facility allows for ready access to phone numbers and email addresses of all company suppliers. Purchase orders created can be emailed directly to any of the defined contacts email addresses.</p> <p> @@ -113,7 +113,7 @@ <!-- Help End: SupplierContacts --> <!-- Help Begin: SupplierInvoices --> <div class="floatright"><a class="minitext" href="#top">⬆ Top</a></div> - <h2>Entering Supplier Invoices</h2> + <h2><a id="SupplierInvoice">Entering Supplier Invoices</a></h2> <p> As with all transactions in webERP the entity to be transacted with must first be selected i.e. a customer, item or supplier. Entering accounts payable transactions then requires the selection of a supplier first. Once a supplier is selected, the menu of options shows for the supplier among them "Enter an Invoice". The process below applies equally to entry of supplier credit notes as it does to entry of purchase invoices. In every case, entry of invoices and supplier credit notes (debit notes) requires entry of: Modified: trunk/doc/Manual/ManualAccountsReceivable.html =================================================================== --- trunk/doc/Manual/ManualAccountsReceivable.html 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/doc/Manual/ManualAccountsReceivable.html 2012-06-25 13:27:02 UTC (rev 5459) @@ -26,7 +26,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h2>Entering New Customers</h2> +<h2><a id="NewCustomer">Entering New Customers</a></h2> <p>From the menu Receivables tab, click on "Add A New Customer". The customer record is the actual charge account, any number of branches can be defined for each customer account. At least one branch must be defined for each customer. It is the branch details that record the local information about delivery address, tax authority, sales area and sales person.</p> @@ -94,8 +94,9 @@ <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> -<h2>Entering Customer Branches</h2> +<h2><a id="NewCustomerBranch">Entering Customer Branches</a></h2> + <p>A customer code entered on its own is insufficient to enter sales orders against. All customers must have at least one branch. The branch records contain the information about the delivery address, the sales area, the tax code, the sales representative and other regional information. New branches can be set up at any time. The first step will always be to select the customer, then to Add/Edit/Delete Customer Branch Records from the Customer menu. There is no limit to the number of branches that can be referenced against a single charge account (customer record). However, branches cannot be transferred between different customers. Only one statement will print per customer, but each invoice will be referenced to the branch it was delivered to.</p> <h3>Branch Name</h3> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ice...@us...> - 2012-06-25 13:27:14
|
Revision: 5459 http://web-erp.svn.sourceforge.net/web-erp/?rev=5459&view=rev Author: icedlava Date: 2012-06-25 13:27:02 +0000 (Mon, 25 Jun 2012) Log Message: ----------- Add a few bookmarks for webERP manual. Modified Paths: -------------- trunk/CustomerBranches.php trunk/Customers.php trunk/Stocks.php trunk/SupplierContacts.php trunk/SupplierInvoice.php trunk/Suppliers.php trunk/doc/Manual/ManualAccountsPayable.html trunk/doc/Manual/ManualAccountsReceivable.html Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/CustomerBranches.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -4,8 +4,10 @@ include('includes/session.inc'); $title = _('Customer Branches'); +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsReceivable'; +$BookMark = 'NewCustomerBranch'; include('includes/header.inc'); - if (isset($_GET['DebtorNo'])) { $DebtorNo = mb_strtoupper($_GET['DebtorNo']); } else if (isset($_POST['DebtorNo'])){ @@ -112,7 +114,7 @@ // Format: Longitude, Latitude, Altitude $Latitude = $coordinatesSplit[1]; $Longitude = $coordinatesSplit[0]; - + $status = $xml->Response->Status->code; if (strcmp($status, '200') == 0) { // Successful geocode @@ -417,11 +419,11 @@ $DebtorNo, urlencode($myrow[1]), _('Delete Branch')); - - if ($myrow[11]){ - $TotalDisable++; - }else { - $TotalEnable++; + + if ($myrow[11]){ + $TotalDisable++; + }else { + $TotalEnable++; } } while ($myrow = DB_fetch_row($result)); @@ -536,7 +538,7 @@ echo '<input type="hidden" name="SelectedBranch" value="' . $SelectedBranch . '" />'; echo '<input type="hidden" name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; - + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { @@ -673,9 +675,9 @@ //SQL to poulate account selection boxes - $sql = "SELECT salesmanname, - salesmancode - FROM salesman + $sql = "SELECT salesmanname, + salesmancode + FROM salesman WHERE current = 1"; $result = DB_query($sql,$db); @@ -799,7 +801,7 @@ echo '<tr> <td>'._('Tax Group').':</td> <td><select tabindex="19" name="TaxGroup">'; - + while ($myrow = DB_fetch_array($TaxGroupResults)) { if (isset($_POST['TaxGroup']) and $myrow['taxgroupid']==$_POST['TaxGroup']) { echo '<option selected="selected" value="'; @@ -825,7 +827,7 @@ echo ' </select></td></tr>'; - + $SQL = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($SQL,$db); if (DB_num_rows($ShipperResults)==0){ @@ -862,7 +864,7 @@ echo '<option selected="selected" value="1">' . _('Show company details and logo') . '</option> <option value="2">' . _('Hide company details and logo') . '</option>'; } - + echo '</select></td> </tr>'; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/Customers.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -5,7 +5,9 @@ include('includes/session.inc'); $title = _('Customer Maintenance'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsReceivable'; +$BookMark = 'NewCustomer'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -500,7 +502,7 @@ $DateString = Date($_SESSION['DefaultDateFormat']); echo '<tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td><input tabindex="10" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" value="' . $DateString . '" size="12" maxlength="10" /></td></tr>'; - + echo '</table></td> <td><table class="selection"> <tr> @@ -611,7 +613,7 @@ <div class="centre"> <input tabindex="20" type="submit" name="submit" value="' . _('Add New Customer') . '" /> <input tabindex="21" type="submit" value="' . _('Reset') . '" /> </div>'; - + } echo '</div>'; echo '</form>'; @@ -650,7 +652,7 @@ typeid FROM debtorsmaster WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; - + $ErrMsg = _('The customer details could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -675,9 +677,9 @@ $_POST['ClientSince'] = ConvertSQLDate($myrow['clientsince']); $_POST['HoldReason'] = $myrow['holdreason']; $_POST['PaymentTerms'] = $myrow['paymentterms']; - $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); + $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); $_POST['DiscountCode'] = $myrow['discountcode']; - $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); + $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); $_POST['CreditLimit'] = locale_number_format($myrow['creditlimit'],0); $_POST['InvAddrBranch'] = $myrow['invaddrbranch']; $_POST['TaxRef'] = $myrow['taxref']; @@ -759,7 +761,7 @@ <td>' . _('Address Line 6') . ':</td> <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address6" size="42" maxlength="40" value="' . $_POST['Address6'] . '" /></td> </tr>'; - + } // Select sales types for drop down list if (isset($_GET['Modify'])) { @@ -808,10 +810,10 @@ echo '</select></td></tr> <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td>' . $_POST['ClientSince'] . '</td></tr>'; - + echo '</table></td> <td><table class="selection">'; - + echo '<tr> <td>' . _('Discount Percent') . ':</td> <td>' . $_POST['Discount'] . '</td> @@ -841,7 +843,7 @@ </tr> </table></td> <td><table class="selection">'; - + echo '<tr> <td>' . _('Discount Percent') . ':</td> <td><input type="text" name="Discount" class="number" size="5" maxlength="4" value="' . $_POST['Discount'] . '" /></td> @@ -995,7 +997,7 @@ if (isset($_GET['delete'])) { //User hit delete link on customer contacts /*Process this first before showing remaining contacts */ - $resultupcc = DB_query("DELETE FROM custcontacts + $resultupcc = DB_query("DELETE FROM custcontacts WHERE debtorno='".$DebtorNo."' AND contid='".$ID."'", $db); @@ -1008,9 +1010,9 @@ role, phoneno, notes, - email - FROM custcontacts - WHERE debtorno='".$DebtorNo."' + email + FROM custcontacts + WHERE debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); @@ -1081,7 +1083,7 @@ } }//END WHILE LIST LOOP echo '</table>'; - + echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { @@ -1096,7 +1098,7 @@ <input type="submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> </div>'; } - + echo '</div> </form>'; } // end of main ifs Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/Stocks.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -4,7 +4,6 @@ include('includes/session.inc'); $title = _('Item Maintenance'); -$title = _('Item Maintenance'); /* webERP manual links before header.inc */ $ViewTopic= 'Inventory'; $BookMark = 'InventoryAddingItems'; Modified: trunk/SupplierContacts.php =================================================================== --- trunk/SupplierContacts.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/SupplierContacts.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -4,7 +4,9 @@ include('includes/session.inc'); $title = _('Supplier Contacts'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsPayable'; +$BookMark = 'SupplierContact'; include('includes/header.inc'); if (isset($_GET['SupplierID'])){ @@ -64,7 +66,7 @@ fax='" . $_POST['Fax'] . "', email='" . $_POST['Email'] . "', mobile = '". $_POST['Mobile'] . "' - WHERE contact='".$SelectedContact."' + WHERE contact='".$SelectedContact."' AND supplierid='".$SupplierID."'"; $msg = _('The supplier contact information has been updated'); @@ -136,16 +138,16 @@ AND suppliercontacts.supplierid = '".$SupplierID."'"; $result = DB_query($sql, $db); - + if (DB_num_rows($result)>0){ - + $myrow = DB_fetch_array($result); - + echo '<table class="selection"> <tr> <th colspan="7"><h3>' . _('Contacts Defined for') . ' - ' . $myrow['suppname'] . '</h3></th> </tr>'; - + echo '<tr> <th>' . _('Name') . '</th> <th>' . _('Position') . '</th> @@ -153,7 +155,7 @@ <th>' . _('Fax No') . '</th> <th>' . _('Email') . '</th> </tr>'; - + do { printf('<tr><td>%s</td> <td>%s</td> @@ -210,7 +212,7 @@ FROM suppliercontacts WHERE contact='" . $SelectedContact . "' AND supplierid='" . $SupplierID . "'"; - + $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/SupplierInvoice.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -12,7 +12,9 @@ include('includes/session.inc'); $title = _('Enter Supplier Invoice'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsPayable'; +$BookMark = 'SupplierInvoice'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -182,7 +184,7 @@ if (!isset($_POST['PostInvoice'])){ - if (isset($_POST['GRNS']) + if (isset($_POST['GRNS']) AND $_POST['GRNS'] == _('Purchase Orders')){ /*This ensures that any changes in the page are stored in the session before calling the grn page */ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppInvGRNs.php">'; @@ -217,7 +219,7 @@ <br />'; exit; } - if (isset($_POST['FixedAssets']) + if (isset($_POST['FixedAssets']) AND $_POST['FixedAssets'] == _('Fixed Assets')){ /*This ensures that any changes in the page are stored in the session before calling the shipments page */ echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppFixedAssetChgs.php">'; @@ -268,8 +270,8 @@ echo '<br /> <div class="centre"> - <input type="submit" name="GRNS" value="' . _('Purchase Orders') . '" /> - <input type="submit" name="Shipts" value="' . _('Shipments') . '" /> + <input type="submit" name="GRNS" value="' . _('Purchase Orders') . '" /> + <input type="submit" name="Shipts" value="' . _('Shipments') . '" /> <input type="submit" name="Contracts" value="' . _('Contracts') . '" /> '; if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ @@ -279,7 +281,7 @@ </div>'; $TotalGRNValue = 0; - + if (count( $_SESSION['SuppTrans']->GRNs)>0){ /*if there are any GRNs selected for invoicing then */ /*Show all the selected GRNs so far from the SESSION['SuppInv']->GRNs array */ @@ -334,9 +336,9 @@ <th>' . _('Amount') . '</th> </tr>'; echo $TableHeader; - + $i=0; //row counter - + foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ echo '<tr> @@ -416,7 +418,7 @@ </tr>'; echo $TableHeader; - + $i=0; foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ @@ -443,7 +445,7 @@ } $TotalGLValue = 0; - + if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ if (count($_SESSION['SuppTrans']->GLCodes) > 0){ @@ -526,7 +528,7 @@ /*If a tax rate is entered that is not the same as it was previously then recalculate automatically the tax amounts */ - if (!isset($_POST['OverRideTax']) + if (!isset($_POST['OverRideTax']) OR $_POST['OverRideTax']=='Auto'){ echo ' <input type="text" class="number" name="TaxRate' . $Tax->TaxCalculationOrder . '" maxlength="4" size="4" value="' . locale_number_format($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100,$_SESSION['SuppTrans']->CurrDecimalPlaces) . '" />%'; @@ -619,43 +621,43 @@ $InputError = False; if ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount < 0){ - + $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); echo '<p>' . _('The tax total is') . ' : ' . locale_number_format($TaxTotal,$_SESSION['SuppTrans']->CurrDecimalPlaces); echo '<p>' . _('The ovamount is') . ' : ' . locale_number_format($_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces); - + } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ - + prnMsg(_('The invoice as entered will be processed but be warned the amount of the invoice is zero!') . '. ' . _('Invoices are normally expected to have a positive charge'),'warn'); - + } elseif (mb_strlen( $_SESSION['SuppTrans']->SuppReference)<1){ - + $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the there is no suppliers invoice number or reference entered') . '. ' . _('The supplier invoice number must be entered'),'error'); } elseif (!Is_date( $_SESSION['SuppTrans']->TranDate)){ - + $InputError = True; prnMsg( _('The invoice as entered cannot be processed because the invoice date entered is not in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); } elseif (DateDiff(Date($_SESSION['DefaultDateFormat']), $_SESSION['SuppTrans']->TranDate, 'd') < 0){ - + $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the invoice date is after today') . '. ' . _('Purchase invoices are expected to have a date prior to or today'),'error'); }elseif ( $_SESSION['SuppTrans']->ExRate <= 0){ - + $InputError = True; prnMsg( _('The invoice as entered cannot be processed because the exchange rate for the invoice has been entered as a negative or zero number') . '. ' . _('The exchange rate is expected to show how many of the suppliers currency there are in 1 of the local currency'),'error'); - + } elseif ( $_SESSION['SuppTrans']->OvAmount < round($_SESSION['SuppTrans']->Total_Shipts_Value() + $_SESSION['SuppTrans']->Total_GL_Value() + $_SESSION['SuppTrans']->Total_Contracts_Value()+ $_SESSION['SuppTrans']->Total_Assets_Value()+$_SESSION['SuppTrans']->Total_GRN_Value(),$_SESSION['SuppTrans']->CurrDecimalPlaces)){ - + prnMsg( _('The invoice total as entered is less than the sum of the shipment charges, the general ledger entries (if any), the charges for goods received, contract charges and fixed asset charges. There must be a mistake somewhere, the invoice as entered will not be processed'),'error'); $InputError = True; } else { - + $sql = "SELECT count(*) FROM supptrans WHERE supplierno='" . $_SESSION['SuppTrans']->SupplierID . "' @@ -782,7 +784,7 @@ account, narrative, amount) - VALUES ('20', + VALUES ('20', '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', '" . $PeriodNo . "', @@ -814,7 +816,7 @@ account, narrative, amount) - VALUES ('20', + VALUES ('20', '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', '" . $PeriodNo . "', @@ -829,7 +831,7 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - if (mb_strlen($EnteredGRN->ShiptRef) == 0 + if (mb_strlen($EnteredGRN->ShiptRef) == 0 OR $EnteredGRN->ShiptRef == 0){ /*so its not a GRN shipment item enter the GL entry to reverse the GRN suspense entry created on delivery @@ -845,7 +847,7 @@ account, narrative, amount) - VALUES ('20', + VALUES ('20', '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', '" . $PeriodNo . "', @@ -870,7 +872,7 @@ /*need to get the stock category record for this stock item - this is function in SQL_CommonFunctions.inc */ $StockGLCode = GetStockGLCode($EnteredGRN->ItemCode,$db); - + /*We have stock item and a purchase price variance need to see whether we are using Standard or WeightedAverageCosting */ if ($_SESSION['WeightedAverageCosting']==1){ /*Weighted Average costing */ @@ -900,11 +902,11 @@ if ($EnteredGRN->This_QuantityInv > $TotalQuantityOnHand){ /*So we need to write off some of the variance to variances and only the balance of the quantity in stock to go to stock value */ - + /*if the TotalQuantityOnHand is negative then this variance to write off is inflated by the negative quantity - which makes sense */ - + $WriteOffToVariances = ($EnteredGRN->This_QuantityInv - $TotalQuantityOnHand) * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); - + $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -926,7 +928,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); } // end if the quantity being invoiced here is greater than the current stock on hand - + /*Now post any remaining price variance to stock rather than price variances */ $SQL = "INSERT INTO gltrans (type, @@ -1093,7 +1095,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the control total could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - + EnsureGLEntriesBalance(20, $InvoiceNo, $db); } /*Thats the end of the GL postings */ @@ -1147,12 +1149,12 @@ /* Now update the GRN and PurchOrderDetails records for amounts invoiced - can't use the other loop through the GRNs as this was only where the GL link to credtors is active */ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - + //in local currency - $ActualCost = $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate; + $ActualCost = $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate; $PurchPriceVar = $EnteredGRN->This_QuantityInv * ($ActualCost - $EnteredGRN->StdCostUnit); - - $SQL = "UPDATE purchorderdetails + + $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced + " . $EnteredGRN->This_QuantityInv .", actprice = '" . $EnteredGRN->ChgPrice . "' WHERE podetailitem = '" . $EnteredGRN->PODetailItem . "'"; @@ -1163,8 +1165,8 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - $SQL = "UPDATE grns - SET quantityinv = quantityinv + " . $EnteredGRN->This_QuantityInv . " + $SQL = "UPDATE grns + SET quantityinv = quantityinv + " . $EnteredGRN->This_QuantityInv . " WHERE grnno = '" . $EnteredGRN->GRNNo . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity invoiced off the goods received record could not be updated because'); @@ -1193,35 +1195,35 @@ } //end of adding GRN shipment charges else { /*so its not a GRN shipment item its a plain old stock item */ - + if ($PurchPriceVar !=0){ /* don't bother with any of this lot if there is no difference ! */ - + if (mb_strlen($EnteredGRN->ItemCode)>0 OR $EnteredGRN->ItemCode != ''){ /*so it is a stock item */ - /*We need to: + /*We need to: * * a) update the stockmove for the delivery to reflect the actual cost of the delivery * * b) If a WeightedAverageCosting system and the stock quantity on hand now is negative then the cost that has gone to sales analysis and the cost of sales stock movement records will have been incorrect ... attempt to fix it retrospectively */ /*Get the location that the stock was booked into */ - $result = DB_query("SELECT intostocklocation - FROM purchorders + $result = DB_query("SELECT intostocklocation + FROM purchorders WHERE orderno='" . $EnteredGRN->PONo . "'", $db); $LocRow = DB_fetch_array($result); $LocCode = $LocRow['intostocklocation']; - + /* First update the stockmoves delivery cost */ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the delivery could not have the cost updated to the actual cost'); - $SQL = "UPDATE stockmoves SET price = '" . $ActualCost . "' - WHERE stockid='" .$EnteredGRN->ItemCode . "' + $SQL = "UPDATE stockmoves SET price = '" . $ActualCost . "' + WHERE stockid='" .$EnteredGRN->ItemCode . "' AND type=25 - AND loccode='" . $LocCode . "' + AND loccode='" . $LocCode . "' AND transno='" . $EnteredGRN->GRNBatchNo . "'"; - + $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,True); - + if ($_SESSION['WeightedAverageCosting']==1){ /* * How many in stock now? @@ -1230,9 +1232,9 @@ * here then some items sold will not have had this cost factored in * The cost of these items = $ActualCost */ - - $sql ="SELECT quantity - FROM locstock + + $sql ="SELECT quantity + FROM locstock WHERE loccode='" . $LocCode . "' AND stockid='" . $EnteredGRN->ItemCode . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity on hand could not be retrieved from the database'); @@ -1240,23 +1242,23 @@ $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); $QtyRow = DB_fetch_row($Result); $TotalQuantityOnHand = $QtyRow[0]; - + /* If the quantity on hand is less the quantity charged on this invoice then some must have been sold and the price variance should be reflected in the cost of sales*/ - + if ($EnteredGRN->This_QuantityInv > $TotalQuantityOnHand){ - - /* The variance to the extent of the quantity invoiced should also be written off against the sales analysis cost - as sales analysis would have been created using the cost at the time the sale was made... this was incorrect as hind-sight has shown here. However, how to determine when these were last sold? To update the sales analysis cost. Work through the last 6 months sales analysis from the latest period in which this invoice is being posted and prior. - + + /* The variance to the extent of the quantity invoiced should also be written off against the sales analysis cost - as sales analysis would have been created using the cost at the time the sale was made... this was incorrect as hind-sight has shown here. However, how to determine when these were last sold? To update the sales analysis cost. Work through the last 6 months sales analysis from the latest period in which this invoice is being posted and prior. + The assumption here is that the goods have been sold prior to the purchase invoice being entered so it is necessary to back track on the sales analysis cost. * Note that this will mean that posting to GL COGS will not agree to the cost of sales from the sales analysis * Of course the price variances will need to be included in COGS as well * */ - + $QuantityVarianceAllocated = $EnteredGRN->This_QuantityInv; $CostVarPerUnit = $ActualCost - $EnteredGRN->StdCostUnit; $PeriodAllocated = $PeriodNo; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales analysis records could not be updated for the cost variances on this purchase invoice'); - + while ($QuantityVarianceAllocated >0) { $SalesAnalResult=DB_query("SELECT cust, custbranch, @@ -1301,9 +1303,9 @@ break; } } /*end loop around different periods to see which sales analysis records to update */ - + /*now we need to work back through the sales stockmoves up to the quantity on this purchase invoice to update costs - * Only go back up to 6 months looking for stockmoves and + * Only go back up to 6 months looking for stockmoves and * Only in the stock location where the purchase order was received * into - if the stock was transferred to another location then * we cannot adjust for this */ @@ -1311,7 +1313,7 @@ type, qty, standardcost - FROM stockmoves + FROM stockmoves WHERE loccode='" . $LocCode . "' AND qty < 0 AND stockid='" . $EnteredGRN->ItemCode . "' @@ -1330,9 +1332,9 @@ } } else { //Only $QuantityVarianceAllocated left to allocate so need need to apportion cost using weighted average if ($StkMoveRow['type']==10) { //its a sales invoice - + $WACost = (((-$StkMoveRow['qty']- $QuantityVarianceAllocated)*$StkMoveRow['standardcost'])+($QuantityVarianceAllocated*$ActualCost))/-$StkMoveRow['qty']; - + $UpdStkMovesResult = DB_query("UPDATE stockmoves SET standardcost = '" . $WACost . "' WHERE stkmoveno = '" . $StkMoveRow['stkmoveno'] . "'", @@ -1344,27 +1346,27 @@ } // end if the quantity being invoiced here is greater than the current stock on hand /*Now to update the stock cost with the new weighted average */ - + /*Need to consider what to do if the cost has been changed manually between receiving the stock and entering the invoice - this code assumes there has been no cost updates made manually and all the price variance is posted to stock. - + A nicety or important?? */ - - + + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost could not be updated because'); $DbgMsg = _('The following SQL to update the cost was used'); - + if ($TotalQuantityOnHand>0) { - + $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; - - $sql = "UPDATE stockmaster + + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . $CostIncrement . " + materialcost=materialcost+" . $CostIncrement . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); - } else { + } else { /* if stock is negative then update the cost to this cost */ - $sql = "UPDATE stockmaster + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, materialcost='" . $ActualCost . "' WHERE stockid='" . $EnteredGRN->ItemCode . "'"; @@ -1397,11 +1399,11 @@ $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - + /*Now update the asset cost in fixedassets table */ - $SQL = "UPDATE fixedassets SET cost = cost + " . ($PurchPriceVar) . " + $SQL = "UPDATE fixedassets SET cost = cost + " . ($PurchPriceVar) . " WHERE assetid = '" . $EnteredGRN->AssetID . "'"; - + $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost could not be updated because:'); $DbgMsg = _('The following SQL was used to attempt the update of the asset cost:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/Suppliers.php 2012-06-25 13:27:02 UTC (rev 5459) @@ -5,7 +5,9 @@ include('includes/session.inc'); $title = _('Supplier Maintenance'); - +/* webERP manual links before header.inc */ +$ViewTopic= 'AccountsPayable'; +$BookMark = 'NewSupplier'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -324,10 +326,10 @@ $Errors[$i] = 'ID'; $i++; } - if (mb_strlen($_POST['SuppName']) > 40 - OR mb_strlen($_POST['SuppName']) == 0 + if (mb_strlen($_POST['SuppName']) > 40 + OR mb_strlen($_POST['SuppName']) == 0 OR $_POST['SuppName'] == '') { - + $InputError = 1; prnMsg(_('The supplier name must be entered and be forty characters or less long'),'error'); $Errors[$i]='Name'; Modified: trunk/doc/Manual/ManualAccountsPayable.html =================================================================== --- trunk/doc/Manual/ManualAccountsPayable.html 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/doc/Manual/ManualAccountsPayable.html 2012-06-25 13:27:02 UTC (rev 5459) @@ -23,7 +23,7 @@ <!-- Help Begin: Suppliers --> <div class="floatright"><a class="minitext" href="#top">⬆ Top</a></div> -<h2>Entering Supplier (Vendors)</h2> +<h2><a id="NewSupplier">Entering Supplier (Vendors)</a></h2> <p> From the menu Payables tab, under Maintenance, click on "Add A New Supplier". The new details entered are only committed to the database as a new supplier once the user clicks on the button to "Insert New Supplier". If the user moves to another screen without clicking this button any entries are lost.</p> <h3>Supplier Code</h3> @@ -89,7 +89,7 @@ <!-- Help End: SelectSupplier --> <!-- Help Begin: SupplierContacts --> <div class="floatright"><a class="minitext" href="#top">⬆ Top</a></div> -<h2>Supplier Contacts</h2> +<h2><a id="SupplierContact">Supplier Contacts</a></h2> <p> Any number of supplier contacts can be defined. This facility allows for ready access to phone numbers and email addresses of all company suppliers. Purchase orders created can be emailed directly to any of the defined contacts email addresses.</p> <p> @@ -113,7 +113,7 @@ <!-- Help End: SupplierContacts --> <!-- Help Begin: SupplierInvoices --> <div class="floatright"><a class="minitext" href="#top">⬆ Top</a></div> - <h2>Entering Supplier Invoices</h2> + <h2><a id="SupplierInvoice">Entering Supplier Invoices</a></h2> <p> As with all transactions in webERP the entity to be transacted with must first be selected i.e. a customer, item or supplier. Entering accounts payable transactions then requires the selection of a supplier first. Once a supplier is selected, the menu of options shows for the supplier among them "Enter an Invoice". The process below applies equally to entry of supplier credit notes as it does to entry of purchase invoices. In every case, entry of invoices and supplier credit notes (debit notes) requires entry of: Modified: trunk/doc/Manual/ManualAccountsReceivable.html =================================================================== --- trunk/doc/Manual/ManualAccountsReceivable.html 2012-06-24 14:39:40 UTC (rev 5458) +++ trunk/doc/Manual/ManualAccountsReceivable.html 2012-06-25 13:27:02 UTC (rev 5459) @@ -26,7 +26,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h2>Entering New Customers</h2> +<h2><a id="NewCustomer">Entering New Customers</a></h2> <p>From the menu Receivables tab, click on "Add A New Customer". The customer record is the actual charge account, any number of branches can be defined for each customer account. At least one branch must be defined for each customer. It is the branch details that record the local information about delivery address, tax authority, sales area and sales person.</p> @@ -94,8 +94,9 @@ <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> -<h2>Entering Customer Branches</h2> +<h2><a id="NewCustomerBranch">Entering Customer Branches</a></h2> + <p>A customer code entered on its own is insufficient to enter sales orders against. All customers must have at least one branch. The branch records contain the information about the delivery address, the sales area, the tax code, the sales representative and other regional information. New branches can be set up at any time. The first step will always be to select the customer, then to Add/Edit/Delete Customer Branch Records from the Customer menu. There is no limit to the number of branches that can be referenced against a single charge account (customer record). However, branches cannot be transferred between different customers. Only one statement will print per customer, but each invoice will be referenced to the branch it was delivered to.</p> <h3>Branch Name</h3> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-26 06:44:11
|
Revision: 5460 http://web-erp.svn.sourceforge.net/web-erp/?rev=5460&view=rev Author: daintree Date: 2012-06-26 06:44:04 +0000 (Tue, 26 Jun 2012) Log Message: ----------- Bob Thomas StockAdjustments link fix Modified Paths: -------------- trunk/StockAdjustments.php trunk/api/api_xml-rpc.php trunk/doc/Change.log Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-06-25 13:27:02 UTC (rev 5459) +++ trunk/StockAdjustments.php 2012-06-26 06:44:04 UTC (rev 5460) @@ -455,8 +455,8 @@ } echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment' . $identifier]->Quantity . '" /> '.locale_number_format($_SESSION['Adjustment' . $identifier]->Quantity,$DecimalPlaces) .' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE?identifier='.$identifier.'">'._('Remove').'</a>] - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD?identifier='.$identifier.'">'._('Add').'</a>]'; + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE?&dentifier='.$identifier.'">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&identifier='.$identifier.'">'._('Add').'</a>]'; } else { echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '" />'; } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-25 13:27:02 UTC (rev 5459) +++ trunk/api/api_xml-rpc.php 2012-06-26 06:44:04 UTC (rev 5460) @@ -789,7 +789,7 @@ $SearchStockItems_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_SearchStockItems($xmlrpcmsg){ - ob_start('ob_file_callback'); + //ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) /*x*/ { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(SearchStockItems($xmlrpcmsg->getParam( 0 )->scalarval( ), @@ -800,7 +800,7 @@ $rtn = new xmlrpcresp( php_xmlrpc_encode(SearchStockItems($xmlrpcmsg->getParam( 0 )->scalarval( ), /*e*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), '', ''))); /*x*/ } - ob_end_flush(); + //ob_end_flush(); return $rtn; } @@ -3012,381 +3012,382 @@ $s = new xmlrpc_server( array( - "weberp.xmlrpc_Login" => array( - "function" => "xmlrpc_Login", - "signature" => $Login_sig, - "docstring" => $Login_doc), - "weberp.xmlrpc_Logout" => array( - "function" => "xmlrpc_Logout", - "signature" => $Logout_sig, - "docstring" => $Logout_doc), - "weberp.xmlrpc_InsertCustomer" => array( - "function" => "xmlrpc_InsertCustomer", - "signature" => $InsertCustomer_sig, - "docstring" => $InsertCustomer_doc), - "weberp.xmlrpc_ModifyCustomer" => array( - "function" => "xmlrpc_ModifyCustomer", - "signature" => $ModifyCustomer_sig, - "docstring" => $ModifyCustomer_doc), - "weberp.xmlrpc_GetCustomer" => array( - "function" => "xmlrpc_GetCustomer", - "signature" => $GetCustomer_sig, - "docstring" => $GetCustomer_doc), - "weberp.xmlrpc_SearchCustomers" => array( - "function" => "xmlrpc_SearchCustomers", - "signature" => $SearchCustomers_sig, - "docstring" => $SearchCustomers_doc), - "weberp.xmlrpc_GetCurrencyList" => array( - "function" => "xmlrpc_GetCurrencyList", - "signature" => $GetCurrencyList_sig, - "docstring" => $GetCurrencyList_doc), - "weberp.xmlrpc_GetCurrencyDetails" => array( - "function" => "xmlrpc_GetCurrencyDetails", - "signature" => $GetCurrencyDetails_sig, - "docstring" => $GetCurrencyDetails_doc), - "weberp.xmlrpc_GetSalesTypeList" => array( - "function" => "xmlrpc_GetSalesTypeList", - "signature" => $GetSalesTypeList_sig, - "docstring" => $GetSalesTypeList_doc), - "weberp.xmlrpc_GetSalesTypeDetails" => array( - "function" => "xmlrpc_GetSalesTypeDetails", - "signature" => $GetSalesTypeDetails_sig, - "docstring" => $GetSalesTypeDetails_doc), - "weberp.xmlrpc_InsertSalesType" => array( - "function" => "xmlrpc_InsertSalesType", - "signature" => $InsertSalesType_sig, - "docstring" => $InsertSalesType_doc), - "weberp.xmlrpc_GetHoldReasonList" => array( - "function" => "xmlrpc_GetHoldReasonList", - "signature" => $GetHoldReasonList_sig, - "docstring" => $GetHoldReasonList_doc), - "weberp.xmlrpc_GetHoldReasonDetails" => array( - "function" => "xmlrpc_GetHoldReasonDetails", - "signature" => $GetHoldReasonDetails_sig, - "docstring" => $GetHoldReasonDetails_doc), - "weberp.xmlrpc_GetPaymentTermsList" => array( - "function" => "xmlrpc_GetPaymentTermsList", - "signature" => $GetPaymentTermsList_sig, - "docstring" => $GetPaymentTermsList_doc), - "weberp.xmlrpc_GetPaymentTermsDetails" => array( - "function" => "xmlrpc_GetPaymentTermsDetails", - "signature" => $GetPaymentTermsDetails_sig, - "docstring" => $GetPaymentTermsDetails_doc), - "weberp.xmlrpc_GetPaymentMethodsList" => array( - "function" => "xmlrpc_GetPaymentMethodsList", - "signature" => $GetPaymentMethodsList_sig, - "docstring" => $GetPaymentMethodsList_doc), - "weberp.xmlrpc_GetPaymentMethodDetails" => array( - "function" => "xmlrpc_GetPaymentMethodDetails", - "signature" => $GetPaymentMethodDetails_sig, - "docstring" => $GetPaymentMethodDetails_doc), - "weberp.xmlrpc_InsertStockItem" => array( - "function" => "xmlrpc_InsertStockItem", - "signature" => $InsertStockItem_sig, - "docstring" => $InsertStockItem_doc), - "weberp.xmlrpc_ModifyStockItem" => array( - "function" => "xmlrpc_ModifyStockItem", - "signature" => $ModifyStockItem_sig, - "docstring" => $ModifyStockItem_doc), - "weberp.xmlrpc_GetStockItem" => array( - "function" => "xmlrpc_GetStockItem", - "signature" => $GetStockItem_sig, - "docstring" => $GetStockItem_doc), - "weberp.xmlrpc_SearchStockItems" => array( - "function" => "xmlrpc_SearchStockItems", - "signature" => $SearchStockItems_sig, - "docstring" => $SearchStockItems_doc), - "weberp.xmlrpc_GetStockBalance" => array( - "function" => "xmlrpc_GetStockBalance", - "signature" => $GetStockBalance_sig, - "docstring" => $GetStockBalance_doc), - "weberp.xmlrpc_GetStockReorderLevel" => array( - "function" => "xmlrpc_GetStockReorderLevel", - "signature" => $GetStockReorderLevel_sig, - "docstring" => $GetStockReorderLevel_doc), - "weberp.xmlrpc_SetStockReorderLevel" => array( - "function" => "xmlrpc_SetStockReorderLevel", - "signature" => $SetStockReorderLevel_sig, - "docstring" => $SetStockReorderLevel_doc), - "weberp.xmlrpc_GetAllocatedStock" => array( - "function" => "xmlrpc_GetAllocatedStock", - "signature" => $GetAllocatedStock_sig, - "docstring" => $GetAllocatedStock_doc), - "weberp.xmlrpc_GetOrderedStock" => array( - "function" => "xmlrpc_GetOrderedStock", - "signature" => $GetOrderedStock_sig, - "docstring" => $GetOrderedStock_doc), - "weberp.xmlrpc_SetStockPrice" => array( - "function" => "xmlrpc_SetStockPrice", - "signature" => $SetStockPrice_sig, - "docstring" => $SetStockPrice_doc), - "weberp.xmlrpc_GetStockPrice" => array( - "function" => "xmlrpc_GetStockPrice", - "signature" => $GetStockPrice_sig, - "docstring" => $GetStockPrice_doc), - "weberp.xmlrpc_InsertSalesInvoice" => array( - "function" => "xmlrpc_InsertSalesInvoice", - "signature" => $InsertSalesInvoice_sig, - "docstring" => $InsertSalesInvoice_doc), - "weberp.xmlrpc_AllocateTrans" => array( - "function" => "xmlrpc_AllocateTrans", - "signature" => $AllocateTrans_sig, - "docstring" => $AllocateTrans_doc), - "weberp.xmlrpc_InsertDebtorReceipt" => array( - "function" => "xmlrpc_InsertDebtorReceipt", - "signature" => $InsertDebtorReceipt_sig, - "docstring" => $InsertDebtorReceipt_doc), - "weberp.xmlrpc_CreateCreditNote" => array( - "function" => "xmlrpc_CreateCreditNote", - "signature" => $CreateCreditNote_sig, - "docstring" => $CreateCreditNote_doc), - "weberp.xmlrpc_InsertSalesCredit" => array( - "function" => "xmlrpc_InsertSalesCredit", - "signature" => $InsertSalesCredit_sig, - "docstring" => $InsertSalesCredit_doc), - "weberp.xmlrpc_InsertBranch" => array( - "function" => "xmlrpc_InsertBranch", - "signature" => $InsertBranch_sig, - "docstring" => $InsertBranch_doc), - "weberp.xmlrpc_ModifyBranch" => array( - "function" => "xmlrpc_ModifyBranch", - "signature" => $ModifyBranch_sig, - "docstring" => $ModifyBranch_doc), - "weberp.xmlrpc_GetCustomerBranchCodes" => array( - "function" => "xmlrpc_GetCustomerBranchCodes", - "signature" => $GetCustomerBranchCodes_sig, - "docstring" => $GetCustomerBranchCodes_doc), - "weberp.xmlrpc_GetCustomerBranch" => array( - "function" => "xmlrpc_GetCustomerBranch", - "signature" => $GetCustomerBranch_sig, - "docstring" => $GetCustomerBranch_doc), - "weberp.xmlrpc_InsertSalesOrderHeader" => array( - "function" => "xmlrpc_InsertSalesOrderHeader", - "signature" => $InsertSalesOrderHeader_sig, - "docstring" => $InsertSalesOrderHeader_doc), - "weberp.xmlrpc_ModifySalesOrderHeader" => array( - "function" => "xmlrpc_ModifySalesOrderHeader", - "signature" => $ModifySalesOrderHeader_sig, - "docstring" => $ModifySalesOrderHeader_doc), - "weberp.xmlrpc_InsertSalesOrderLine" => array( - "function" => "xmlrpc_InsertSalesOrderLine", - "signature" => $InsertSalesOrderLine_sig, - "docstring" => $InsertSalesOrderLine_doc), - "weberp.xmlrpc_ModifySalesOrderLine" => array( - "function" => "xmlrpc_ModifySalesOrderLine", - "signature" => $ModifySalesOrderLine_sig, - "docstring" => $ModifySalesOrderLine_doc), - "weberp.xmlrpc_InvoiceSalesOrder" => array( - "function" => "xmlrpc_InvoiceSalesOrder", - "signature" => $InvoiceSalesOrder_sig, - "docstring" => $InvoiceSalesOrder_doc), - "weberp.xmlrpc_InsertGLAccount" => array( - "function" => "xmlrpc_InsertGLAccount", - "signature" => $InsertGLAccount_sig, - "docstring" => $InsertGLAccount_doc), - "weberp.xmlrpc_InsertGLAccountSection" => array( - "function" => "xmlrpc_InsertGLAccountSection", - "signature" => $InsertGLAccountSection_sig, - "docstring" => $InsertGLAccountSection_doc), - "weberp.xmlrpc_InsertGLAccountGroup" => array( - "function" => "xmlrpc_InsertGLAccountGroup", - "signature" => $InsertGLAccountGroup_sig, - "docstring" => $InsertGLAccountGroup_doc), - "weberp.xmlrpc_GetLocationList" => array( - "function" => "xmlrpc_GetLocationList", - "signature" => $GetLocationList_sig, - "docstring" => $GetLocationList_doc), - "weberp.xmlrpc_GetLocationDetails" => array( - "function" => "xmlrpc_GetLocationDetails", - "signature" => $GetLocationDetails_sig, - "docstring" => $GetLocationDetails_doc), - "weberp.xmlrpc_GetShipperList" => array( - "function" => "xmlrpc_GetShipperList", - "signature" => $GetShipperList_sig, - "docstring" => $GetShipperList_doc), - "weberp.xmlrpc_GetShipperDetails" => array( - "function" => "xmlrpc_GetShipperDetails", - "signature" => $GetShipperDetails_sig, - "docstring" => $GetShipperDetails_doc), - "weberp.xmlrpc_GetSalesAreasList" => array( - "function" => "xmlrpc_GetSalesAreasList", - "signature" => $GetSalesAreasList_sig, - "docstring" => $GetSalesAreasList_doc), - "weberp.xmlrpc_InsertSalesArea" => array( - "function" => "xmlrpc_InsertSalesArea", - "signature" => $InsertSalesArea_sig, - "docstring" => $InsertSalesArea_doc), - "weberp.xmlrpc_GetSalesAreaDetails" => array( - "function" => "xmlrpc_GetSalesAreaDetails", - "signature" => $GetSalesAreaDetails_sig, - "docstring" => $GetSalesAreaDetails_doc), - "weberp.xmlrpc_GetSalesAreaDetailsFromName" => array( - "function" => "xmlrpc_GetSalesAreaDetailsFromName", - "signature" => $GetSalesAreaDetailsFromName_sig, - "docstring" => $GetSalesAreaDetailsFromName_doc), - "weberp.xmlrpc_GetSalesmanList" => array( - "function" => "xmlrpc_GetSalesmanList", - "signature" => $GetSalesmanList_sig, - "docstring" => $GetSalesmanList_doc), - "weberp.xmlrpc_GetSalesmanDetails" => array( - "function" => "xmlrpc_GetSalesmanDetails", - "signature" => $GetSalesmanDetails_sig, - "docstring" => $GetSalesmanDetails_doc), - "weberp.xmlrpc_GetSalesmanDetailsFromName" => array( - "function" => "xmlrpc_GetSalesmanDetailsFromName", - "signature" => $GetSalesmanDetailsFromName_sig, - "docstring" => $GetSalesmanDetailsFromName_doc), - "weberp.xmlrpc_InsertSalesman" => array( - "function" => "xmlrpc_InsertSalesman", - "signature" => $InsertSalesman_sig, - "docstring" => $InsertSalesman_doc), - "weberp.xmlrpc_GetTaxGroupList" => array( - "function" => "xmlrpc_GetTaxGroupList", - "signature" => $GetTaxGroupList_sig, - "docstring" => $GetTaxGroupList_doc), - "weberp.xmlrpc_GetTaxGroupDetails" => array( - "function" => "xmlrpc_GetTaxGroupDetails", - "signature" => $GetTaxGroupDetails_sig, - "docstring" => $GetTaxGroupDetails_doc), - "weberp.xmlrpc_GetTaxGroupTaxes" => array( - "function" => "xmlrpc_GetTaxGroupTaxes", - "signature" => $GetTaxGroupTaxes_sig, - "docstring" => $GetTaxGroupTaxes_doc), - "weberp.xmlrpc_GetTaxAuthorityList" => array( - "function" => "xmlrpc_GetTaxAuthorityList", - "signature" => $GetTaxAuthorityList_sig, - "docstring" => $GetTaxAuthorityList_doc), - "weberp.xmlrpc_GetTaxAuthorityDetails" => array( - "function" => "xmlrpc_GetTaxAuthorityDetails", - "signature" => $GetTaxAuthorityDetails_sig, - "docstring" => $GetTaxAuthorityDetails_doc), - "weberp.xmlrpc_GetTaxAuthorityRates" => array( - "function" => "xmlrpc_GetTaxAuthorityRates", - "signature" => $GetTaxAuthorityRates_sig, - "docstring" => $GetTaxAuthorityRates_doc), - "weberp.xmlrpc_GetCustomerTypeList" => array( - "function" => "xmlrpc_GetCustomerTypeList", - "signature" => $GetCustomerTypeList_sig, - "docstring" => $GetCustomerTypeList_doc), - "weberp.xmlrpc_GetCustomerTypeDetails" => array( - "function" => "xmlrpc_GetCustomerTypeDetails", - "signature" => $GetCustomerTypeDetails_sig, - "docstring" => $GetCustomerTypeDetails_doc), - "weberp.xmlrpc_InsertStockCategory" => array( - "function" => "xmlrpc_InsertStockCategory", - "signature" => $InsertStockCategory_sig, - "docstring" => $InsertStockCategory_doc), - "weberp.xmlrpc_ModifyStockCategory" => array( - "function" => "xmlrpc_ModifyStockCategory", - "signature" => $ModifyStockCategory_sig, - "docstring" => $ModifyStockCategory_doc), - "weberp.xmlrpc_GetStockCategory" => array( - "function" => "xmlrpc_GetStockCategory", - "signature" => $GetStockCategory_sig, - "docstring" => $GetStockCategory_doc), - "weberp.xmlrpc_SearchStockCategories" => array( - "function" => "xmlrpc_SearchStockCategories", - "signature" => $SearchStockCategories_sig, - "docstring" => $SearchStockCategories_doc), - "weberp.xmlrpc_StockCatPropertyList" => array( - "function" => "xmlrpc_StockCatPropertyList", - "signature" => $StockCatPropertyList_sig, - "docstring" => $StockCatPropertyList_doc), - "weberp.xmlrpc_GetStockCategoryList" => array( - "function" => "xmlrpc_GetStockCategoryList", - "signature" => $GetStockCategoryList_sig, - "docstring" => $GetStockCategoryList_doc), - "weberp.xmlrpc_GetGLAccountList" => array( - "function" => "xmlrpc_GetGLAccountList", - "signature" => $GetGLAccountList_sig, - "docstring" => $GetGLAccountList_doc), - "weberp.xmlrpc_GetGLAccountDetails" => array( - "function" => "xmlrpc_GetGLAccountDetails", - "signature" => $GetGLAccountDetails_sig, - "docstring" => $GetGLAccountDetails_doc), - "weberp.xmlrpc_GetStockTaxRate" => array( - "function" => "xmlrpc_GetStockTaxRate", - "signature" => $GetStockTaxRate_sig, - "docstring" => $GetStockTaxRate_doc), - "weberp.xmlrpc_InsertSupplier" => array( - "function" => "xmlrpc_InsertSupplier", - "signature" => $InsertSupplier_sig, - "docstring" => $InsertSupplier_doc), - "weberp.xmlrpc_ModifySupplier" => array( - "function" => "xmlrpc_ModifySupplier", - "signature" => $ModifySupplier_sig, - "docstring" => $ModifySupplier_doc), - "weberp.xmlrpc_GetSupplier" => array( - "function" => "xmlrpc_GetSupplier", - "signature" => $GetSupplier_sig, - "docstring" => $GetSupplier_doc), - "weberp.xmlrpc_SearchSuppliers" => array( - "function" => "xmlrpc_SearchSuppliers", - "signature" => $SearchSuppliers_sig, - "docstring" => $SearchSuppliers_doc), - "weberp.xmlrpc_StockAdjustment" => array( - "function" => "xmlrpc_StockAdjustment", - "signature" => $StockAdjustment_sig, - "docstring" => $StockAdjustment_doc), - "weberp.xmlrpc_WorkOrderIssue" => array( - "function" => "xmlrpc_WorkOrderIssue", - "signature" => $WorkOrderIssue_sig, - "docstring" => $WorkOrderIssue_doc), - "weberp.xmlrpc_InsertPurchData" => array( - "function" => "xmlrpc_InsertPurchData", - "signature" => $InsertPurchData_sig, - "docstring" => $InsertPurchData_doc), - "weberp.xmlrpc_ModifyPurchData" => array( - "function" => "xmlrpc_ModifyPurchData", - "signature" => $ModifyPurchData_sig, - "docstring" => $ModifyPurchData_doc), - "weberp.xmlrpc_InsertWorkOrder" => array( - "function" => "xmlrpc_InsertWorkOrder", - "signature" => $InsertWorkOrder_sig, - "docstring" => $InsertWorkOrder_doc), - "weberp.xmlrpc_WorkOrderReceive" => array( - "function" => "xmlrpc_WorkOrderReceive", - "signature" => $WorkOrderReceive_sig, - "docstring" => $WorkOrderReceive_doc), - "weberp.xmlrpc_SearchWorkOrders" => array( - "function" => "xmlrpc_SearchWorkOrders", - "signature" => $SearchWorkOrders_sig, - "docstring" => $SearchWorkOrders_doc), - "weberp.xmlrpc_GetBatches" => array( - "function" => "xmlrpc_GetBatches", - "signature" => $GetBatches_sig, - "docstring" => $GetBatches_doc), - "weberp.xmlrpc_GetDefaultDateFormat" => array( - "function" => "xmlrpc_GetDefaultDateFormat", - "signature" => $GetDefaultDateFormat_sig, - "docstring" => $GetDefaultDateFormat_doc), - "weberp.xmlrpc_GetDefaultShipper" => array( - "function" => "xmlrpc_GetDefaultShipper", - "signature" => $GetDefaultShipper_sig, - "docstring" => $GetDefaultShipper_doc), - "weberp.xmlrpc_GetDefaultCurrency" => array( - "function" => "xmlrpc_GetDefaultCurrency", - "signature" => $GetDefaultCurrency_sig, - "docstring" => $GetDefaultCurrency_doc), - "weberp.xmlrpc_GetDefaultPriceList" => array( - "function" => "xmlrpc_GetDefaultPriceList", - "signature" => $GetDefaultPriceList_sig, - "docstring" => $GetDefaultPriceList_doc), - "weberp.xmlrpc_GetDefaultLocation" => array( - "function" => "xmlrpc_GetDefaultLocation", - "signature" => $GetDefaultLocation_sig, - "docstring" => $GetDefaultLocation_doc), - "weberp.xmlrpc_GetStockCatProperty" => array( - "function" => "xmlrpc_GetStockCatProperty", - "signature" => $GetStockCatProperty_sig, - "docstring" => $GetStockCatProperty_doc), - "weberp.xmlrpc_GetErrorMessages" => array( - "function" => "xmlrpc_GetErrorMessages", - "signature" => $GetErrorMessages_sig, - "docstring" => $GetErrorMessages_doc), - ) + "weberp.xmlrpc_Login" => array( + "function" => "xmlrpc_Login", + "signature" => $Login_sig, + "docstring" => $Login_doc), + "weberp.xmlrpc_Logout" => array( + "function" => "xmlrpc_Logout", + "signature" => $Logout_sig, + "docstring" => $Logout_doc), + "weberp.xmlrpc_InsertCustomer" => array( + "function" => "xmlrpc_InsertCustomer", + "signature" => $InsertCustomer_sig, + "docstring" => $InsertCustomer_doc), + "weberp.xmlrpc_ModifyCustomer" => array( + "function" => "xmlrpc_ModifyCustomer", + "signature" => $ModifyCustomer_sig, + "docstring" => $ModifyCustomer_doc), + "weberp.xmlrpc_GetCustomer" => array( + "function" => "xmlrpc_GetCustomer", + "signature" => $GetCustomer_sig, + "docstring" => $GetCustomer_doc), + "weberp.xmlrpc_SearchCustomers" => array( + "function" => "xmlrpc_SearchCustomers", + "signature" => $SearchCustomers_sig, + "docstring" => $SearchCustomers_doc), + "weberp.xmlrpc_GetCurrencyList" => array( + "function" => "xmlrpc_GetCurrencyList", + "signature" => $GetCurrencyList_sig, + "docstring" => $GetCurrencyList_doc), + "weberp.xmlrpc_GetCurrencyDetails" => array( + "function" => "xmlrpc_GetCurrencyDetails", + "signature" => $GetCurrencyDetails_sig, + "docstring" => $GetCurrencyDetails_doc), + "weberp.xmlrpc_GetSalesTypeList" => array( + "function" => "xmlrpc_GetSalesTypeList", + "signature" => $GetSalesTypeList_sig, + "docstring" => $GetSalesTypeList_doc), + "weberp.xmlrpc_GetSalesTypeDetails" => array( + "function" => "xmlrpc_GetSalesTypeDetails", + "signature" => $GetSalesTypeDetails_sig, + "docstring" => $GetSalesTypeDetails_doc), + "weberp.xmlrpc_InsertSalesType" => array( + "function" => "xmlrpc_InsertSalesType", + "signature" => $InsertSalesType_sig, + "docstring" => $InsertSalesType_doc), + "weberp.xmlrpc_GetHoldReasonList" => array( + "function" => "xmlrpc_GetHoldReasonList", + "signature" => $GetHoldReasonList_sig, + "docstring" => $GetHoldReasonList_doc), + "weberp.xmlrpc_GetHoldReasonDetails" => array( + "function" => "xmlrpc_GetHoldReasonDetails", + "signature" => $GetHoldReasonDetails_sig, + "docstring" => $GetHoldReasonDetails_doc), + "weberp.xmlrpc_GetPaymentTermsList" => array( + "function" => "xmlrpc_GetPaymentTermsList", + "signature" => $GetPaymentTermsList_sig, + "docstring" => $GetPaymentTermsList_doc), + "weberp.xmlrpc_GetPaymentTermsDetails" => array( + "function" => "xmlrpc_GetPaymentTermsDetails", + "signature" => $GetPaymentTermsDetails_sig, + "docstring" => $GetPaymentTermsDetails_doc), + "weberp.xmlrpc_GetPaymentMethodsList" => array( + "function" => "xmlrpc_GetPaymentMethodsList", + "signature" => $GetPaymentMethodsList_sig, + "docstring" => $GetPaymentMethodsList_doc), + "weberp.xmlrpc_GetPaymentMethodDetails" => array( + "function" => "xmlrpc_GetPaymentMethodDetails", + "signature" => $GetPaymentMethodDetails_sig, + "docstring" => $GetPaymentMethodDetails_doc), + "weberp.xmlrpc_InsertStockItem" => array( + "function" => "xmlrpc_InsertStockItem", + "signature" => $InsertStockItem_sig, + "docstring" => $InsertStockItem_doc), + "weberp.xmlrpc_ModifyStockItem" => array( + "function" => "xmlrpc_ModifyStockItem", + "signature" => $ModifyStockItem_sig, + "docstring" => $ModifyStockItem_doc), + "weberp.xmlrpc_GetStockItem" => array( + "function" => "xmlrpc_GetStockItem", + "signature" => $GetStockItem_sig, + "docstring" => $GetStockItem_doc), + "weberp.xmlrpc_SearchStockItems" => array( + "function" => "xmlrpc_SearchStockItems", + "signature" => $SearchStockItems_sig, + "docstring" => $SearchStockItems_doc), + "weberp.xmlrpc_GetStockBalance" => array( + "function" => "xmlrpc_GetStockBalance", + "signature" => $GetStockBalance_sig, + "docstring" => $GetStockBalance_doc), + "weberp.xmlrpc_GetStockReorderLevel" => array( + "function" => "xmlrpc_GetStockReorderLevel", + "signature" => $GetStockReorderLevel_sig, + "docstring" => $GetStockReorderLevel_doc), + "weberp.xmlrpc_SetStockReorderLevel" => array( + "function" => "xmlrpc_SetStockReorderLevel", + "signature" => $SetStockReorderLevel_sig, + "docstring" => $SetStockReorderLevel_doc), + "weberp.xmlrpc_GetAllocatedStock" => array( + "function" => "xmlrpc_GetAllocatedStock", + "signature" => $GetAllocatedStock_sig, + "docstring" => $GetAllocatedStock_doc), + "weberp.xmlrpc_GetOrderedStock" => array( + "function" => "xmlrpc_GetOrderedStock", + "signature" => $GetOrderedStock_sig, + "docstring" => $GetOrderedStock_doc), + "weberp.xmlrpc_SetStockPrice" => array( + "function" => "xmlrpc_SetStockPrice", + "signature" => $SetStockPrice_sig, + "docstring" => $SetStockPrice_doc), + "weberp.xmlrpc_GetStockPrice" => array( + "function" => "xmlrpc_GetStockPrice", + "signature" => $GetStockPrice_sig, + "docstring" => $GetStockPrice_doc), + "weberp.xmlrpc_InsertSalesInvoice" => array( + "function" => "xmlrpc_InsertSalesInvoice", + "signature" => $InsertSalesInvoice_sig, + "docstring" => $InsertSalesInvoice_doc), + "weberp.xmlrpc_AllocateTrans" => array( + "function" => "xmlrpc_AllocateTrans", + "signature" => $AllocateTrans_sig, + "docstring" => $AllocateTrans_doc), + "weberp.xmlrpc_InsertDebtorReceipt" => array( + "function" => "xmlrpc_InsertDebtorReceipt", + "signature" => $InsertDebtorReceipt_sig, + "docstring" => $InsertDebtorReceipt_doc), + "weberp.xmlrpc_CreateCreditNote" => array( + "function" => "xmlrpc_CreateCreditNote", + "signature" => $CreateCreditNote_sig, + "docstring" => $CreateCreditNote_doc), + "weberp.xmlrpc_InsertSalesCredit" => array( + "function" => "xmlrpc_InsertSalesCredit", + "signature" => $InsertSalesCredit_sig, + "docstring" => $InsertSalesCredit_doc), + "weberp.xmlrpc_InsertBranch" => array( + "function" => "xmlrpc_InsertBranch", + "signature" => $InsertBranch_sig, + "docstring" => $InsertBranch_doc), + "weberp.xmlrpc_ModifyBranch" => array( + "function" => "xmlrpc_ModifyBranch", + "signature" => $ModifyBranch_sig, + "docstring" => $ModifyBranch_doc), + "weberp.xmlrpc_GetCustomerBranchCodes" => array( + "function" => "xmlrpc_GetCustomerBranchCodes", + "signature" => $GetCustomerBranchCodes_sig, + "docstring" => $GetCustomerBranchCodes_doc), + "weberp.xmlrpc_GetCustomerBranch" => array( + "function" => "xmlrpc_GetCustomerBranch", + "signature" => $GetCustomerBranch_sig, + "docstring" => $GetCustomerBranch_doc), + "weberp.xmlrpc_InsertSalesOrderHeader" => array( + "function" => "xmlrpc_InsertSalesOrderHeader", + "signature" => $InsertSalesOrderHeader_sig, + "docstring" => $InsertSalesOrderHeader_doc), + "weberp.xmlrpc_ModifySalesOrderHeader" => array( + "function" => "xmlrpc_ModifySalesOrderHeader", + "signature" => $ModifySalesOrderHeader_sig, + "docstring" => $ModifySalesOrderHeader_doc), + "weberp.xmlrpc_InsertSalesOrderLine" => array( + "function" => "xmlrpc_InsertSalesOrderLine", + "signature" => $InsertSalesOrderLine_sig, + "docstring" => $InsertSalesOrderLine_doc), + "weberp.xmlrpc_ModifySalesOrderLine" => array( + "function" => "xmlrpc_ModifySalesOrderLine", + "signature" => $ModifySalesOrderLine_sig, + "docstring" => $ModifySalesOrderLine_doc), + "weberp.xmlrpc_InvoiceSalesOrder" => array( + "function" => "xmlrpc_InvoiceSalesOrder", + "signature" => $InvoiceSalesOrder_sig, + "docstring" => $InvoiceSalesOrder_doc), + "weberp.xmlrpc_InsertGLAccount" => array( + "function" => "xmlrpc_InsertGLAccount", + "signature" => $InsertGLAccount_sig, + "docstring" => $InsertGLAccount_doc), + "weberp.xmlrpc_InsertGLAccountSection" => array( + "function" => "xmlrpc_InsertGLAccountSection", + "signature" => $InsertGLAccountSection_sig, + "docstring" => $InsertGLAccountSection_doc), + "weberp.xmlrpc_InsertGLAccountGroup" => array( + "function" => "xmlrpc_InsertGLAccountGroup", + "signature" => $InsertGLAccountGroup_sig, + "docstring" => $InsertGLAccountGroup_doc), + "weberp.xmlrpc_GetLocationList" => array( + "function" => "xmlrpc_GetLocationList", + "signature" => $GetLocationList_sig, + "docstring" => $GetLocationList_doc), + "weberp.xmlrpc_GetLocationDetails" => array( + "function" => "xmlrpc_GetLocationDetails", + "signature" => $GetLocationDetails_sig, + "docstring" => $GetLocationDetails_doc), + "weberp.xmlrpc_GetShipperList" => array( + "function" => "xmlrpc_GetShipperList", + "signature" => $GetShipperList_sig, + "docstring" => $GetShipperList_doc), + "weberp.xmlrpc_GetShipperDetails" => array( + "function" => "xmlrpc_GetShipperDetails", + "signature" => $GetShipperDetails_sig, + "docstring" => $GetShipperDetails_doc), + "weberp.xmlrpc_GetSalesAreasList" => array( + "function" => "xmlrpc_GetSalesAreasList", + "signature" => $GetSalesAreasList_sig, + "docstring" => $GetSalesAreasList_doc), + "weberp.xmlrpc_InsertSalesArea" => array( + "function" => "xmlrpc_InsertSalesArea", + "signature" => $InsertSalesArea_sig, + "docstring" => $InsertSalesArea_doc), + "weberp.xmlrpc_GetSalesAreaDetails" => array( + "function" => "xmlrpc_GetSalesAreaDetails", + "signature" => $GetSalesAreaDetails_sig, + "docstring" => $GetSalesAreaDetails_doc), + "weberp.xmlrpc_GetSalesAreaDetailsFromName" => array( + "function" => "xmlrpc_GetSalesAreaDetailsFromName", + "signature" => $GetSalesAreaDetailsFromName_sig, + "docstring" => $GetSalesAreaDetailsFromName_doc), + "weberp.xmlrpc_GetSalesmanList" => array( + "function" => "xmlrpc_GetSalesmanList", + "signature" => $GetSalesmanList_sig, + "docstring" => $GetSalesmanList_doc), + "weberp.xmlrpc_GetSalesmanDetails" => array( + "function" => "xmlrpc_GetSalesmanDetails", + "signature" => $GetSalesmanDetails_sig, + "docstring" => $GetSalesmanDetails_doc), + "weberp.xmlrpc_GetSalesmanDetailsFromName" => array( + "function" => "xmlrpc_GetSalesmanDetailsFromName", + "signature" => $GetSalesmanDetailsFromName_sig, + "docstring" => $GetSalesmanDetailsFromName_doc), + "weberp.xmlrpc_InsertSalesman" => array( + "function" => "xmlrpc_InsertSalesman", + "signature" => $InsertSalesman_sig, + "docstring" => $InsertSalesman_doc), + "weberp.xmlrpc_GetTaxGroupList" => array( + "function" => "xmlrpc_GetTaxGroupList", + "signature" => $GetTaxGroupList_sig, + "docstring" => $GetTaxGroupList_doc), + "weberp.xmlrpc_GetTaxGroupDetails" => array( + "function" => "xmlrpc_GetTaxGroupDetails", + "signature" => $GetTaxGroupDetails_sig, + "docstring" => $GetTaxGroupDetails_doc), + "weberp.xmlrpc_GetTaxGroupTaxes" => array( + "function" => "xmlrpc_GetTaxGroupTaxes", + "signature" => $GetTaxGroupTaxes_sig, + "docstring" => $GetTaxGroupTaxes_doc), + "weberp.xmlrpc_GetTaxAuthorityList" => array( + "function" => "xmlrpc_GetTaxAuthorityList", + "signature" => $GetTaxAuthorityList_sig, + "docstring" => $GetTaxAuthorityList_doc), + "weberp.xmlrpc_GetTaxAuthorityDetails" => array( + "function" => "xmlrpc_GetTaxAuthorityDetails", + "signature" => $GetTaxAuthorityDetails_sig, + "docstring" => $GetTaxAuthorityDetails_doc), + "weberp.xmlrpc_GetTaxAuthorityRates" => array( + "function" => "xmlrpc_GetTaxAuthorityRates", + "signature" => $GetTaxAuthorityRates_sig, + "docstring" => $GetTaxAuthorityRates_doc), + "weberp.xmlrpc_GetCustomerTypeList" => array( + "function" => "xmlrpc_GetCustomerTypeList", + "signature" => $GetCustomerTypeList_sig, + "docstring" => $GetCustomerTypeList_doc), + "weberp.xmlrpc_GetCustomerTypeDetails" => array( + "function" => "xmlrpc_GetCustomerTypeDetails", + "signature" => $GetCustomerTypeDetails_sig, + "docstring" => $GetCustomerTypeDetails_doc), + "weberp.xmlrpc_InsertStockCategory" => array( + "function" => "xmlrpc_InsertStockCategory", + "signature" => $InsertStockCategory_sig, + "docstring" => $InsertStockCategory_doc), + "weberp.xmlrpc_ModifyStockCategory" => array( + "function" => "xmlrpc_ModifyStockCategory", + "signature" => $ModifyStockCategory_sig, + "docstring" => $ModifyStockCategory_doc), + "weberp.xmlrpc_GetStockCategory" => array( + "function" => "xmlrpc_GetStockCategory", + "signature" => $GetStockCategory_sig, + "docstring" => $GetStockCategory_doc), + "weberp.xmlrpc_SearchStockCategories" => array( + "function" => "xmlrpc_SearchStockCategories", + "signature" => $SearchStockCategories_sig, + "docstring" => $SearchStockCategories_doc), + "weberp.xmlrpc_StockCatPropertyList" => array( + "function" => "xmlrpc_StockCatPropertyList", + "signature" => $StockCatPropertyList_sig, + "docstring" => $StockCatPropertyList_doc), + "weberp.xmlrpc_GetStockCategoryList" => array( + "function" => "xmlrpc_GetStockCategoryList", + "signature" => $GetStockCategoryList_sig, + "docstring" => $GetStockCategoryList_doc), + "weberp.xmlrpc_GetGLAccountList" => array( + "function" => "xmlrpc_GetGLAccountList", + "signature" => $GetGLAccountList_sig, + "docstring" => $GetGLAccountList_doc), + "weberp.xmlrpc_GetGLAccountDetails" => array( + "function" => "xmlrpc_GetGLAccountDetails", + "signature" => $GetGLAccountDetails_sig, + "docstring" => $GetGLAccountDetails_doc), + "weberp.xmlrpc_GetStockTaxRate" => array( + "function" => "xmlrpc_GetStockTaxRate", + "signature" => $GetStockTaxRate_sig, + "docstring" => $GetStockTaxRate_doc), + "weberp.xmlrpc_InsertSupplier" => array( + "function" => "xmlrpc_InsertSupplier", + "signature" => $InsertSupplier_sig, + "docstring" => $InsertSupplier_doc), + "weberp.xmlrpc_ModifySupplier" => array( + "function" => "xmlrpc_ModifySupplier", + "signature" => $ModifySupplier_sig, + "docstring" => $ModifySupplier_doc), + "weberp.xmlrpc_GetSupplier" => array( + "function" => "xmlrpc_GetSupplier", + "signature" => $GetSupplier_sig, + "docstring" => $GetSupplier_doc), + "weberp.xmlrpc_SearchSuppliers" => array( + "function" => "xmlrpc_SearchSuppliers", + "signature" => $SearchSuppliers_sig, + "docstring" => $SearchSuppliers_doc), + "weberp.xmlrpc_StockAdjustment" => array( + "function" => "xmlrpc_StockAdjustment", + "signature" => $StockAdjustment_sig, + "docstring" => $StockAdjustment_doc), + "weberp.xmlrpc_WorkOrderIssue" => array( + "function" => "xmlrpc_WorkOrderIssue", + "signature" => $WorkOrderIssue_sig, + "docstring" => $WorkOrderIssue_doc), + "weberp.xmlrpc_InsertPurchData" => array( + "function" => "xmlrpc_InsertPurchData", + "signature" => $InsertPurchData_sig, + "docstring" => $InsertPurchData_doc), + "weberp.xmlrpc_ModifyPurchData" => array( + "function" => "xmlrpc_ModifyPurchData", + "signature" => $ModifyPurchData_sig, + "docstring" => $ModifyPurchData_doc), + "weberp.xmlrpc_InsertWorkOrder" => array( + "function" => "xmlrpc_InsertWorkOrder", + "signature" => $InsertWorkOrder_sig, + "docstring" => $InsertWorkOrder_doc), + "weberp.xmlrpc_WorkOrderReceive" => array( + "function" => "xmlrpc_WorkOrderReceive", + "signature" => $WorkOrderReceive_sig, + "docstring" => $WorkOrderReceive_doc), + "weberp.xmlrpc_SearchWorkOrders" => array( + "function" => "xmlrpc_SearchWorkOrders", + "signature" => $SearchWorkOrders_sig, + "docstring" => $SearchWorkOrders_doc), + "weberp.xmlrpc_GetBatches" => array( + "function" => "xmlrpc_GetBatches", + "signature" => $GetBatches_sig, + "docstring" => $GetBatches_doc), + "weberp.xmlrpc_GetDefaultDateFormat" => array( + "function" => "xmlrpc_GetDefaultDateFormat", + "signature" => $GetDefaultDateFormat_sig, + "docstring" => $GetDefaultDateFormat_doc), + "weberp.xmlrpc_GetDefaultShipper" => array( + "function" => "xmlrpc_GetDefaultShipper", + "signature" => $GetDefaultShipper_sig, + "docstring" => $GetDefaultShipper_doc), + "weberp.xmlrpc_GetDefaultCurrency" => array( + "function" => "xmlrpc_GetDefaultCurrency", + "signature" => $GetDefaultCurrency_sig, + "docstring" => $GetDefaultCurrency_doc), + "weberp.xmlrpc_GetDefaultPriceList" => array( + "function" => "xmlrpc_GetDefaultPriceList", + "signature" => $GetDefaultPriceList_sig, + "docstring" => $GetDefaultPriceList_doc), + "weberp.xmlrpc_GetDefaultLocation" => array( + "function" => "xmlrpc_GetDefaultLocation", + "signature" => $GetDefaultLocation_sig, + "docstring" => $GetDefaultLocation_doc), + "weberp.xmlrpc_GetStockCatProperty" => array( + "function" => "xmlrpc_GetStockCatProperty", + "signature" => $GetStockCatProperty_sig, + "docstring" => $GetStockCatProperty_doc), + "weberp.xmlrpc_GetErrorMessages" => array( + "function" => "xmlrpc_GetErrorMessages", + "signature" => $GetErrorMessages_sig, + "docstring" => $GetErrorMessages_doc), + ) ); + // Generate the HTMLised description string for each API. function apiBuildDocHTML( $description, $parameter, $return ) Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-06-25 13:27:02 UTC (rev 5459) +++ trunk/doc/Change.log 2012-06-26 06:44:04 UTC (rev 5460) @@ -1,5 +1,6 @@ webERP Change Log +26/06/12 Bob Thomas: StockAdjustments fix link to controlled stock adjustments entry 24/06/2012 Phil: Added tooltip/title showing long description on many scripts where short description is currently shown SelectOrderItems.php SelectCreditItems.php CreditInvoice.php DeliveryDetails.php CounterSales.php RecurringSalesOrders.php 24/06/2012 Icedlava: Add ViewTopic and BookMark vars to some functions to take advantage of new Manual contextual help. Must be added before header.inc include. 24/06/2012 Icedlava: Adjust header.inc, ManualContents.php, ManualHeader.html to take Viewtopic and Bookmark parameters in displaying manual. Add ManualOutline.php file containing manual TOC, add CSS and rework all manual docs. Still to add $Viewtopic and $Bookmark to functions (eg see Stocks.php) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-26 06:44:15
|
Revision: 5460 http://web-erp.svn.sourceforge.net/web-erp/?rev=5460&view=rev Author: daintree Date: 2012-06-26 06:44:04 +0000 (Tue, 26 Jun 2012) Log Message: ----------- Bob Thomas StockAdjustments link fix Modified Paths: -------------- trunk/StockAdjustments.php trunk/api/api_xml-rpc.php trunk/doc/Change.log Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-06-25 13:27:02 UTC (rev 5459) +++ trunk/StockAdjustments.php 2012-06-26 06:44:04 UTC (rev 5460) @@ -455,8 +455,8 @@ } echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment' . $identifier]->Quantity . '" /> '.locale_number_format($_SESSION['Adjustment' . $identifier]->Quantity,$DecimalPlaces) .' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE?identifier='.$identifier.'">'._('Remove').'</a>] - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD?identifier='.$identifier.'">'._('Add').'</a>]'; + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE?&dentifier='.$identifier.'">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&identifier='.$identifier.'">'._('Add').'</a>]'; } else { echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '" />'; } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-25 13:27:02 UTC (rev 5459) +++ trunk/api/api_xml-rpc.php 2012-06-26 06:44:04 UTC (rev 5460) @@ -789,7 +789,7 @@ $SearchStockItems_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_SearchStockItems($xmlrpcmsg){ - ob_start('ob_file_callback'); + //ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) /*x*/ { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(SearchStockItems($xmlrpcmsg->getParam( 0 )->scalarval( ), @@ -800,7 +800,7 @@ $rtn = new xmlrpcresp( php_xmlrpc_encode(SearchStockItems($xmlrpcmsg->getParam( 0 )->scalarval( ), /*e*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), '', ''))); /*x*/ } - ob_end_flush(); + //ob_end_flush(); return $rtn; } @@ -3012,381 +3012,382 @@ $s = new xmlrpc_server( array( - "weberp.xmlrpc_Login" => array( - "function" => "xmlrpc_Login", - "signature" => $Login_sig, - "docstring" => $Login_doc), - "weberp.xmlrpc_Logout" => array( - "function" => "xmlrpc_Logout", - "signature" => $Logout_sig, - "docstring" => $Logout_doc), - "weberp.xmlrpc_InsertCustomer" => array( - "function" => "xmlrpc_InsertCustomer", - "signature" => $InsertCustomer_sig, - "docstring" => $InsertCustomer_doc), - "weberp.xmlrpc_ModifyCustomer" => array( - "function" => "xmlrpc_ModifyCustomer", - "signature" => $ModifyCustomer_sig, - "docstring" => $ModifyCustomer_doc), - "weberp.xmlrpc_GetCustomer" => array( - "function" => "xmlrpc_GetCustomer", - "signature" => $GetCustomer_sig, - "docstring" => $GetCustomer_doc), - "weberp.xmlrpc_SearchCustomers" => array( - "function" => "xmlrpc_SearchCustomers", - "signature" => $SearchCustomers_sig, - "docstring" => $SearchCustomers_doc), - "weberp.xmlrpc_GetCurrencyList" => array( - "function" => "xmlrpc_GetCurrencyList", - "signature" => $GetCurrencyList_sig, - "docstring" => $GetCurrencyList_doc), - "weberp.xmlrpc_GetCurrencyDetails" => array( - "function" => "xmlrpc_GetCurrencyDetails", - "signature" => $GetCurrencyDetails_sig, - "docstring" => $GetCurrencyDetails_doc), - "weberp.xmlrpc_GetSalesTypeList" => array( - "function" => "xmlrpc_GetSalesTypeList", - "signature" => $GetSalesTypeList_sig, - "docstring" => $GetSalesTypeList_doc), - "weberp.xmlrpc_GetSalesTypeDetails" => array( - "function" => "xmlrpc_GetSalesTypeDetails", - "signature" => $GetSalesTypeDetails_sig, - "docstring" => $GetSalesTypeDetails_doc), - "weberp.xmlrpc_InsertSalesType" => array( - "function" => "xmlrpc_InsertSalesType", - "signature" => $InsertSalesType_sig, - "docstring" => $InsertSalesType_doc), - "weberp.xmlrpc_GetHoldReasonList" => array( - "function" => "xmlrpc_GetHoldReasonList", - "signature" => $GetHoldReasonList_sig, - "docstring" => $GetHoldReasonList_doc), - "weberp.xmlrpc_GetHoldReasonDetails" => array( - "function" => "xmlrpc_GetHoldReasonDetails", - "signature" => $GetHoldReasonDetails_sig, - "docstring" => $GetHoldReasonDetails_doc), - "weberp.xmlrpc_GetPaymentTermsList" => array( - "function" => "xmlrpc_GetPaymentTermsList", - "signature" => $GetPaymentTermsList_sig, - "docstring" => $GetPaymentTermsList_doc), - "weberp.xmlrpc_GetPaymentTermsDetails" => array( - "function" => "xmlrpc_GetPaymentTermsDetails", - "signature" => $GetPaymentTermsDetails_sig, - "docstring" => $GetPaymentTermsDetails_doc), - "weberp.xmlrpc_GetPaymentMethodsList" => array( - "function" => "xmlrpc_GetPaymentMethodsList", - "signature" => $GetPaymentMethodsList_sig, - "docstring" => $GetPaymentMethodsList_doc), - "weberp.xmlrpc_GetPaymentMethodDetails" => array( - "function" => "xmlrpc_GetPaymentMethodDetails", - "signature" => $GetPaymentMethodDetails_sig, - "docstring" => $GetPaymentMethodDetails_doc), - "weberp.xmlrpc_InsertStockItem" => array( - "function" => "xmlrpc_InsertStockItem", - "signature" => $InsertStockItem_sig, - "docstring" => $InsertStockItem_doc), - "weberp.xmlrpc_ModifyStockItem" => array( - "function" => "xmlrpc_ModifyStockItem", - "signature" => $ModifyStockItem_sig, - "docstring" => $ModifyStockItem_doc), - "weberp.xmlrpc_GetStockItem" => array( - "function" => "xmlrpc_GetStockItem", - "signature" => $GetStockItem_sig, - "docstring" => $GetStockItem_doc), - "weberp.xmlrpc_SearchStockItems" => array( - "function" => "xmlrpc_SearchStockItems", - "signature" => $SearchStockItems_sig, - "docstring" => $SearchStockItems_doc), - "weberp.xmlrpc_GetStockBalance" => array( - "function" => "xmlrpc_GetStockBalance", - "signature" => $GetStockBalance_sig, - "docstring" => $GetStockBalance_doc), - "weberp.xmlrpc_GetStockReorderLevel" => array( - "function" => "xmlrpc_GetStockReorderLevel", - "signature" => $GetStockReorderLevel_sig, - "docstring" => $GetStockReorderLevel_doc), - "weberp.xmlrpc_SetStockReorderLevel" => array( - "function" => "xmlrpc_SetStockReorderLevel", - "signature" => $SetStockReorderLevel_sig, - "docstring" => $SetStockReorderLevel_doc), - "weberp.xmlrpc_GetAllocatedStock" => array( - "function" => "xmlrpc_GetAllocatedStock", - "signature" => $GetAllocatedStock_sig, - "docstring" => $GetAllocatedStock_doc), - "weberp.xmlrpc_GetOrderedStock" => array( - "function" => "xmlrpc_GetOrderedStock", - "signature" => $GetOrderedStock_sig, - "docstring" => $GetOrderedStock_doc), - "weberp.xmlrpc_SetStockPrice" => array( - "function" => "xmlrpc_SetStockPrice", - "signature" => $SetStockPrice_sig, - "docstring" => $SetStockPrice_doc), - "weberp.xmlrpc_GetStockPrice" => array( - "function" => "xmlrpc_GetStockPrice", - "signature" => $GetStockPrice_sig, - "docstring" => $GetStockPrice_doc), - "weberp.xmlrpc_InsertSalesInvoice" => array( - "function" => "xmlrpc_InsertSalesInvoice", - "signature" => $InsertSalesInvoice_sig, - "docstring" => $InsertSalesInvoice_doc), - "weberp.xmlrpc_AllocateTrans" => array( - "function" => "xmlrpc_AllocateTrans", - "signature" => $AllocateTrans_sig, - "docstring" => $AllocateTrans_doc), - "weberp.xmlrpc_InsertDebtorReceipt" => array( - "function" => "xmlrpc_InsertDebtorReceipt", - "signature" => $InsertDebtorReceipt_sig, - "docstring" => $InsertDebtorReceipt_doc), - "weberp.xmlrpc_CreateCreditNote" => array( - "function" => "xmlrpc_CreateCreditNote", - "signature" => $CreateCreditNote_sig, - "docstring" => $CreateCreditNote_doc), - "weberp.xmlrpc_InsertSalesCredit" => array( - "function" => "xmlrpc_InsertSalesCredit", - "signature" => $InsertSalesCredit_sig, - "docstring" => $InsertSalesCredit_doc), - "weberp.xmlrpc_InsertBranch" => array( - "function" => "xmlrpc_InsertBranch", - "signature" => $InsertBranch_sig, - "docstring" => $InsertBranch_doc), - "weberp.xmlrpc_ModifyBranch" => array( - "function" => "xmlrpc_ModifyBranch", - "signature" => $ModifyBranch_sig, - "docstring" => $ModifyBranch_doc), - "weberp.xmlrpc_GetCustomerBranchCodes" => array( - "function" => "xmlrpc_GetCustomerBranchCodes", - "signature" => $GetCustomerBranchCodes_sig, - "docstring" => $GetCustomerBranchCodes_doc), - "weberp.xmlrpc_GetCustomerBranch" => array( - "function" => "xmlrpc_GetCustomerBranch", - "signature" => $GetCustomerBranch_sig, - "docstring" => $GetCustomerBranch_doc), - "weberp.xmlrpc_InsertSalesOrderHeader" => array( - "function" => "xmlrpc_InsertSalesOrderHeader", - "signature" => $InsertSalesOrderHeader_sig, - "docstring" => $InsertSalesOrderHeader_doc), - "weberp.xmlrpc_ModifySalesOrderHeader" => array( - "function" => "xmlrpc_ModifySalesOrderHeader", - "signature" => $ModifySalesOrderHeader_sig, - "docstring" => $ModifySalesOrderHeader_doc), - "weberp.xmlrpc_InsertSalesOrderLine" => array( - "function" => "xmlrpc_InsertSalesOrderLine", - "signature" => $InsertSalesOrderLine_sig, - "docstring" => $InsertSalesOrderLine_doc), - "weberp.xmlrpc_ModifySalesOrderLine" => array( - "function" => "xmlrpc_ModifySalesOrderLine", - "signature" => $ModifySalesOrderLine_sig, - "docstring" => $ModifySalesOrderLine_doc), - "weberp.xmlrpc_InvoiceSalesOrder" => array( - "function" => "xmlrpc_InvoiceSalesOrder", - "signature" => $InvoiceSalesOrder_sig, - "docstring" => $InvoiceSalesOrder_doc), - "weberp.xmlrpc_InsertGLAccount" => array( - "function" => "xmlrpc_InsertGLAccount", - "signature" => $InsertGLAccount_sig, - "docstring" => $InsertGLAccount_doc), - "weberp.xmlrpc_InsertGLAccountSection" => array( - "function" => "xmlrpc_InsertGLAccountSection", - "signature" => $InsertGLAccountSection_sig, - "docstring" => $InsertGLAccountSection_doc), - "weberp.xmlrpc_InsertGLAccountGroup" => array( - "function" => "xmlrpc_InsertGLAccountGroup", - "signature" => $InsertGLAccountGroup_sig, - "docstring" => $InsertGLAccountGroup_doc), - "weberp.xmlrpc_GetLocationList" => array( - "function" => "xmlrpc_GetLocationList", - "signature" => $GetLocationList_sig, - "docstring" => $GetLocationList_doc), - "weberp.xmlrpc_GetLocationDetails" => array( - "function" => "xmlrpc_GetLocationDetails", - "signature" => $GetLocationDetails_sig, - "docstring" => $GetLocationDetails_doc), - "weberp.xmlrpc_GetShipperList" => array( - "function" => "xmlrpc_GetShipperList", - "signature" => $GetShipperList_sig, - "docstring" => $GetShipperList_doc), - "weberp.xmlrpc_GetShipperDetails" => array( - "function" => "xmlrpc_GetShipperDetails", - "signature" => $GetShipperDetails_sig, - "docstring" => $GetShipperDetails_doc), - "weberp.xmlrpc_GetSalesAreasList" => array( - "function" => "xmlrpc_GetSalesAreasList", - "signature" => $GetSalesAreasList_sig, - "docstring" => $GetSalesAreasList_doc), - "weberp.xmlrpc_InsertSalesArea" => array( - "function" => "xmlrpc_InsertSalesArea", - "signature" => $InsertSalesArea_sig, - "docstring" => $InsertSalesArea_doc), - "weberp.xmlrpc_GetSalesAreaDetails" => array( - "function" => "xmlrpc_GetSalesAreaDetails", - "signature" => $GetSalesAreaDetails_sig, - "docstring" => $GetSalesAreaDetails_doc), - "weberp.xmlrpc_GetSalesAreaDetailsFromName" => array( - "function" => "xmlrpc_GetSalesAreaDetailsFromName", - "signature" => $GetSalesAreaDetailsFromName_sig, - "docstring" => $GetSalesAreaDetailsFromName_doc), - "weberp.xmlrpc_GetSalesmanList" => array( - "function" => "xmlrpc_GetSalesmanList", - "signature" => $GetSalesmanList_sig, - "docstring" => $GetSalesmanList_doc), - "weberp.xmlrpc_GetSalesmanDetails" => array( - "function" => "xmlrpc_GetSalesmanDetails", - "signature" => $GetSalesmanDetails_sig, - "docstring" => $GetSalesmanDetails_doc), - "weberp.xmlrpc_GetSalesmanDetailsFromName" => array( - "function" => "xmlrpc_GetSalesmanDetailsFromName", - "signature" => $GetSalesmanDetailsFromName_sig, - "docstring" => $GetSalesmanDetailsFromName_doc), - "weberp.xmlrpc_InsertSalesman" => array( - "function" => "xmlrpc_InsertSalesman", - "signature" => $InsertSalesman_sig, - "docstring" => $InsertSalesman_doc), - "weberp.xmlrpc_GetTaxGroupList" => array( - "function" => "xmlrpc_GetTaxGroupList", - "signature" => $GetTaxGroupList_sig, - "docstring" => $GetTaxGroupList_doc), - "weberp.xmlrpc_GetTaxGroupDetails" => array( - "function" => "xmlrpc_GetTaxGroupDetails", - "signature" => $GetTaxGroupDetails_sig, - "docstring" => $GetTaxGroupDetails_doc), - "weberp.xmlrpc_GetTaxGroupTaxes" => array( - "function" => "xmlrpc_GetTaxGroupTaxes", - "signature" => $GetTaxGroupTaxes_sig, - "docstring" => $GetTaxGroupTaxes_doc), - "weberp.xmlrpc_GetTaxAuthorityList" => array( - "function" => "xmlrpc_GetTaxAuthorityList", - "signature" => $GetTaxAuthorityList_sig, - "docstring" => $GetTaxAuthorityList_doc), - "weberp.xmlrpc_GetTaxAuthorityDetails" => array( - "function" => "xmlrpc_GetTaxAuthorityDetails", - "signature" => $GetTaxAuthorityDetails_sig, - "docstring" => $GetTaxAuthorityDetails_doc), - "weberp.xmlrpc_GetTaxAuthorityRates" => array( - "function" => "xmlrpc_GetTaxAuthorityRates", - "signature" => $GetTaxAuthorityRates_sig, - "docstring" => $GetTaxAuthorityRates_doc), - "weberp.xmlrpc_GetCustomerTypeList" => array( - "function" => "xmlrpc_GetCustomerTypeList", - "signature" => $GetCustomerTypeList_sig, - "docstring" => $GetCustomerTypeList_doc), - "weberp.xmlrpc_GetCustomerTypeDetails" => array( - "function" => "xmlrpc_GetCustomerTypeDetails", - "signature" => $GetCustomerTypeDetails_sig, - "docstring" => $GetCustomerTypeDetails_doc), - "weberp.xmlrpc_InsertStockCategory" => array( - "function" => "xmlrpc_InsertStockCategory", - "signature" => $InsertStockCategory_sig, - "docstring" => $InsertStockCategory_doc), - "weberp.xmlrpc_ModifyStockCategory" => array( - "function" => "xmlrpc_ModifyStockCategory", - "signature" => $ModifyStockCategory_sig, - "docstring" => $ModifyStockCategory_doc), - "weberp.xmlrpc_GetStockCategory" => array( - "function" => "xmlrpc_GetStockCategory", - "signature" => $GetStockCategory_sig, - "docstring" => $GetStockCategory_doc), - "weberp.xmlrpc_SearchStockCategories" => array( - "function" => "xmlrpc_SearchStockCategories", - "signature" => $SearchStockCategories_sig, - "docstring" => $SearchStockCategories_doc), - "weberp.xmlrpc_StockCatPropertyList" => array( - "function" => "xmlrpc_StockCatPropertyList", - "signature" => $StockCatPropertyList_sig, - "docstring" => $StockCatPropertyList_doc), - "weberp.xmlrpc_GetStockCategoryList" => array( - "function" => "xmlrpc_GetStockCategoryList", - "signature" => $GetStockCategoryList_sig, - "docstring" => $GetStockCategoryList_doc), - "weberp.xmlrpc_GetGLAccountList" => array( - "function" => "xmlrpc_GetGLAccountList", - "signature" => $GetGLAccountList_sig, - "docstring" => $GetGLAccountList_doc), - "weberp.xmlrpc_GetGLAccountDetails" => array( - "function" => "xmlrpc_GetGLAccountDetails", - "signature" => $GetGLAccountDetails_sig, - "docstring" => $GetGLAccountDetails_doc), - "weberp.xmlrpc_GetStockTaxRate" => array( - "function" => "xmlrpc_GetStockTaxRate", - "signature" => $GetStockTaxRate_sig, - "docstring" => $GetStockTaxRate_doc), - "weberp.xmlrpc_InsertSupplier" => array( - "function" => "xmlrpc_InsertSupplier", - "signature" => $InsertSupplier_sig, - "docstring" => $InsertSupplier_doc), - "weberp.xmlrpc_ModifySupplier" => array( - "function" => "xmlrpc_ModifySupplier", - "signature" => $ModifySupplier_sig, - "docstring" => $ModifySupplier_doc), - "weberp.xmlrpc_GetSupplier" => array( - "function" => "xmlrpc_GetSupplier", - "signature" => $GetSupplier_sig, - "docstring" => $GetSupplier_doc), - "weberp.xmlrpc_SearchSuppliers" => array( - "function" => "xmlrpc_SearchSuppliers", - "signature" => $SearchSuppliers_sig, - "docstring" => $SearchSuppliers_doc), - "weberp.xmlrpc_StockAdjustment" => array( - "function" => "xmlrpc_StockAdjustment", - "signature" => $StockAdjustment_sig, - "docstring" => $StockAdjustment_doc), - "weberp.xmlrpc_WorkOrderIssue" => array( - "function" => "xmlrpc_WorkOrderIssue", - "signature" => $WorkOrderIssue_sig, - "docstring" => $WorkOrderIssue_doc), - "weberp.xmlrpc_InsertPurchData" => array( - "function" => "xmlrpc_InsertPurchData", - "signature" => $InsertPurchData_sig, - "docstring" => $InsertPurchData_doc), - "weberp.xmlrpc_ModifyPurchData" => array( - "function" => "xmlrpc_ModifyPurchData", - "signature" => $ModifyPurchData_sig, - "docstring" => $ModifyPurchData_doc), - "weberp.xmlrpc_InsertWorkOrder" => array( - "function" => "xmlrpc_InsertWorkOrder", - "signature" => $InsertWorkOrder_sig, - "docstring" => $InsertWorkOrder_doc), - "weberp.xmlrpc_WorkOrderReceive" => array( - "function" => "xmlrpc_WorkOrderReceive", - "signature" => $WorkOrderReceive_sig, - "docstring" => $WorkOrderReceive_doc), - "weberp.xmlrpc_SearchWorkOrders" => array( - "function" => "xmlrpc_SearchWorkOrders", - "signature" => $SearchWorkOrders_sig, - "docstring" => $SearchWorkOrders_doc), - "weberp.xmlrpc_GetBatches" => array( - "function" => "xmlrpc_GetBatches", - "signature" => $GetBatches_sig, - "docstring" => $GetBatches_doc), - "weberp.xmlrpc_GetDefaultDateFormat" => array( - "function" => "xmlrpc_GetDefaultDateFormat", - "signature" => $GetDefaultDateFormat_sig, - "docstring" => $GetDefaultDateFormat_doc), - "weberp.xmlrpc_GetDefaultShipper" => array( - "function" => "xmlrpc_GetDefaultShipper", - "signature" => $GetDefaultShipper_sig, - "docstring" => $GetDefaultShipper_doc), - "weberp.xmlrpc_GetDefaultCurrency" => array( - "function" => "xmlrpc_GetDefaultCurrency", - "signature" => $GetDefaultCurrency_sig, - "docstring" => $GetDefaultCurrency_doc), - "weberp.xmlrpc_GetDefaultPriceList" => array( - "function" => "xmlrpc_GetDefaultPriceList", - "signature" => $GetDefaultPriceList_sig, - "docstring" => $GetDefaultPriceList_doc), - "weberp.xmlrpc_GetDefaultLocation" => array( - "function" => "xmlrpc_GetDefaultLocation", - "signature" => $GetDefaultLocation_sig, - "docstring" => $GetDefaultLocation_doc), - "weberp.xmlrpc_GetStockCatProperty" => array( - "function" => "xmlrpc_GetStockCatProperty", - "signature" => $GetStockCatProperty_sig, - "docstring" => $GetStockCatProperty_doc), - "weberp.xmlrpc_GetErrorMessages" => array( - "function" => "xmlrpc_GetErrorMessages", - "signature" => $GetErrorMessages_sig, - "docstring" => $GetErrorMessages_doc), - ) + "weberp.xmlrpc_Login" => array( + "function" => "xmlrpc_Login", + "signature" => $Login_sig, + "docstring" => $Login_doc), + "weberp.xmlrpc_Logout" => array( + "function" => "xmlrpc_Logout", + "signature" => $Logout_sig, + "docstring" => $Logout_doc), + "weberp.xmlrpc_InsertCustomer" => array( + "function" => "xmlrpc_InsertCustomer", + "signature" => $InsertCustomer_sig, + "docstring" => $InsertCustomer_doc), + "weberp.xmlrpc_ModifyCustomer" => array( + "function" => "xmlrpc_ModifyCustomer", + "signature" => $ModifyCustomer_sig, + "docstring" => $ModifyCustomer_doc), + "weberp.xmlrpc_GetCustomer" => array( + "function" => "xmlrpc_GetCustomer", + "signature" => $GetCustomer_sig, + "docstring" => $GetCustomer_doc), + "weberp.xmlrpc_SearchCustomers" => array( + "function" => "xmlrpc_SearchCustomers", + "signature" => $SearchCustomers_sig, + "docstring" => $SearchCustomers_doc), + "weberp.xmlrpc_GetCurrencyList" => array( + "function" => "xmlrpc_GetCurrencyList", + "signature" => $GetCurrencyList_sig, + "docstring" => $GetCurrencyList_doc), + "weberp.xmlrpc_GetCurrencyDetails" => array( + "function" => "xmlrpc_GetCurrencyDetails", + "signature" => $GetCurrencyDetails_sig, + "docstring" => $GetCurrencyDetails_doc), + "weberp.xmlrpc_GetSalesTypeList" => array( + "function" => "xmlrpc_GetSalesTypeList", + "signature" => $GetSalesTypeList_sig, + "docstring" => $GetSalesTypeList_doc), + "weberp.xmlrpc_GetSalesTypeDetails" => array( + "function" => "xmlrpc_GetSalesTypeDetails", + "signature" => $GetSalesTypeDetails_sig, + "docstring" => $GetSalesTypeDetails_doc), + "weberp.xmlrpc_InsertSalesType" => array( + "function" => "xmlrpc_InsertSalesType", + "signature" => $InsertSalesType_sig, + "docstring" => $InsertSalesType_doc), + "weberp.xmlrpc_GetHoldReasonList" => array( + "function" => "xmlrpc_GetHoldReasonList", + "signature" => $GetHoldReasonList_sig, + "docstring" => $GetHoldReasonList_doc), + "weberp.xmlrpc_GetHoldReasonDetails" => array( + "function" => "xmlrpc_GetHoldReasonDetails", + "signature" => $GetHoldReasonDetails_sig, + "docstring" => $GetHoldReasonDetails_doc), + "weberp.xmlrpc_GetPaymentTermsList" => array( + "function" => "xmlrpc_GetPaymentTermsList", + "signature" => $GetPaymentTermsList_sig, + "docstring" => $GetPaymentTermsList_doc), + "weberp.xmlrpc_GetPaymentTermsDetails" => array( + "function" => "xmlrpc_GetPaymentTermsDetails", + "signature" => $GetPaymentTermsDetails_sig, + "docstring" => $GetPaymentTermsDetails_doc), + "weberp.xmlrpc_GetPaymentMethodsList" => array( + "function" => "xmlrpc_GetPaymentMethodsList", + "signature" => $GetPaymentMethodsList_sig, + "docstring" => $GetPaymentMethodsList_doc), + "weberp.xmlrpc_GetPaymentMethodDetails" => array( + "function" => "xmlrpc_GetPaymentMethodDetails", + "signature" => $GetPaymentMethodDetails_sig, + "docstring" => $GetPaymentMethodDetails_doc), + "weberp.xmlrpc_InsertStockItem" => array( + "function" => "xmlrpc_InsertStockItem", + "signature" => $InsertStockItem_sig, + "docstring" => $InsertStockItem_doc), + "weberp.xmlrpc_ModifyStockItem" => array( + "function" => "xmlrpc_ModifyStockItem", + "signature" => $ModifyStockItem_sig, + "docstring" => $ModifyStockItem_doc), + "weberp.xmlrpc_GetStockItem" => array( + "function" => "xmlrpc_GetStockItem", + "signature" => $GetStockItem_sig, + "docstring" => $GetStockItem_doc), + "weberp.xmlrpc_SearchStockItems" => array( + "function" => "xmlrpc_SearchStockItems", + "signature" => $SearchStockItems_sig, + "docstring" => $SearchStockItems_doc), + "weberp.xmlrpc_GetStockBalance" => array( + "function" => "xmlrpc_GetStockBalance", + "signature" => $GetStockBalance_sig, + "docstring" => $GetStockBalance_doc), + "weberp.xmlrpc_GetStockReorderLevel" => array( + "function" => "xmlrpc_GetStockReorderLevel", + "signature" => $GetStockReorderLevel_sig, + "docstring" => $GetStockReorderLevel_doc), + "weberp.xmlrpc_SetStockReorderLevel" => array( + "function" => "xmlrpc_SetStockReorderLevel", + "signature" => $SetStockReorderLevel_sig, + "docstring" => $SetStockReorderLevel_doc), + "weberp.xmlrpc_GetAllocatedStock" => array( + "function" => "xmlrpc_GetAllocatedStock", + "signature" => $GetAllocatedStock_sig, + "docstring" => $GetAllocatedStock_doc), + "weberp.xmlrpc_GetOrderedStock" => array( + "function" => "xmlrpc_GetOrderedStock", + "signature" => $GetOrderedStock_sig, + "docstring" => $GetOrderedStock_doc), + "weberp.xmlrpc_SetStockPrice" => array( + "function" => "xmlrpc_SetStockPrice", + "signature" => $SetStockPrice_sig, + "docstring" => $SetStockPrice_doc), + "weberp.xmlrpc_GetStockPrice" => array( + "function" => "xmlrpc_GetStockPrice", + "signature" => $GetStockPrice_sig, + "docstring" => $GetStockPrice_doc), + "weberp.xmlrpc_InsertSalesInvoice" => array( + "function" => "xmlrpc_InsertSalesInvoice", + "signature" => $InsertSalesInvoice_sig, + "docstring" => $InsertSalesInvoice_doc), + "weberp.xmlrpc_AllocateTrans" => array( + "function" => "xmlrpc_AllocateTrans", + "signature" => $AllocateTrans_sig, + "docstring" => $AllocateTrans_doc), + "weberp.xmlrpc_InsertDebtorReceipt" => array( + "function" => "xmlrpc_InsertDebtorReceipt", + "signature" => $InsertDebtorReceipt_sig, + "docstring" => $InsertDebtorReceipt_doc), + "weberp.xmlrpc_CreateCreditNote" => array( + "function" => "xmlrpc_CreateCreditNote", + "signature" => $CreateCreditNote_sig, + "docstring" => $CreateCreditNote_doc), + "weberp.xmlrpc_InsertSalesCredit" => array( + "function" => "xmlrpc_InsertSalesCredit", + "signature" => $InsertSalesCredit_sig, + "docstring" => $InsertSalesCredit_doc), + "weberp.xmlrpc_InsertBranch" => array( + "function" => "xmlrpc_InsertBranch", + "signature" => $InsertBranch_sig, + "docstring" => $InsertBranch_doc), + "weberp.xmlrpc_ModifyBranch" => array( + "function" => "xmlrpc_ModifyBranch", + "signature" => $ModifyBranch_sig, + "docstring" => $ModifyBranch_doc), + "weberp.xmlrpc_GetCustomerBranchCodes" => array( + "function" => "xmlrpc_GetCustomerBranchCodes", + "signature" => $GetCustomerBranchCodes_sig, + "docstring" => $GetCustomerBranchCodes_doc), + "weberp.xmlrpc_GetCustomerBranch" => array( + "function" => "xmlrpc_GetCustomerBranch", + "signature" => $GetCustomerBranch_sig, + "docstring" => $GetCustomerBranch_doc), + "weberp.xmlrpc_InsertSalesOrderHeader" => array( + "function" => "xmlrpc_InsertSalesOrderHeader", + "signature" => $InsertSalesOrderHeader_sig, + "docstring" => $InsertSalesOrderHeader_doc), + "weberp.xmlrpc_ModifySalesOrderHeader" => array( + "function" => "xmlrpc_ModifySalesOrderHeader", + "signature" => $ModifySalesOrderHeader_sig, + "docstring" => $ModifySalesOrderHeader_doc), + "weberp.xmlrpc_InsertSalesOrderLine" => array( + "function" => "xmlrpc_InsertSalesOrderLine", + "signature" => $InsertSalesOrderLine_sig, + "docstring" => $InsertSalesOrderLine_doc), + "weberp.xmlrpc_ModifySalesOrderLine" => array( + "function" => "xmlrpc_ModifySalesOrderLine", + "signature" => $ModifySalesOrderLine_sig, + "docstring" => $ModifySalesOrderLine_doc), + "weberp.xmlrpc_InvoiceSalesOrder" => array( + "function" => "xmlrpc_InvoiceSalesOrder", + "signature" => $InvoiceSalesOrder_sig, + "docstring" => $InvoiceSalesOrder_doc), + "weberp.xmlrpc_InsertGLAccount" => array( + "function" => "xmlrpc_InsertGLAccount", + "signature" => $InsertGLAccount_sig, + "docstring" => $InsertGLAccount_doc), + "weberp.xmlrpc_InsertGLAccountSection" => array( + "function" => "xmlrpc_InsertGLAccountSection", + "signature" => $InsertGLAccountSection_sig, + "docstring" => $InsertGLAccountSection_doc), + "weberp.xmlrpc_InsertGLAccountGroup" => array( + "function" => "xmlrpc_InsertGLAccountGroup", + "signature" => $InsertGLAccountGroup_sig, + "docstring" => $InsertGLAccountGroup_doc), + "weberp.xmlrpc_GetLocationList" => array( + "function" => "xmlrpc_GetLocationList", + "signature" => $GetLocationList_sig, + "docstring" => $GetLocationList_doc), + "weberp.xmlrpc_GetLocationDetails" => array( + "function" => "xmlrpc_GetLocationDetails", + "signature" => $GetLocationDetails_sig, + "docstring" => $GetLocationDetails_doc), + "weberp.xmlrpc_GetShipperList" => array( + "function" => "xmlrpc_GetShipperList", + "signature" => $GetShipperList_sig, + "docstring" => $GetShipperList_doc), + "weberp.xmlrpc_GetShipperDetails" => array( + "function" => "xmlrpc_GetShipperDetails", + "signature" => $GetShipperDetails_sig, + "docstring" => $GetShipperDetails_doc), + "weberp.xmlrpc_GetSalesAreasList" => array( + "function" => "xmlrpc_GetSalesAreasList", + "signature" => $GetSalesAreasList_sig, + "docstring" => $GetSalesAreasList_doc), + "weberp.xmlrpc_InsertSalesArea" => array( + "function" => "xmlrpc_InsertSalesArea", + "signature" => $InsertSalesArea_sig, + "docstring" => $InsertSalesArea_doc), + "weberp.xmlrpc_GetSalesAreaDetails" => array( + "function" => "xmlrpc_GetSalesAreaDetails", + "signature" => $GetSalesAreaDetails_sig, + "docstring" => $GetSalesAreaDetails_doc), + "weberp.xmlrpc_GetSalesAreaDetailsFromName" => array( + "function" => "xmlrpc_GetSalesAreaDetailsFromName", + "signature" => $GetSalesAreaDetailsFromName_sig, + "docstring" => $GetSalesAreaDetailsFromName_doc), + "weberp.xmlrpc_GetSalesmanList" => array( + "function" => "xmlrpc_GetSalesmanList", + "signature" => $GetSalesmanList_sig, + "docstring" => $GetSalesmanList_doc), + "weberp.xmlrpc_GetSalesmanDetails" => array( + "function" => "xmlrpc_GetSalesmanDetails", + "signature" => $GetSalesmanDetails_sig, + "docstring" => $GetSalesmanDetails_doc), + "weberp.xmlrpc_GetSalesmanDetailsFromName" => array( + "function" => "xmlrpc_GetSalesmanDetailsFromName", + "signature" => $GetSalesmanDetailsFromName_sig, + "docstring" => $GetSalesmanDetailsFromName_doc), + "weberp.xmlrpc_InsertSalesman" => array( + "function" => "xmlrpc_InsertSalesman", + "signature" => $InsertSalesman_sig, + "docstring" => $InsertSalesman_doc), + "weberp.xmlrpc_GetTaxGroupList" => array( + "function" => "xmlrpc_GetTaxGroupList", + "signature" => $GetTaxGroupList_sig, + "docstring" => $GetTaxGroupList_doc), + "weberp.xmlrpc_GetTaxGroupDetails" => array( + "function" => "xmlrpc_GetTaxGroupDetails", + "signature" => $GetTaxGroupDetails_sig, + "docstring" => $GetTaxGroupDetails_doc), + "weberp.xmlrpc_GetTaxGroupTaxes" => array( + "function" => "xmlrpc_GetTaxGroupTaxes", + "signature" => $GetTaxGroupTaxes_sig, + "docstring" => $GetTaxGroupTaxes_doc), + "weberp.xmlrpc_GetTaxAuthorityList" => array( + "function" => "xmlrpc_GetTaxAuthorityList", + "signature" => $GetTaxAuthorityList_sig, + "docstring" => $GetTaxAuthorityList_doc), + "weberp.xmlrpc_GetTaxAuthorityDetails" => array( + "function" => "xmlrpc_GetTaxAuthorityDetails", + "signature" => $GetTaxAuthorityDetails_sig, + "docstring" => $GetTaxAuthorityDetails_doc), + "weberp.xmlrpc_GetTaxAuthorityRates" => array( + "function" => "xmlrpc_GetTaxAuthorityRates", + "signature" => $GetTaxAuthorityRates_sig, + "docstring" => $GetTaxAuthorityRates_doc), + "weberp.xmlrpc_GetCustomerTypeList" => array( + "function" => "xmlrpc_GetCustomerTypeList", + "signature" => $GetCustomerTypeList_sig, + "docstring" => $GetCustomerTypeList_doc), + "weberp.xmlrpc_GetCustomerTypeDetails" => array( + "function" => "xmlrpc_GetCustomerTypeDetails", + "signature" => $GetCustomerTypeDetails_sig, + "docstring" => $GetCustomerTypeDetails_doc), + "weberp.xmlrpc_InsertStockCategory" => array( + "function" => "xmlrpc_InsertStockCategory", + "signature" => $InsertStockCategory_sig, + "docstring" => $InsertStockCategory_doc), + "weberp.xmlrpc_ModifyStockCategory" => array( + "function" => "xmlrpc_ModifyStockCategory", + "signature" => $ModifyStockCategory_sig, + "docstring" => $ModifyStockCategory_doc), + "weberp.xmlrpc_GetStockCategory" => array( + "function" => "xmlrpc_GetStockCategory", + "signature" => $GetStockCategory_sig, + "docstring" => $GetStockCategory_doc), + "weberp.xmlrpc_SearchStockCategories" => array( + "function" => "xmlrpc_SearchStockCategories", + "signature" => $SearchStockCategories_sig, + "docstring" => $SearchStockCategories_doc), + "weberp.xmlrpc_StockCatPropertyList" => array( + "function" => "xmlrpc_StockCatPropertyList", + "signature" => $StockCatPropertyList_sig, + "docstring" => $StockCatPropertyList_doc), + "weberp.xmlrpc_GetStockCategoryList" => array( + "function" => "xmlrpc_GetStockCategoryList", + "signature" => $GetStockCategoryList_sig, + "docstring" => $GetStockCategoryList_doc), + "weberp.xmlrpc_GetGLAccountList" => array( + "function" => "xmlrpc_GetGLAccountList", + "signature" => $GetGLAccountList_sig, + "docstring" => $GetGLAccountList_doc), + "weberp.xmlrpc_GetGLAccountDetails" => array( + "function" => "xmlrpc_GetGLAccountDetails", + "signature" => $GetGLAccountDetails_sig, + "docstring" => $GetGLAccountDetails_doc), + "weberp.xmlrpc_GetStockTaxRate" => array( + "function" => "xmlrpc_GetStockTaxRate", + "signature" => $GetStockTaxRate_sig, + "docstring" => $GetStockTaxRate_doc), + "weberp.xmlrpc_InsertSupplier" => array( + "function" => "xmlrpc_InsertSupplier", + "signature" => $InsertSupplier_sig, + "docstring" => $InsertSupplier_doc), + "weberp.xmlrpc_ModifySupplier" => array( + "function" => "xmlrpc_ModifySupplier", + "signature" => $ModifySupplier_sig, + "docstring" => $ModifySupplier_doc), + "weberp.xmlrpc_GetSupplier" => array( + "function" => "xmlrpc_GetSupplier", + "signature" => $GetSupplier_sig, + "docstring" => $GetSupplier_doc), + "weberp.xmlrpc_SearchSuppliers" => array( + "function" => "xmlrpc_SearchSuppliers", + "signature" => $SearchSuppliers_sig, + "docstring" => $SearchSuppliers_doc), + "weberp.xmlrpc_StockAdjustment" => array( + "function" => "xmlrpc_StockAdjustment", + "signature" => $StockAdjustment_sig, + "docstring" => $StockAdjustment_doc), + "weberp.xmlrpc_WorkOrderIssue" => array( + "function" => "xmlrpc_WorkOrderIssue", + "signature" => $WorkOrderIssue_sig, + "docstring" => $WorkOrderIssue_doc), + "weberp.xmlrpc_InsertPurchData" => array( + "function" => "xmlrpc_InsertPurchData", + "signature" => $InsertPurchData_sig, + "docstring" => $InsertPurchData_doc), + "weberp.xmlrpc_ModifyPurchData" => array( + "function" => "xmlrpc_ModifyPurchData", + "signature" => $ModifyPurchData_sig, + "docstring" => $ModifyPurchData_doc), + "weberp.xmlrpc_InsertWorkOrder" => array( + "function" => "xmlrpc_InsertWorkOrder", + "signature" => $InsertWorkOrder_sig, + "docstring" => $InsertWorkOrder_doc), + "weberp.xmlrpc_WorkOrderReceive" => array( + "function" => "xmlrpc_WorkOrderReceive", + "signature" => $WorkOrderReceive_sig, + "docstring" => $WorkOrderReceive_doc), + "weberp.xmlrpc_SearchWorkOrders" => array( + "function" => "xmlrpc_SearchWorkOrders", + "signature" => $SearchWorkOrders_sig, + "docstring" => $SearchWorkOrders_doc), + "weberp.xmlrpc_GetBatches" => array( + "function" => "xmlrpc_GetBatches", + "signature" => $GetBatches_sig, + "docstring" => $GetBatches_doc), + "weberp.xmlrpc_GetDefaultDateFormat" => array( + "function" => "xmlrpc_GetDefaultDateFormat", + "signature" => $GetDefaultDateFormat_sig, + "docstring" => $GetDefaultDateFormat_doc), + "weberp.xmlrpc_GetDefaultShipper" => array( + "function" => "xmlrpc_GetDefaultShipper", + "signature" => $GetDefaultShipper_sig, + "docstring" => $GetDefaultShipper_doc), + "weberp.xmlrpc_GetDefaultCurrency" => array( + "function" => "xmlrpc_GetDefaultCurrency", + "signature" => $GetDefaultCurrency_sig, + "docstring" => $GetDefaultCurrency_doc), + "weberp.xmlrpc_GetDefaultPriceList" => array( + "function" => "xmlrpc_GetDefaultPriceList", + "signature" => $GetDefaultPriceList_sig, + "docstring" => $GetDefaultPriceList_doc), + "weberp.xmlrpc_GetDefaultLocation" => array( + "function" => "xmlrpc_GetDefaultLocation", + "signature" => $GetDefaultLocation_sig, + "docstring" => $GetDefaultLocation_doc), + "weberp.xmlrpc_GetStockCatProperty" => array( + "function" => "xmlrpc_GetStockCatProperty", + "signature" => $GetStockCatProperty_sig, + "docstring" => $GetStockCatProperty_doc), + "weberp.xmlrpc_GetErrorMessages" => array( + "function" => "xmlrpc_GetErrorMessages", + "signature" => $GetErrorMessages_sig, + "docstring" => $GetErrorMessages_doc), + ) ); + // Generate the HTMLised description string for each API. function apiBuildDocHTML( $description, $parameter, $return ) Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-06-25 13:27:02 UTC (rev 5459) +++ trunk/doc/Change.log 2012-06-26 06:44:04 UTC (rev 5460) @@ -1,5 +1,6 @@ webERP Change Log +26/06/12 Bob Thomas: StockAdjustments fix link to controlled stock adjustments entry 24/06/2012 Phil: Added tooltip/title showing long description on many scripts where short description is currently shown SelectOrderItems.php SelectCreditItems.php CreditInvoice.php DeliveryDetails.php CounterSales.php RecurringSalesOrders.php 24/06/2012 Icedlava: Add ViewTopic and BookMark vars to some functions to take advantage of new Manual contextual help. Must be added before header.inc include. 24/06/2012 Icedlava: Adjust header.inc, ManualContents.php, ManualHeader.html to take Viewtopic and Bookmark parameters in displaying manual. Add ManualOutline.php file containing manual TOC, add CSS and rework all manual docs. Still to add $Viewtopic and $Bookmark to functions (eg see Stocks.php) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-28 19:21:53
|
Revision: 5463 http://web-erp.svn.sourceforge.net/web-erp/?rev=5463&view=rev Author: daintree Date: 2012-06-28 19:21:46 +0000 (Thu, 28 Jun 2012) Log Message: ----------- POS Data creation Modified Paths: -------------- trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/includes/GetPrice.inc Added Paths: ----------- trunk/Z_POS_Data.php trunk/includes/Z_POSDataCreation.php Added: trunk/Z_POS_Data.php =================================================================== --- trunk/Z_POS_Data.php (rev 0) +++ trunk/Z_POS_Data.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -0,0 +1,69 @@ +<?php +include('includes/GetPrice.inc'); +/* $Id: Z_POS_Data.php 3843 2010-09-30 14:49:45Z daintree $*/ +$PageSecurity = 9; + +include('includes/session.inc'); + +$title = _('Create POS Data Upload File'); + +include('includes/header.inc'); + +if (!isset($_GET['POSDebtorNo']) AND !isset($_GET['POSBranchCode'])){ + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Create POS Data File') . '" alt="">' . ' ' . $title.'<br />'; + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '><br>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + //Need to get POS customer as need to know currency for prices and the sale type for prices + if (!isset($_POST['POSDebtorNo'])){ + $_POST['POSDebtorNo']=''; + } + if (!isset($_POST['POSBranchCode'])){ + $_POST['POSBranchCode']=''; + } + echo '<table class="selection"> + <tr> + <td>' . _('POS Customer Code') . ':</td> + <td><input tabindex="1" type="text" name="POSDebtorNo" value="' . $_POST['POSDebtorNo'] . '" size="12" maxlength="12" /></td> + </tr> + <tr> + <td>' . _('POS Branch Code') . ':</td> + <td><input tabindex="2" type="text" name="POSBranchCode" value="' . $_POST['POSBranchCode'] .'" size="12" maxlength="12" /></td> + </tr>'; + + echo '<tr><td colspan=2><div class="centre"><input tabindex="3" type="Submit" name="CreatePOSDataFile" value=' . _('Create POS Data File') .'></div></td></tr>'; + echo '</table></form>'; +} else { + $_POST['POSDebtorNo'] = $_GET['POSDebtorNo']; + $_POST['POSBranchCode'] = $_GET['POSBranchCode']; + $_POST['CreatePOSDataFile'] = 'Yes Please'; +} + +if (isset($_POST['CreatePOSDataFile'])){ + + $InputError =0; + + if (!isset($_POST['POSDebtorNo']) OR $_POST['POSDebtorNo'] == ''){ + prnMsg(_('Cannot create POS Data file without the POS Customer Code'),'error'); + $InputError =1; + } elseif(!isset($_POST['POSBranchCode']) OR $_POST['POSBranchCode']==''){ + prnMsg(_('Cannot create POS Data file without the POS Customer Branch Code'),'error'); + $InputError =1; + } + + if ($InputError ==0) { + + include('includes/Z_POSDataCreation.php'); + if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ + echo '<br /> + <br /> + <a href="' . $_SESSION['reports_dir'] . '/POS.sql.zip">' . _('Download POS Upload File') . '</a>'; + } else { + prnMsg(_('Unable to create POS Data file - perhaps the POS Customer Code or Branch Code do not exist'),'error'); + } + + } // end if no input errors +} //hit create POSDataFile + +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-06-28 13:47:00 UTC (rev 5462) +++ trunk/api/api_webERPsettings.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -67,7 +67,7 @@ } $sql = "select defaultlocation from www_users where userid='".$user."'"; $result = DB_query($sql, $db); - $answer=DB_fetch_array($result); + $answer=DB_fetch_array($result); $ReturnValue[0]=0; $ReturnValue[1]=$answer; return $ReturnValue; @@ -90,5 +90,24 @@ $ReturnValue[1]=$answer; return $ReturnValue; } + + /* This function creates a POS zipped update file */ + include('../../includes/POSDataCreation.php'); + + function CreatePOSDataFull($POSDebtorNo, $POSBranchCode, $User, $Password) { + $Errors = array(); + $db = db($User, $Password); + if (gettype($db)=='integer') { + $Errors[0]=NoAuthorisation; + return $Errors; + } + if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ + $ReturnValue=0; + } else { + $ReturnValue=1; + } + return $ReturnValue; + } + ?> Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-28 13:47:00 UTC (rev 5462) +++ trunk/api/api_xml-rpc.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -2931,12 +2931,12 @@ unset($Parameter); unset($ReturnValue); - $Description = _('Returns the webERP currency code'); + $Description = _('Returns the webERP default inventory location'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); $Parameter[1]['name'] = _('User password'); $Parameter[1]['description'] = _('The weberp password associated with this user name. '); - $ReturnValue[0] = _('If successful this function returns a string contain the default currency code. ') + $ReturnValue[0] = _('If successful this function returns a string contain the default inventory location. ') ._('Otherwise an array of error codes is returned. '); /*E*/ $GetDefaultLocation_sig = array(array($xmlrpcStruct), @@ -2960,6 +2960,43 @@ unset($Parameter); unset($ReturnValue); + $Description = _('This function creates a POS data file on the webERP server for download by the POS'); + $Parameter[0]['name'] = _('POS Customer Code - a valid webERP customer that sales from the POS are made against.'); + $Parameter[0]['description'] = _('POS Customer Branch Code - a valid branch code of the webERP customer that the POS sales are made against'); + $Parameter[1]['name'] = _('User name'); + $Parameter[1]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[2]['name'] = _('User name'); + $Parameter[2]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[3]['name'] = _('User password'); + $Parameter[3]['description'] = _('The weberp password associated with this user name. '); + $ReturnValue[0] = _('If successful this function returns 0 for success and 1 for error. '); + + $GetCreatePOSDataFull_sig = array(array($xmlrpcStruct), + array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); + $GetCreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + + function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ + ob_start('ob_file_callback'); +/*x*/ if ($xmlrpcmsg->getNumParams() == 4) { +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), + $xmlrpcmsg->getParam( 2 )->scalarval( ), + $xmlrpcmsg->getParam( 3 )->scalarval( ))) ); +/*x*/ } else { +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull( $xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), + '', + ''))); +/*x*/ } + ob_end_flush(); + return $rtn; + } + + + unset($Description); + unset($Parameter); + unset($ReturnValue); + $Description = _('Returns the value of the specified stock category property for the specified stock item category'); $Parameter[0]['name'] = _('Property'); $Parameter[0]['description'] = _('The name of the specific property to be returned.'); Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-06-28 13:47:00 UTC (rev 5462) +++ trunk/includes/GetPrice.inc 2012-06-28 19:21:46 UTC (rev 5463) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -function GetPrice ($StockID, $DebtorNo, $BranchCode, $db){ +function GetPrice ($StockID, $DebtorNo, $BranchCode, $db, $ReportZeroPrice=1){ $Price = 0; /*Search by branch and customer for a date specified price */ @@ -140,7 +140,9 @@ if (DB_num_rows($result)==0){ /*Not even a price set up in the default price list so return 0 */ - prnMsg(_('There are no prices set up for') . ' ' . $StockID,'warn'); + if ($ReportZeroPrice ==1){ + prnMsg(_('There are no prices set up for') . ' ' . $StockID,'warn'); + } Return 0; } } Added: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php (rev 0) +++ trunk/includes/Z_POSDataCreation.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -0,0 +1,139 @@ +<?php + +function CreatePOSDataFull ( $POSDebtorNo, $POSBranchCode, $db) { + $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); + $CustomerRow = DB_fetch_array($result); + if (DB_num_rows($result)==0){ + return 0; + } + $CurrCode = $CustomerRow['currcode']; + $SalesType = $CustomerRow['salestype']; + + $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); + + fwrite($FileHandle,"DELETE FROM currencies;\n"); + $result = DB_query('SELECT currency, currabrev, country, hundredsname,decimalplaces, rate FROM currencies',$db); + while ($CurrRow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO currencies VALUES ('" . $CurrRow['currency'] . "', '" . $CurrRow['currabrev'] . "', '" . sqlite_escape_string ($CurrRow['country']) . "', '" . sqlite_escape_string ($CurrRow['hundredsname']) . "', '" .$CurrRow['decimalplaces'] . "', '" .$CurrRow['rate'] . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM salestypes;\n"); + + $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . sqlite_escape_string ($myrow['sales_type']) . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM holdreasons;\n"); + + $result = DB_query('SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . sqlite_escape_string ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM paymentterms;\n"); + + $result = DB_query('SELECT termsindicator, terms FROM paymentterms',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . sqlite_escape_string ($myrow['terms']) . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM paymentmethods;\n"); + $result = DB_query('SELECT paymentid, paymentname,opencashdrawer FROM paymentmethods',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . sqlite_escape_string ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM locations;\n"); + $result = DB_query('SELECT loccode, locationname,taxprovinceid FROM locations',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . sqlite_escape_string ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM stockcategory;\n"); + $result = DB_query('SELECT categoryid, categorydescription FROM stockcategory',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . sqlite_escape_string ($myrow['categorydescription']) . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM taxgroups;\n"); + $result = DB_query('SELECT taxgroupid, taxgroupdescription FROM taxgroups',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . sqlite_escape_string ($myrow['taxgroupdescription']) . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM taxgrouptaxes;\n"); + $result = DB_query('SELECT taxgroupid, taxauthid, calculationorder, taxontax FROM taxgrouptaxes',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxgrouptaxes VALUES ('" . $myrow['taxgroupid'] . "', '" . $myrow['taxauthid'] . "', '" . $myrow['calculationorder'] . "', '" . $myrow['taxontax'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM taxauthorities;\n"); + $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . sqlite_escape_string ($myrow['description']) . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM taxauthrates;\n"); + $result = DB_query('SELECT taxauthority, dispatchtaxprovince, taxcatid, taxrate FROM taxauthrates',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxauthrates VALUES ('" . $myrow['taxauthority'] . "', '" . $myrow['dispatchtaxprovince'] . "', '" . $myrow['taxcatid'] . "', '" . $myrow['taxrate'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM stockmaster;\n"); + $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . sqlite_escape_string ($myrow['stockid']) . "', '" . sqlite_escape_string ($myrow['categoryid']) . "', '" . sqlite_escape_string ($myrow['description']) . "', '" . sqlite_escape_string (str_replace("\n", '', $myrow['longdescription'])) . "', '" . sqlite_escape_string ($myrow['units']) . "', '" . sqlite_escape_string ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); + $Price = GetPrice ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db,0); + if ($Price!=0) { + fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); + } + + } + fwrite($FileHandle,"DELETE FROM debtorsmaster;\n"); + $result = DB_query("SELECT debtorno, name, currcode, salestype, holdreason, paymentterms, discount, creditlimit, discountcode FROM debtorsmaster WHERE currcode='". $CurrCode . "'",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . sqlite_escape_string ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM custbranch;\n"); + $result = DB_query("SELECT branchcode, debtorsmaster.debtorno, brname, contactname, specialinstructions,taxgroupid FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE debtorsmaster.currcode='". $CurrCode . "'",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO custbranch VALUES ('" . $myrow['branchcode'] . "', '" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['brname']) . "', '" . sqlite_escape_string ($myrow['contactname']) . "', '" . sqlite_escape_string ($myrow['specialinstructions']) . "', '" . $myrow['taxgroupid'] . "');\n"); + + } + + fclose($FileHandle); + /*Now compress to a zip archive */ + if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + } + $ZipFile = new ZipArchive(); + if ($ZipFile->open($_SESSION['reports_dir'] . '/POS.sql.zip', ZIPARCHIVE::CREATE)!==TRUE) { + exit("cannot open <" . $_SESSION['reports_dir'] . "/POS.sql.zip\n"); + include('includes/footer.inc'); + } + $ZipFile->addFile($_SESSION['reports_dir'] . '/POS.sql','POS.sql'); + $ZipFile->close(); +} + +?> \ 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...> - 2012-06-28 19:21:53
|
Revision: 5463 http://web-erp.svn.sourceforge.net/web-erp/?rev=5463&view=rev Author: daintree Date: 2012-06-28 19:21:46 +0000 (Thu, 28 Jun 2012) Log Message: ----------- POS Data creation Modified Paths: -------------- trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/includes/GetPrice.inc Added Paths: ----------- trunk/Z_POS_Data.php trunk/includes/Z_POSDataCreation.php Added: trunk/Z_POS_Data.php =================================================================== --- trunk/Z_POS_Data.php (rev 0) +++ trunk/Z_POS_Data.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -0,0 +1,69 @@ +<?php +include('includes/GetPrice.inc'); +/* $Id: Z_POS_Data.php 3843 2010-09-30 14:49:45Z daintree $*/ +$PageSecurity = 9; + +include('includes/session.inc'); + +$title = _('Create POS Data Upload File'); + +include('includes/header.inc'); + +if (!isset($_GET['POSDebtorNo']) AND !isset($_GET['POSBranchCode'])){ + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Create POS Data File') . '" alt="">' . ' ' . $title.'<br />'; + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '><br>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + //Need to get POS customer as need to know currency for prices and the sale type for prices + if (!isset($_POST['POSDebtorNo'])){ + $_POST['POSDebtorNo']=''; + } + if (!isset($_POST['POSBranchCode'])){ + $_POST['POSBranchCode']=''; + } + echo '<table class="selection"> + <tr> + <td>' . _('POS Customer Code') . ':</td> + <td><input tabindex="1" type="text" name="POSDebtorNo" value="' . $_POST['POSDebtorNo'] . '" size="12" maxlength="12" /></td> + </tr> + <tr> + <td>' . _('POS Branch Code') . ':</td> + <td><input tabindex="2" type="text" name="POSBranchCode" value="' . $_POST['POSBranchCode'] .'" size="12" maxlength="12" /></td> + </tr>'; + + echo '<tr><td colspan=2><div class="centre"><input tabindex="3" type="Submit" name="CreatePOSDataFile" value=' . _('Create POS Data File') .'></div></td></tr>'; + echo '</table></form>'; +} else { + $_POST['POSDebtorNo'] = $_GET['POSDebtorNo']; + $_POST['POSBranchCode'] = $_GET['POSBranchCode']; + $_POST['CreatePOSDataFile'] = 'Yes Please'; +} + +if (isset($_POST['CreatePOSDataFile'])){ + + $InputError =0; + + if (!isset($_POST['POSDebtorNo']) OR $_POST['POSDebtorNo'] == ''){ + prnMsg(_('Cannot create POS Data file without the POS Customer Code'),'error'); + $InputError =1; + } elseif(!isset($_POST['POSBranchCode']) OR $_POST['POSBranchCode']==''){ + prnMsg(_('Cannot create POS Data file without the POS Customer Branch Code'),'error'); + $InputError =1; + } + + if ($InputError ==0) { + + include('includes/Z_POSDataCreation.php'); + if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ + echo '<br /> + <br /> + <a href="' . $_SESSION['reports_dir'] . '/POS.sql.zip">' . _('Download POS Upload File') . '</a>'; + } else { + prnMsg(_('Unable to create POS Data file - perhaps the POS Customer Code or Branch Code do not exist'),'error'); + } + + } // end if no input errors +} //hit create POSDataFile + +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-06-28 13:47:00 UTC (rev 5462) +++ trunk/api/api_webERPsettings.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -67,7 +67,7 @@ } $sql = "select defaultlocation from www_users where userid='".$user."'"; $result = DB_query($sql, $db); - $answer=DB_fetch_array($result); + $answer=DB_fetch_array($result); $ReturnValue[0]=0; $ReturnValue[1]=$answer; return $ReturnValue; @@ -90,5 +90,24 @@ $ReturnValue[1]=$answer; return $ReturnValue; } + + /* This function creates a POS zipped update file */ + include('../../includes/POSDataCreation.php'); + + function CreatePOSDataFull($POSDebtorNo, $POSBranchCode, $User, $Password) { + $Errors = array(); + $db = db($User, $Password); + if (gettype($db)=='integer') { + $Errors[0]=NoAuthorisation; + return $Errors; + } + if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ + $ReturnValue=0; + } else { + $ReturnValue=1; + } + return $ReturnValue; + } + ?> Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-28 13:47:00 UTC (rev 5462) +++ trunk/api/api_xml-rpc.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -2931,12 +2931,12 @@ unset($Parameter); unset($ReturnValue); - $Description = _('Returns the webERP currency code'); + $Description = _('Returns the webERP default inventory location'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); $Parameter[1]['name'] = _('User password'); $Parameter[1]['description'] = _('The weberp password associated with this user name. '); - $ReturnValue[0] = _('If successful this function returns a string contain the default currency code. ') + $ReturnValue[0] = _('If successful this function returns a string contain the default inventory location. ') ._('Otherwise an array of error codes is returned. '); /*E*/ $GetDefaultLocation_sig = array(array($xmlrpcStruct), @@ -2960,6 +2960,43 @@ unset($Parameter); unset($ReturnValue); + $Description = _('This function creates a POS data file on the webERP server for download by the POS'); + $Parameter[0]['name'] = _('POS Customer Code - a valid webERP customer that sales from the POS are made against.'); + $Parameter[0]['description'] = _('POS Customer Branch Code - a valid branch code of the webERP customer that the POS sales are made against'); + $Parameter[1]['name'] = _('User name'); + $Parameter[1]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[2]['name'] = _('User name'); + $Parameter[2]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[3]['name'] = _('User password'); + $Parameter[3]['description'] = _('The weberp password associated with this user name. '); + $ReturnValue[0] = _('If successful this function returns 0 for success and 1 for error. '); + + $GetCreatePOSDataFull_sig = array(array($xmlrpcStruct), + array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); + $GetCreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + + function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ + ob_start('ob_file_callback'); +/*x*/ if ($xmlrpcmsg->getNumParams() == 4) { +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), + $xmlrpcmsg->getParam( 2 )->scalarval( ), + $xmlrpcmsg->getParam( 3 )->scalarval( ))) ); +/*x*/ } else { +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull( $xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), + '', + ''))); +/*x*/ } + ob_end_flush(); + return $rtn; + } + + + unset($Description); + unset($Parameter); + unset($ReturnValue); + $Description = _('Returns the value of the specified stock category property for the specified stock item category'); $Parameter[0]['name'] = _('Property'); $Parameter[0]['description'] = _('The name of the specific property to be returned.'); Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-06-28 13:47:00 UTC (rev 5462) +++ trunk/includes/GetPrice.inc 2012-06-28 19:21:46 UTC (rev 5463) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -function GetPrice ($StockID, $DebtorNo, $BranchCode, $db){ +function GetPrice ($StockID, $DebtorNo, $BranchCode, $db, $ReportZeroPrice=1){ $Price = 0; /*Search by branch and customer for a date specified price */ @@ -140,7 +140,9 @@ if (DB_num_rows($result)==0){ /*Not even a price set up in the default price list so return 0 */ - prnMsg(_('There are no prices set up for') . ' ' . $StockID,'warn'); + if ($ReportZeroPrice ==1){ + prnMsg(_('There are no prices set up for') . ' ' . $StockID,'warn'); + } Return 0; } } Added: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php (rev 0) +++ trunk/includes/Z_POSDataCreation.php 2012-06-28 19:21:46 UTC (rev 5463) @@ -0,0 +1,139 @@ +<?php + +function CreatePOSDataFull ( $POSDebtorNo, $POSBranchCode, $db) { + $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); + $CustomerRow = DB_fetch_array($result); + if (DB_num_rows($result)==0){ + return 0; + } + $CurrCode = $CustomerRow['currcode']; + $SalesType = $CustomerRow['salestype']; + + $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); + + fwrite($FileHandle,"DELETE FROM currencies;\n"); + $result = DB_query('SELECT currency, currabrev, country, hundredsname,decimalplaces, rate FROM currencies',$db); + while ($CurrRow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO currencies VALUES ('" . $CurrRow['currency'] . "', '" . $CurrRow['currabrev'] . "', '" . sqlite_escape_string ($CurrRow['country']) . "', '" . sqlite_escape_string ($CurrRow['hundredsname']) . "', '" .$CurrRow['decimalplaces'] . "', '" .$CurrRow['rate'] . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM salestypes;\n"); + + $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . sqlite_escape_string ($myrow['sales_type']) . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM holdreasons;\n"); + + $result = DB_query('SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . sqlite_escape_string ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM paymentterms;\n"); + + $result = DB_query('SELECT termsindicator, terms FROM paymentterms',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . sqlite_escape_string ($myrow['terms']) . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM paymentmethods;\n"); + $result = DB_query('SELECT paymentid, paymentname,opencashdrawer FROM paymentmethods',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . sqlite_escape_string ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM locations;\n"); + $result = DB_query('SELECT loccode, locationname,taxprovinceid FROM locations',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . sqlite_escape_string ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM stockcategory;\n"); + $result = DB_query('SELECT categoryid, categorydescription FROM stockcategory',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . sqlite_escape_string ($myrow['categorydescription']) . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM taxgroups;\n"); + $result = DB_query('SELECT taxgroupid, taxgroupdescription FROM taxgroups',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . sqlite_escape_string ($myrow['taxgroupdescription']) . "');\n"); + + } + + fwrite($FileHandle,"DELETE FROM taxgrouptaxes;\n"); + $result = DB_query('SELECT taxgroupid, taxauthid, calculationorder, taxontax FROM taxgrouptaxes',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxgrouptaxes VALUES ('" . $myrow['taxgroupid'] . "', '" . $myrow['taxauthid'] . "', '" . $myrow['calculationorder'] . "', '" . $myrow['taxontax'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM taxauthorities;\n"); + $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . sqlite_escape_string ($myrow['description']) . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM taxauthrates;\n"); + $result = DB_query('SELECT taxauthority, dispatchtaxprovince, taxcatid, taxrate FROM taxauthrates',$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO taxauthrates VALUES ('" . $myrow['taxauthority'] . "', '" . $myrow['dispatchtaxprovince'] . "', '" . $myrow['taxcatid'] . "', '" . $myrow['taxrate'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM stockmaster;\n"); + $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . sqlite_escape_string ($myrow['stockid']) . "', '" . sqlite_escape_string ($myrow['categoryid']) . "', '" . sqlite_escape_string ($myrow['description']) . "', '" . sqlite_escape_string (str_replace("\n", '', $myrow['longdescription'])) . "', '" . sqlite_escape_string ($myrow['units']) . "', '" . sqlite_escape_string ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); + $Price = GetPrice ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db,0); + if ($Price!=0) { + fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); + } + + } + fwrite($FileHandle,"DELETE FROM debtorsmaster;\n"); + $result = DB_query("SELECT debtorno, name, currcode, salestype, holdreason, paymentterms, discount, creditlimit, discountcode FROM debtorsmaster WHERE currcode='". $CurrCode . "'",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . sqlite_escape_string ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); + + } + fwrite($FileHandle,"DELETE FROM custbranch;\n"); + $result = DB_query("SELECT branchcode, debtorsmaster.debtorno, brname, contactname, specialinstructions,taxgroupid FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE debtorsmaster.currcode='". $CurrCode . "'",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO custbranch VALUES ('" . $myrow['branchcode'] . "', '" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['brname']) . "', '" . sqlite_escape_string ($myrow['contactname']) . "', '" . sqlite_escape_string ($myrow['specialinstructions']) . "', '" . $myrow['taxgroupid'] . "');\n"); + + } + + fclose($FileHandle); + /*Now compress to a zip archive */ + if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + } + $ZipFile = new ZipArchive(); + if ($ZipFile->open($_SESSION['reports_dir'] . '/POS.sql.zip', ZIPARCHIVE::CREATE)!==TRUE) { + exit("cannot open <" . $_SESSION['reports_dir'] . "/POS.sql.zip\n"); + include('includes/footer.inc'); + } + $ZipFile->addFile($_SESSION['reports_dir'] . '/POS.sql','POS.sql'); + $ZipFile->close(); +} + +?> \ 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: <tim...@us...> - 2012-06-29 18:54:41
|
Revision: 5464 http://web-erp.svn.sourceforge.net/web-erp/?rev=5464&view=rev Author: tim_schofield Date: 2012-06-29 18:54:34 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Give the option to print quotations in Landscape or Portrait Modified Paths: -------------- trunk/DeliveryDetails.php trunk/SelectSalesOrder.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2012-06-28 19:21:46 UTC (rev 5463) +++ trunk/DeliveryDetails.php 2012-06-29 18:54:34 UTC (rev 5464) @@ -583,7 +583,7 @@ <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>'; - + echo '</table>'; } else { @@ -768,17 +768,23 @@ $Quotation = $_SESSION['Items'.$identifier]->Quotation; unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); - + if($Quotation){ //handle Quotations and Orders print after modification prnMsg(_('Quotation Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('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 target="_blank" href="' .$rootpath.'/PDFQuotation.php?QuotationNo='.$_SESSION['ExistingOrder'.$identifier].'">'._('Print Quotation').'</a></td> - </tr> - </table>'; //end of print Quotation + /*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=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('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?identifier='.$identifier . '&QuotationNo=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('Print Quotation (Portrait)') .'</a></td> + </tr> + </table>'; }else{ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); @@ -824,9 +830,9 @@ /*Display the order with or without discount depending on access level*/ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - + echo '<table>'; - + if ($_SESSION['Items'.$identifier]->Quotation==1){ echo '<tr><th colspan="7">'._('Quotation Summary').'</th></tr>'; } else { @@ -1064,7 +1070,7 @@ echo '<tr><td>' . _('Packlist Type') . ':</td> <td><select name="DeliverBlind">'; - + if ($_SESSION['Items'.$identifier]->DeliverBlind ==2){ echo '<option value="1">' . _('Show Company Details/Logo') . '</option>'; echo '<option selected="selected" value="2">' . _('Hide Company Details/Logo') . '</option>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2012-06-28 19:21:46 UTC (rev 5463) +++ trunk/SelectSalesOrder.php 2012-06-29 18:54:34 UTC (rev 5464) @@ -58,16 +58,16 @@ stockcategory.stockact ORDER BY purchdata.supplierno, purchdata.stockid"; - + $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); $ItemResult = DB_query($sql,$db,$ErrMsg); - + $ItemArray = array(); - + while ($myrow = DB_fetch_array($ItemResult)){ $ItemArray[$myrow['stockid']] = $myrow; } - + /* Now figure out if there are any components of Assembly items that need to be ordered too */ $sql = "SELECT purchdata.supplierno, purchdata.stockid, @@ -81,21 +81,21 @@ stockmaster.volume, stockcategory.stockact, SUM(bom.quantity *(salesorderdetails.quantity-salesorderdetails.qtyinvoiced)) AS orderqty - FROM purchdata INNER JOIN bom + FROM purchdata INNER JOIN bom ON purchdata.stockid=bom.component INNER JOIN salesorderdetails ON bom.parent=salesorderdetails.stkcode INNER JOIN stockmaster ON purchdata.stockid = stockmaster.stockid - INNER JOIN stockmaster AS stockmaster2 + INNER JOIN stockmaster AS stockmaster2 ON stockmaster2.stockid=salesorderdetails.stkcode INNER JOIN stockcategory ON stockmaster.categoryid = stockcategory.categoryid - WHERE purchdata.preferred=1 + WHERE purchdata.preferred=1 AND stockmaster2.mbflag='A' AND bom.loccode ='" . $_SESSION['UserStockLocation'] . "' AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' - AND bom.effectiveafter <='" . Date('Y-m-d') . "' + AND bom.effectiveafter <='" . Date('Y-m-d') . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' AND (" . $OrdersToPlacePOFor . ") GROUP BY purchdata.supplierno, @@ -113,7 +113,7 @@ purchdata.stockid"; $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); $ItemResult = DB_query($sql,$db,$ErrMsg); - + /* add any assembly item components from salesorders to the ItemArray */ while ($myrow = DB_fetch_array($ItemResult)){ if (isset($ItemArray[$myrow['stockid']])){ @@ -129,9 +129,9 @@ */ foreach ($ItemArray as $key => $row) { //to make the Supplier array with the keys of the $ItemArray - $SupplierArray[$key] = $row['supplierno']; + $SupplierArray[$key] = $row['supplierno']; } - + /* Use array_multisort to Sort the ItemArray with supplierno ascending Add $ItemArray as the last parameter, to sort by the common key */ @@ -214,7 +214,7 @@ /*Starting a new purchase order with a different supplier */ $result = DB_Txn_Begin($db); - + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number $SupplierID = $ItemRow['supplierno']; @@ -333,20 +333,20 @@ /* The last line to be purchase ordered was reach so there will be an order which is not yet completed in progress now to completed it */ - + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { //if the user has authority to authorise the PO then it should be created as authorised $AuthSQL ="SELECT authlevel FROM purchorderauth WHERE userid='".$_SESSION['UserID']."' AND currabrev='".$SuppRow['currcode']."'"; - + $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); if ($AuthRow['authlevel']=''){ $AuthRow['authlevel'] = 0; } - + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order $StatusComment = date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; $ErrMsg = _('Could not update purchase order status to Authorised'); @@ -362,7 +362,7 @@ } else { $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; } - + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $SuppRow['currcode'] . ' '. $Order_Value .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order has been created with a status of pending and will require authorisation'), 'warn'); } } //end of authorisation status settings @@ -573,7 +573,7 @@ </div> <br />'; -if (isset($StockItemsResult) +if (isset($StockItemsResult) AND DB_num_rows($StockItemsResult)>0) { echo '<table cellpadding="2" class="selection">'; @@ -632,7 +632,7 @@ if(!isset($_POST['StockLocation'])) { $_POST['StockLocation'] = ''; } - if (isset($_REQUEST['OrderNumber']) + if (isset($_REQUEST['OrderNumber']) AND $_REQUEST['OrderNumber'] !='') { $SQL = "SELECT salesorders.orderno, debtorsmaster.name, @@ -644,11 +644,11 @@ salesorders.printedpackingslip, salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -682,11 +682,11 @@ salesorders.printedpackingslip, salesorders.poplaced, salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -710,11 +710,11 @@ salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -747,11 +747,11 @@ salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -781,11 +781,11 @@ salesorders.printedpackingslip, salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -813,12 +813,12 @@ /*show a table of the orders returned by the SQL */ if (DB_num_rows($SalesOrdersResult)>0) { - + /* Get users authority to place POs */ $AuthSQL="SELECT cancreate FROM purchorderauth WHERE userid='". $_SESSION['UserID'] . "'"; - + /*we don't know what currency these orders might be in but if no authority at all then don't show option*/ $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); @@ -837,7 +837,7 @@ <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> <th>' . _('Order Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th>'; - + if ($AuthRow['cancreate']==0){ //If cancreate==0 then this means the user can create orders hmmm!! $tableheader .= '<th>' . _('Place PO') . '</th></tr>'; } else { @@ -863,7 +863,7 @@ $j = 1; $k=0; //row colour counter $OrdersTotal =0; - + while ($myrow=DB_fetch_array($SalesOrdersResult)) { @@ -877,25 +877,26 @@ $ModifyPage = $rootpath . '/SelectOrderItems.php?ModifyOrderNumber=' . $myrow['orderno']; $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?OrderNumber=' .$myrow['orderno']; - + if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $myrow['orderno']; } else { /*pre-printed stationery default */ $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?TransNo=' . $myrow['orderno']; } $PrintQuotation = $rootpath . '/PDFQuotation.php?QuotationNo=' . $myrow['orderno']; + $PrintQuotationPortrait = $rootpath . '/PDFQuotationPortrait.php?QuotationNo=' . $myrow['orderno']; $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$_SESSION['CompanyRecord']['decimalplaces']); - + if ($myrow['printedpackingslip']==0) { $PrintText = _('Print'); } else { $PrintText = _('Reprint'); } - + if ($_POST['Quotations']=='Orders_Only'){ - + /*Check authority to create POs if user has authority then show the check boxes to select sales orders to place POs for otherwise don't provide this option */ if ($AuthRow['cancreate']==0 AND $myrow['poplaced']==0){ //cancreate==0 if the user can create POs and not already placed printf('<td><a href="%s">%s</a></td> @@ -948,10 +949,10 @@ html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue); } - + } else { /*must be quotes only */ printf('<td><a href="%s">%s</a></td> - <td><a target="_blank" href="%s">' . $PrintText . '</a></td> + <td><a target="_blank" href="%s">' . _('Landscape') . '</a> <a target="_blank" href="%s">' . _('Portrait') . '</a></td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -963,6 +964,7 @@ $ModifyPage, $myrow['orderno'], $PrintQuotation, + $PrintQuotationPortrait, $myrow['name'], $myrow['brname'], $myrow['customerref'], @@ -980,9 +982,9 @@ } //end of page full new headings if }//end while loop through orders to display - if ($_POST['Quotations']=='Orders_Only' + if ($_POST['Quotations']=='Orders_Only' AND $AuthRow['cancreate']==0){ //cancreate==0 means can create POs - + echo '<tr><td colspan="11" class="number"><input type="submit" name="PlacePO" value="' . _('Place') . " " . _('PO') . '" onclick="return confirm(\'' . _('This will create purchase orders for all the items on the checked sales orders above, based on the preferred supplier purchasing data held in the system. Are You Absolutely Sure?') . '\');" /></td</tr>'; } echo '<tr><td colspan="9" class="number">'; @@ -995,7 +997,7 @@ <td class="number"><b>' . locale_number_format($OrdersTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr> </table>'; - } //end if there are some orders to show + } //end if there are some orders to show } echo '</div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-06-29 18:54:41
|
Revision: 5464 http://web-erp.svn.sourceforge.net/web-erp/?rev=5464&view=rev Author: tim_schofield Date: 2012-06-29 18:54:34 +0000 (Fri, 29 Jun 2012) Log Message: ----------- Give the option to print quotations in Landscape or Portrait Modified Paths: -------------- trunk/DeliveryDetails.php trunk/SelectSalesOrder.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2012-06-28 19:21:46 UTC (rev 5463) +++ trunk/DeliveryDetails.php 2012-06-29 18:54:34 UTC (rev 5464) @@ -583,7 +583,7 @@ <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>'; - + echo '</table>'; } else { @@ -768,17 +768,23 @@ $Quotation = $_SESSION['Items'.$identifier]->Quotation; unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); - + if($Quotation){ //handle Quotations and Orders print after modification prnMsg(_('Quotation Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('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 target="_blank" href="' .$rootpath.'/PDFQuotation.php?QuotationNo='.$_SESSION['ExistingOrder'.$identifier].'">'._('Print Quotation').'</a></td> - </tr> - </table>'; //end of print Quotation + /*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=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('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?identifier='.$identifier . '&QuotationNo=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('Print Quotation (Portrait)') .'</a></td> + </tr> + </table>'; }else{ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); @@ -824,9 +830,9 @@ /*Display the order with or without discount depending on access level*/ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - + echo '<table>'; - + if ($_SESSION['Items'.$identifier]->Quotation==1){ echo '<tr><th colspan="7">'._('Quotation Summary').'</th></tr>'; } else { @@ -1064,7 +1070,7 @@ echo '<tr><td>' . _('Packlist Type') . ':</td> <td><select name="DeliverBlind">'; - + if ($_SESSION['Items'.$identifier]->DeliverBlind ==2){ echo '<option value="1">' . _('Show Company Details/Logo') . '</option>'; echo '<option selected="selected" value="2">' . _('Hide Company Details/Logo') . '</option>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2012-06-28 19:21:46 UTC (rev 5463) +++ trunk/SelectSalesOrder.php 2012-06-29 18:54:34 UTC (rev 5464) @@ -58,16 +58,16 @@ stockcategory.stockact ORDER BY purchdata.supplierno, purchdata.stockid"; - + $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); $ItemResult = DB_query($sql,$db,$ErrMsg); - + $ItemArray = array(); - + while ($myrow = DB_fetch_array($ItemResult)){ $ItemArray[$myrow['stockid']] = $myrow; } - + /* Now figure out if there are any components of Assembly items that need to be ordered too */ $sql = "SELECT purchdata.supplierno, purchdata.stockid, @@ -81,21 +81,21 @@ stockmaster.volume, stockcategory.stockact, SUM(bom.quantity *(salesorderdetails.quantity-salesorderdetails.qtyinvoiced)) AS orderqty - FROM purchdata INNER JOIN bom + FROM purchdata INNER JOIN bom ON purchdata.stockid=bom.component INNER JOIN salesorderdetails ON bom.parent=salesorderdetails.stkcode INNER JOIN stockmaster ON purchdata.stockid = stockmaster.stockid - INNER JOIN stockmaster AS stockmaster2 + INNER JOIN stockmaster AS stockmaster2 ON stockmaster2.stockid=salesorderdetails.stkcode INNER JOIN stockcategory ON stockmaster.categoryid = stockcategory.categoryid - WHERE purchdata.preferred=1 + WHERE purchdata.preferred=1 AND stockmaster2.mbflag='A' AND bom.loccode ='" . $_SESSION['UserStockLocation'] . "' AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' - AND bom.effectiveafter <='" . Date('Y-m-d') . "' + AND bom.effectiveafter <='" . Date('Y-m-d') . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' AND (" . $OrdersToPlacePOFor . ") GROUP BY purchdata.supplierno, @@ -113,7 +113,7 @@ purchdata.stockid"; $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); $ItemResult = DB_query($sql,$db,$ErrMsg); - + /* add any assembly item components from salesorders to the ItemArray */ while ($myrow = DB_fetch_array($ItemResult)){ if (isset($ItemArray[$myrow['stockid']])){ @@ -129,9 +129,9 @@ */ foreach ($ItemArray as $key => $row) { //to make the Supplier array with the keys of the $ItemArray - $SupplierArray[$key] = $row['supplierno']; + $SupplierArray[$key] = $row['supplierno']; } - + /* Use array_multisort to Sort the ItemArray with supplierno ascending Add $ItemArray as the last parameter, to sort by the common key */ @@ -214,7 +214,7 @@ /*Starting a new purchase order with a different supplier */ $result = DB_Txn_Begin($db); - + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number $SupplierID = $ItemRow['supplierno']; @@ -333,20 +333,20 @@ /* The last line to be purchase ordered was reach so there will be an order which is not yet completed in progress now to completed it */ - + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { //if the user has authority to authorise the PO then it should be created as authorised $AuthSQL ="SELECT authlevel FROM purchorderauth WHERE userid='".$_SESSION['UserID']."' AND currabrev='".$SuppRow['currcode']."'"; - + $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); if ($AuthRow['authlevel']=''){ $AuthRow['authlevel'] = 0; } - + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order $StatusComment = date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; $ErrMsg = _('Could not update purchase order status to Authorised'); @@ -362,7 +362,7 @@ } else { $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; } - + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $SuppRow['currcode'] . ' '. $Order_Value .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order has been created with a status of pending and will require authorisation'), 'warn'); } } //end of authorisation status settings @@ -573,7 +573,7 @@ </div> <br />'; -if (isset($StockItemsResult) +if (isset($StockItemsResult) AND DB_num_rows($StockItemsResult)>0) { echo '<table cellpadding="2" class="selection">'; @@ -632,7 +632,7 @@ if(!isset($_POST['StockLocation'])) { $_POST['StockLocation'] = ''; } - if (isset($_REQUEST['OrderNumber']) + if (isset($_REQUEST['OrderNumber']) AND $_REQUEST['OrderNumber'] !='') { $SQL = "SELECT salesorders.orderno, debtorsmaster.name, @@ -644,11 +644,11 @@ salesorders.printedpackingslip, salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -682,11 +682,11 @@ salesorders.printedpackingslip, salesorders.poplaced, salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -710,11 +710,11 @@ salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -747,11 +747,11 @@ salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -781,11 +781,11 @@ salesorders.printedpackingslip, salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue - FROM salesorders INNER JOIN salesorderdetails + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno - INNER JOIN debtorsmaster + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch + INNER JOIN custbranch ON debtorsmaster.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN currencies @@ -813,12 +813,12 @@ /*show a table of the orders returned by the SQL */ if (DB_num_rows($SalesOrdersResult)>0) { - + /* Get users authority to place POs */ $AuthSQL="SELECT cancreate FROM purchorderauth WHERE userid='". $_SESSION['UserID'] . "'"; - + /*we don't know what currency these orders might be in but if no authority at all then don't show option*/ $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); @@ -837,7 +837,7 @@ <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> <th>' . _('Order Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th>'; - + if ($AuthRow['cancreate']==0){ //If cancreate==0 then this means the user can create orders hmmm!! $tableheader .= '<th>' . _('Place PO') . '</th></tr>'; } else { @@ -863,7 +863,7 @@ $j = 1; $k=0; //row colour counter $OrdersTotal =0; - + while ($myrow=DB_fetch_array($SalesOrdersResult)) { @@ -877,25 +877,26 @@ $ModifyPage = $rootpath . '/SelectOrderItems.php?ModifyOrderNumber=' . $myrow['orderno']; $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?OrderNumber=' .$myrow['orderno']; - + if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $myrow['orderno']; } else { /*pre-printed stationery default */ $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?TransNo=' . $myrow['orderno']; } $PrintQuotation = $rootpath . '/PDFQuotation.php?QuotationNo=' . $myrow['orderno']; + $PrintQuotationPortrait = $rootpath . '/PDFQuotationPortrait.php?QuotationNo=' . $myrow['orderno']; $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$_SESSION['CompanyRecord']['decimalplaces']); - + if ($myrow['printedpackingslip']==0) { $PrintText = _('Print'); } else { $PrintText = _('Reprint'); } - + if ($_POST['Quotations']=='Orders_Only'){ - + /*Check authority to create POs if user has authority then show the check boxes to select sales orders to place POs for otherwise don't provide this option */ if ($AuthRow['cancreate']==0 AND $myrow['poplaced']==0){ //cancreate==0 if the user can create POs and not already placed printf('<td><a href="%s">%s</a></td> @@ -948,10 +949,10 @@ html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue); } - + } else { /*must be quotes only */ printf('<td><a href="%s">%s</a></td> - <td><a target="_blank" href="%s">' . $PrintText . '</a></td> + <td><a target="_blank" href="%s">' . _('Landscape') . '</a> <a target="_blank" href="%s">' . _('Portrait') . '</a></td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -963,6 +964,7 @@ $ModifyPage, $myrow['orderno'], $PrintQuotation, + $PrintQuotationPortrait, $myrow['name'], $myrow['brname'], $myrow['customerref'], @@ -980,9 +982,9 @@ } //end of page full new headings if }//end while loop through orders to display - if ($_POST['Quotations']=='Orders_Only' + if ($_POST['Quotations']=='Orders_Only' AND $AuthRow['cancreate']==0){ //cancreate==0 means can create POs - + echo '<tr><td colspan="11" class="number"><input type="submit" name="PlacePO" value="' . _('Place') . " " . _('PO') . '" onclick="return confirm(\'' . _('This will create purchase orders for all the items on the checked sales orders above, based on the preferred supplier purchasing data held in the system. Are You Absolutely Sure?') . '\');" /></td</tr>'; } echo '<tr><td colspan="9" class="number">'; @@ -995,7 +997,7 @@ <td class="number"><b>' . locale_number_format($OrdersTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr> </table>'; - } //end if there are some orders to show + } //end if there are some orders to show } echo '</div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-06-29 23:40:14
|
Revision: 5465 http://web-erp.svn.sourceforge.net/web-erp/?rev=5465&view=rev Author: daintree Date: 2012-06-29 23:40:08 +0000 (Fri, 29 Jun 2012) Log Message: ----------- attempt to make quicker GetPrice function Modified Paths: -------------- trunk/StockAdjustments.php trunk/WorkOrderEntry.php trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/includes/GetPrice.inc Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/StockAdjustments.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -455,7 +455,7 @@ } echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment' . $identifier]->Quantity . '" /> '.locale_number_format($_SESSION['Adjustment' . $identifier]->Quantity,$DecimalPlaces) .' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&dentifier='.$identifier.'">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&identifier='.$identifier.'">'._('Remove').'</a>] [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&identifier='.$identifier.'">'._('Add').'</a>]'; } else { echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '" />'; Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/WorkOrderEntry.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -88,7 +88,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.description " . LIKE . " '$SearchString' AND stockmaster.discontinued=0 AND mbflag='M' @@ -100,7 +100,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -113,6 +113,7 @@ $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; + /* Only items of stock type F finished goods or M - raw materials can have work orders created - raw materials can include the manufacture of components (as noted by Bob Thomas! */ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, stockmaster.description, @@ -120,7 +121,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 AND mbflag='M' @@ -132,7 +133,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -147,7 +148,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.discontinued=0 AND mbflag='M' ORDER BY stockmaster.stockid"; @@ -158,7 +159,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' AND mbflag='M' @@ -339,12 +340,12 @@ nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."', stdcost ='" . $Cost . "' WHERE wo='" . $_POST['WO'] . "' - AND stockid='" . $_POST['OutputItem'.$i] . "'"; + AND stockid='" . $_POST['OutputItem'.$i] . "'"; } elseif (isset($_POST['HasWOSerialNos'.$i]) AND $_POST['HasWOSerialNos'.$i]==false) { $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."' WHERE wo='" . $_POST['WO'] . "' - AND stockid='" . $_POST['OutputItem'.$i] . "'"; + AND stockid='" . $_POST['OutputItem'.$i] . "'"; } } @@ -375,8 +376,8 @@ // can't delete it there are open work issues $HasTransResult = DB_query("SELECT transno FROM stockmoves - WHERE (stockmoves.type= 26 OR stockmoves.type=28) - AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); + WHERE (stockmoves.type= 26 OR stockmoves.type=28) + AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); if (DB_num_rows($HasTransResult)>0){ prnMsg(_('This work order cannot be deleted because it has issues or receipts related to it'),'error'); $CancelDelete=true; @@ -429,9 +430,8 @@ startdate, costissued, closed - FROM workorders - INNER JOIN locations - ON workorders.loccode=locations.loccode + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode WHERE workorders.wo='" . $_POST['WO'] . "'"; $WOResult = DB_query($sql,$db); @@ -454,9 +454,8 @@ serialised, stockmaster.decimalplaces, nextserialno - FROM woitems - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid + FROM woitems INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid WHERE wo='" .$_POST['WO'] . "'",$db,$ErrMsg); $NumberOfOutputs=DB_num_rows($WOItemsResult); @@ -586,7 +585,7 @@ $SQL="SELECT categoryid, categorydescription FROM stockcategory - WHERE stocktype='F' OR stocktype='D' + WHERE stocktype='F' OR stocktype='M' ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/api/api_php.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -15,6 +15,7 @@ include($PathPrefix . 'includes/SQL_CommonFunctions.inc'); /* Required for creating invoices/credits */ include($PathPrefix . 'includes/GetSalesTransGLCodes.inc'); + include($PathPrefix . 'includes/POSDataCreation.php'); /* Get weberp authentication, and return a valid database connection */ Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/api/api_webERPsettings.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -90,10 +90,9 @@ $ReturnValue[1]=$answer; return $ReturnValue; } - + /* This function creates a POS zipped update file */ - include('../../includes/POSDataCreation.php'); function CreatePOSDataFull($POSDebtorNo, $POSBranchCode, $User, $Password) { $Errors = array(); Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/includes/GetPrice.inc 2012-06-29 23:40:08 UTC (rev 5465) @@ -15,7 +15,7 @@ AND prices.branchcode='" . $BranchCode . "' AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'"; - + $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); $result = DB_query($sql, $db,$ErrMsg); if (DB_num_rows($result)==0){ @@ -33,11 +33,11 @@ AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate ='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql, $db,$ErrMsg); - + if (DB_num_rows($result)==0){ - + /* No result returned for customer and branch search try for just a customer match */ $sql = "SELECT prices.price FROM prices, @@ -50,8 +50,8 @@ AND prices.branchcode='' AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'"; - - + + $result = DB_query($sql,$db,$ErrMsg); if (DB_num_rows($result)==0){ //if no specific price between the dates maybe there is a default price with no end date specified @@ -68,11 +68,11 @@ AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql,$db,$ErrMsg); - + if (DB_num_rows($result)==0){ - + /*No special customer specific pricing use the customers normal price list but look for special limited time prices with specific end date*/ $sql = "SELECT prices.price FROM prices, @@ -80,13 +80,13 @@ WHERE debtorsmaster.salestype=prices.typeabbrev AND debtorsmaster.debtorno='" . $DebtorNo . "' AND prices.stockid = '" . $StockID . "' - AND prices.debtorno='' + AND prices.debtorno='' AND prices.currabrev = debtorsmaster.currcode AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'"; - + $result = DB_query($sql,$db,$ErrMsg); - + if (DB_num_rows($result)==0){ /*No special customer specific pricing use the customers normal price list but look for default price with 0000-00-00 end date*/ $sql = "SELECT prices.price, @@ -96,19 +96,19 @@ WHERE debtorsmaster.salestype=prices.typeabbrev AND debtorsmaster.debtorno='" . $DebtorNo . "' AND prices.stockid = '" . $StockID . "' - AND prices.debtorno='' + AND prices.debtorno='' AND prices.currabrev = debtorsmaster.currcode AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate ='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql,$db,$ErrMsg); - - if (DB_num_rows($result)==0){ - + + if (DB_num_rows($result)==0){ + /* Now use the default salestype/price list cos all else has failed */ $sql="SELECT prices.price - FROM prices, + FROM prices, debtorsmaster WHERE prices.stockid = '" . $StockID . "' AND prices.currabrev = debtorsmaster.currcode @@ -117,11 +117,11 @@ AND prices.debtorno='' AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'";; - + $result = DB_query($sql, $db,$ErrMsg); - - if (DB_num_rows($result)==0){ - + + if (DB_num_rows($result)==0){ + /* Now use the default salestype/price list cos all else has failed */ $sql="SELECT prices.price, prices.startdate @@ -135,9 +135,9 @@ AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate ='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql, $db,$ErrMsg); - + if (DB_num_rows($result)==0){ /*Not even a price set up in the default price list so return 0 */ if ($ReportZeroPrice ==1){ @@ -164,4 +164,61 @@ } +function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $db){ + + $Price = 0; + + $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev + FROM prices INNER JOIN debtorsmaster + AND prices.currabrev = debtorsmaster.currcode + WHERE debtorsmaster.debtorno='" . $DebtorNo . "' + AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "') + AND prices.stockid = '" . $StockID . "' + AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') + AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') + AND prices.startdate <='" . Date('Y-m-d') . "' + AND (prices.enddate >='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; + + $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); + $result = DB_query($sql, $db,$ErrMsg); + if (DB_num_rows($result)==0){ + return $Price; + } else { + $PricesArray = array(); + $RankArray = array(); + $i = 0; + while ($myrow=DB_fetch_row($result)){ + $Prices[$i]['Price'] = $myrow['price']; + $Prices[$i]['DebtorNo'] = $myrow['debtorno']; + $Prices[$i]['BranchCode'] = $myrow['branchcode']; + $Prices[$i]['EndDate'] = $myrow['enddate']; + if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { + $Rank[$i] = 1; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { + $Rank[$i] = 2; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 3; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ + $Rank[$i] = 4; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList'] AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 5; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList']){ + $Rank[$i] = 6; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 7; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ + $Rank[$i] = 8; + } + $i++; + } + $LowestRank = 10; + foreach ($RankArray as $ArrayElement=>$Ranking) { + if ($Ranking < $LowestRank){ + $LowestRankElement = $ArrayElement; + $LowestRank = $Ranking; + } + } + return $Prices[$ArrayElement]['Price']; + } +} ?> \ 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...> - 2012-06-29 23:40:14
|
Revision: 5465 http://web-erp.svn.sourceforge.net/web-erp/?rev=5465&view=rev Author: daintree Date: 2012-06-29 23:40:08 +0000 (Fri, 29 Jun 2012) Log Message: ----------- attempt to make quicker GetPrice function Modified Paths: -------------- trunk/StockAdjustments.php trunk/WorkOrderEntry.php trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/includes/GetPrice.inc Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/StockAdjustments.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -455,7 +455,7 @@ } echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment' . $identifier]->Quantity . '" /> '.locale_number_format($_SESSION['Adjustment' . $identifier]->Quantity,$DecimalPlaces) .' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&dentifier='.$identifier.'">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&identifier='.$identifier.'">'._('Remove').'</a>] [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&identifier='.$identifier.'">'._('Add').'</a>]'; } else { echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '" />'; Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/WorkOrderEntry.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -88,7 +88,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.description " . LIKE . " '$SearchString' AND stockmaster.discontinued=0 AND mbflag='M' @@ -100,7 +100,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -113,6 +113,7 @@ $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; + /* Only items of stock type F finished goods or M - raw materials can have work orders created - raw materials can include the manufacture of components (as noted by Bob Thomas! */ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, stockmaster.description, @@ -120,7 +121,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 AND mbflag='M' @@ -132,7 +133,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -147,7 +148,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.discontinued=0 AND mbflag='M' ORDER BY stockmaster.stockid"; @@ -158,7 +159,7 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='M') AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' AND mbflag='M' @@ -339,12 +340,12 @@ nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."', stdcost ='" . $Cost . "' WHERE wo='" . $_POST['WO'] . "' - AND stockid='" . $_POST['OutputItem'.$i] . "'"; + AND stockid='" . $_POST['OutputItem'.$i] . "'"; } elseif (isset($_POST['HasWOSerialNos'.$i]) AND $_POST['HasWOSerialNos'.$i]==false) { $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."' WHERE wo='" . $_POST['WO'] . "' - AND stockid='" . $_POST['OutputItem'.$i] . "'"; + AND stockid='" . $_POST['OutputItem'.$i] . "'"; } } @@ -375,8 +376,8 @@ // can't delete it there are open work issues $HasTransResult = DB_query("SELECT transno FROM stockmoves - WHERE (stockmoves.type= 26 OR stockmoves.type=28) - AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); + WHERE (stockmoves.type= 26 OR stockmoves.type=28) + AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); if (DB_num_rows($HasTransResult)>0){ prnMsg(_('This work order cannot be deleted because it has issues or receipts related to it'),'error'); $CancelDelete=true; @@ -429,9 +430,8 @@ startdate, costissued, closed - FROM workorders - INNER JOIN locations - ON workorders.loccode=locations.loccode + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode WHERE workorders.wo='" . $_POST['WO'] . "'"; $WOResult = DB_query($sql,$db); @@ -454,9 +454,8 @@ serialised, stockmaster.decimalplaces, nextserialno - FROM woitems - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid + FROM woitems INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid WHERE wo='" .$_POST['WO'] . "'",$db,$ErrMsg); $NumberOfOutputs=DB_num_rows($WOItemsResult); @@ -586,7 +585,7 @@ $SQL="SELECT categoryid, categorydescription FROM stockcategory - WHERE stocktype='F' OR stocktype='D' + WHERE stocktype='F' OR stocktype='M' ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/api/api_php.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -15,6 +15,7 @@ include($PathPrefix . 'includes/SQL_CommonFunctions.inc'); /* Required for creating invoices/credits */ include($PathPrefix . 'includes/GetSalesTransGLCodes.inc'); + include($PathPrefix . 'includes/POSDataCreation.php'); /* Get weberp authentication, and return a valid database connection */ Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/api/api_webERPsettings.php 2012-06-29 23:40:08 UTC (rev 5465) @@ -90,10 +90,9 @@ $ReturnValue[1]=$answer; return $ReturnValue; } - + /* This function creates a POS zipped update file */ - include('../../includes/POSDataCreation.php'); function CreatePOSDataFull($POSDebtorNo, $POSBranchCode, $User, $Password) { $Errors = array(); Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-06-29 18:54:34 UTC (rev 5464) +++ trunk/includes/GetPrice.inc 2012-06-29 23:40:08 UTC (rev 5465) @@ -15,7 +15,7 @@ AND prices.branchcode='" . $BranchCode . "' AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'"; - + $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); $result = DB_query($sql, $db,$ErrMsg); if (DB_num_rows($result)==0){ @@ -33,11 +33,11 @@ AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate ='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql, $db,$ErrMsg); - + if (DB_num_rows($result)==0){ - + /* No result returned for customer and branch search try for just a customer match */ $sql = "SELECT prices.price FROM prices, @@ -50,8 +50,8 @@ AND prices.branchcode='' AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'"; - - + + $result = DB_query($sql,$db,$ErrMsg); if (DB_num_rows($result)==0){ //if no specific price between the dates maybe there is a default price with no end date specified @@ -68,11 +68,11 @@ AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql,$db,$ErrMsg); - + if (DB_num_rows($result)==0){ - + /*No special customer specific pricing use the customers normal price list but look for special limited time prices with specific end date*/ $sql = "SELECT prices.price FROM prices, @@ -80,13 +80,13 @@ WHERE debtorsmaster.salestype=prices.typeabbrev AND debtorsmaster.debtorno='" . $DebtorNo . "' AND prices.stockid = '" . $StockID . "' - AND prices.debtorno='' + AND prices.debtorno='' AND prices.currabrev = debtorsmaster.currcode AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'"; - + $result = DB_query($sql,$db,$ErrMsg); - + if (DB_num_rows($result)==0){ /*No special customer specific pricing use the customers normal price list but look for default price with 0000-00-00 end date*/ $sql = "SELECT prices.price, @@ -96,19 +96,19 @@ WHERE debtorsmaster.salestype=prices.typeabbrev AND debtorsmaster.debtorno='" . $DebtorNo . "' AND prices.stockid = '" . $StockID . "' - AND prices.debtorno='' + AND prices.debtorno='' AND prices.currabrev = debtorsmaster.currcode AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate ='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql,$db,$ErrMsg); - - if (DB_num_rows($result)==0){ - + + if (DB_num_rows($result)==0){ + /* Now use the default salestype/price list cos all else has failed */ $sql="SELECT prices.price - FROM prices, + FROM prices, debtorsmaster WHERE prices.stockid = '" . $StockID . "' AND prices.currabrev = debtorsmaster.currcode @@ -117,11 +117,11 @@ AND prices.debtorno='' AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate >='" . Date('Y-m-d') . "'";; - + $result = DB_query($sql, $db,$ErrMsg); - - if (DB_num_rows($result)==0){ - + + if (DB_num_rows($result)==0){ + /* Now use the default salestype/price list cos all else has failed */ $sql="SELECT prices.price, prices.startdate @@ -135,9 +135,9 @@ AND prices.startdate <='" . Date('Y-m-d') . "' AND prices.enddate ='0000-00-00' ORDER BY prices.startdate DESC"; - + $result = DB_query($sql, $db,$ErrMsg); - + if (DB_num_rows($result)==0){ /*Not even a price set up in the default price list so return 0 */ if ($ReportZeroPrice ==1){ @@ -164,4 +164,61 @@ } +function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $db){ + + $Price = 0; + + $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev + FROM prices INNER JOIN debtorsmaster + AND prices.currabrev = debtorsmaster.currcode + WHERE debtorsmaster.debtorno='" . $DebtorNo . "' + AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "') + AND prices.stockid = '" . $StockID . "' + AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') + AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') + AND prices.startdate <='" . Date('Y-m-d') . "' + AND (prices.enddate >='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; + + $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); + $result = DB_query($sql, $db,$ErrMsg); + if (DB_num_rows($result)==0){ + return $Price; + } else { + $PricesArray = array(); + $RankArray = array(); + $i = 0; + while ($myrow=DB_fetch_row($result)){ + $Prices[$i]['Price'] = $myrow['price']; + $Prices[$i]['DebtorNo'] = $myrow['debtorno']; + $Prices[$i]['BranchCode'] = $myrow['branchcode']; + $Prices[$i]['EndDate'] = $myrow['enddate']; + if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { + $Rank[$i] = 1; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { + $Rank[$i] = 2; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 3; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ + $Rank[$i] = 4; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList'] AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 5; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList']){ + $Rank[$i] = 6; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 7; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ + $Rank[$i] = 8; + } + $i++; + } + $LowestRank = 10; + foreach ($RankArray as $ArrayElement=>$Ranking) { + if ($Ranking < $LowestRank){ + $LowestRankElement = $ArrayElement; + $LowestRank = $Ranking; + } + } + return $Prices[$ArrayElement]['Price']; + } +} ?> \ 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...> - 2012-07-01 02:53:07
|
Revision: 5466 http://web-erp.svn.sourceforge.net/web-erp/?rev=5466&view=rev Author: daintree Date: 2012-07-01 02:53:00 +0000 (Sun, 01 Jul 2012) Log Message: ----------- Modified Paths: -------------- trunk/Z_POS_Data.php trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/config.distrib.php trunk/doc/Change.log trunk/includes/GetPrice.inc trunk/includes/Z_POSDataCreation.php Modified: trunk/Z_POS_Data.php =================================================================== --- trunk/Z_POS_Data.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/Z_POS_Data.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -3,12 +3,21 @@ /* $Id: Z_POS_Data.php 3843 2010-09-30 14:49:45Z daintree $*/ $PageSecurity = 9; +/* Note: For really large databases need to change config.php MaxExecutionTime = 1000; or similar */ + include('includes/session.inc'); $title = _('Create POS Data Upload File'); include('includes/header.inc'); +if (isset($_GET['Delete'])){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + prnMsg(_('Old POS upload files deleted'),'info'); +} + + if (!isset($_GET['POSDebtorNo']) AND !isset($_GET['POSBranchCode'])){ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Create POS Data File') . '" alt="">' . ' ' . $title.'<br />'; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '><br>'; @@ -54,10 +63,10 @@ if ($InputError ==0) { include('includes/Z_POSDataCreation.php'); - if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ - echo '<br /> - <br /> - <a href="' . $_SESSION['reports_dir'] . '/POS.sql.zip">' . _('Download POS Upload File') . '</a>'; + if (Create_POS_Data_Full($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) == 1 ){ + echo '<br /> + <br /> + <a href="' . $_SESSION['reports_dir'] . '/POS.sql.zip">' . _('Download POS Upload File') . '</a>'; } else { prnMsg(_('Unable to create POS Data file - perhaps the POS Customer Code or Branch Code do not exist'),'error'); } @@ -65,5 +74,9 @@ } // end if no input errors } //hit create POSDataFile +if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + prnMsg(_('It is important to delete the POS Data file after it has been retrieved - use the link below to delete it'),'warn'); + echo '<p><a href="' . $_SERVER['PHP_SELF'] . '?Delete=Yes">' . _('Delete the POS Upload File') . '</a></p>'; +} include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/api/api_php.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -3,7 +3,7 @@ /* Include session.inc, to allow database connection, and access to miscfunctions, and datefunctions.*/ // FOLLOWING ONLY REQUIRED TO SUPPORT PER FUNCTION AUTHENTICATION - $api_DatabaseName='weberpdemo'; + $api_DatabaseName='ipartx_erp'; // END OF OLD STYLE AUTHENTICATION $AllowAnyone = true; @@ -15,7 +15,7 @@ include($PathPrefix . 'includes/SQL_CommonFunctions.inc'); /* Required for creating invoices/credits */ include($PathPrefix . 'includes/GetSalesTransGLCodes.inc'); - include($PathPrefix . 'includes/POSDataCreation.php'); + include($PathPrefix . 'includes/Z_POSDataCreation.php'); /* Get weberp authentication, and return a valid database connection */ Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/api/api_webERPsettings.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -101,12 +101,24 @@ $Errors[0]=NoAuthorisation; return $Errors; } - if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ - $ReturnValue=0; + + if (Create_POS_Data_Full($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ + $ReturnValue[0]=0; } else { - $ReturnValue=1; + $ReturnValue[0]=1; } return $ReturnValue; } + function DeletePOSData($User, $Password) { + $Errors = array(); + $db = db($User, $Password); + if (gettype($db)=='integer') { + $Errors[0]=NoAuthorisation; + return $Errors; + } + Delete_POS_Data(); + $ReturnValue[0]=0; + return $ReturnValue; + } -?> +?> \ No newline at end of file Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/api/api_xml-rpc.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -1140,7 +1140,7 @@ ob_end_flush(); return $rtn; } - + unset($Description); unset($Parameter); unset($ReturnValue); @@ -1475,7 +1475,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $Description = _('This function returns a list of stock location ids.'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); @@ -2971,28 +2971,57 @@ $Parameter[3]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('If successful this function returns 0 for success and 1 for error. '); - $GetCreatePOSDataFull_sig = array(array($xmlrpcStruct), + $CreatePOSDataFull_sig = array(array($xmlrpcStruct), array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); - $GetCreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + $CreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), -/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), $xmlrpcmsg->getParam( 2 )->scalarval( ), $xmlrpcmsg->getParam( 3 )->scalarval( ))) ); /*x*/ } else { /*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull( $xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), - '', + '', ''))); /*x*/ } ob_end_flush(); return $rtn; } + unset($Description); + unset($Parameter); + unset($ReturnValue); + $Description = _('This function deletes a POS data file on the webERP server'); + $Parameter[0]['name'] = _('User name'); + $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[1]['name'] = _('User password'); + $Parameter[1]['description'] = _('The weberp password associated with this user name. '); + $ReturnValue[0] = _('Returns 0 if the delete POS Data was successfull'); + +/*E*/$DeletePOSData_sig = array(array($xmlrpcStruct), +/*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); + $DeletePOSData_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + + + function xmlrpc_DeletePOSData($xmlrpcmsg){ + ob_start('ob_file_callback'); +/*x*/ if ($xmlrpcmsg->getNumParams() == 2) { +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); +/*x*/ } else { +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '', + ''))); +/*x*/ } + ob_end_flush(); + return $rtn; + } + + unset($Description); unset($Parameter); unset($ReturnValue); @@ -3413,6 +3442,14 @@ "function" => "xmlrpc_GetDefaultLocation", "signature" => $GetDefaultLocation_sig, "docstring" => $GetDefaultLocation_doc), + "weberp.xmlrpc_CreatePOSDataFull" => array( + "function" => "xmlrpc_CreatePOSDataFull", + "signature" => $CreatePOSDataFull_sig, + "docstring" => $CreatePOSDataFull_doc), + "weberp.xmlrpc_DeletePOSData" => array( + "function" => "xmlrpc_DeletePOSData", + "signature" => $DeletePOSData_sig, + "docstring" => $DeletePOSData_doc), "weberp.xmlrpc_GetStockCatProperty" => array( "function" => "xmlrpc_GetStockCatProperty", "signature" => $GetStockCatProperty_sig, @@ -3424,7 +3461,7 @@ ) ); - + // Generate the HTMLised description string for each API. function apiBuildDocHTML( $description, $parameter, $return ) Modified: trunk/config.distrib.php =================================================================== --- trunk/config.distrib.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/config.distrib.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -18,10 +18,12 @@ // The timezone of the business - this allows the possibility of having // the web-server on a overseas machine but record local time // this is not necessary if you have your own server locally -putenv('TZ=Europe/London'); -// putenv('TZ=Australia/Melbourne'); -// putenv('TZ=Australia/Sydney'); -//putenv('TZ=Pacific/Auckland'); +//date_default_timezone_set('Europe/London'); +//date_default_timezone_set('America/Los_Angeles'); +date_default_timezone_set('Asia/Shanghai'); +//date_default_timezone_set('Australia/Melbourne'); +//date_default_timezone_set('Australia/Sydney'); +//date_default_timezone_set('Pacific/Auckland'); // Connection information for the database // $host is the computer ip address or name where the database is located Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/doc/Change.log 2012-07-01 02:53:00 UTC (rev 5466) @@ -1,5 +1,7 @@ webERP Change Log +30/6/12 Phil: Attempt at quicker price retrieval +30/6/12 Phil: Allow creation of work orders for Raw materials - well intermediary components manufacture - per Bob Thomas email 26/06/12 Bob Thomas: StockAdjustments fix link to controlled stock adjustments entry 24/06/2012 Phil: Added tooltip/title showing long description on many scripts where short description is currently shown SelectOrderItems.php SelectCreditItems.php CreditInvoice.php DeliveryDetails.php CounterSales.php RecurringSalesOrders.php 24/06/2012 Icedlava: Add ViewTopic and BookMark vars to some functions to take advantage of new Manual contextual help. Must be added before header.inc include. Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/includes/GetPrice.inc 2012-07-01 02:53:00 UTC (rev 5466) @@ -170,7 +170,7 @@ $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev FROM prices INNER JOIN debtorsmaster - AND prices.currabrev = debtorsmaster.currcode + ON prices.currabrev = debtorsmaster.currcode WHERE debtorsmaster.debtorno='" . $DebtorNo . "' AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "') AND prices.stockid = '" . $StockID . "' @@ -187,7 +187,7 @@ $PricesArray = array(); $RankArray = array(); $i = 0; - while ($myrow=DB_fetch_row($result)){ + while ($myrow=DB_fetch_array($result)){ $Prices[$i]['Price'] = $myrow['price']; $Prices[$i]['DebtorNo'] = $myrow['debtorno']; $Prices[$i]['BranchCode'] = $myrow['branchcode']; Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/includes/Z_POSDataCreation.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -1,6 +1,6 @@ <?php -function CreatePOSDataFull ( $POSDebtorNo, $POSBranchCode, $db) { +function Create_POS_Data_Full ( $POSDebtorNo, $POSBranchCode, $db) { $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); $CustomerRow = DB_fetch_array($result); if (DB_num_rows($result)==0){ @@ -11,11 +11,15 @@ $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); + if ($FileHandle == false){ + return 0; + } + fwrite($FileHandle,"DELETE FROM currencies;\n"); $result = DB_query('SELECT currency, currabrev, country, hundredsname,decimalplaces, rate FROM currencies',$db); while ($CurrRow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO currencies VALUES ('" . $CurrRow['currency'] . "', '" . $CurrRow['currabrev'] . "', '" . sqlite_escape_string ($CurrRow['country']) . "', '" . sqlite_escape_string ($CurrRow['hundredsname']) . "', '" .$CurrRow['decimalplaces'] . "', '" .$CurrRow['rate'] . "');\n"); + fwrite($FileHandle,"INSERT INTO currencies VALUES ('" . $CurrRow['currency'] . "', '" . $CurrRow['currabrev'] . "', '" . SQLite_Escape ($CurrRow['country']) . "', '" . SQLite_Escape ($CurrRow['hundredsname']) . "', '" .$CurrRow['decimalplaces'] . "', '" .$CurrRow['rate'] . "');\n"); } @@ -24,7 +28,7 @@ $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . sqlite_escape_string ($myrow['sales_type']) . "');\n"); + fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . SQLite_Escape ($myrow['sales_type']) . "');\n"); } fwrite($FileHandle,"DELETE FROM holdreasons;\n"); @@ -32,7 +36,7 @@ $result = DB_query('SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . sqlite_escape_string ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); + fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . SQLite_Escape ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); } fwrite($FileHandle,"DELETE FROM paymentterms;\n"); @@ -40,7 +44,7 @@ $result = DB_query('SELECT termsindicator, terms FROM paymentterms',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . sqlite_escape_string ($myrow['terms']) . "');\n"); + fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . SQLite_Escape ($myrow['terms']) . "');\n"); } @@ -48,7 +52,7 @@ $result = DB_query('SELECT paymentid, paymentname,opencashdrawer FROM paymentmethods',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . sqlite_escape_string ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); + fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . SQLite_Escape ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); } @@ -56,7 +60,7 @@ $result = DB_query('SELECT loccode, locationname,taxprovinceid FROM locations',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . sqlite_escape_string ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); + fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . SQLite_Escape ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); } @@ -64,14 +68,14 @@ $result = DB_query('SELECT categoryid, categorydescription FROM stockcategory',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . sqlite_escape_string ($myrow['categorydescription']) . "');\n"); + fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . SQLite_Escape ($myrow['categorydescription']) . "');\n"); } fwrite($FileHandle,"DELETE FROM taxgroups;\n"); $result = DB_query('SELECT taxgroupid, taxgroupdescription FROM taxgroups',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . sqlite_escape_string ($myrow['taxgroupdescription']) . "');\n"); + fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . SQLite_Escape ($myrow['taxgroupdescription']) . "');\n"); } @@ -86,7 +90,7 @@ $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . sqlite_escape_string ($myrow['description']) . "');\n"); + fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . SQLite_Escape ($myrow['description']) . "');\n"); } fwrite($FileHandle,"DELETE FROM taxauthrates;\n"); @@ -100,8 +104,8 @@ $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0",$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . sqlite_escape_string ($myrow['stockid']) . "', '" . sqlite_escape_string ($myrow['categoryid']) . "', '" . sqlite_escape_string ($myrow['description']) . "', '" . sqlite_escape_string (str_replace("\n", '', $myrow['longdescription'])) . "', '" . sqlite_escape_string ($myrow['units']) . "', '" . sqlite_escape_string ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); - $Price = GetPrice ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db,0); + fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); + $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db); if ($Price!=0) { fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); } @@ -111,14 +115,14 @@ $result = DB_query("SELECT debtorno, name, currcode, salestype, holdreason, paymentterms, discount, creditlimit, discountcode FROM debtorsmaster WHERE currcode='". $CurrCode . "'",$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . sqlite_escape_string ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); + fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . SQLite_Escape ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . SQLite_Escape ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); } fwrite($FileHandle,"DELETE FROM custbranch;\n"); $result = DB_query("SELECT branchcode, debtorsmaster.debtorno, brname, contactname, specialinstructions,taxgroupid FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE debtorsmaster.currcode='". $CurrCode . "'",$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO custbranch VALUES ('" . $myrow['branchcode'] . "', '" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['brname']) . "', '" . sqlite_escape_string ($myrow['contactname']) . "', '" . sqlite_escape_string ($myrow['specialinstructions']) . "', '" . $myrow['taxgroupid'] . "');\n"); + fwrite($FileHandle,"INSERT INTO custbranch VALUES ('" . $myrow['branchcode'] . "', '" . $myrow['debtorno'] . "', '" . SQLite_Escape ($myrow['brname']) . "', '" . SQLite_Escape ($myrow['contactname']) . "', '" . SQLite_Escape ($myrow['specialinstructions']) . "', '" . $myrow['taxgroupid'] . "');\n"); } @@ -134,6 +138,25 @@ } $ZipFile->addFile($_SESSION['reports_dir'] . '/POS.sql','POS.sql'); $ZipFile->close(); + //delete the original big sql file as we now have the zip for transferring + unlink($_SESSION['reports_dir'] . '/POS.sql'); + return 1; } +function SQLite_Escape($String) { + $SearchCharacters = array('&', '"', "'",'<', '>',"\n","\r" ); + $ReplaceWith = array('&', '""', "''", '<', '>', '', ' '); + + $String = str_replace($SearchCharacters, $ReplaceWith, $String); + return $String; +} +function Delete_POS_Data(){ + if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + } + if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + } + return 1; +} ?> \ 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...> - 2012-07-01 02:53:07
|
Revision: 5466 http://web-erp.svn.sourceforge.net/web-erp/?rev=5466&view=rev Author: daintree Date: 2012-07-01 02:53:00 +0000 (Sun, 01 Jul 2012) Log Message: ----------- Modified Paths: -------------- trunk/Z_POS_Data.php trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/config.distrib.php trunk/doc/Change.log trunk/includes/GetPrice.inc trunk/includes/Z_POSDataCreation.php Modified: trunk/Z_POS_Data.php =================================================================== --- trunk/Z_POS_Data.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/Z_POS_Data.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -3,12 +3,21 @@ /* $Id: Z_POS_Data.php 3843 2010-09-30 14:49:45Z daintree $*/ $PageSecurity = 9; +/* Note: For really large databases need to change config.php MaxExecutionTime = 1000; or similar */ + include('includes/session.inc'); $title = _('Create POS Data Upload File'); include('includes/header.inc'); +if (isset($_GET['Delete'])){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + prnMsg(_('Old POS upload files deleted'),'info'); +} + + if (!isset($_GET['POSDebtorNo']) AND !isset($_GET['POSBranchCode'])){ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Create POS Data File') . '" alt="">' . ' ' . $title.'<br />'; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '><br>'; @@ -54,10 +63,10 @@ if ($InputError ==0) { include('includes/Z_POSDataCreation.php'); - if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ - echo '<br /> - <br /> - <a href="' . $_SESSION['reports_dir'] . '/POS.sql.zip">' . _('Download POS Upload File') . '</a>'; + if (Create_POS_Data_Full($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) == 1 ){ + echo '<br /> + <br /> + <a href="' . $_SESSION['reports_dir'] . '/POS.sql.zip">' . _('Download POS Upload File') . '</a>'; } else { prnMsg(_('Unable to create POS Data file - perhaps the POS Customer Code or Branch Code do not exist'),'error'); } @@ -65,5 +74,9 @@ } // end if no input errors } //hit create POSDataFile +if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + prnMsg(_('It is important to delete the POS Data file after it has been retrieved - use the link below to delete it'),'warn'); + echo '<p><a href="' . $_SERVER['PHP_SELF'] . '?Delete=Yes">' . _('Delete the POS Upload File') . '</a></p>'; +} include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/api/api_php.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -3,7 +3,7 @@ /* Include session.inc, to allow database connection, and access to miscfunctions, and datefunctions.*/ // FOLLOWING ONLY REQUIRED TO SUPPORT PER FUNCTION AUTHENTICATION - $api_DatabaseName='weberpdemo'; + $api_DatabaseName='ipartx_erp'; // END OF OLD STYLE AUTHENTICATION $AllowAnyone = true; @@ -15,7 +15,7 @@ include($PathPrefix . 'includes/SQL_CommonFunctions.inc'); /* Required for creating invoices/credits */ include($PathPrefix . 'includes/GetSalesTransGLCodes.inc'); - include($PathPrefix . 'includes/POSDataCreation.php'); + include($PathPrefix . 'includes/Z_POSDataCreation.php'); /* Get weberp authentication, and return a valid database connection */ Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/api/api_webERPsettings.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -101,12 +101,24 @@ $Errors[0]=NoAuthorisation; return $Errors; } - if (CreatePOSDataFull($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ - $ReturnValue=0; + + if (Create_POS_Data_Full($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ + $ReturnValue[0]=0; } else { - $ReturnValue=1; + $ReturnValue[0]=1; } return $ReturnValue; } + function DeletePOSData($User, $Password) { + $Errors = array(); + $db = db($User, $Password); + if (gettype($db)=='integer') { + $Errors[0]=NoAuthorisation; + return $Errors; + } + Delete_POS_Data(); + $ReturnValue[0]=0; + return $ReturnValue; + } -?> +?> \ No newline at end of file Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/api/api_xml-rpc.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -1140,7 +1140,7 @@ ob_end_flush(); return $rtn; } - + unset($Description); unset($Parameter); unset($ReturnValue); @@ -1475,7 +1475,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $Description = _('This function returns a list of stock location ids.'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); @@ -2971,28 +2971,57 @@ $Parameter[3]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('If successful this function returns 0 for success and 1 for error. '); - $GetCreatePOSDataFull_sig = array(array($xmlrpcStruct), + $CreatePOSDataFull_sig = array(array($xmlrpcStruct), array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); - $GetCreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + $CreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), -/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), $xmlrpcmsg->getParam( 2 )->scalarval( ), $xmlrpcmsg->getParam( 3 )->scalarval( ))) ); /*x*/ } else { /*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull( $xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), - '', + '', ''))); /*x*/ } ob_end_flush(); return $rtn; } + unset($Description); + unset($Parameter); + unset($ReturnValue); + $Description = _('This function deletes a POS data file on the webERP server'); + $Parameter[0]['name'] = _('User name'); + $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[1]['name'] = _('User password'); + $Parameter[1]['description'] = _('The weberp password associated with this user name. '); + $ReturnValue[0] = _('Returns 0 if the delete POS Data was successfull'); + +/*E*/$DeletePOSData_sig = array(array($xmlrpcStruct), +/*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); + $DeletePOSData_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + + + function xmlrpc_DeletePOSData($xmlrpcmsg){ + ob_start('ob_file_callback'); +/*x*/ if ($xmlrpcmsg->getNumParams() == 2) { +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); +/*x*/ } else { +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '', + ''))); +/*x*/ } + ob_end_flush(); + return $rtn; + } + + unset($Description); unset($Parameter); unset($ReturnValue); @@ -3413,6 +3442,14 @@ "function" => "xmlrpc_GetDefaultLocation", "signature" => $GetDefaultLocation_sig, "docstring" => $GetDefaultLocation_doc), + "weberp.xmlrpc_CreatePOSDataFull" => array( + "function" => "xmlrpc_CreatePOSDataFull", + "signature" => $CreatePOSDataFull_sig, + "docstring" => $CreatePOSDataFull_doc), + "weberp.xmlrpc_DeletePOSData" => array( + "function" => "xmlrpc_DeletePOSData", + "signature" => $DeletePOSData_sig, + "docstring" => $DeletePOSData_doc), "weberp.xmlrpc_GetStockCatProperty" => array( "function" => "xmlrpc_GetStockCatProperty", "signature" => $GetStockCatProperty_sig, @@ -3424,7 +3461,7 @@ ) ); - + // Generate the HTMLised description string for each API. function apiBuildDocHTML( $description, $parameter, $return ) Modified: trunk/config.distrib.php =================================================================== --- trunk/config.distrib.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/config.distrib.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -18,10 +18,12 @@ // The timezone of the business - this allows the possibility of having // the web-server on a overseas machine but record local time // this is not necessary if you have your own server locally -putenv('TZ=Europe/London'); -// putenv('TZ=Australia/Melbourne'); -// putenv('TZ=Australia/Sydney'); -//putenv('TZ=Pacific/Auckland'); +//date_default_timezone_set('Europe/London'); +//date_default_timezone_set('America/Los_Angeles'); +date_default_timezone_set('Asia/Shanghai'); +//date_default_timezone_set('Australia/Melbourne'); +//date_default_timezone_set('Australia/Sydney'); +//date_default_timezone_set('Pacific/Auckland'); // Connection information for the database // $host is the computer ip address or name where the database is located Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/doc/Change.log 2012-07-01 02:53:00 UTC (rev 5466) @@ -1,5 +1,7 @@ webERP Change Log +30/6/12 Phil: Attempt at quicker price retrieval +30/6/12 Phil: Allow creation of work orders for Raw materials - well intermediary components manufacture - per Bob Thomas email 26/06/12 Bob Thomas: StockAdjustments fix link to controlled stock adjustments entry 24/06/2012 Phil: Added tooltip/title showing long description on many scripts where short description is currently shown SelectOrderItems.php SelectCreditItems.php CreditInvoice.php DeliveryDetails.php CounterSales.php RecurringSalesOrders.php 24/06/2012 Icedlava: Add ViewTopic and BookMark vars to some functions to take advantage of new Manual contextual help. Must be added before header.inc include. Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/includes/GetPrice.inc 2012-07-01 02:53:00 UTC (rev 5466) @@ -170,7 +170,7 @@ $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev FROM prices INNER JOIN debtorsmaster - AND prices.currabrev = debtorsmaster.currcode + ON prices.currabrev = debtorsmaster.currcode WHERE debtorsmaster.debtorno='" . $DebtorNo . "' AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "') AND prices.stockid = '" . $StockID . "' @@ -187,7 +187,7 @@ $PricesArray = array(); $RankArray = array(); $i = 0; - while ($myrow=DB_fetch_row($result)){ + while ($myrow=DB_fetch_array($result)){ $Prices[$i]['Price'] = $myrow['price']; $Prices[$i]['DebtorNo'] = $myrow['debtorno']; $Prices[$i]['BranchCode'] = $myrow['branchcode']; Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-06-29 23:40:08 UTC (rev 5465) +++ trunk/includes/Z_POSDataCreation.php 2012-07-01 02:53:00 UTC (rev 5466) @@ -1,6 +1,6 @@ <?php -function CreatePOSDataFull ( $POSDebtorNo, $POSBranchCode, $db) { +function Create_POS_Data_Full ( $POSDebtorNo, $POSBranchCode, $db) { $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); $CustomerRow = DB_fetch_array($result); if (DB_num_rows($result)==0){ @@ -11,11 +11,15 @@ $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); + if ($FileHandle == false){ + return 0; + } + fwrite($FileHandle,"DELETE FROM currencies;\n"); $result = DB_query('SELECT currency, currabrev, country, hundredsname,decimalplaces, rate FROM currencies',$db); while ($CurrRow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO currencies VALUES ('" . $CurrRow['currency'] . "', '" . $CurrRow['currabrev'] . "', '" . sqlite_escape_string ($CurrRow['country']) . "', '" . sqlite_escape_string ($CurrRow['hundredsname']) . "', '" .$CurrRow['decimalplaces'] . "', '" .$CurrRow['rate'] . "');\n"); + fwrite($FileHandle,"INSERT INTO currencies VALUES ('" . $CurrRow['currency'] . "', '" . $CurrRow['currabrev'] . "', '" . SQLite_Escape ($CurrRow['country']) . "', '" . SQLite_Escape ($CurrRow['hundredsname']) . "', '" .$CurrRow['decimalplaces'] . "', '" .$CurrRow['rate'] . "');\n"); } @@ -24,7 +28,7 @@ $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . sqlite_escape_string ($myrow['sales_type']) . "');\n"); + fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . SQLite_Escape ($myrow['sales_type']) . "');\n"); } fwrite($FileHandle,"DELETE FROM holdreasons;\n"); @@ -32,7 +36,7 @@ $result = DB_query('SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . sqlite_escape_string ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); + fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . SQLite_Escape ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); } fwrite($FileHandle,"DELETE FROM paymentterms;\n"); @@ -40,7 +44,7 @@ $result = DB_query('SELECT termsindicator, terms FROM paymentterms',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . sqlite_escape_string ($myrow['terms']) . "');\n"); + fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . SQLite_Escape ($myrow['terms']) . "');\n"); } @@ -48,7 +52,7 @@ $result = DB_query('SELECT paymentid, paymentname,opencashdrawer FROM paymentmethods',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . sqlite_escape_string ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); + fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . SQLite_Escape ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); } @@ -56,7 +60,7 @@ $result = DB_query('SELECT loccode, locationname,taxprovinceid FROM locations',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . sqlite_escape_string ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); + fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . SQLite_Escape ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); } @@ -64,14 +68,14 @@ $result = DB_query('SELECT categoryid, categorydescription FROM stockcategory',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . sqlite_escape_string ($myrow['categorydescription']) . "');\n"); + fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . SQLite_Escape ($myrow['categorydescription']) . "');\n"); } fwrite($FileHandle,"DELETE FROM taxgroups;\n"); $result = DB_query('SELECT taxgroupid, taxgroupdescription FROM taxgroups',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . sqlite_escape_string ($myrow['taxgroupdescription']) . "');\n"); + fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . SQLite_Escape ($myrow['taxgroupdescription']) . "');\n"); } @@ -86,7 +90,7 @@ $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . sqlite_escape_string ($myrow['description']) . "');\n"); + fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . SQLite_Escape ($myrow['description']) . "');\n"); } fwrite($FileHandle,"DELETE FROM taxauthrates;\n"); @@ -100,8 +104,8 @@ $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0",$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . sqlite_escape_string ($myrow['stockid']) . "', '" . sqlite_escape_string ($myrow['categoryid']) . "', '" . sqlite_escape_string ($myrow['description']) . "', '" . sqlite_escape_string (str_replace("\n", '', $myrow['longdescription'])) . "', '" . sqlite_escape_string ($myrow['units']) . "', '" . sqlite_escape_string ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); - $Price = GetPrice ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db,0); + fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); + $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db); if ($Price!=0) { fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); } @@ -111,14 +115,14 @@ $result = DB_query("SELECT debtorno, name, currcode, salestype, holdreason, paymentterms, discount, creditlimit, discountcode FROM debtorsmaster WHERE currcode='". $CurrCode . "'",$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . sqlite_escape_string ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); + fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . SQLite_Escape ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . SQLite_Escape ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); } fwrite($FileHandle,"DELETE FROM custbranch;\n"); $result = DB_query("SELECT branchcode, debtorsmaster.debtorno, brname, contactname, specialinstructions,taxgroupid FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE debtorsmaster.currcode='". $CurrCode . "'",$db); while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO custbranch VALUES ('" . $myrow['branchcode'] . "', '" . $myrow['debtorno'] . "', '" . sqlite_escape_string ($myrow['brname']) . "', '" . sqlite_escape_string ($myrow['contactname']) . "', '" . sqlite_escape_string ($myrow['specialinstructions']) . "', '" . $myrow['taxgroupid'] . "');\n"); + fwrite($FileHandle,"INSERT INTO custbranch VALUES ('" . $myrow['branchcode'] . "', '" . $myrow['debtorno'] . "', '" . SQLite_Escape ($myrow['brname']) . "', '" . SQLite_Escape ($myrow['contactname']) . "', '" . SQLite_Escape ($myrow['specialinstructions']) . "', '" . $myrow['taxgroupid'] . "');\n"); } @@ -134,6 +138,25 @@ } $ZipFile->addFile($_SESSION['reports_dir'] . '/POS.sql','POS.sql'); $ZipFile->close(); + //delete the original big sql file as we now have the zip for transferring + unlink($_SESSION['reports_dir'] . '/POS.sql'); + return 1; } +function SQLite_Escape($String) { + $SearchCharacters = array('&', '"', "'",'<', '>',"\n","\r" ); + $ReplaceWith = array('&', '""', "''", '<', '>', '', ' '); + + $String = str_replace($SearchCharacters, $ReplaceWith, $String); + return $String; +} +function Delete_POS_Data(){ + if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + } + if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + } + return 1; +} ?> \ 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...> - 2012-07-01 10:48:24
|
Revision: 5468 http://web-erp.svn.sourceforge.net/web-erp/?rev=5468&view=rev Author: daintree Date: 2012-07-01 10:48:17 +0000 (Sun, 01 Jul 2012) Log Message: ----------- POS api functions Modified Paths: -------------- trunk/Z_POS_Data.php trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/includes/Z_POSDataCreation.php Modified: trunk/Z_POS_Data.php =================================================================== --- trunk/Z_POS_Data.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/Z_POS_Data.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -12,8 +12,12 @@ include('includes/header.inc'); if (isset($_GET['Delete'])){ - unlink($_SESSION['reports_dir'] . '/POS.sql'); - unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + } + if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + } prnMsg(_('Old POS upload files deleted'),'info'); } Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/api/api_php.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -27,7 +27,7 @@ global $api_DatabaseName; $rc = LoginAPI ($api_DatabaseName, $user, $password); if ($rc[0] == UL_OK ) { - return $_SESSION['db']; + return $_SESSION['db']; } } return NoAuthorisation; Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/api/api_webERPsettings.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -67,7 +67,7 @@ } $sql = "select defaultlocation from www_users where userid='".$user."'"; $result = DB_query($sql, $db); - $answer=DB_fetch_array($result); + $answer=DB_fetch_array($result); $ReturnValue[0]=0; $ReturnValue[1]=$answer; return $ReturnValue; @@ -98,14 +98,13 @@ $Errors = array(); $db = db($User, $Password); if (gettype($db)=='integer') { - $Errors[0]=NoAuthorisation; - return $Errors; + return NoAuthorisation; } - - if (Create_POS_Data_Full($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ - $ReturnValue[0]=0; + $Result = Create_POS_Data_Full($POSDebtorNo,$POSBranchCode,$db); + if ($Result==1) { + $ReturnValue=0; } else { - $ReturnValue[0]=1; + $ReturnValue=1; } return $ReturnValue; } @@ -113,12 +112,14 @@ $Errors = array(); $db = db($User, $Password); if (gettype($db)=='integer') { - $Errors[0]=NoAuthorisation; - return $Errors; + return NoAuthorisation; } - Delete_POS_Data(); - $ReturnValue[0]=0; - return $ReturnValue; + $Result = Delete_POS_Data(); + if ($Result==1){ + return 0; + } else { + return 1; + } } ?> \ No newline at end of file Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/api/api_xml-rpc.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -2971,12 +2971,11 @@ $Parameter[3]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('If successful this function returns 0 for success and 1 for error. '); - $CreatePOSDataFull_sig = array(array($xmlrpcStruct), - array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); + $CreatePOSDataFull_sig = array(array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); $CreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ - ob_start('ob_file_callback'); + //ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), @@ -2988,7 +2987,7 @@ '', ''))); /*x*/ } - ob_end_flush(); + //ob_end_flush(); return $rtn; } @@ -3003,8 +3002,7 @@ $Parameter[1]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('Returns 0 if the delete POS Data was successfull'); -/*E*/$DeletePOSData_sig = array(array($xmlrpcStruct), -/*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); +/*E*/$DeletePOSData_sig = array(array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); $DeletePOSData_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); @@ -3014,8 +3012,7 @@ /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); /*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '', - ''))); +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '',''))); /*x*/ } ob_end_flush(); return $rtn; Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/includes/Z_POSDataCreation.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -1,9 +1,11 @@ <?php -function Create_POS_Data_Full ( $POSDebtorNo, $POSBranchCode, $db) { +function Create_POS_Data_Full ($POSDebtorNo, $POSBranchCode, $db) { + $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); $CustomerRow = DB_fetch_array($result); if (DB_num_rows($result)==0){ + echo 'customer not found'; return 0; } $CurrCode = $CustomerRow['currcode']; @@ -12,6 +14,7 @@ $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); if ($FileHandle == false){ + echo 'cant open file'; return 0; } @@ -151,12 +154,17 @@ return $String; } function Delete_POS_Data(){ + $Success = true; if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ - unlink($_SESSION['reports_dir'] . '/POS.sql'); + $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); } if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ - unlink($_SESSION['reports_dir'] . '/POS.sql'); + $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); } - return 1; + if ($Success){ + return 1; + } else { + return 0; + } } ?> \ 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...> - 2012-07-01 10:48:24
|
Revision: 5468 http://web-erp.svn.sourceforge.net/web-erp/?rev=5468&view=rev Author: daintree Date: 2012-07-01 10:48:17 +0000 (Sun, 01 Jul 2012) Log Message: ----------- POS api functions Modified Paths: -------------- trunk/Z_POS_Data.php trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/includes/Z_POSDataCreation.php Modified: trunk/Z_POS_Data.php =================================================================== --- trunk/Z_POS_Data.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/Z_POS_Data.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -12,8 +12,12 @@ include('includes/header.inc'); if (isset($_GET['Delete'])){ - unlink($_SESSION['reports_dir'] . '/POS.sql'); - unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ + unlink($_SESSION['reports_dir'] . '/POS.sql'); + } + if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ + unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + } prnMsg(_('Old POS upload files deleted'),'info'); } Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/api/api_php.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -27,7 +27,7 @@ global $api_DatabaseName; $rc = LoginAPI ($api_DatabaseName, $user, $password); if ($rc[0] == UL_OK ) { - return $_SESSION['db']; + return $_SESSION['db']; } } return NoAuthorisation; Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/api/api_webERPsettings.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -67,7 +67,7 @@ } $sql = "select defaultlocation from www_users where userid='".$user."'"; $result = DB_query($sql, $db); - $answer=DB_fetch_array($result); + $answer=DB_fetch_array($result); $ReturnValue[0]=0; $ReturnValue[1]=$answer; return $ReturnValue; @@ -98,14 +98,13 @@ $Errors = array(); $db = db($User, $Password); if (gettype($db)=='integer') { - $Errors[0]=NoAuthorisation; - return $Errors; + return NoAuthorisation; } - - if (Create_POS_Data_Full($_POST['POSDebtorNo'],$_POST['POSBranchCode'],$db) ==1){ - $ReturnValue[0]=0; + $Result = Create_POS_Data_Full($POSDebtorNo,$POSBranchCode,$db); + if ($Result==1) { + $ReturnValue=0; } else { - $ReturnValue[0]=1; + $ReturnValue=1; } return $ReturnValue; } @@ -113,12 +112,14 @@ $Errors = array(); $db = db($User, $Password); if (gettype($db)=='integer') { - $Errors[0]=NoAuthorisation; - return $Errors; + return NoAuthorisation; } - Delete_POS_Data(); - $ReturnValue[0]=0; - return $ReturnValue; + $Result = Delete_POS_Data(); + if ($Result==1){ + return 0; + } else { + return 1; + } } ?> \ No newline at end of file Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/api/api_xml-rpc.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -2971,12 +2971,11 @@ $Parameter[3]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('If successful this function returns 0 for success and 1 for error. '); - $CreatePOSDataFull_sig = array(array($xmlrpcStruct), - array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); + $CreatePOSDataFull_sig = array(array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)); $CreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ - ob_start('ob_file_callback'); + //ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), @@ -2988,7 +2987,7 @@ '', ''))); /*x*/ } - ob_end_flush(); + //ob_end_flush(); return $rtn; } @@ -3003,8 +3002,7 @@ $Parameter[1]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('Returns 0 if the delete POS Data was successfull'); -/*E*/$DeletePOSData_sig = array(array($xmlrpcStruct), -/*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); +/*E*/$DeletePOSData_sig = array(array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); $DeletePOSData_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); @@ -3014,8 +3012,7 @@ /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); /*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '', - ''))); +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '',''))); /*x*/ } ob_end_flush(); return $rtn; Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-07-01 02:55:01 UTC (rev 5467) +++ trunk/includes/Z_POSDataCreation.php 2012-07-01 10:48:17 UTC (rev 5468) @@ -1,9 +1,11 @@ <?php -function Create_POS_Data_Full ( $POSDebtorNo, $POSBranchCode, $db) { +function Create_POS_Data_Full ($POSDebtorNo, $POSBranchCode, $db) { + $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); $CustomerRow = DB_fetch_array($result); if (DB_num_rows($result)==0){ + echo 'customer not found'; return 0; } $CurrCode = $CustomerRow['currcode']; @@ -12,6 +14,7 @@ $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); if ($FileHandle == false){ + echo 'cant open file'; return 0; } @@ -151,12 +154,17 @@ return $String; } function Delete_POS_Data(){ + $Success = true; if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ - unlink($_SESSION['reports_dir'] . '/POS.sql'); + $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); } if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ - unlink($_SESSION['reports_dir'] . '/POS.sql'); + $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); } - return 1; + if ($Success){ + return 1; + } else { + return 0; + } } ?> \ 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...> - 2012-07-02 10:52:54
|
Revision: 5469 http://web-erp.svn.sourceforge.net/web-erp/?rev=5469&view=rev Author: daintree Date: 2012-07-02 10:52:47 +0000 (Mon, 02 Jul 2012) Log Message: ----------- POS api function Modified Paths: -------------- trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/includes/GetPrice.inc trunk/includes/Z_POSDataCreation.php Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/api/api_php.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -16,6 +16,7 @@ /* Required for creating invoices/credits */ include($PathPrefix . 'includes/GetSalesTransGLCodes.inc'); include($PathPrefix . 'includes/Z_POSDataCreation.php'); + include($PathPrefix . 'includes/GetPrice.inc'); /* Get weberp authentication, and return a valid database connection */ Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/api/api_webERPsettings.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -100,11 +100,11 @@ if (gettype($db)=='integer') { return NoAuthorisation; } - $Result = Create_POS_Data_Full($POSDebtorNo,$POSBranchCode,$db); + $Result = Create_POS_Data_Full($POSDebtorNo,$POSBranchCode,dirname(__FILE__).'/../',$db); if ($Result==1) { $ReturnValue=0; } else { - $ReturnValue=1; + $ReturnValue=$Result; } return $ReturnValue; } @@ -114,11 +114,11 @@ if (gettype($db)=='integer') { return NoAuthorisation; } - $Result = Delete_POS_Data(); + $Result = Delete_POS_Data(dirname(__FILE__).'/../',$db); if ($Result==1){ return 0; } else { - return 1; + return $Result; } } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/api/api_xml-rpc.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -2975,7 +2975,7 @@ $CreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ - //ob_start('ob_file_callback'); + ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), @@ -2987,7 +2987,7 @@ '', ''))); /*x*/ } - //ob_end_flush(); + ob_end_flush(); return $rtn; } @@ -3008,12 +3008,12 @@ function xmlrpc_DeletePOSData($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 2) { -/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), -/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); -/*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '',''))); -/*x*/ } + if ($xmlrpcmsg->getNumParams() == 2) { + $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), + $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); + } else { + $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '',''))); + } ob_end_flush(); return $rtn; } Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/includes/GetPrice.inc 2012-07-02 10:52:47 UTC (rev 5469) @@ -163,62 +163,4 @@ } } - -function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $db){ - - $Price = 0; - - $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev - FROM prices INNER JOIN debtorsmaster - ON prices.currabrev = debtorsmaster.currcode - WHERE debtorsmaster.debtorno='" . $DebtorNo . "' - AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "') - AND prices.stockid = '" . $StockID . "' - AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') - AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') - AND prices.startdate <='" . Date('Y-m-d') . "' - AND (prices.enddate >='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; - - $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); - $result = DB_query($sql, $db,$ErrMsg); - if (DB_num_rows($result)==0){ - return $Price; - } else { - $PricesArray = array(); - $RankArray = array(); - $i = 0; - while ($myrow=DB_fetch_array($result)){ - $Prices[$i]['Price'] = $myrow['price']; - $Prices[$i]['DebtorNo'] = $myrow['debtorno']; - $Prices[$i]['BranchCode'] = $myrow['branchcode']; - $Prices[$i]['EndDate'] = $myrow['enddate']; - if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { - $Rank[$i] = 1; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { - $Rank[$i] = 2; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ - $Rank[$i] = 3; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ - $Rank[$i] = 4; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList'] AND $myrow['enddate']!='0000-00-00'){ - $Rank[$i] = 5; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList']){ - $Rank[$i] = 6; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ - $Rank[$i] = 7; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ - $Rank[$i] = 8; - } - $i++; - } - $LowestRank = 10; - foreach ($RankArray as $ArrayElement=>$Ranking) { - if ($Ranking < $LowestRank){ - $LowestRankElement = $ArrayElement; - $LowestRank = $Ranking; - } - } - return $Prices[$ArrayElement]['Price']; - } -} ?> \ No newline at end of file Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/includes/Z_POSDataCreation.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -1,21 +1,29 @@ <?php -function Create_POS_Data_Full ($POSDebtorNo, $POSBranchCode, $db) { +function Create_POS_Data_Full ($POSDebtorNo, $POSBranchCode, $PathPrefix, $db) { + $result = DB_query("SELECT confvalue FROM config WHERE confname='reports_dir'",$db); + $ReportDirRow = DB_fetch_row($result); + $ReportDir = $ReportDirRow[0]; + + $result = DB_query("SELECT confvalue FROM config WHERE confname='DefaultPriceList'",$db); + $DefaultPriceListRow = DB_fetch_row($result); + $DefaultPriceList= $DefaultPriceListRow[0]; + + $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); $CustomerRow = DB_fetch_array($result); if (DB_num_rows($result)==0){ - echo 'customer not found'; return 0; } $CurrCode = $CustomerRow['currcode']; $SalesType = $CustomerRow['salestype']; + + + $FileHandle = fopen($PathPrefix . $ReportDir . '/POS.sql','w'); - $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); - if ($FileHandle == false){ - echo 'cant open file'; - return 0; + return 'cant open file ' . $PathPrefix . $ReportDir . '/POS.sql'; } fwrite($FileHandle,"DELETE FROM currencies;\n"); @@ -108,7 +116,7 @@ while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); - $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db); + $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $DefaultPriceList, $db); if ($Price!=0) { fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); } @@ -131,18 +139,17 @@ fclose($FileHandle); /*Now compress to a zip archive */ - if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ - unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + if (file_exists($PathPrefix . $ReportDir . '/POS.sql.zip')){ + unlink($PathPrefix . $ReportDir . '/POS.sql.zip'); } $ZipFile = new ZipArchive(); - if ($ZipFile->open($_SESSION['reports_dir'] . '/POS.sql.zip', ZIPARCHIVE::CREATE)!==TRUE) { - exit("cannot open <" . $_SESSION['reports_dir'] . "/POS.sql.zip\n"); - include('includes/footer.inc'); + if ($ZipFile->open($PathPrefix . $ReportDir . '/POS.sql.zip', ZIPARCHIVE::CREATE)!==TRUE) { + return 'couldnt open zip file ' . $PathPrefix . $ReportDir . '/POS.sql.zip'; } - $ZipFile->addFile($_SESSION['reports_dir'] . '/POS.sql','POS.sql'); + $ZipFile->addFile($PathPrefix . $ReportDir . '/POS.sql','POS.sql'); $ZipFile->close(); //delete the original big sql file as we now have the zip for transferring - unlink($_SESSION['reports_dir'] . '/POS.sql'); + unlink($PathPrefix . $ReportDir . '/POS.sql'); return 1; } @@ -153,13 +160,20 @@ $String = str_replace($SearchCharacters, $ReplaceWith, $String); return $String; } -function Delete_POS_Data(){ + +function Delete_POS_Data($PathPrefix, $db){ + + $result = DB_query("SELECT confvalue FROM config WHERE confname='reports_dir'",$db); + $ReportDirRow = DB_fetch_row($result); + $ReportDir = $ReportDirRow[0]; + + $Success = true; - if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ - $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); + if (file_exists($PathPrefix . $ReportDir . '/POS.sql.zip')){ + $Success = unlink($PathPrefix . $ReportDir . '/POS.sql.zip'); } - if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ - $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); + if (file_exists($PathPrefix . $ReportDir . '/POS.sql')){ + $Success = unlink($PathPrefix . $ReportDir . '/POS.sql'); } if ($Success){ return 1; @@ -167,4 +181,60 @@ return 0; } } + +function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $DefaultPriceList,$db){ + + $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev + FROM prices INNER JOIN debtorsmaster + ON prices.currabrev = debtorsmaster.currcode + WHERE debtorsmaster.debtorno='" . $DebtorNo . "' + AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $DefaultPriceList . "') + AND prices.stockid = '" . $StockID . "' + AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') + AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') + AND prices.startdate <='" . Date('Y-m-d') . "' + AND (prices.enddate >='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; + + $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); + $result = DB_query($sql, $db,$ErrMsg); + if (DB_num_rows($result)==0){ + return 0; + } else { + $PricesArray = array(); + $RankArray = array(); + $i = 0; + while ($myrow=DB_fetch_array($result)){ + $Prices[$i]['Price'] = $myrow['price']; + $Prices[$i]['DebtorNo'] = $myrow['debtorno']; + $Prices[$i]['BranchCode'] = $myrow['branchcode']; + $Prices[$i]['EndDate'] = $myrow['enddate']; + if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { + $Rank[$i] = 1; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { + $Rank[$i] = 2; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 3; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ + $Rank[$i] = 4; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$DefaultPriceList AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 5; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$DefaultPriceList){ + $Rank[$i] = 6; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 7; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ + $Rank[$i] = 8; + } + $i++; + } + $LowestRank = 10; + foreach ($RankArray as $ArrayElement=>$Ranking) { + if ($Ranking < $LowestRank){ + $LowestRankElement = $ArrayElement; + $LowestRank = $Ranking; + } + } + return $Prices[$ArrayElement]['Price']; + } +} ?> \ 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...> - 2012-07-02 10:52:59
|
Revision: 5469 http://web-erp.svn.sourceforge.net/web-erp/?rev=5469&view=rev Author: daintree Date: 2012-07-02 10:52:47 +0000 (Mon, 02 Jul 2012) Log Message: ----------- POS api function Modified Paths: -------------- trunk/api/api_php.php trunk/api/api_webERPsettings.php trunk/api/api_xml-rpc.php trunk/includes/GetPrice.inc trunk/includes/Z_POSDataCreation.php Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/api/api_php.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -16,6 +16,7 @@ /* Required for creating invoices/credits */ include($PathPrefix . 'includes/GetSalesTransGLCodes.inc'); include($PathPrefix . 'includes/Z_POSDataCreation.php'); + include($PathPrefix . 'includes/GetPrice.inc'); /* Get weberp authentication, and return a valid database connection */ Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/api/api_webERPsettings.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -100,11 +100,11 @@ if (gettype($db)=='integer') { return NoAuthorisation; } - $Result = Create_POS_Data_Full($POSDebtorNo,$POSBranchCode,$db); + $Result = Create_POS_Data_Full($POSDebtorNo,$POSBranchCode,dirname(__FILE__).'/../',$db); if ($Result==1) { $ReturnValue=0; } else { - $ReturnValue=1; + $ReturnValue=$Result; } return $ReturnValue; } @@ -114,11 +114,11 @@ if (gettype($db)=='integer') { return NoAuthorisation; } - $Result = Delete_POS_Data(); + $Result = Delete_POS_Data(dirname(__FILE__).'/../',$db); if ($Result==1){ return 0; } else { - return 1; + return $Result; } } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/api/api_xml-rpc.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -2975,7 +2975,7 @@ $CreatePOSDataFull_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); function xmlrpc_CreatePOSDataFull($xmlrpcmsg){ - //ob_start('ob_file_callback'); + ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 4) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(CreatePOSDataFull($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), @@ -2987,7 +2987,7 @@ '', ''))); /*x*/ } - //ob_end_flush(); + ob_end_flush(); return $rtn; } @@ -3008,12 +3008,12 @@ function xmlrpc_DeletePOSData($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 2) { -/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), -/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); -/*x*/ } else { -/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '',''))); -/*x*/ } + if ($xmlrpcmsg->getNumParams() == 2) { + $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData($xmlrpcmsg->getParam( 0 )->scalarval( ), + $xmlrpcmsg->getParam( 1 )->scalarval( ) )) ); + } else { + $rtn = new xmlrpcresp( php_xmlrpc_encode(DeletePOSData( '',''))); + } ob_end_flush(); return $rtn; } Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/includes/GetPrice.inc 2012-07-02 10:52:47 UTC (rev 5469) @@ -163,62 +163,4 @@ } } - -function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $db){ - - $Price = 0; - - $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev - FROM prices INNER JOIN debtorsmaster - ON prices.currabrev = debtorsmaster.currcode - WHERE debtorsmaster.debtorno='" . $DebtorNo . "' - AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "') - AND prices.stockid = '" . $StockID . "' - AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') - AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') - AND prices.startdate <='" . Date('Y-m-d') . "' - AND (prices.enddate >='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; - - $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); - $result = DB_query($sql, $db,$ErrMsg); - if (DB_num_rows($result)==0){ - return $Price; - } else { - $PricesArray = array(); - $RankArray = array(); - $i = 0; - while ($myrow=DB_fetch_array($result)){ - $Prices[$i]['Price'] = $myrow['price']; - $Prices[$i]['DebtorNo'] = $myrow['debtorno']; - $Prices[$i]['BranchCode'] = $myrow['branchcode']; - $Prices[$i]['EndDate'] = $myrow['enddate']; - if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { - $Rank[$i] = 1; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { - $Rank[$i] = 2; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ - $Rank[$i] = 3; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ - $Rank[$i] = 4; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList'] AND $myrow['enddate']!='0000-00-00'){ - $Rank[$i] = 5; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$_SESSION['DefaultPriceList']){ - $Rank[$i] = 6; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ - $Rank[$i] = 7; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ - $Rank[$i] = 8; - } - $i++; - } - $LowestRank = 10; - foreach ($RankArray as $ArrayElement=>$Ranking) { - if ($Ranking < $LowestRank){ - $LowestRankElement = $ArrayElement; - $LowestRank = $Ranking; - } - } - return $Prices[$ArrayElement]['Price']; - } -} ?> \ No newline at end of file Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-07-01 10:48:17 UTC (rev 5468) +++ trunk/includes/Z_POSDataCreation.php 2012-07-02 10:52:47 UTC (rev 5469) @@ -1,21 +1,29 @@ <?php -function Create_POS_Data_Full ($POSDebtorNo, $POSBranchCode, $db) { +function Create_POS_Data_Full ($POSDebtorNo, $POSBranchCode, $PathPrefix, $db) { + $result = DB_query("SELECT confvalue FROM config WHERE confname='reports_dir'",$db); + $ReportDirRow = DB_fetch_row($result); + $ReportDir = $ReportDirRow[0]; + + $result = DB_query("SELECT confvalue FROM config WHERE confname='DefaultPriceList'",$db); + $DefaultPriceListRow = DB_fetch_row($result); + $DefaultPriceList= $DefaultPriceListRow[0]; + + $result = DB_query("SELECT currcode, salestype FROM debtorsmaster WHERE debtorno='" . $POSDebtorNo . "'",$db); $CustomerRow = DB_fetch_array($result); if (DB_num_rows($result)==0){ - echo 'customer not found'; return 0; } $CurrCode = $CustomerRow['currcode']; $SalesType = $CustomerRow['salestype']; + + + $FileHandle = fopen($PathPrefix . $ReportDir . '/POS.sql','w'); - $FileHandle = fopen($_SESSION['reports_dir'] . '/POS.sql','w'); - if ($FileHandle == false){ - echo 'cant open file'; - return 0; + return 'cant open file ' . $PathPrefix . $ReportDir . '/POS.sql'; } fwrite($FileHandle,"DELETE FROM currencies;\n"); @@ -108,7 +116,7 @@ while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); - $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $db); + $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $DefaultPriceList, $db); if ($Price!=0) { fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); } @@ -131,18 +139,17 @@ fclose($FileHandle); /*Now compress to a zip archive */ - if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ - unlink($_SESSION['reports_dir'] . '/POS.sql.zip'); + if (file_exists($PathPrefix . $ReportDir . '/POS.sql.zip')){ + unlink($PathPrefix . $ReportDir . '/POS.sql.zip'); } $ZipFile = new ZipArchive(); - if ($ZipFile->open($_SESSION['reports_dir'] . '/POS.sql.zip', ZIPARCHIVE::CREATE)!==TRUE) { - exit("cannot open <" . $_SESSION['reports_dir'] . "/POS.sql.zip\n"); - include('includes/footer.inc'); + if ($ZipFile->open($PathPrefix . $ReportDir . '/POS.sql.zip', ZIPARCHIVE::CREATE)!==TRUE) { + return 'couldnt open zip file ' . $PathPrefix . $ReportDir . '/POS.sql.zip'; } - $ZipFile->addFile($_SESSION['reports_dir'] . '/POS.sql','POS.sql'); + $ZipFile->addFile($PathPrefix . $ReportDir . '/POS.sql','POS.sql'); $ZipFile->close(); //delete the original big sql file as we now have the zip for transferring - unlink($_SESSION['reports_dir'] . '/POS.sql'); + unlink($PathPrefix . $ReportDir . '/POS.sql'); return 1; } @@ -153,13 +160,20 @@ $String = str_replace($SearchCharacters, $ReplaceWith, $String); return $String; } -function Delete_POS_Data(){ + +function Delete_POS_Data($PathPrefix, $db){ + + $result = DB_query("SELECT confvalue FROM config WHERE confname='reports_dir'",$db); + $ReportDirRow = DB_fetch_row($result); + $ReportDir = $ReportDirRow[0]; + + $Success = true; - if (file_exists($_SESSION['reports_dir'] . '/POS.sql.zip')){ - $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); + if (file_exists($PathPrefix . $ReportDir . '/POS.sql.zip')){ + $Success = unlink($PathPrefix . $ReportDir . '/POS.sql.zip'); } - if (file_exists($_SESSION['reports_dir'] . '/POS.sql')){ - $Success = unlink($_SESSION['reports_dir'] . '/POS.sql'); + if (file_exists($PathPrefix . $ReportDir . '/POS.sql')){ + $Success = unlink($PathPrefix . $ReportDir . '/POS.sql'); } if ($Success){ return 1; @@ -167,4 +181,60 @@ return 0; } } + +function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $DefaultPriceList,$db){ + + $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev + FROM prices INNER JOIN debtorsmaster + ON prices.currabrev = debtorsmaster.currcode + WHERE debtorsmaster.debtorno='" . $DebtorNo . "' + AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $DefaultPriceList . "') + AND prices.stockid = '" . $StockID . "' + AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') + AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') + AND prices.startdate <='" . Date('Y-m-d') . "' + AND (prices.enddate >='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; + + $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); + $result = DB_query($sql, $db,$ErrMsg); + if (DB_num_rows($result)==0){ + return 0; + } else { + $PricesArray = array(); + $RankArray = array(); + $i = 0; + while ($myrow=DB_fetch_array($result)){ + $Prices[$i]['Price'] = $myrow['price']; + $Prices[$i]['DebtorNo'] = $myrow['debtorno']; + $Prices[$i]['BranchCode'] = $myrow['branchcode']; + $Prices[$i]['EndDate'] = $myrow['enddate']; + if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { + $Rank[$i] = 1; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { + $Rank[$i] = 2; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 3; + } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ + $Rank[$i] = 4; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$DefaultPriceList AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 5; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$DefaultPriceList){ + $Rank[$i] = 6; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ + $Rank[$i] = 7; + } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ + $Rank[$i] = 8; + } + $i++; + } + $LowestRank = 10; + foreach ($RankArray as $ArrayElement=>$Ranking) { + if ($Ranking < $LowestRank){ + $LowestRankElement = $ArrayElement; + $LowestRank = $Ranking; + } + } + return $Prices[$ArrayElement]['Price']; + } +} ?> \ 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...> - 2012-07-06 06:53:20
|
Revision: 5478 http://web-erp.svn.sourceforge.net/web-erp/?rev=5478&view=rev Author: daintree Date: 2012-07-06 06:53:13 +0000 (Fri, 06 Jul 2012) Log Message: ----------- Modified Paths: -------------- trunk/GLTransInquiry.php trunk/UpgradeDatabase.php Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2012-07-06 06:00:46 UTC (rev 5477) +++ trunk/GLTransInquiry.php 2012-07-06 06:53:13 UTC (rev 5478) @@ -107,7 +107,6 @@ $DetailSQL = "SELECT supptrans.supplierno, supptrans.ovamount, supptrans.ovgst, - supptrans.ovfreight, supptrans.rate, suppliers.suppname FROM supptrans INNER JOIN suppliers @@ -146,7 +145,7 @@ $Debit = locale_number_format(($DetailRow[1] + $DetailRow[2]+ $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); $Credit = ' '; } else { - $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2] $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); $Credit = ' '; } } else { @@ -154,7 +153,7 @@ $Credit = locale_number_format(-($DetailRow[1] + $DetailRow[2] + $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } else { - $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2] + $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } } Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-07-06 06:00:46 UTC (rev 5477) +++ trunk/UpgradeDatabase.php 2012-07-06 06:53:13 UTC (rev 5478) @@ -142,7 +142,11 @@ case '4.07.3': case '4.07.4': case '4.07.5': - case '4.07.6': + case '4.07.6': + case '4.07.7': + case '4.07.8': + case '4.07.9': + case '4.07.10': $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; case '4.08': case '4.08.1': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-06 06:53:20
|
Revision: 5478 http://web-erp.svn.sourceforge.net/web-erp/?rev=5478&view=rev Author: daintree Date: 2012-07-06 06:53:13 +0000 (Fri, 06 Jul 2012) Log Message: ----------- Modified Paths: -------------- trunk/GLTransInquiry.php trunk/UpgradeDatabase.php Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2012-07-06 06:00:46 UTC (rev 5477) +++ trunk/GLTransInquiry.php 2012-07-06 06:53:13 UTC (rev 5478) @@ -107,7 +107,6 @@ $DetailSQL = "SELECT supptrans.supplierno, supptrans.ovamount, supptrans.ovgst, - supptrans.ovfreight, supptrans.rate, suppliers.suppname FROM supptrans INNER JOIN suppliers @@ -146,7 +145,7 @@ $Debit = locale_number_format(($DetailRow[1] + $DetailRow[2]+ $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); $Credit = ' '; } else { - $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2] $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); $Credit = ' '; } } else { @@ -154,7 +153,7 @@ $Credit = locale_number_format(-($DetailRow[1] + $DetailRow[2] + $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } else { - $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2] + $DetailRow[3]) / $DetailRow[4],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } } Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-07-06 06:00:46 UTC (rev 5477) +++ trunk/UpgradeDatabase.php 2012-07-06 06:53:13 UTC (rev 5478) @@ -142,7 +142,11 @@ case '4.07.3': case '4.07.4': case '4.07.5': - case '4.07.6': + case '4.07.6': + case '4.07.7': + case '4.07.8': + case '4.07.9': + case '4.07.10': $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; case '4.08': case '4.08.1': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-07 06:21:14
|
Revision: 5481 http://web-erp.svn.sourceforge.net/web-erp/?rev=5481&view=rev Author: daintree Date: 2012-07-07 06:21:07 +0000 (Sat, 07 Jul 2012) Log Message: ----------- new purge prices script Modified Paths: -------------- trunk/Prices.php trunk/doc/Change.log trunk/includes/DateFunctions.inc trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.08-4.09.sql Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/Prices.php 2012-07-07 06:21:07 UTC (rev 5481) @@ -74,35 +74,35 @@ $InputError =1; prnMsg (_('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); } - - if (FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ - if (! Is_Date($_POST['EndDate']) AND $_POST['EndDate']!=''){ - $InputError =1; - prnMsg (_('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); + if ($_POST['EndDate']!='') { + if (FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ + if (! Is_Date($_POST['EndDate']) AND $_POST['EndDate']!=''){ + $InputError =1; + prnMsg (_('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); + } + if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ + $InputError =1; + prnMsg (_('The end date is expected to be after the start date, enter an end date after the start date for this price'),'error'); + } + if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']),$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ + $InputError =1; + prnMsg(_('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!'),'error'); + } } - if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ - $InputError =1; - prnMsg (_('The end date is expected to be after the start date, enter an end date after the start date for this price'),'error'); - } - if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']),$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ - $InputError =1; - prnMsg(_('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!'),'error'); - } } if (Is_Date($_POST['EndDate'])){ $SQLEndDate = FormatDateForSQL($_POST['EndDate']); } else { $SQLEndDate = '0000-00-00'; } - + $sql = "SELECT COUNT(typeabbrev) FROM prices WHERE prices.stockid='".$Item."' AND startdate='" .FormatDateForSQL($_POST['StartDate']) . "' AND enddate ='" . $SQLEndDate . "' AND prices.typeabbrev='" . $_POST['TypeAbbrev'] . "' - AND prices.currabrev='" . $_POST['CurrAbrev'] . "' - AND prices.price='" . filter_number_format($_POST['Price']) . "'"; + AND prices.currabrev='" . $_POST['CurrAbrev'] . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); @@ -111,9 +111,9 @@ prnMsg( _('This price has already been entered. To change it you should edit it') , 'warn'); $InputError =1; } - - - + + + if (isset($_POST['OldTypeAbbrev']) AND isset($_POST['OldCurrAbrev']) AND mb_strlen($Item)>1 AND $InputError !=1) { /* Need to see if there is also a price entered that has an end date after the start date of this price and if so we will need to update it so there is no ambiguity as to which price will be used*/ @@ -157,10 +157,11 @@ '" . filter_number_format($_POST['Price']) . "')"; $ErrMsg = _('The new price could not be added'); $result = DB_query($sql,$db,$ErrMsg); - + ReSequenceEffectiveDates ($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db) ; prnMsg(_('The new price has been inserted'),'success'); } + unset($_POST['Price']); unset($_POST['StartDate']); unset($_POST['EndDate']); @@ -182,176 +183,176 @@ } //Always do this stuff -if ($InputError ==0){ - $sql = "SELECT currencies.currency, - salestypes.sales_type, - prices.price, - prices.stockid, - prices.typeabbrev, - prices.currabrev, - prices.startdate, - prices.enddate, - currencies.decimalplaces AS currdecimalplaces - FROM prices - INNER JOIN salestypes - ON prices.typeabbrev = salestypes.typeabbrev - INNER JOIN currencies - ON prices.currabrev=currencies.currabrev - WHERE prices.stockid='".$Item."' - AND prices.debtorno='' - ORDER BY prices.currabrev, - prices.typeabbrev, - prices.startdate"; - $result = DB_query($sql,$db); +$sql = "SELECT currencies.currency, + salestypes.sales_type, + prices.price, + prices.stockid, + prices.typeabbrev, + prices.currabrev, + prices.startdate, + prices.enddate, + currencies.decimalplaces AS currdecimalplaces + FROM prices + INNER JOIN salestypes + ON prices.typeabbrev = salestypes.typeabbrev + INNER JOIN currencies + ON prices.currabrev=currencies.currabrev + WHERE prices.stockid='".$Item."' + AND prices.debtorno='' + ORDER BY prices.currabrev, + prices.typeabbrev, + prices.startdate"; - if (DB_num_rows($result) > 0) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<table class="selection"> - <tr> - <th colspan="7"> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . - _('Pricing for part') . ': - <input type="text" name="Item" size="22" value="' . $Item . '" maxlength="20" /> - <input type="submit" name="NewPart" value="' . _('Review Prices') . '" /></th> - </tr>'; +$result = DB_query($sql,$db); - echo '<tr><th>' . _('Currency') . '</th> - <th>' . _('Sales Type') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Start Date') . ' </th> - <th>' . _('End Date') . '</th> - </tr>'; +if (DB_num_rows($result) > 0) { + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; + echo '<div>'; + echo '<table class="selection"> + <tr> + <th colspan="7"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . + _('Pricing for part') . ': + <input type="text" name="Item" size="22" value="' . $Item . '" maxlength="20" /> + <input type="submit" name="NewPart" value="' . _('Review Prices') . '" /></th> + </tr>'; - $k=0; //row colour counter + echo '<tr><th>' . _('Currency') . '</th> + <th>' . _('Sales Type') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Start Date') . ' </th> + <th>' . _('End Date') . '</th> + </tr>'; - while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - if ($myrow['enddate']=='0000-00-00'){ - $EndDateDisplay = _('No End Date'); - } else { - $EndDateDisplay = ConvertSQLDate($myrow['enddate']); - } - /*Only allow access to modify prices if securiy token 5 is allowed */ - if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { - echo '<td>' . $myrow['currency'] . '</td> - <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> - <td>' . ConvertSQLDate($myrow['startdate']) . '</td> - <td>' . $EndDateDisplay . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&Price=' . $myrow['price'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&Edit=1">' . _('Edit') . '</a></td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this price?') . '\');">' . _('Delete') . '</a></td></tr>'; - - } else { - echo '<td>' . $myrow['currency'] . '</td> - <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> - <td>' . ConvertSQLDate($myrow['startdate']) . '</td> - <td>' . $EndDateDisplay . '</td></tr>'; - } + $k=0; //row colour counter + while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; } - //END WHILE LIST LOOP - echo '</table><br />'; - echo '</div> - </form>'; - } else { - prnMsg(_('There are no prices set up for this part'),'warn'); - } + if ($myrow['enddate']=='0000-00-00'){ + $EndDateDisplay = _('No End Date'); + } else { + $EndDateDisplay = ConvertSQLDate($myrow['enddate']); + } + /*Only allow access to modify prices if securiy token 5 is allowed */ + if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { + echo '<td>' . $myrow['currency'] . '</td> + <td>' . $myrow['sales_type'] . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> + <td>' . ConvertSQLDate($myrow['startdate']) . '</td> + <td>' . $EndDateDisplay . '</td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&Price=' . $myrow['price'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&Edit=1">' . _('Edit') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this price?') . '\');">' . _('Delete') . '</a></td></tr>'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($_GET['Edit'])){ - echo '<input type="hidden" name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'" />'; - echo '<input type="hidden" name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '" />'; - echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] . '" />'; - echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '" />'; - $_POST['CurrAbrev'] = $_GET['CurrAbrev']; - $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; - /*the price sent with the get is sql format price so no need to filter */ - $_POST['Price'] = $_GET['Price']; - $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); - if ($_GET['EndDate']=='' OR $_GET['EndDate']=='0000-00-00'){ - $_POST['EndDate'] = ''; } else { - $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + echo '<td>' . $myrow['currency'] . '</td> + <td>' . $myrow['sales_type'] . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> + <td>' . ConvertSQLDate($myrow['startdate']) . '</td> + <td>' . $EndDateDisplay . '</td></tr>'; } + } + //END WHILE LIST LOOP + echo '</table><br />'; + echo '</div> + </form>'; +} else { + prnMsg(_('There are no prices set up for this part'),'warn'); +} - $SQL = "SELECT currabrev, - currency - FROM currencies"; - $result = DB_query($SQL,$db); +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; +echo '<div>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if (isset($_GET['Edit'])){ + echo '<input type="hidden" name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'" />'; + echo '<input type="hidden" name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '" />'; + echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] . '" />'; + echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '" />'; + $_POST['CurrAbrev'] = $_GET['CurrAbrev']; + $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; + /*the price sent with the get is sql format price so no need to filter */ + $_POST['Price'] = $_GET['Price']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + if ($_GET['EndDate']=='' OR $_GET['EndDate']=='0000-00-00'){ + $_POST['EndDate'] = ''; + } else { + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + } +} - echo '<br /><table class="selection">'; - echo '<tr><th colspan="5"><h3>' . $Item . ' - ' . $PartDescription . '</h3></th></tr>'; - echo '<tr><td>' . _('Currency') . ':</td> - <td><select name="CurrAbrev">'; - while ($myrow = DB_fetch_array($result)) { - if ($myrow['currabrev']==$_POST['CurrAbrev']) { - echo '<option selected="selected" value="'; - } else { - echo '<option value="'; - } - echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } //end while loop +$SQL = "SELECT currabrev, + currency + FROM currencies"; +$result = DB_query($SQL,$db); - DB_free_result($result); +echo '<br /><table class="selection">'; +echo '<tr><th colspan="5"><h3>' . $Item . ' - ' . $PartDescription . '</h3></th></tr>'; +echo '<tr><td>' . _('Currency') . ':</td> + <td><select name="CurrAbrev">'; +while ($myrow = DB_fetch_array($result)) { + if ($myrow['currabrev']==$_POST['CurrAbrev']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; +} //end while loop - echo '</select> </td></tr> - <tr> - <td>' . _('Sales Type Price List') . ':</td> - <td><select name="TypeAbbrev">'; +DB_free_result($result); - $SQL = "SELECT typeabbrev, sales_type FROM salestypes"; - $result = DB_query($SQL,$db); +echo '</select> </td></tr> + <tr> + <td>' . _('Sales Type Price List') . ':</td> + <td><select name="TypeAbbrev">'; - while ($myrow = DB_fetch_array($result)) { - if ($myrow['typeabbrev']==$_POST['TypeAbbrev']) { - echo '<option selected="selected" value="'; - } else { - echo '<option value="'; - } - echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; +$SQL = "SELECT typeabbrev, sales_type FROM salestypes"; +$result = DB_query($SQL,$db); - } //end while loop - echo '</select></td></tr>'; - - DB_free_result($result); +while ($myrow = DB_fetch_array($result)) { + if ($myrow['typeabbrev']==$_POST['TypeAbbrev']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; - if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); - } - if (!isset($_POST['EndDate'])){ - $_POST['EndDate'] = ''; - } - echo '<tr><td>' . _('Price Effective From Date') . ':</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="StartDate" size="10" maxlength="10" value="' . $_POST['StartDate'] . '" /></td></tr>'; - echo '<tr><td>' . _('Price Effective To Date') . ':</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="EndDate" size="10" maxlength="10" value="' . $_POST['EndDate'] . '" />'; - echo '<input type="hidden" name="Item" value="' . $Item.'" /></td></tr>'; - echo '<tr><td>' . _('Price') . ':</td> - <td> - <input type="text" class="number" name="Price" size="12" maxlength="11" value="'; - if (isset($_POST['Price'])) { - echo $_POST['Price']; - } - echo '" /> - </td></tr> - </table> - <br /><div class="centre"> - <input type="submit" name="submit" value="' . _('Enter') . '/' . _('Amend Price') . '" /> - </div>'; +} //end while loop +echo '</select></td></tr>'; + +DB_free_result($result); + +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); } +if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = ''; +} +echo '<tr><td>' . _('Price Effective From Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="StartDate" size="10" maxlength="10" value="' . $_POST['StartDate'] . '" /></td></tr>'; +echo '<tr><td>' . _('Price Effective To Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="EndDate" size="10" maxlength="10" value="' . $_POST['EndDate'] . '" />'; +echo '<input type="hidden" name="Item" value="' . $Item.'" /></td></tr>'; +echo '<tr><td>' . _('Price') . ':</td> + <td> + <input type="text" class="number" name="Price" size="12" maxlength="11" value="'; + if (isset($_POST['Price'])) { + echo $_POST['Price']; + } + echo '" /> + </td></tr> +</table> +<br /><div class="centre"> +<input type="submit" name="submit" value="' . _('Enter') . '/' . _('Amend Price') . '" /> +</div>'; + echo '</div> </form>'; include('includes/footer.inc'); @@ -361,7 +362,7 @@ /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where one price falls inside another effective date range except in the case of a blank end date - ie no end date - the default price for the currency/salestype. I first thought that we would need to update the previous default price (blank end date), when a new default price is entered, to have an end date of the startdate of this new default price less 1 day - but this is converting a default price into a special price which could result in having two special prices over the same date range - best to leave it unchanged and use logic in the GetPrice.inc to ensure the correct default price is returned - * + * * After further discussion (Ricard) if the new price has a blank end date - i.e. no end then the pre-existing price with no end date should be changed to have an end date just prior to the new default (no end date) price commencing */ //this is just the case where debtorno='' - see the Prices_Customer.php script for customer special prices @@ -376,7 +377,7 @@ AND enddate <>'0000-00-00' ORDER BY startdate, enddate"; $result = DB_query($SQL,$db); - + while ($myrow = DB_fetch_array($result)){ if (isset($NextStartDate)){ if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ @@ -402,7 +403,7 @@ $EndDate = $myrow['enddate']; $Price = $myrow['price']; } // end of loop around all prices - + //Now look for duplicate prices with no end $SQL = "SELECT price, startdate, @@ -415,7 +416,7 @@ AND enddate ='0000-00-00' ORDER BY startdate"; $result = DB_query($SQL,$db); - + while ($myrow = DB_fetch_array($result)) { if (isset($OldStartDate)){ /*Need to make the end date the new start date less 1 day */ @@ -431,7 +432,7 @@ } $OldStartDate = $myrow['startdate']; } // end of loop around duplicate no end date prices - + } // end function ReSequenceEffectiveDates ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/doc/Change.log 2012-07-07 06:21:07 UTC (rev 5481) @@ -1,5 +1,7 @@ webERP Change Log +6/7/12 Phil: Add stable versions to UpgradeDatabase.php script +6/7/12 Phil: Added new Z_DeleteOldPrices.php script to purge prices which are past their end date 30/6/12 Phil: Attempt at quicker price retrieval 30/6/12 Phil: Allow creation of work orders for Raw materials - well intermediary components manufacture - per Bob Thomas email 26/06/12 Bob Thomas: StockAdjustments fix link to controlled stock adjustments entry Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/includes/DateFunctions.inc 2012-07-07 06:21:07 UTC (rev 5481) @@ -92,7 +92,7 @@ if (mb_strlen($Date_Array[2])>4) { $Date_Array[2]= mb_substr($Date_Array[2],0,2); } - + $MonthName = GetMonthText(date('n', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]))); return $MonthName . ' ' . date('Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])); @@ -458,7 +458,7 @@ /* takes a date in a the format specified in $_SESSION['DefaultDateFormat'] and converts to a yyyy/mm/dd format */ - $DateArray = array(); + $Date_Array = array(); $DateEntry = trim($DateEntry); if (mb_strpos($DateEntry,'/')) { @@ -487,7 +487,7 @@ } return $Date_Array[0].'-'.$Date_Array[1].'-'.$Date_Array[2]; - }elseif (($_SESSION['DefaultDateFormat']=='d/m/Y') + } elseif (($_SESSION['DefaultDateFormat']=='d/m/Y') OR $_SESSION['DefaultDateFormat']=='d.m.Y'){ if (mb_strlen($Date_Array[2])==2) { if ((int)$Date_Array[2] <=60) { @@ -522,11 +522,11 @@ function LastDayOfMonth ( $DateEntry) { /*Expects a date in DefaultDateFormat and * Returns the last day of the month in the entered date - * in the DefaultDateFormat - * + * in the DefaultDateFormat + * * mktime (0,0,0 month, day, year) */ - + $DateEntry = trim($DateEntry); if (mb_strpos($DateEntry,'/')) { @@ -565,8 +565,8 @@ } } $DateStamp = mktime(0,0,0, $Date_Array[1]+1, 0, $Date_Array[2]); - - + + } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y') { if (mb_strlen($Date_Array[2])==2) { if ((int)$Date_Array[2] <=60) { @@ -719,13 +719,13 @@ } function DateAdd ($DateToAddTo,$PeriodString,$NumberPeriods){ - /*Takes - * DateToAddTo in $_SESSION['DefaultDateFormat'] format + /*Takes + * DateToAddTo in $_SESSION['DefaultDateFormat'] format * $PeriodString is one of: * d - days * w - weeks * m - months - * y - years + * y - years * $NumberPeriods is an integer positve or negative */ $DateToAddTo = trim($DateToAddTo); @@ -925,7 +925,7 @@ } elseif (mb_strpos ($TransDate,'.')) { $Date_Array = explode('.',$TransDate); } - + if (($_SESSION['DefaultDateFormat']=='d/m/Y') or ($_SESSION['DefaultDateFormat']=='d.m.Y')){ $TransDate = mktime(0,0,0,$Date_Array[1],$Date_Array[0],$Date_Array[2]); } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y'){ @@ -947,7 +947,7 @@ $sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); - + if (is_null($myrow[0])){ $InsertFirstPeriodResult = DB_query("INSERT INTO periods VALUES (0,'" . Date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))) . "')",$db,_('Could not insert first period')); $InsertFirstPeriodResult = DB_query("INSERT INTO periods VALUES (1,'" . Date('Y-m-d',mktime(0,0,0,Date('m')+2,0,Date('Y'))) . "')",$db,_('Could not insert second period')); @@ -969,11 +969,11 @@ /* If the period number doesn't exist */ if (!PeriodExists($TransDate, $db)) { /* if the transaction is after the last period */ - + if ($TransDate > $LastPeriodEnd) { - + $PeriodEnd = mktime(0,0,0,Date('m', $TransDate)+1, 0, Date('Y', $TransDate)); - + while ($PeriodEnd >= $LastPeriodEnd) { if (Date('m', $LastPeriodEnd)<=13) { $LastPeriodEnd = mktime(0,0,0,Date('m', $LastPeriodEnd)+2, 0, Date('Y', $LastPeriodEnd)); @@ -1011,9 +1011,9 @@ /* Now return the period number of the transaction */ $MonthAfterTransDate = Mktime(0,0,0,Date('m',$TransDate)+1,Date('d',$TransDate),Date('Y',$TransDate)); - $GetPrdSQL = "SELECT periodno - FROM periods - WHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "' + $GetPrdSQL = "SELECT periodno + FROM periods + WHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "' AND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'"; $ErrMsg = _('An error occurred in retrieving the period number'); Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/includes/MainMenuLinksArray.php 2012-07-07 06:21:07 UTC (rev 5481) @@ -565,7 +565,8 @@ _('Import Fixed Assets from .csv file'), _('Create new company template SQL file and submit to webERP'), _('Re-calculate brought forward amounts in GL'), - _('Re-Post all GL transactions from a specified period') + _('Re-Post all GL transactions from a specified period'), + _('Purge all old prices') ); $MenuItems['Utilities']['Maintenance']['URL'] = array ('/Z_poAdmin.php', @@ -575,6 +576,7 @@ '/Z_ImportFixedAssets.php', '/Z_CreateCompanyTemplateFile.php', '/Z_UpdateChartDetailsBFwd.php', - '/Z_RePostGLFromPeriod.php' + '/Z_RePostGLFromPeriod.php', + '/Z_DeleteOldPrices.php' ); ?> \ No newline at end of file Modified: trunk/sql/mysql/upgrade4.08-4.09.sql =================================================================== --- trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-07 06:21:07 UTC (rev 5481) @@ -1,2 +1,4 @@ +INSERT INTO scripts VALUES ('Z_DeleteOldPrices.php','15','Deletes all old prices'); +INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code') UPDATE config SET confvalue='4.08.1' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-07 06:21:14
|
Revision: 5481 http://web-erp.svn.sourceforge.net/web-erp/?rev=5481&view=rev Author: daintree Date: 2012-07-07 06:21:07 +0000 (Sat, 07 Jul 2012) Log Message: ----------- new purge prices script Modified Paths: -------------- trunk/Prices.php trunk/doc/Change.log trunk/includes/DateFunctions.inc trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.08-4.09.sql Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/Prices.php 2012-07-07 06:21:07 UTC (rev 5481) @@ -74,35 +74,35 @@ $InputError =1; prnMsg (_('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); } - - if (FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ - if (! Is_Date($_POST['EndDate']) AND $_POST['EndDate']!=''){ - $InputError =1; - prnMsg (_('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); + if ($_POST['EndDate']!='') { + if (FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ + if (! Is_Date($_POST['EndDate']) AND $_POST['EndDate']!=''){ + $InputError =1; + prnMsg (_('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); + } + if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ + $InputError =1; + prnMsg (_('The end date is expected to be after the start date, enter an end date after the start date for this price'),'error'); + } + if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']),$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ + $InputError =1; + prnMsg(_('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!'),'error'); + } } - if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ - $InputError =1; - prnMsg (_('The end date is expected to be after the start date, enter an end date after the start date for this price'),'error'); - } - if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']),$_POST['EndDate']) AND $_POST['EndDate']!='' AND FormatDateForSQL($_POST['EndDate'])!='0000-00-00'){ - $InputError =1; - prnMsg(_('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!'),'error'); - } } if (Is_Date($_POST['EndDate'])){ $SQLEndDate = FormatDateForSQL($_POST['EndDate']); } else { $SQLEndDate = '0000-00-00'; } - + $sql = "SELECT COUNT(typeabbrev) FROM prices WHERE prices.stockid='".$Item."' AND startdate='" .FormatDateForSQL($_POST['StartDate']) . "' AND enddate ='" . $SQLEndDate . "' AND prices.typeabbrev='" . $_POST['TypeAbbrev'] . "' - AND prices.currabrev='" . $_POST['CurrAbrev'] . "' - AND prices.price='" . filter_number_format($_POST['Price']) . "'"; + AND prices.currabrev='" . $_POST['CurrAbrev'] . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); @@ -111,9 +111,9 @@ prnMsg( _('This price has already been entered. To change it you should edit it') , 'warn'); $InputError =1; } - - - + + + if (isset($_POST['OldTypeAbbrev']) AND isset($_POST['OldCurrAbrev']) AND mb_strlen($Item)>1 AND $InputError !=1) { /* Need to see if there is also a price entered that has an end date after the start date of this price and if so we will need to update it so there is no ambiguity as to which price will be used*/ @@ -157,10 +157,11 @@ '" . filter_number_format($_POST['Price']) . "')"; $ErrMsg = _('The new price could not be added'); $result = DB_query($sql,$db,$ErrMsg); - + ReSequenceEffectiveDates ($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db) ; prnMsg(_('The new price has been inserted'),'success'); } + unset($_POST['Price']); unset($_POST['StartDate']); unset($_POST['EndDate']); @@ -182,176 +183,176 @@ } //Always do this stuff -if ($InputError ==0){ - $sql = "SELECT currencies.currency, - salestypes.sales_type, - prices.price, - prices.stockid, - prices.typeabbrev, - prices.currabrev, - prices.startdate, - prices.enddate, - currencies.decimalplaces AS currdecimalplaces - FROM prices - INNER JOIN salestypes - ON prices.typeabbrev = salestypes.typeabbrev - INNER JOIN currencies - ON prices.currabrev=currencies.currabrev - WHERE prices.stockid='".$Item."' - AND prices.debtorno='' - ORDER BY prices.currabrev, - prices.typeabbrev, - prices.startdate"; - $result = DB_query($sql,$db); +$sql = "SELECT currencies.currency, + salestypes.sales_type, + prices.price, + prices.stockid, + prices.typeabbrev, + prices.currabrev, + prices.startdate, + prices.enddate, + currencies.decimalplaces AS currdecimalplaces + FROM prices + INNER JOIN salestypes + ON prices.typeabbrev = salestypes.typeabbrev + INNER JOIN currencies + ON prices.currabrev=currencies.currabrev + WHERE prices.stockid='".$Item."' + AND prices.debtorno='' + ORDER BY prices.currabrev, + prices.typeabbrev, + prices.startdate"; - if (DB_num_rows($result) > 0) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<table class="selection"> - <tr> - <th colspan="7"> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . - _('Pricing for part') . ': - <input type="text" name="Item" size="22" value="' . $Item . '" maxlength="20" /> - <input type="submit" name="NewPart" value="' . _('Review Prices') . '" /></th> - </tr>'; +$result = DB_query($sql,$db); - echo '<tr><th>' . _('Currency') . '</th> - <th>' . _('Sales Type') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Start Date') . ' </th> - <th>' . _('End Date') . '</th> - </tr>'; +if (DB_num_rows($result) > 0) { + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; + echo '<div>'; + echo '<table class="selection"> + <tr> + <th colspan="7"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . + _('Pricing for part') . ': + <input type="text" name="Item" size="22" value="' . $Item . '" maxlength="20" /> + <input type="submit" name="NewPart" value="' . _('Review Prices') . '" /></th> + </tr>'; - $k=0; //row colour counter + echo '<tr><th>' . _('Currency') . '</th> + <th>' . _('Sales Type') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Start Date') . ' </th> + <th>' . _('End Date') . '</th> + </tr>'; - while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - if ($myrow['enddate']=='0000-00-00'){ - $EndDateDisplay = _('No End Date'); - } else { - $EndDateDisplay = ConvertSQLDate($myrow['enddate']); - } - /*Only allow access to modify prices if securiy token 5 is allowed */ - if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { - echo '<td>' . $myrow['currency'] . '</td> - <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> - <td>' . ConvertSQLDate($myrow['startdate']) . '</td> - <td>' . $EndDateDisplay . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&Price=' . $myrow['price'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&Edit=1">' . _('Edit') . '</a></td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this price?') . '\');">' . _('Delete') . '</a></td></tr>'; - - } else { - echo '<td>' . $myrow['currency'] . '</td> - <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> - <td>' . ConvertSQLDate($myrow['startdate']) . '</td> - <td>' . $EndDateDisplay . '</td></tr>'; - } + $k=0; //row colour counter + while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; } - //END WHILE LIST LOOP - echo '</table><br />'; - echo '</div> - </form>'; - } else { - prnMsg(_('There are no prices set up for this part'),'warn'); - } + if ($myrow['enddate']=='0000-00-00'){ + $EndDateDisplay = _('No End Date'); + } else { + $EndDateDisplay = ConvertSQLDate($myrow['enddate']); + } + /*Only allow access to modify prices if securiy token 5 is allowed */ + if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { + echo '<td>' . $myrow['currency'] . '</td> + <td>' . $myrow['sales_type'] . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> + <td>' . ConvertSQLDate($myrow['startdate']) . '</td> + <td>' . $EndDateDisplay . '</td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&Price=' . $myrow['price'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&Edit=1">' . _('Edit') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this price?') . '\');">' . _('Delete') . '</a></td></tr>'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($_GET['Edit'])){ - echo '<input type="hidden" name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'" />'; - echo '<input type="hidden" name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '" />'; - echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] . '" />'; - echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '" />'; - $_POST['CurrAbrev'] = $_GET['CurrAbrev']; - $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; - /*the price sent with the get is sql format price so no need to filter */ - $_POST['Price'] = $_GET['Price']; - $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); - if ($_GET['EndDate']=='' OR $_GET['EndDate']=='0000-00-00'){ - $_POST['EndDate'] = ''; } else { - $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + echo '<td>' . $myrow['currency'] . '</td> + <td>' . $myrow['sales_type'] . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> + <td>' . ConvertSQLDate($myrow['startdate']) . '</td> + <td>' . $EndDateDisplay . '</td></tr>'; } + } + //END WHILE LIST LOOP + echo '</table><br />'; + echo '</div> + </form>'; +} else { + prnMsg(_('There are no prices set up for this part'),'warn'); +} - $SQL = "SELECT currabrev, - currency - FROM currencies"; - $result = DB_query($SQL,$db); +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; +echo '<div>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if (isset($_GET['Edit'])){ + echo '<input type="hidden" name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'" />'; + echo '<input type="hidden" name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '" />'; + echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] . '" />'; + echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '" />'; + $_POST['CurrAbrev'] = $_GET['CurrAbrev']; + $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; + /*the price sent with the get is sql format price so no need to filter */ + $_POST['Price'] = $_GET['Price']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + if ($_GET['EndDate']=='' OR $_GET['EndDate']=='0000-00-00'){ + $_POST['EndDate'] = ''; + } else { + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + } +} - echo '<br /><table class="selection">'; - echo '<tr><th colspan="5"><h3>' . $Item . ' - ' . $PartDescription . '</h3></th></tr>'; - echo '<tr><td>' . _('Currency') . ':</td> - <td><select name="CurrAbrev">'; - while ($myrow = DB_fetch_array($result)) { - if ($myrow['currabrev']==$_POST['CurrAbrev']) { - echo '<option selected="selected" value="'; - } else { - echo '<option value="'; - } - echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } //end while loop +$SQL = "SELECT currabrev, + currency + FROM currencies"; +$result = DB_query($SQL,$db); - DB_free_result($result); +echo '<br /><table class="selection">'; +echo '<tr><th colspan="5"><h3>' . $Item . ' - ' . $PartDescription . '</h3></th></tr>'; +echo '<tr><td>' . _('Currency') . ':</td> + <td><select name="CurrAbrev">'; +while ($myrow = DB_fetch_array($result)) { + if ($myrow['currabrev']==$_POST['CurrAbrev']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; +} //end while loop - echo '</select> </td></tr> - <tr> - <td>' . _('Sales Type Price List') . ':</td> - <td><select name="TypeAbbrev">'; +DB_free_result($result); - $SQL = "SELECT typeabbrev, sales_type FROM salestypes"; - $result = DB_query($SQL,$db); +echo '</select> </td></tr> + <tr> + <td>' . _('Sales Type Price List') . ':</td> + <td><select name="TypeAbbrev">'; - while ($myrow = DB_fetch_array($result)) { - if ($myrow['typeabbrev']==$_POST['TypeAbbrev']) { - echo '<option selected="selected" value="'; - } else { - echo '<option value="'; - } - echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; +$SQL = "SELECT typeabbrev, sales_type FROM salestypes"; +$result = DB_query($SQL,$db); - } //end while loop - echo '</select></td></tr>'; - - DB_free_result($result); +while ($myrow = DB_fetch_array($result)) { + if ($myrow['typeabbrev']==$_POST['TypeAbbrev']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; - if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); - } - if (!isset($_POST['EndDate'])){ - $_POST['EndDate'] = ''; - } - echo '<tr><td>' . _('Price Effective From Date') . ':</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="StartDate" size="10" maxlength="10" value="' . $_POST['StartDate'] . '" /></td></tr>'; - echo '<tr><td>' . _('Price Effective To Date') . ':</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="EndDate" size="10" maxlength="10" value="' . $_POST['EndDate'] . '" />'; - echo '<input type="hidden" name="Item" value="' . $Item.'" /></td></tr>'; - echo '<tr><td>' . _('Price') . ':</td> - <td> - <input type="text" class="number" name="Price" size="12" maxlength="11" value="'; - if (isset($_POST['Price'])) { - echo $_POST['Price']; - } - echo '" /> - </td></tr> - </table> - <br /><div class="centre"> - <input type="submit" name="submit" value="' . _('Enter') . '/' . _('Amend Price') . '" /> - </div>'; +} //end while loop +echo '</select></td></tr>'; + +DB_free_result($result); + +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); } +if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = ''; +} +echo '<tr><td>' . _('Price Effective From Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="StartDate" size="10" maxlength="10" value="' . $_POST['StartDate'] . '" /></td></tr>'; +echo '<tr><td>' . _('Price Effective To Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="EndDate" size="10" maxlength="10" value="' . $_POST['EndDate'] . '" />'; +echo '<input type="hidden" name="Item" value="' . $Item.'" /></td></tr>'; +echo '<tr><td>' . _('Price') . ':</td> + <td> + <input type="text" class="number" name="Price" size="12" maxlength="11" value="'; + if (isset($_POST['Price'])) { + echo $_POST['Price']; + } + echo '" /> + </td></tr> +</table> +<br /><div class="centre"> +<input type="submit" name="submit" value="' . _('Enter') . '/' . _('Amend Price') . '" /> +</div>'; + echo '</div> </form>'; include('includes/footer.inc'); @@ -361,7 +362,7 @@ /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where one price falls inside another effective date range except in the case of a blank end date - ie no end date - the default price for the currency/salestype. I first thought that we would need to update the previous default price (blank end date), when a new default price is entered, to have an end date of the startdate of this new default price less 1 day - but this is converting a default price into a special price which could result in having two special prices over the same date range - best to leave it unchanged and use logic in the GetPrice.inc to ensure the correct default price is returned - * + * * After further discussion (Ricard) if the new price has a blank end date - i.e. no end then the pre-existing price with no end date should be changed to have an end date just prior to the new default (no end date) price commencing */ //this is just the case where debtorno='' - see the Prices_Customer.php script for customer special prices @@ -376,7 +377,7 @@ AND enddate <>'0000-00-00' ORDER BY startdate, enddate"; $result = DB_query($SQL,$db); - + while ($myrow = DB_fetch_array($result)){ if (isset($NextStartDate)){ if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ @@ -402,7 +403,7 @@ $EndDate = $myrow['enddate']; $Price = $myrow['price']; } // end of loop around all prices - + //Now look for duplicate prices with no end $SQL = "SELECT price, startdate, @@ -415,7 +416,7 @@ AND enddate ='0000-00-00' ORDER BY startdate"; $result = DB_query($SQL,$db); - + while ($myrow = DB_fetch_array($result)) { if (isset($OldStartDate)){ /*Need to make the end date the new start date less 1 day */ @@ -431,7 +432,7 @@ } $OldStartDate = $myrow['startdate']; } // end of loop around duplicate no end date prices - + } // end function ReSequenceEffectiveDates ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/doc/Change.log 2012-07-07 06:21:07 UTC (rev 5481) @@ -1,5 +1,7 @@ webERP Change Log +6/7/12 Phil: Add stable versions to UpgradeDatabase.php script +6/7/12 Phil: Added new Z_DeleteOldPrices.php script to purge prices which are past their end date 30/6/12 Phil: Attempt at quicker price retrieval 30/6/12 Phil: Allow creation of work orders for Raw materials - well intermediary components manufacture - per Bob Thomas email 26/06/12 Bob Thomas: StockAdjustments fix link to controlled stock adjustments entry Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/includes/DateFunctions.inc 2012-07-07 06:21:07 UTC (rev 5481) @@ -92,7 +92,7 @@ if (mb_strlen($Date_Array[2])>4) { $Date_Array[2]= mb_substr($Date_Array[2],0,2); } - + $MonthName = GetMonthText(date('n', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]))); return $MonthName . ' ' . date('Y', mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0])); @@ -458,7 +458,7 @@ /* takes a date in a the format specified in $_SESSION['DefaultDateFormat'] and converts to a yyyy/mm/dd format */ - $DateArray = array(); + $Date_Array = array(); $DateEntry = trim($DateEntry); if (mb_strpos($DateEntry,'/')) { @@ -487,7 +487,7 @@ } return $Date_Array[0].'-'.$Date_Array[1].'-'.$Date_Array[2]; - }elseif (($_SESSION['DefaultDateFormat']=='d/m/Y') + } elseif (($_SESSION['DefaultDateFormat']=='d/m/Y') OR $_SESSION['DefaultDateFormat']=='d.m.Y'){ if (mb_strlen($Date_Array[2])==2) { if ((int)$Date_Array[2] <=60) { @@ -522,11 +522,11 @@ function LastDayOfMonth ( $DateEntry) { /*Expects a date in DefaultDateFormat and * Returns the last day of the month in the entered date - * in the DefaultDateFormat - * + * in the DefaultDateFormat + * * mktime (0,0,0 month, day, year) */ - + $DateEntry = trim($DateEntry); if (mb_strpos($DateEntry,'/')) { @@ -565,8 +565,8 @@ } } $DateStamp = mktime(0,0,0, $Date_Array[1]+1, 0, $Date_Array[2]); - - + + } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y') { if (mb_strlen($Date_Array[2])==2) { if ((int)$Date_Array[2] <=60) { @@ -719,13 +719,13 @@ } function DateAdd ($DateToAddTo,$PeriodString,$NumberPeriods){ - /*Takes - * DateToAddTo in $_SESSION['DefaultDateFormat'] format + /*Takes + * DateToAddTo in $_SESSION['DefaultDateFormat'] format * $PeriodString is one of: * d - days * w - weeks * m - months - * y - years + * y - years * $NumberPeriods is an integer positve or negative */ $DateToAddTo = trim($DateToAddTo); @@ -925,7 +925,7 @@ } elseif (mb_strpos ($TransDate,'.')) { $Date_Array = explode('.',$TransDate); } - + if (($_SESSION['DefaultDateFormat']=='d/m/Y') or ($_SESSION['DefaultDateFormat']=='d.m.Y')){ $TransDate = mktime(0,0,0,$Date_Array[1],$Date_Array[0],$Date_Array[2]); } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y'){ @@ -947,7 +947,7 @@ $sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); - + if (is_null($myrow[0])){ $InsertFirstPeriodResult = DB_query("INSERT INTO periods VALUES (0,'" . Date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))) . "')",$db,_('Could not insert first period')); $InsertFirstPeriodResult = DB_query("INSERT INTO periods VALUES (1,'" . Date('Y-m-d',mktime(0,0,0,Date('m')+2,0,Date('Y'))) . "')",$db,_('Could not insert second period')); @@ -969,11 +969,11 @@ /* If the period number doesn't exist */ if (!PeriodExists($TransDate, $db)) { /* if the transaction is after the last period */ - + if ($TransDate > $LastPeriodEnd) { - + $PeriodEnd = mktime(0,0,0,Date('m', $TransDate)+1, 0, Date('Y', $TransDate)); - + while ($PeriodEnd >= $LastPeriodEnd) { if (Date('m', $LastPeriodEnd)<=13) { $LastPeriodEnd = mktime(0,0,0,Date('m', $LastPeriodEnd)+2, 0, Date('Y', $LastPeriodEnd)); @@ -1011,9 +1011,9 @@ /* Now return the period number of the transaction */ $MonthAfterTransDate = Mktime(0,0,0,Date('m',$TransDate)+1,Date('d',$TransDate),Date('Y',$TransDate)); - $GetPrdSQL = "SELECT periodno - FROM periods - WHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "' + $GetPrdSQL = "SELECT periodno + FROM periods + WHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "' AND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'"; $ErrMsg = _('An error occurred in retrieving the period number'); Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/includes/MainMenuLinksArray.php 2012-07-07 06:21:07 UTC (rev 5481) @@ -565,7 +565,8 @@ _('Import Fixed Assets from .csv file'), _('Create new company template SQL file and submit to webERP'), _('Re-calculate brought forward amounts in GL'), - _('Re-Post all GL transactions from a specified period') + _('Re-Post all GL transactions from a specified period'), + _('Purge all old prices') ); $MenuItems['Utilities']['Maintenance']['URL'] = array ('/Z_poAdmin.php', @@ -575,6 +576,7 @@ '/Z_ImportFixedAssets.php', '/Z_CreateCompanyTemplateFile.php', '/Z_UpdateChartDetailsBFwd.php', - '/Z_RePostGLFromPeriod.php' + '/Z_RePostGLFromPeriod.php', + '/Z_DeleteOldPrices.php' ); ?> \ No newline at end of file Modified: trunk/sql/mysql/upgrade4.08-4.09.sql =================================================================== --- trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-06 09:24:44 UTC (rev 5480) +++ trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-07 06:21:07 UTC (rev 5481) @@ -1,2 +1,4 @@ +INSERT INTO scripts VALUES ('Z_DeleteOldPrices.php','15','Deletes all old prices'); +INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code') UPDATE config SET confvalue='4.08.1' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-08 10:14:22
|
Revision: 5483 http://web-erp.svn.sourceforge.net/web-erp/?rev=5483&view=rev Author: daintree Date: 2012-07-08 10:14:15 +0000 (Sun, 08 Jul 2012) Log Message: ----------- fix links to non-existent script Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.08-4.09.sql Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-07-07 10:02:45 UTC (rev 5482) +++ trunk/includes/MainMenuLinksArray.php 2012-07-08 10:14:15 UTC (rev 5483) @@ -533,7 +533,6 @@ $MenuItems['Utilities']['Transactions']['Caption'] = array (_('Change A Customer Code'), _('Change A Customer Branch Code'), _('Change An Inventory Item Code'), - _('Change A Supplier Code'), _('Change A Location Code'), _('Update costs for all BOM items, from the bottom up'), _('Re-apply costs to Sales Analysis'), @@ -543,7 +542,6 @@ $MenuItems['Utilities']['Transactions']['URL'] = array ('/Z_ChangeCustomerCode.php', '/Z_ChangeBranchCode.php', '/Z_ChangeStockCode.php', - '/Z_ChangeSupplierCode.php', '/Z_ChangeLocationCode.php', '/Z_BottomUpCosts.php', '/Z_ReApplyCostToSA.php', Modified: trunk/sql/mysql/upgrade4.08-4.09.sql =================================================================== --- trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-07 10:02:45 UTC (rev 5482) +++ trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-08 10:14:15 UTC (rev 5483) @@ -1,4 +1,5 @@ INSERT INTO scripts VALUES ('Z_DeleteOldPrices.php','15','Deletes all old prices'); -INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code') -UPDATE config SET confvalue='4.08.1' WHERE confname='VersionNumber'; +INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code'); +DELETE FROM scripts WHERE script='Z_ChangeSupplierCode.php'; +UPDATE config SET confvalue='4.08.2' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-08 10:14:22
|
Revision: 5483 http://web-erp.svn.sourceforge.net/web-erp/?rev=5483&view=rev Author: daintree Date: 2012-07-08 10:14:15 +0000 (Sun, 08 Jul 2012) Log Message: ----------- fix links to non-existent script Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.08-4.09.sql Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-07-07 10:02:45 UTC (rev 5482) +++ trunk/includes/MainMenuLinksArray.php 2012-07-08 10:14:15 UTC (rev 5483) @@ -533,7 +533,6 @@ $MenuItems['Utilities']['Transactions']['Caption'] = array (_('Change A Customer Code'), _('Change A Customer Branch Code'), _('Change An Inventory Item Code'), - _('Change A Supplier Code'), _('Change A Location Code'), _('Update costs for all BOM items, from the bottom up'), _('Re-apply costs to Sales Analysis'), @@ -543,7 +542,6 @@ $MenuItems['Utilities']['Transactions']['URL'] = array ('/Z_ChangeCustomerCode.php', '/Z_ChangeBranchCode.php', '/Z_ChangeStockCode.php', - '/Z_ChangeSupplierCode.php', '/Z_ChangeLocationCode.php', '/Z_BottomUpCosts.php', '/Z_ReApplyCostToSA.php', Modified: trunk/sql/mysql/upgrade4.08-4.09.sql =================================================================== --- trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-07 10:02:45 UTC (rev 5482) +++ trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-08 10:14:15 UTC (rev 5483) @@ -1,4 +1,5 @@ INSERT INTO scripts VALUES ('Z_DeleteOldPrices.php','15','Deletes all old prices'); -INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code') -UPDATE config SET confvalue='4.08.1' WHERE confname='VersionNumber'; +INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code'); +DELETE FROM scripts WHERE script='Z_ChangeSupplierCode.php'; +UPDATE config SET confvalue='4.08.2' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-08 19:44:37
|
Revision: 5485 http://web-erp.svn.sourceforge.net/web-erp/?rev=5485&view=rev Author: daintree Date: 2012-07-08 19:44:30 +0000 (Sun, 08 Jul 2012) Log Message: ----------- reinstated Z_ChangeSupplierCode.php Modified Paths: -------------- trunk/doc/Change.log trunk/doc/Manual/ManualCreatingNewSystem.html trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.08-4.09.sql Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/doc/Change.log 2012-07-08 19:44:30 UTC (rev 5485) @@ -1,5 +1,6 @@ webERP Change Log +9/7/12 Tim/Ricard: Add Z_ChangeSupplierCode.php - 6/7/12 Phil: Add stable versions to UpgradeDatabase.php script 6/7/12 Phil: Added new Z_DeleteOldPrices.php script to purge prices which are past their end date 30/6/12 Phil: Attempt at quicker price retrieval Modified: trunk/doc/Manual/ManualCreatingNewSystem.html =================================================================== --- trunk/doc/Manual/ManualCreatingNewSystem.html 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/doc/Manual/ManualCreatingNewSystem.html 2012-07-08 19:44:30 UTC (rev 5485) @@ -355,7 +355,7 @@ <p>Wikis are a valuable business advantage for a dispersed company. However, they make no sense for a 5 man operation all in the same office - that's why wacko wiki is not bundled with webERP - it is simply not appropriate accross all the businesses that might be using webERP.</p> - <p><a href="http://wackowiki.com/files/wacko.r4.2.zip">Get Wacko Wiki</a></p> + <p><a href="http://wackowiki.org/">Get Wacko Wiki</a></p> <p></p> </td> Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/includes/MainMenuLinksArray.php 2012-07-08 19:44:30 UTC (rev 5485) @@ -532,6 +532,7 @@ $MenuItems['Utilities']['Transactions']['Caption'] = array (_('Change A Customer Code'), _('Change A Customer Branch Code'), + _('Change A Supplier Code'), _('Change An Inventory Item Code'), _('Change A Location Code'), _('Update costs for all BOM items, from the bottom up'), @@ -541,6 +542,7 @@ $MenuItems['Utilities']['Transactions']['URL'] = array ('/Z_ChangeCustomerCode.php', '/Z_ChangeBranchCode.php', + '/Z_ChangeSupplierCode.php', '/Z_ChangeStockCode.php', '/Z_ChangeLocationCode.php', '/Z_BottomUpCosts.php', Modified: trunk/sql/mysql/upgrade4.08-4.09.sql =================================================================== --- trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-08 19:44:30 UTC (rev 5485) @@ -1,5 +1,4 @@ INSERT INTO scripts VALUES ('Z_DeleteOldPrices.php','15','Deletes all old prices'); INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code'); -DELETE FROM scripts WHERE script='Z_ChangeSupplierCode.php'; UPDATE config SET confvalue='4.08.2' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-08 19:44:37
|
Revision: 5485 http://web-erp.svn.sourceforge.net/web-erp/?rev=5485&view=rev Author: daintree Date: 2012-07-08 19:44:30 +0000 (Sun, 08 Jul 2012) Log Message: ----------- reinstated Z_ChangeSupplierCode.php Modified Paths: -------------- trunk/doc/Change.log trunk/doc/Manual/ManualCreatingNewSystem.html trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.08-4.09.sql Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/doc/Change.log 2012-07-08 19:44:30 UTC (rev 5485) @@ -1,5 +1,6 @@ webERP Change Log +9/7/12 Tim/Ricard: Add Z_ChangeSupplierCode.php - 6/7/12 Phil: Add stable versions to UpgradeDatabase.php script 6/7/12 Phil: Added new Z_DeleteOldPrices.php script to purge prices which are past their end date 30/6/12 Phil: Attempt at quicker price retrieval Modified: trunk/doc/Manual/ManualCreatingNewSystem.html =================================================================== --- trunk/doc/Manual/ManualCreatingNewSystem.html 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/doc/Manual/ManualCreatingNewSystem.html 2012-07-08 19:44:30 UTC (rev 5485) @@ -355,7 +355,7 @@ <p>Wikis are a valuable business advantage for a dispersed company. However, they make no sense for a 5 man operation all in the same office - that's why wacko wiki is not bundled with webERP - it is simply not appropriate accross all the businesses that might be using webERP.</p> - <p><a href="http://wackowiki.com/files/wacko.r4.2.zip">Get Wacko Wiki</a></p> + <p><a href="http://wackowiki.org/">Get Wacko Wiki</a></p> <p></p> </td> Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/includes/MainMenuLinksArray.php 2012-07-08 19:44:30 UTC (rev 5485) @@ -532,6 +532,7 @@ $MenuItems['Utilities']['Transactions']['Caption'] = array (_('Change A Customer Code'), _('Change A Customer Branch Code'), + _('Change A Supplier Code'), _('Change An Inventory Item Code'), _('Change A Location Code'), _('Update costs for all BOM items, from the bottom up'), @@ -541,6 +542,7 @@ $MenuItems['Utilities']['Transactions']['URL'] = array ('/Z_ChangeCustomerCode.php', '/Z_ChangeBranchCode.php', + '/Z_ChangeSupplierCode.php', '/Z_ChangeStockCode.php', '/Z_ChangeLocationCode.php', '/Z_BottomUpCosts.php', Modified: trunk/sql/mysql/upgrade4.08-4.09.sql =================================================================== --- trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-08 12:57:46 UTC (rev 5484) +++ trunk/sql/mysql/upgrade4.08-4.09.sql 2012-07-08 19:44:30 UTC (rev 5485) @@ -1,5 +1,4 @@ INSERT INTO scripts VALUES ('Z_DeleteOldPrices.php','15','Deletes all old prices'); INSERT INTO scripts VALUES ('Z_ChangeLocationCode.php','15','Change a locations code and in all tables where the old code was used to the new code'); -DELETE FROM scripts WHERE script='Z_ChangeSupplierCode.php'; UPDATE config SET confvalue='4.08.2' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-07-12 10:09:56
|
Revision: 5496 http://web-erp.svn.sourceforge.net/web-erp/?rev=5496&view=rev Author: daintree Date: 2012-07-12 10:09:49 +0000 (Thu, 12 Jul 2012) Log Message: ----------- Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/api/api_webERPsettings.php trunk/doc/Change.log trunk/includes/GetConfig.php trunk/includes/Z_POSDataCreation.php trunk/includes/session.inc Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/PO_Header.php 2012-07-12 10:09:49 UTC (rev 5496) @@ -179,7 +179,7 @@ /* set the SupplierID we got */ $_SESSION['PO'.$identifier]->SupplierID = $_GET['SelectedSupplier']; $_SESSION['PO'.$identifier]->DeliveryDate = date($_SESSION['DefaultDateFormat']); - + $_SESSION['PO'.$identifier]->Initiator = $_SESSION['UsersRealName']; $_SESSION['RequireSupplierSelection'] = 0; $_POST['Select'] = $_GET['SelectedSupplier']; @@ -760,7 +760,7 @@ <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="DeliveryDate" size="11" value="' . $_POST['DeliveryDate'] . '" /></td></tr>'; if (!isset($_POST['Initiator'])) { - $_POST['Initiator'] = $_SESSION['UserID']; + $_POST['Initiator'] = $_SESSION['UsersRealName']; $_POST['Requisition'] = ''; } Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/PO_Items.php 2012-07-12 10:09:49 UTC (rev 5496) @@ -596,6 +596,13 @@ $SuppliersUnitOfMeasure = $PurchRow['suppliersuom']; $SuppliersPartNo = $PurchRow['suppliers_partno']; $LeadTime = $PurchRow['leadtime']; + /* Work out the delivery date based on today + lead time + * if > header DeliveryDate then set DeliveryDate to today + leadtime + */ + $DeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$LeadTime); + if (! Date1GreaterThanDate2($DeliveryDate,$_SESSION['PO'.$identifier]->DeliveryDate)){ + $DeliveryDate = $_SESSION['PO'.$identifier]->DeliveryDate; + } } else { // no purchasing data setup $PurchPrice = 0; $ConversionFactor = 1; @@ -603,6 +610,7 @@ $SuppliersUnitOfMeasure = $ItemRow['units']; $SuppliersPartNo = ''; $LeadTime = 1; + $DeliveryDate = $_SESSION['PO'.$identifier]->DeliveryDate; } $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, @@ -614,7 +622,7 @@ $PurchPrice, $ItemRow['units'], $ItemRow['stockact'], - $_SESSION['PO'.$identifier]->DeliveryDate, + $DeliveryDate, 0, 0, 0, Modified: trunk/api/api_webERPsettings.php =================================================================== --- trunk/api/api_webERPsettings.php 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/api/api_webERPsettings.php 2012-07-12 10:09:49 UTC (rev 5496) @@ -108,6 +108,7 @@ } return $ReturnValue; } + function DeletePOSData($User, $Password) { $Errors = array(); $db = db($User, $Password); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/doc/Change.log 2012-07-12 10:09:49 UTC (rev 5496) @@ -1,6 +1,7 @@ webERP Change Log -9/7/12 Tim/Ricard: Add Z_ChangeSupplierCode.php - +10/7/12 Phil: Made purchase order lines look at the purchasing data lead time and set the delivery date of the line to today + the lead time if this is beyond the delivery date specified in the PO header. +9/7/12 Tim/Ricard: Add Z_ChangeSupplierCode.php 6/7/12 Phil: Add stable versions to UpgradeDatabase.php script 6/7/12 Phil: Added new Z_DeleteOldPrices.php script to purge prices which are past their end date 30/6/12 Phil: Attempt at quicker price retrieval Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/includes/GetConfig.php 2012-07-12 10:09:49 UTC (rev 5496) @@ -3,7 +3,7 @@ // $ForceConfigReload to true /* $Id$*/ -if(isset($ForceConfigReload) and $ForceConfigReload==TRUE OR !isset($_SESSION['CompanyDefaultsLoaded'])) { +if(isset($ForceConfigReload) AND $ForceConfigReload==true OR !isset($_SESSION['CompanyDefaultsLoaded'])) { global $db; // It is global, we may not be. $sql = "SELECT confname, confvalue FROM config"; $ErrMsg = _('Could not get the configuration parameters from the database because'); Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/includes/Z_POSDataCreation.php 2012-07-12 10:09:49 UTC (rev 5496) @@ -36,7 +36,7 @@ fwrite($FileHandle,"DELETE FROM salestypes;\n"); - $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes',$db); + $result = DB_query("SELECT typeabbrev, sales_type FROM salestypes",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO salestypes VALUES ('" . $myrow['typeabbrev'] . "', '" . SQLite_Escape ($myrow['sales_type']) . "');\n"); @@ -44,7 +44,7 @@ } fwrite($FileHandle,"DELETE FROM holdreasons;\n"); - $result = DB_query('SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons',$db); + $result = DB_query("SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO holdreasons VALUES ('" . $myrow['reasoncode'] . "', '" . SQLite_Escape ($myrow['reasondescription']) . "', '" . $myrow['dissallowinvoices'] . "');\n"); @@ -52,7 +52,7 @@ } fwrite($FileHandle,"DELETE FROM paymentterms;\n"); - $result = DB_query('SELECT termsindicator, terms FROM paymentterms',$db); + $result = DB_query("SELECT termsindicator, terms FROM paymentterms",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO paymentterms VALUES ('" . $myrow['termsindicator'] . "', '" . SQLite_Escape ($myrow['terms']) . "');\n"); @@ -60,7 +60,7 @@ } fwrite($FileHandle,"DELETE FROM paymentmethods;\n"); - $result = DB_query('SELECT paymentid, paymentname,opencashdrawer FROM paymentmethods',$db); + $result = DB_query("SELECT paymentid, paymentname,opencashdrawer FROM paymentmethods",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO paymentmethods VALUES ('" . $myrow['paymentid'] . "', '" . SQLite_Escape ($myrow['paymentname']) . "', '" . $myrow['opencashdrawer'] . "');\n"); @@ -68,7 +68,7 @@ } fwrite($FileHandle,"DELETE FROM locations;\n"); - $result = DB_query('SELECT loccode, locationname,taxprovinceid FROM locations',$db); + $result = DB_query("SELECT loccode, locationname,taxprovinceid FROM locations",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO locations VALUES ('" . $myrow['loccode'] . "', '" . SQLite_Escape ($myrow['locationname']) . "', '" . $myrow['taxprovinceid'] . "');\n"); @@ -76,14 +76,14 @@ } fwrite($FileHandle,"DELETE FROM stockcategory;\n"); - $result = DB_query('SELECT categoryid, categorydescription FROM stockcategory',$db); + $result = DB_query("SELECT categoryid, categorydescription FROM stockcategory",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO stockcategory VALUES ('" . $myrow['categoryid'] . "', '" . SQLite_Escape ($myrow['categorydescription']) . "');\n"); } fwrite($FileHandle,"DELETE FROM taxgroups;\n"); - $result = DB_query('SELECT taxgroupid, taxgroupdescription FROM taxgroups',$db); + $result = DB_query("SELECT taxgroupid, taxgroupdescription FROM taxgroups",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO taxgroups VALUES ('" . $myrow['taxgroupid'] . "', '" . SQLite_Escape ($myrow['taxgroupdescription']) . "');\n"); @@ -91,21 +91,21 @@ } fwrite($FileHandle,"DELETE FROM taxgrouptaxes;\n"); - $result = DB_query('SELECT taxgroupid, taxauthid, calculationorder, taxontax FROM taxgrouptaxes',$db); + $result = DB_query("SELECT taxgroupid, taxauthid, calculationorder, taxontax FROM taxgrouptaxes",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO taxgrouptaxes VALUES ('" . $myrow['taxgroupid'] . "', '" . $myrow['taxauthid'] . "', '" . $myrow['calculationorder'] . "', '" . $myrow['taxontax'] . "');\n"); } fwrite($FileHandle,"DELETE FROM taxauthorities;\n"); - $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + $result = DB_query("SELECT taxid, description FROM taxauthorities",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO taxauthorities VALUES ('" . $myrow['taxid'] . "', '" . SQLite_Escape ($myrow['description']) . "');\n"); } fwrite($FileHandle,"DELETE FROM taxauthrates;\n"); - $result = DB_query('SELECT taxauthority, dispatchtaxprovince, taxcatid, taxrate FROM taxauthrates',$db); + $result = DB_query("SELECT taxauthority, dispatchtaxprovince, taxcatid, taxrate FROM taxauthrates",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO taxauthrates VALUES ('" . $myrow['taxauthority'] . "', '" . $myrow['dispatchtaxprovince'] . "', '" . $myrow['taxcatid'] . "', '" . $myrow['taxrate'] . "');\n"); @@ -116,7 +116,10 @@ while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); - $Price = GetPriceQuick ($myrow['stockid'], $_POST['POSDebtorNo'], $_POST['POSBranchCode'], $DefaultPriceList, $db); + + fwrite($FileHandle,"DELETE FROM prices WHERE stockid='" . $myrow['stockid'] . "';\n"); + + $Price = GetPriceQuick ($myrow['stockid'], $POSDebtorNo, $POSBranchCode, $DefaultPriceList, $db); if ($Price!=0) { fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); } @@ -154,7 +157,7 @@ } function SQLite_Escape($String) { - $SearchCharacters = array('&', '"', "'",'<', '>',"\n","\r" ); + $SearchCharacters = array('&', '"', "'",'<', '>',"\n","\r"); $ReplaceWith = array('&', '""', "''", '<', '>', '', ' '); $String = str_replace($SearchCharacters, $ReplaceWith, $String); Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-07-11 07:15:36 UTC (rev 5495) +++ trunk/includes/session.inc 2012-07-12 10:09:49 UTC (rev 5496) @@ -31,7 +31,7 @@ include($PathPrefix . 'includes/ConnectDB.inc'); include($PathPrefix . 'includes/DateFunctions.inc'); -// Un comment to turn off attempts counter +// Uncomment to turn off attempts counter //$_SESSION['AttemptsCounter'] = 0; if (!isset($_SESSION['AttemptsCounter'])){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |