Additional tax : remains when correct operation

Cosmetic
This commit is contained in:
sparkyx 2022-05-31 19:12:00 +02:00
parent b25682eada
commit a4c1c3c120
3 changed files with 10 additions and 8 deletions

View file

@ -506,7 +506,6 @@ function compute_ledger(p_ctl_nb)
let other_tax=g("other_tax");
let other_tax_id=(other_tax && other_tax.checked)?other_tax.value:-1;
console.debug(`other tax is ${other_tax_id}`);
var querystring = { gDossier : dossier , c : qcode ,t :tva_id,p : price , q:quantity,n:p_ctl_nb,'other_tax_id':other_tax_id};
var action = new Ajax.Request(
"compute.php",

View file

@ -3197,6 +3197,7 @@ class Acc_Ledger extends jrn_def_sql
$http=new HttpInput();
$nb=$http->post("nb_item", "number", 0);
echo HtmlInput::post_to_hidden(['p_currency_rate','p_currency_code']);
echo HtmlInput::post_to_hidden(['other_tax','other_tax_amount']);
for ($i=0; $i<$nb; $i++)
{
echo HtmlInput::post_to_hidden(
@ -3360,15 +3361,17 @@ class Acc_Ledger extends jrn_def_sql
*/
function input_additional_tax()
{
$http=new HttpInput();
if ($this->has_other_tax() == false ) { return "";}
$amount=new INum("other_tax_amount",0);
$amount->value=$http->request("other_tax_amount","number",0);
$amount->javascript='onchange="format_number(this,2);refresh_ledger();"';
$msg=_("Montant");
$row=$this->cn->get_row("select ac_id,ac_label,ac_rate from acc_other_tax where $1 = any (ajrn_def_id)",
[$this->id]);
$checkbox=new ICheckBox("other_tax",$row['ac_id']);
$checkbox->set_check($http->request("other_tax","number",-1));
$checkbox->javascript=<<<EOF
onchange='if (! this.checked) { $("other_tax_amount").value=0;}compute_all_ledger();'
EOF;

View file

@ -133,11 +133,11 @@ echo '</tr>';
<td class="visible_gt800 visible_gt1155"> </td>
<td> </td>
<td> </td>
<td class="num visible_gt800"> <span id="htva">0.0</span></td>
<td style="text-align:center" class="visible_gt800"> <span id="htva">0.0</span></td>
<?php if ( $flag_tva=='Y' ) : ?>
<td> </td>
<td class="num visible_gt800"> <span id="tva">0.0</span> </td>
<td class="num"> <span id="tvac" >0.0</span> </td>
<td style="text-align:center" class="visible_gt800"> <span id="tva">0.0</span> </td>
<td style="text-align:center"> <span id="tvac" >0.0</span> </td>
<?php endif; ?>
</tr>
@ -147,14 +147,14 @@ echo '</tr>';
</td>
<td class="num visible_gt800"></td>
<?php if ($flag_tva=='Y') {?>
<td class="num visible_gt800 visible_gt1155"></td>
<td style="text-align:center" class="visible_gt800 visible_gt1155"></td>
<td></td>
<td class="num visible_gt800"></td>
<td class="visible_gt800"></td>
<?php } ?>
<td></td>
<td></td>
<td></td>
<td class="num">
<td style="text-align:center">
<span id="p_currency_euro"></span>
</td>
</tr>