From: Phil D. <ph...@lo...> - 2014-03-01 01:13:13
|
Hi Ricard, I can see an issue here because you are not using the filter_number_format() on any of your cash entry fields - so if someone inputs 1,234.12 how does the script handle this? That is what the filter_number_format() function is for - to parse out any formatting in the numbers. Phil Phil Daintree Logic Works Ltd - +64 (0)275 567890 http://www.logicworks.co.nz On 01/03/14 14:05, Pak Ricard wrote: > Hi rafael: > > In my Counter Sales scripts lines read as: > $TotalFromCustomer = $_POST['AmountPaidCash'] > + $_POST['AmountPaidCC'] > + $_POST['AmountPaidAmex'] > + $_POST['AmountReturnedGoods'] > + $_POST['AmountVouchers']; > if (abs($TotalFromCustomer > -($_SESSION['Items'.$identifier]->total+$_POST['TaxTotal']))>=0.01) { > prnMsg(_('The amount entered as payment does not equal the amount of > the invoice. Please ensure the customer has paid the correct amount > and re-enter'),'error'); > $InputError = true; > > and it works OK. Mine is a heavily modified version, but the idea is I > calculate it from the _POST. I remember having similar problems > loooooooong time ago, so probably this was the fix. > > Hope it helps > > Regards, > Ricard > > > 2014-03-01 5:58 GMT+08:00 Rafael Chacón > <raf...@gm... <mailto:raf...@gm...>>: > > Hi, > > We are using "Enter Counter Sales" with an item 11 times, with > price in USD (Default Price List is in USD). It is banked to a > bank-account in USD, but Home Currency is in CRC. > > When the cashier enters the Amount Paid (exactly teh total). he > gets the advise "The amount entered as payment does not equal the > amount of the invoice. Please ensure the customer has paid the > correct amount and re-enter". > > I think the problem is in: > > (abs(filter_number_format($_POST['AmountPaid']) > -(round($_SESSION['Items'.$identifier]->total+filter_number_format($_POST['TaxTotal']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces)))>=0.01) > > probably in the way the number format is handled. > > > > Someone has had a similar problem? Why we use "xxx->yyy" instead > of "$zzz" ? > > Regards, Rafael. > > ------------------------------------------------------------------------------ > Flow-based real-time traffic analytics software. Cisco certified tool. > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer > Customize your own dashboards, set traffic alerts and generate > reports. > Network behavioral analysis & security monitoring. All-in-one tool. > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > <mailto:Web...@li...> > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > > > > ------------------------------------------------------------------------------ > Flow-based real-time traffic analytics software. Cisco certified tool. > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer > Customize your own dashboards, set traffic alerts and generate reports. > Network behavioral analysis & security monitoring. All-in-one tool. > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk > > > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers |