[Astpp-commit] SF.net SVN: astpp:[2211] trunk/astpp-common.pl
Brought to you by:
darrenkw
From: <dar...@us...> - 2008-11-25 05:24:19
|
Revision: 2211 http://astpp.svn.sourceforge.net/astpp/?rev=2211&view=rev Author: darrenkw Date: 2008-11-25 05:24:17 +0000 (Tue, 25 Nov 2008) Log Message: ----------- The "decimalpoints" variable is not being respected when posting to oscommerce. Fixed this. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2008-11-25 05:12:49 UTC (rev 2210) +++ trunk/astpp-common.pl 2008-11-25 05:24:17 UTC (rev 2211) @@ -4641,6 +4641,7 @@ $desc = "$row->{callstart} SRC: $row->{callerid} DST: $row->{callednum} SEC:$row->{billseconds} $row->{notes}"; $price = $row->{debit} / 10000; if($config->{osc_post_nc} == 1 || $price != 0) { + $price = sprintf( "%." . $config->{decimalpoints} . "f", $price ); $tmp = "INSERT INTO `orders_products` (`orders_products_id`,`orders_id`,`products_id`,`products_name`,`products_price`," . "`final_price`,`products_tax`,`products_quantity`) VALUES (''," @@ -4747,6 +4748,7 @@ $tax_priority = $tax->{tax_priority}; $tax_amount = $subtotal * ( $tax->{tax_rate} / 100 ); $sort++; + $tax_amount = sprintf( "%." . $config->{decimalpoints} . "f", $tax_amount ); &osc_post_total( $osc_db, $config, $invoice_id, $tax->{tax_description}, "\$$tax_amount", $tax_amount, $sort, "ot_tax" ); $tax_count++; @@ -4758,12 +4760,14 @@ $tax_priority = $tax->{tax_priority}; $tax_amount = $subtotal * ( $tax->{tax_rate} / 100 ); $sort++; + $tax_amount = sprintf( "%." . $config->{decimalpoints} . "f", $tax_amount ); &osc_post_total($osc_db, $config, $invoice_id, $tax->{tax_description}, "\$$tax_amount", $tax_amount, $sort, "ot_tax" ); } } $total = &osc_order_total($osc_db, $config, $invoice_id); $sort++; + $total = sprintf( "%." . $config->{decimalpoints} . "f", $total ); &osc_post_total($osc_db, $config, $invoice_id, "Total:", "<b>\$$total</b>", $total, $sort, "ot_total" ); &email_new_invoice( $astpp_db, "", $config, $account, $invoice_id, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |