[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 29/219: Task #0001443: opérations rapprochée
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 29/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation Esthetique show the autoreversed VAT |
Date: |
Mon, 18 Dec 2017 13:22:30 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 7b1aa4252980643604e8d695b3f5a12844f3a506
Author: Dany De Bontridder <address@hidden>
Date: Thu Aug 31 10:53:01 2017 +0200
Task #0001443: opérations rapprochées : bug quand on utilise des tva avec
autoliquidation
Esthetique show the autoreversed VAT
---
include/class/acc_reconciliation.class.php | 2 +-
include/template/impress_reconciliation.php | 63 +++++++++++++++-------
include/template/impress_reconciliation_detail.php | 14 +++++
3 files changed, 58 insertions(+), 21 deletions(-)
diff --git a/include/class/acc_reconciliation.class.php
b/include/class/acc_reconciliation.class.php
index ba6d01f..4233d7c 100644
--- a/include/class/acc_reconciliation.class.php
+++ b/include/class/acc_reconciliation.class.php
@@ -386,7 +386,7 @@ j1.j_poste as poste
for ($e=0;$e<count($array[$i]['depend']);$e++)
{
$retdb=$this->db->execute("detail_quant",array($array[$i]['depend'][$e]['jr_id']));
- // if exist in quant_
+ // if exist in v_quant_detail
if ( Database::num_row($retdb) != 0)
{
// then second_amount takes in account the vat_sided
diff --git a/include/template/impress_reconciliation.php
b/include/template/impress_reconciliation.php
index 5da24b9..d6b3f19 100644
--- a/include/template/impress_reconciliation.php
+++ b/include/template/impress_reconciliation.php
@@ -25,6 +25,16 @@
<?php
for ($i=0;$i<count($array);$i++) {
$tot=$array[$i]['first']['jr_montant'];
+
$retdb=$cn->execute("detail_quant",array($array[$i]['first']['jr_id']));
+ if ( Database::num_row($retdb) != 0)
+ {
+ // then second_amount takes in account the vat_sided
+ $row=Database::fetch_array($retdb, 0);
+ $total_price=bcadd($row['price'],$row['vat_amount']);
+ $total_price=bcsub($total_price,$row['vat_sided']);
+ $tot=$total_price;
+
+ }
$r='';
$r.=td($i);
$r.=td(format_date($array[$i]['first']['jr_date']));
@@ -32,7 +42,7 @@ for ($i=0;$i<count($array);$i++) {
$r.=td($detail);
$r.=td($array[$i]['first']['jr_pj_number']);
$r.=td($array[$i]['first']['jr_comment']);
-
$r.=td(nbm($array[$i]['first']['jr_montant']),'style="text-align:right"');
+ $r.=td(nbm($tot),'style="text-align:right"');
echo tr($r);
// check if operation does exist in v_detail_quant
$ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['first']['jr_id']));
@@ -40,25 +50,38 @@ for ($i=0;$i<count($array);$i++) {
if ( isset($array[$i]['depend']) )
{
$tot2=0;
- $limit=count($array[$i]['depend'])-1;
- for ($e=0;$e<count($array[$i]['depend']);$e++) {
- $r='';
- $r.=td($i);
-
$r.=td(format_date($array[$i]['depend'][$e]['jr_date']));
- $detail =
HtmlInput::detail_op($array[$i]['depend'][$e]['jr_id'],
$array[$i]['depend'][$e]['jr_internal']);
- $r.=td($detail);
- $r.=td($array[$i]['depend'][$e]['jr_pj_number']);
- $r.=td($array[$i]['depend'][$e]['jr_comment']);
-
$r.=td(nbm($array[$i]['depend'][$e]['jr_montant']),'style="text-align:right"');
-
$tot2=bcadd($tot2,$array[$i]['depend'][$e]['jr_montant']);
- if ( $e==$limit)
- echo '<tr>'.$r.'</tr>';
- else
- echo tr($r);
-
$ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['depend'][$e]['jr_id']));
- $acc_reconciliation->show_detail($ret);
- }
- echo tr(td(_('Total
')).td('operation').td(nbm($tot)).td('operations
dépendantes').td(nbm($tot2)).td('Delta').td(bcsub($tot,$tot2)),'
class="highlight"');
+ $limit=count($array[$i]['depend'])-1;
+ for ($e=0;$e<count($array[$i]['depend']);$e++) {
+ $r='';
+ $r.=td($i);
+ $r.=td(format_date($array[$i]['depend'][$e]['jr_date']));
+ $detail =
HtmlInput::detail_op($array[$i]['depend'][$e]['jr_id'],
$array[$i]['depend'][$e]['jr_internal']);
+ $r.=td($detail);
+ $r.=td($array[$i]['depend'][$e]['jr_pj_number']);
+ $r.=td($array[$i]['depend'][$e]['jr_comment']);
+
$r.=td(nbm($array[$i]['depend'][$e]['jr_montant']),'style="text-align:right"');
+
$retdb=$cn->execute("detail_quant",array($array[$i]['depend'][$e]['jr_id']));
+ // if exist in v_quant_detail
+ if ( Database::num_row($retdb) != 0)
+ {
+ // then second_amount takes in account the vat_sided
+ $row=Database::fetch_array($retdb, 0);
+ $total_price=bcadd($row['price'],$row['vat_amount']);
+ $total_price=bcsub($total_price,$row['vat_sided']);
+ $tot2=bcadd($tot2,$total_price);
+
+ } else {
+ // else take the amount from jrn
+
$tot2=bcadd($tot2,$array[$i]['depend'][$e]['jr_montant']);
+ }
+ if ( $e==$limit)
+ echo '<tr>'.$r.'</tr>';
+ else
+ echo tr($r);
+
$ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['depend'][$e]['jr_id']));
+ $acc_reconciliation->show_detail($ret);
+ }
+ echo tr(td(_('Total
')).td(_('operation')).td(nbm($tot)).td(_('operations
dépendantes')).td(nbm($tot2)).td(_('Delta')).td(bcsub($tot,$tot2)),'
class="highlight"');
echo tr(td('<hr>',' colspan="6" style="witdh:auto"'));
}
diff --git a/include/template/impress_reconciliation_detail.php
b/include/template/impress_reconciliation_detail.php
index 0d65172..9232b5f 100644
--- a/include/template/impress_reconciliation_detail.php
+++ b/include/template/impress_reconciliation_detail.php
@@ -22,6 +22,9 @@
<?php echo _("Tva ND")?>
</th>
<th style="text-align:right">
+ <?php echo _("Autoliquidation")?>
+ </th>
+ <th style="text-align:right">
<?php echo _("TVAC")?>
</th>
</tr>
@@ -33,6 +36,7 @@ $tot_cum_vat=0;
$tot_cum_nd=0;
$tot_cum_nd_tva=0;
$tot_cum_tvac=0;
+$tot_autoliquidation=0;
for ($i=0;$i < $nb_record;$i++) :
$row=Database::fetch_array($p_ret,$i);
$tot_cum_price=bcadd($tot_cum_price,$row['price']);
@@ -67,8 +71,15 @@ for ($i=0;$i < $nb_record;$i++) :
</td>
<td class="num">
<?php
+ $tot_autoliquidation=bcadd($tot_autoliquidation,
$row['vat_sided']);
+ echo nbm($row['vat_sided']);
+ ?>
+ </td>
+ <td class="num">
+ <?php
$tot=bcadd($tot_vat,$row['price']);
$tot=bcadd($tot,$row['vat_amount']);
+ $tot=bcsub($tot,$row['vat_sided']);
$tot_cum_tvac=bcadd($tot_cum_tvac,$tot);
echo nbm($tot);
?>
@@ -97,6 +108,9 @@ for ($i=0;$i < $nb_record;$i++) :
<?php echo nbm($tot_cum_nd_tva); ?>
</td>
<td class="num">
+ <?php echo nbm($tot_autoliquidation); ?>
+ </td>
+ <td class="num">
<?php
echo nbm($tot_cum_tvac); ?>
</td>
- [Noalyss-commit] [noalyss] 116/219: Task #0001297: Perfectionnement menu COMPTA/ADV/OPEN, (continued)
- [Noalyss-commit] [noalyss] 116/219: Task #0001297: Perfectionnement menu COMPTA/ADV/OPEN, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 56/219: Task #1469 : Les esperluettes ne passent pas dans les libellés pour «opération identique»., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 189/219: Task #1506 Fiche : max longueur du poste comptable = 40, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 195/219: Task #001381 : favori de filtre , ajout des favoris de filtre dans les recherches., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 71/219: Task #0001475: Todo note : il manque le bouton "Fermer", Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 146/219: ANC : ANC_TABLE replace PGPLSQL procedure by Php functions : Anc_Table:create_temp_account Anc_Table:create_temp_card, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 102/219: task #0001386: Amélioration visuelle plan comptable - postes utilisés Ajout lien si poste comptable utilisé, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 32/219: Task #0001426: Distinction dans l'affichage des historiques des OD: libellé + fiche Ajout des qcodes pour l'historique par poste Ajout des postes comptables pour l'historique par Fiche Ajout des tiers Fait aussi pour les export PDF & CSV, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 149/219: HttpInput: protect against injection, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 47/219: Task #0001462: CA - apostrophe non affichée Use of ManageTableSQL for improving adding , update and delete analytic accounting, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 29/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation Esthetique show the autoreversed VAT,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 204/219: Bug : when pressing on the template button, the input field to focus is not diplaid and the javascript gives an exception, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 206/219: typo, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 88/219: Task #0001481: Encodage Vente, Achat, Fin ou OD 1. S'il n'y a qu'une seule catégorie de fiche , il n'est plus nécessaire d'afficher le choix (puisqu'il n'y en a qu'un) 2. Avoir pour chaque ligne un bouton ajout fiche, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 212/219: Esthetic : show ledger : width of the box, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 179/219: Fix ID problem, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 167/219: Space, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 138/219: Javascript : small error, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 100/219: CSS input field with focus 0001302: FICHES: mise en évidence champs NOM/POSTE/CODE, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 26/219: task #1438 Remplacement de HtmlInput par Http_Input, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 91/219: Esthetic : change button appearance, Dany De Bontridder, 2017/12/18