diff --git a/html/js/acc_currency.js b/html/js/acc_currency.js index fdf49ab2a..6f56135b3 100644 --- a/html/js/acc_currency.js +++ b/html/js/acc_currency.js @@ -102,17 +102,17 @@ function CurrencyUpdateCode(p_dossier,p_code,p_update) */ function CurrencyCompute(p_rate,p_update) { - var tvac=$('tvac').innerHTML; + var tvac=1; + + if ($('tvac')) { + tvac=$('tvac').innerHTML; + } - console.log("tvac= "+tvac); if ( isNaN(tvac)) { - console.log("tva is nan" + tvac); tvac=1; } var rate=$(p_rate).value; - console.log("rate = "+rate); if ( isNaN(rate)) { - console.log("rate is nan" + rate); rate=1; } var tot=tvac/rate; @@ -132,20 +132,14 @@ function CurrencyComputeMisc(p_rate,p_update) var debAmount=$('totalDeb').innerHTML; var credAmount=$('totalCred').innerHTML; - console.log("debAmount= "+debAmount); - console.log("credAmount= "+credAmount); if ( isNaN(debAmount)) { - console.log("debAmount is nan" + debAmount); debAmount=0; } if ( isNaN(credAmount)) { - console.log("credAmount is nan" + credAmount); credAmount=0; } var rate=$(p_rate).value; - console.log("rate = "+rate); if ( isNaN(rate) || parseFloat(rate) == 0) { - console.log("rate is nan" + rate); rate=1; } var totDeb=debAmount/rate; @@ -170,7 +164,7 @@ function CurrencyComputeMisc(p_rate,p_update) function LedgerCurrencyUpdate(p_dossier,p_code,p_update,p_rate,p_eur_amount) { // Hide or show the row of the table with the amount in EUR - if ($(p_code).value != -1) { + if ($(p_code).value != 0) { $('row_currency').show(); }else { $('row_currency').hide(); diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js index 4624c690d..5a5301f6b 100644 --- a/html/js/noalyss_script.js +++ b/html/js/noalyss_script.js @@ -289,7 +289,6 @@ function compute_number(value) points dans le nombre et eval() lève une exception*/ try { - console.debug("value = "+value); retval = eval(value); } catch (e) { @@ -4025,7 +4024,7 @@ function check_file_size(p_object,p_max_size) function check_receipt_size(p_max_size,p_info) { document.getElementById(p_info).style.display="inline"; - console.debug ("param p_max_file_size"+p_max_size); + var f=document.getElementById("receipt_id"); if ( f && f.files[0] && f.files[0].size > parseFloat(p_max_size)) { document.getElementById("receipt_info_id").innerHTML=content[78]; diff --git a/include/ajax/ajax_admin.php b/include/ajax/ajax_admin.php index 9882d7021..c2d6655f4 100644 --- a/include/ajax/ajax_admin.php +++ b/include/ajax/ajax_admin.php @@ -351,7 +351,7 @@ if ($op=='upgradeCore') $progress->set_value(5); $core->download(); $progress->set_value(55); - if ( DEBUGNOALYSS > 0 ) + if ( DEBUGNOALYSS == 0 ) { $core->install(); } diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php index f69931fc3..06a95920c 100644 --- a/include/class/acc_ledger_purchase.class.php +++ b/include/class/acc_ledger_purchase.class.php @@ -1404,10 +1404,9 @@ class Acc_Ledger_Purchase extends Acc_Ledger $quant=(isset(${"e_quant$i"}))?${"e_quant$i"}:"1" ; $Quantity=new INum(); - $Quantity->prec=4; $Quantity->setReadOnly(false); $Quantity->size=9; - $Quantity->javascript="onchange=\"format_number(this);clean_tva($i);compute_ledger($i)\""; + $Quantity->javascript="onchange=\"format_number(this,4);clean_tva($i);compute_ledger($i)\""; $array[$i]['quantity']=$Quantity->input("e_quant".$i,$quant); } diff --git a/include/class/acc_ledger_sale.class.php b/include/class/acc_ledger_sale.class.php index 50af86213..9a5e7cf1b 100644 --- a/include/class/acc_ledger_sale.class.php +++ b/include/class/acc_ledger_sale.class.php @@ -430,6 +430,8 @@ class Acc_Ledger_Sale extends Acc_Ledger { $price_euro/* Price /unit */ )); } else { + $tva_item_currency=0; + $r = $this->db->exec_sql("select insert_quant_sold ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10) ", array(null, /* 1 */ $j_id, /* 2 */ ${'e_march' . $i}, /* 3 */ @@ -977,77 +979,79 @@ class Acc_Ledger_Sale extends Acc_Ledger { // Format amount $tot_amount=nbm($tot_amount); $tot_tva=nbm($tot_tva); - + $rate=_("Taux "); if ( $g_parameter->MY_TVA_USE=="Y") { - $r.=<< - {$decalage} - - {$str_tot} {$str_code} - - - {$tot_tva} - - - {$tot_amount} - - - {$tot} {$str_code} - - + $r.=<< + {$decalage} + + {$str_tot} {$str_code} + + + {$tot_tva} + + + {$tot_amount} + + + {$tot} {$str_code} + + EOF; - if ($p_currency_code !=0) { - $rate=_("Taux "); -$r.=<< - {$decalage} - - - - - - - - {$rate} {$p_currency_rate} - - - {$tot_eur} EUR - - + + if ($p_currency_code !=0) { + + $r.=<< + {$decalage} + + + + + + + + {$rate} {$p_currency_rate} + + + {$tot_eur} EUR + + EOF; - } - - } else { - $r.=<< - {$decalage} - - {$str_tot} {$str_code} - - - - - - - - - {$tot} - - - - {$decalage} - - - - - - + } + + } else { + // without VAT + $r.=<< + {$decalage} + + {$str_tot} {$str_code} + + + + + + + + + {$tot} + + + + {$decalage} + + + + + + {$rate} {$p_currency_rate} - - - {$tot} {$str_code} - - + + + {$tot_eur} EUR + + EOF; } $r.=''; @@ -1468,13 +1472,12 @@ EOF; } // quantity //-- - $quant = (isset(${"e_quant$i"})) ? ${"e_quant$i"} : "1" - ; + $quant = (isset(${"e_quant$i"})) ? ${"e_quant$i"} : "1"; $Quantity = new INum(); - $Quantity->prec=4; + $Quantity->setReadOnly(false); $Quantity->size = 8; - $Quantity->javascript = "onchange=\"format_number(this);clean_tva($i);compute_ledger($i);\""; + $Quantity->javascript = "onchange=\"format_number(this,4);clean_tva($i);compute_ledger($i);\""; $array[$i]['quantity'] = $Quantity->input("e_quant" . $i, $quant); }// foreach article $f_type = _('Client');