[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 27/219: Task #0001443: opérations rapprochée
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 27/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation Check with the view v_quant_detail and take into account the negative VAT |
Date: |
Mon, 18 Dec 2017 13:22:30 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit c587b47be8ace878d259b0e5828eb2d2c4c9de78
Author: Dany De Bontridder <address@hidden>
Date: Thu Aug 31 10:09:51 2017 +0200
Task #0001443: opérations rapprochées : bug quand on utilise des tva avec
autoliquidation
Check with the view v_quant_detail and take into account the negative VAT
---
include/class/acc_reconciliation.class.php | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/include/class/acc_reconciliation.class.php
b/include/class/acc_reconciliation.class.php
index ad5351a..ba6d01f 100644
--- a/include/class/acc_reconciliation.class.php
+++ b/include/class/acc_reconciliation.class.php
@@ -369,11 +369,36 @@ j1.j_poste as poste
bcscale(2);
for ($i=0;$i<count($array);$i++)
{
- $first_amount=$array[$i]['first']['jr_montant'];
+
$retdb=$this->db->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']);
+ $first_amount=$total_price;
+
+ } else {
+ // else take the amount from jrn
+ $first_amount=$array[$i]['first']['jr_montant'];
+ }
$second_amount=0;
for ($e=0;$e<count($array[$i]['depend']);$e++)
{
-
$second_amount=bcadd($second_amount,$array[$i]['depend'][$e]['jr_montant']);
+
$retdb=$this->db->execute("detail_quant",array($array[$i]['depend'][$e]['jr_id']));
+ // if exist in quant_
+ 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']);
+ $second_amount=bcadd($second_amount,$total_price);
+
+ } else {
+ // else take the amount from jrn
+
$second_amount=bcadd($second_amount,$array[$i]['depend'][$e]['jr_montant']);
+ }
}
if ( $p_equal && $first_amount==$second_amount)
{
- [Noalyss-commit] [noalyss] 99/219: CSS : button border, (continued)
- [Noalyss-commit] [noalyss] 99/219: CSS : button border, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 108/219: task #0001272: Rendre possible l'appel de la calculatrice depuis le fin fond d'une page., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 174/219: space, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 114/219: Change max article in STOCK INV, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 16/219: Update test with new architecture, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 173/219: Improve calc, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 104/219: Réécriture de CFGPCMN pour utiliser ManageTable pas de delete proposé si compte utilisé, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 14/219: Infobulle : warning : esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 44/219: fix minor bug + doc, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 46/219: Manage_Table : Improve Javascript for adding / removing row of table, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 27/219: Task #0001443: opérations rapprochées : bug quand on utilise des tva avec autoliquidation Check with the view v_quant_detail and take into account the negative VAT,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 33/219: Task #0001324: Afficher la date (période) dans FSALDO, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 198/219: Task #001381 : reinitialize the search_form, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 154/219: Task #1440 CA - opération diverses inaccessibles Task #1370 les OD en comptabilité analytique - problème., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 209/219: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 186/219: Protect queryString with encodeURI, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 207/219: Task #1381 Change esthetic Search Filter, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 208/219: Fix search for reconcile, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 157/219: Fix issue with open_basedir, sometime set in the server config, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 196/219: Task #001381 : favori de filtre , table pour sauvegarder, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 109/219: Add button to pin the box, Dany De Bontridder, 2017/12/18