[Weberp-svn] SF.net SVN: weberp:[5304] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-05-17 19:20:00
|
Revision: 5304 http://weberp.svn.sourceforge.net/weberp/?rev=5304&view=rev Author: tim_schofield Date: 2011-05-17 19:19:52 +0000 (Tue, 17 May 2011) Log Message: ----------- Improvements to Cash Sales Modified Paths: -------------- trunk/.bzrignore trunk/CounterSales.php trunk/includes/GetPrice.inc trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/.bzrignore =================================================================== --- trunk/.bzrignore 2011-05-16 17:53:41 UTC (rev 5303) +++ trunk/.bzrignore 2011-05-17 19:19:52 UTC (rev 5304) @@ -2,3 +2,5 @@ .bzrignore geany_run_script.sh companies/weberpdemo/reportwriter/graph.png +config.php +.bzrignore Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-05-16 17:53:41 UTC (rev 5303) +++ trunk/CounterSales.php 2011-05-17 19:19:52 UTC (rev 5304) @@ -22,11 +22,8 @@ } if (isset($_SESSION['Items'.$identifier])){ //update the Items object variable with the data posted from the form - $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; - $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; - $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; - $_SESSION['Items'.$identifier]->Email = $_POST['Email']; + $_SESSION['Items'.$identifier]->CustRef = _('Cash Sale'); + $_SESSION['Items'.$identifier]->Comments = _('Cash Sale') . ' ' . DATE($_SESSION['DefaultDateFormat']); } if (isset($_POST['QuickEntry'])){ @@ -504,6 +501,8 @@ $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, $Price, + $OrderLine->Units, + $OrderLine->ConversionFactor, ($DiscountPercentage/100), $Narrative, 'Yes', /*Update DB */ @@ -697,7 +696,7 @@ */ echo '<br /> - <table width="90%" cellpadding="2" colspan="7"> + <table width="90%" cellpadding="2" colspan="7" class="selection"> <tr bgcolor="#800000">'; echo '<th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> @@ -803,9 +802,9 @@ </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; - echo '<table><tr><td>'; + echo '<br /><table><tr><td>'; //nested table - echo '<table><tr> + echo '<table class="selection"><tr> <td>'. _('Picked Up By') .':</td> <td><input type="text" size="25" maxlength="25" name="DeliverTo" value="' . stripslashes($_SESSION['Items'.$identifier]->DeliverTo) . '" /></td> </tr>'; @@ -855,12 +854,12 @@ if (!isset($_POST['AmountPaid'])){ $_POST['AmountPaid'] =0; } - echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . $_POST['AmountPaid'] . '" /></td></tr>'; + echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . ($_SESSION['Items'.$identifier]->total+$TaxTotal) . '" /></td></tr>'; echo '</table>'; //end the sub table in the second column of master table echo '</th></tr></table>'; //end of column/row/master table echo '<br /><div class="centre"><input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> - <input type="submit" name="ProcessSale" value="' . _('Process The Sale') . '" /></div><hr />'; + <input type="submit" name="ProcessSale" value="' . _('Process The Sale') . '" /></div><br />'; } # end of if lines @@ -1957,8 +1956,9 @@ * end of Invoice Processing * ***************************** */ +// This code needs sorting out, but until then : +$ImageSource = _('No Image'); - /* Now show the stock item selection search stuff below */ if (!isset($_POST['ProcessSale'])){ if (isset($_POST['PartSearch']) and $_POST['PartSearch']!=''){ @@ -2000,8 +2000,6 @@ $k=0; //row colour counter while ($myrow=DB_fetch_array($result2)) { - // This code needs sorting out, but until then : - $ImageSource = _('No Image'); // Find the quantity in stock at location $QohSql = "SELECT sum(quantity) FROM locstock @@ -2094,6 +2092,9 @@ $rootpath, SID, $myrow['stockid']); + + echo '<input type="hidden" name="Units' . $myrow['stockid'] . '" value="' . $myrow['units'] . '" />'; + if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } @@ -2251,7 +2252,7 @@ } $OnOrder = $PurchQty + $WoQty; - $Available = $qoh - $DemandQty + $OnOrder; + $Available = $QOH - $DemandQty + $OnOrder; printf('<td>%s</td> <td>%s</td> @@ -2274,6 +2275,9 @@ $rootpath, SID, $myrow['stockid']); + + echo '<input type="hidden" name="Units' . $myrow['stockid'] . '" value="' . $myrow['units'] . '" />'; + if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } @@ -2298,7 +2302,7 @@ else { /* show the quick entry form variable */ echo '<div class="page_help_text"><b>' . _('Use this form to add items quickly if the item codes are already known') . '</b></div><br /> - <table border="1"> + <table class="selection"> <tr>'; /*do not display colum unless customer requires po line number by sales order line*/ echo '<th>' . _('Item Code') . '</th> @@ -2333,4 +2337,4 @@ } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2011-05-16 17:53:41 UTC (rev 5303) +++ trunk/includes/GetPrice.inc 2011-05-17 19:19:52 UTC (rev 5304) @@ -4,7 +4,8 @@ $Price = 0; /*Search by branch and customer for a date specified price */ - $sql="SELECT prices.price + $sql="SELECT prices.price, + prices.conversionfactor FROM prices, debtorsmaster WHERE debtorsmaster.salestype=prices.typeabbrev @@ -21,7 +22,8 @@ if (DB_num_rows($result)==0){ /*Need to try same specific search but for a default price with a zero end date */ $sql="SELECT prices.price, - prices.startdate + prices.startdate, + prices.conversionfactor FROM prices, debtorsmaster WHERE debtorsmaster.salestype=prices.typeabbrev @@ -39,7 +41,8 @@ if (DB_num_rows($result)==0){ /* No result returned for customer and branch search try for just a customer match */ - $sql = "SELECT prices.price + $sql = "SELECT prices.price, + prices.conversionfactor FROM prices, debtorsmaster WHERE debtorsmaster.salestype=prices.typeabbrev @@ -56,7 +59,8 @@ if (DB_num_rows($result)==0){ //if no specific price between the dates maybe there is a default price with no end date specified $sql = "SELECT prices.price, - prices.startdate + prices.startdate, + prices.conversionfactor FROM prices, debtorsmaster WHERE debtorsmaster.salestype=prices.typeabbrev @@ -74,7 +78,8 @@ 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 + $sql = "SELECT prices.price, + prices.conversionfactor FROM prices, debtorsmaster WHERE debtorsmaster.salestype=prices.typeabbrev @@ -90,7 +95,8 @@ 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, - prices.startdate + prices.startdate, + prices.conversionfactor FROM prices, debtorsmaster WHERE debtorsmaster.salestype=prices.typeabbrev @@ -107,7 +113,8 @@ if (DB_num_rows($result)==0){ /* Now use the default salestype/price list cos all else has failed */ - $sql="SELECT prices.price + $sql="SELECT prices.price, + prices.conversionfactor FROM prices, debtorsmaster WHERE prices.stockid = '" . $StockID . "' @@ -124,7 +131,8 @@ /* Now use the default salestype/price list cos all else has failed */ $sql="SELECT prices.price, - prices.startdate + prices.startdate, + prices.conversionfactor FROM prices, debtorsmaster WHERE prices.stockid = '" . $StockID . "' @@ -141,7 +149,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'); - Return 0; + $Prices[0]=0; + $Prices[1]=1; + return $Prices; } } } @@ -155,11 +165,13 @@ /*There is a price from one of the above so return that */ $myrow=DB_fetch_row($result); - Return $myrow[0]; + return $myrow; } else { - Return 0; + $Prices[0]=0; + $Prices[1]=1; + return $Prices; } } -?> \ No newline at end of file +?> Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-05-16 17:53:41 UTC (rev 5303) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-05-17 19:19:52 UTC (rev 5304) @@ -108,8 +108,9 @@ $Discount = 0; } - $Price = GetPrice($NewItem, $_SESSION['Items'.$identifier]->DebtorNo,$_SESSION['Items'.$identifier]->Branch, $db); - + $PriceArray = GetPrice($NewItem, $_SESSION['Items'.$identifier]->DebtorNo,$_SESSION['Items'.$identifier]->Branch, $db); + $Price=$PriceArray[0]; + $ConversionFactor=$PriceArray[1]; $WithinCreditLimit = true; if (!isset($_SESSION['WarnOnce']) and $_SESSION['Items'.$identifier]->SpecialInstructions) { @@ -157,7 +158,7 @@ $myItemRow['eoq'], $myItemRow['nextserialno'], $ExRate, - $_POST['ConversionFactor'.$NewItem]); + $ConversionFactor); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |