[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 20/21: VAT ND Analytic : fix bug
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 20/21: VAT ND Analytic : fix bug |
Date: |
Sun, 15 Dec 2024 09:51:40 -0500 (EST) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit dfd5ed54676348319ee01a80f54df5d5e1673f01
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 unstable updated (078674672 -> 80be65420), dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 01/21: PHP8.3 : remove deprecated in Document_Type, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 12/21: FIX P0TVA when no data, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 03/21: Improve Code Documentation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 13/21: New : label cannot be empty, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 02/21: Merge branch '241104-correct' into unstable, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 15/21: improve Operation detail : show Analytic imputation for VAT Not Deductible, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 04/21: css : font size rem or % , remove all fixed font-size in px, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 20/21: VAT ND Analytic : fix bug,
dwm <=
- [Noalyss-commit] [noalyss] 07/21: NEW #0002395: C0TVA : pouvoir choisir la contrepartie pour l'autoliquidation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 06/21: FIX : some doc in comment, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 21/21: Esthetic, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 11/21: FIX : javascript id$ function, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 09/21: FIX : Tax_Summary->check fails when there is no data, check was not correct, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 05/21: WIP : CSS : use variables, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 08/21: Convert upgrade.sql to upgrade202.sql, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 16/21: 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] 14/21: improve doc, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 19/21: Integrate stash, dwm, 2024/12/15