[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 11/11: VAT ND Analytic : fix bug
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 11/11: VAT ND Analytic : fix bug |
Date: |
Sun, 15 Dec 2024 09:51:26 -0500 (EST) |
sparkyx pushed a commit to branch stable
in repository noalyss.
commit c64f356cfac55a5f9bf19761ff8814be7e3a0132
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Dec 15 14:33:15 2024 +0100
VAT ND Analytic : fix bug
---
include/class/anc_operation.class.php | 35 ++++++++++++-----------------------
1 file changed, 12 insertions(+), 23 deletions(-)
diff --git a/include/class/anc_operation.class.php
b/include/class/anc_operation.class.php
index 70dc8f0e8..ceb7cd033 100644
--- a/include/class/anc_operation.class.php
+++ b/include/class/anc_operation.class.php
@@ -723,7 +723,7 @@ EOF;
* @param $p_item int nb of the item of the form
* @param $p_j_id int jrnx.j_id concerned writing
* @param $p_nd float amount nd vat
- * @see Anc_Operation::save_form_plan_vat_nd
+ * @see Anc_Operation::save_form_plan()
*/
function save_form_plan_vat_nd($p_array,$p_item,$p_j_id,$p_nd):void
{
@@ -733,18 +733,16 @@ EOF;
if ( ! isset(${'amount_t'.$p_item}) )
throw new Exception ('amount not set');
-
- $tot=0;
- /* variable for in array
- pa_id array of existing pa_id
- hplan double array with the pa_id (column)
- val double array by row with amount
- op contains sequence
- p_item is used to identify what op is concerned
+
+ /**
+ * variable for in array
+ * @var pa_id array of existing pa_id
+ @var hplan double array with the pa_id as key (column)
+ @var val double array by row with amount
+ * @var op contains sequence
+ @var p_item is used to identify what op is concerned
*/
- /* echo "j_id = $j_id p_item = $p_item
hplan=".var_export($hplan[$p_item],true)." val =
".var_export($val[$p_item],true).'<br>'; */
- /* for each row */
- // for ($i=0;$i<count($val[$p_item]);$i++) {
+
$idx_pa_id=0;
$row=0;
$a_Anc_Operation=array();
@@ -781,21 +779,12 @@ EOF;
$idx_pa_id++;
}
$nb_op=count($a_Anc_Operation);
- bcscale(4);
- for ($i=0;$i<$nb_op;$i++)
- {
- $tot=bcadd($tot,$a_Anc_Operation[$i]->oa_amount);
- }
- // security : if tot != nd so the amount is reduced by the difference
between computed and max
- if ( $tot != $p_nd && count($a_Anc_Operation) > 0 )
- {
- $diff= bcsub($tot, $p_nd);
-
$a_Anc_Operation[0]->oa_amount=bcsub($a_Anc_Operation[0]->oa_amount,$diff);
- }
+
for ($i=0;$i<$nb_op;$i++)
{
$a_Anc_Operation[$i]->add();
}
+
}
/*!\brief it called for each item, the data are taken from $p_array
* data and set before in this. Amount will be transformed thanks the
$this->currency_rate;
- [Noalyss-commit] [noalyss] branch stable updated (87930cbe3 -> c64f356cf), dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 02/11: FIX : some doc in comment, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 01/11: NEW #0002395: C0TVA : pouvoir choisir la contrepartie pour l'autoliquidation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 08/11: improve Operation detail : show Analytic imputation for VAT Not Deductible, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 07/11: improve doc, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 09/11: Operation Analytic : save_form_plan_vat_nd , check that the total is the same as the VAT ND amount, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 11/11: VAT ND Analytic : fix bug,
dwm <=
- [Noalyss-commit] [noalyss] 05/11: FIX P0TVA when no data, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 10/11: Documentation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 04/11: FIX : Tax_Summary->check fails when there is no data, check was not correct, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 06/11: New : label cannot be empty, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 03/11: Convert upgrade.sql to upgrade202.sql, dwm, 2024/12/15