[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/07: Bug #2065 : non - assujetti , vente ne
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/07: Bug #2065 : non - assujetti , vente ne fonctionnent pas, problème devise |
Date: |
Thu, 23 Sep 2021 04:04:56 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit d94d05ec0ee44d06ccbf081ffa71e34571551386
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue Sep 7 14:12:35 2021 +0200
Bug #2065 : non - assujetti , vente ne fonctionnent pas, problème devise
---
html/js/acc_currency.js | 18 ++--
html/js/noalyss_script.js | 3 +-
include/ajax/ajax_admin.php | 2 +-
include/class/acc_ledger_purchase.class.php | 3 +-
include/class/acc_ledger_sale.class.php | 145 ++++++++++++++--------------
5 files changed, 83 insertions(+), 88 deletions(-)
diff --git a/html/js/acc_currency.js b/html/js/acc_currency.js
index fdf49ab..6f56135 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 4624c69..5a5301f 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 9882d70..c2d6655 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 f69931f..06a9592 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 50af862..9a5e7cf 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.=<<<EOF
-<tr class="highlight">
- {$decalage}
- <td>
- {$str_tot} {$str_code}
- </td>
- <td class="num">
- {$tot_tva}
- </td>
- <td class="num">
- {$tot_amount}
- </td>
- <td class="num">
- {$tot} {$str_code}
- </td>
- </tr>
+ $r.=<<<EOF
+ <tr class="highlight">
+ {$decalage}
+ <td>
+ {$str_tot} {$str_code}
+ </td>
+ <td class="num">
+ {$tot_tva}
+ </td>
+ <td class="num">
+ {$tot_amount}
+ </td>
+ <td class="num">
+ {$tot} {$str_code}
+ </td>
+ </tr>
EOF;
- if ($p_currency_code !=0) {
- $rate=_("Taux ");
-$r.=<<<EOF
-<tr class="highlight">
- {$decalage}
- <td>
-
- </td>
- <td class="num">
-
- </td>
- <td class="num">
- {$rate} {$p_currency_rate}
- </td>
- <td class="num">
- {$tot_eur} EUR
- </td>
-</tr>
+
+ if ($p_currency_code !=0) {
+
+ $r.=<<<EOF
+ <tr class="highlight">
+ {$decalage}
+ <td>
+
+ </td>
+ <td class="num">
+
+ </td>
+ <td class="num">
+ {$rate} {$p_currency_rate}
+ </td>
+ <td class="num">
+ {$tot_eur} EUR
+ </td>
+ </tr>
EOF;
- }
-
- } else {
- $r.=<<<EOF
-<tr class="highlight">
- {$decalage}
- <td>
- {$str_tot} {$str_code}
- </td>
- <td class="num">
-
- </td>
- <td class="num">
-
- </td>
- <td class="num">
- {$tot}
- </td>
- </tr>
-<tr class="highlight">
- {$decalage}
- <td>
- </td>
- <td>
-
- </td>
- <td>
+ }
+
+ } else {
+ // without VAT
+ $r.=<<<EOF
+ <tr class="highlight">
+ {$decalage}
+ <td>
+ {$str_tot} {$str_code}
+ </td>
+ <td class="num">
+
+ </td>
+ <td class="num">
+
+ </td>
+ <td class="num">
+ {$tot}
+ </td>
+ </tr>
+ <tr class="highlight">
+ {$decalage}
+ <td>
+ </td>
+ <td>
+
+ </td>
+ <td>
{$rate} {$p_currency_rate}
- </td>
- <td class="num">
- {$tot} {$str_code}
- </td>
-</tr>
+ </td>
+ <td class="num">
+ {$tot_eur} EUR
+ </td>
+ </tr>
EOF;
}
$r.='</table>';
@@ -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');
- [Noalyss-commit] [noalyss] branch master updated (9a23cc5 -> ed31dd8), Dany De Bontridder, 2021/09/23
- [Noalyss-commit] [noalyss] 04/07: Cosmetic small devices, Dany De Bontridder, 2021/09/23
- [Noalyss-commit] [noalyss] 06/07: Bug : cannot print great leadger, due an "ambiguous column", incompatible with psql 12, Dany De Bontridder, 2021/09/23
- [Noalyss-commit] [noalyss] 03/07: Doc., Dany De Bontridder, 2021/09/23
- [Noalyss-commit] [noalyss] 02/07: Bug : lettering for card, false warning if paid in several times caused by PostgreSQL 12, Dany De Bontridder, 2021/09/23
- [Noalyss-commit] [noalyss] 05/07: Doc and audit, Dany De Bontridder, 2021/09/23
- [Noalyss-commit] [noalyss] 01/07: Bug #2065 : non - assujetti , vente ne fonctionnent pas, problème devise,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 07/07: Bug : cannot create separate PDF, Dany De Bontridder, 2021/09/23