[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 04/12: Bug : if all the quantity are NULL, th
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 04/12: Bug : if all the quantity are NULL, then we have only one row in jrn |
Date: |
Fri, 15 Jan 2021 09:40:05 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 60b15becfdf0f51bc1c41d35d86588aa7342defd
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon Jan 4 13:04:47 2021 +0100
Bug : if all the quantity are NULL, then we have only
one row in jrn
---
include/class/acc_ledger_purchase.class.php | 2 +-
include/class/acc_ledger_sold.class.php | 4 +++-
include/class/acc_operation.class.php | 4 ++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/class/acc_ledger_purchase.class.php
b/include/class/acc_ledger_purchase.class.php
index 39f3c55..d624af0 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -260,7 +260,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
}
}
}
- $nb++;
+ if ( ${"e_quant".$i} != 0 && trim(${"e_quant".$i}) !="" ) {$nb++;}
}
if ( $nb == 0 )
diff --git a/include/class/acc_ledger_sold.class.php
b/include/class/acc_ledger_sold.class.php
index 9cb0668..27ec56a 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -208,7 +208,9 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$fiche->get_by_qcode(${'e_march' . $i});
if ($fiche->belong_ledger($p_jrn, 'cred') != 1)
throw new Exception(_('La fiche ') . ${'e_march' . $i} .
_('n\'est pas accessible à ce journal'), 10);
- $nb++;
+
+ if ( ${"e_quant".$i} != 0 && trim(${"e_quant".$i}) !="" ) {$nb++;}
+
}
if ($nb == 0)
throw new Exception(_('Il n\'y a aucune marchandise'), 12);
diff --git a/include/class/acc_operation.class.php
b/include/class/acc_operation.class.php
index fd30cf6..e2bdaf8 100644
--- a/include/class/acc_operation.class.php
+++ b/include/class/acc_operation.class.php
@@ -60,6 +60,7 @@ class Acc_Operation
$this->periode=$g_user->get_periode();
$this->jr_id=0;
$this->jr_optype="NOR";
+ $this->amount=0;
}
/**
*@brief retrieve the grpt_id from jrn for a jr_id
@@ -183,6 +184,7 @@ class Acc_Operation
$this->amount=abs($this->amount);
$debit=($this->type=='c')?'false':'true';
$this->desc=(isset($this->desc))?$this->desc:'';
+
$this->amount=(trim($this->amount)==''||$this->amount==NULL)?0:$this->amount;
$Res=$this->db->exec_sql("select insert_jrnx
($1::text,abs($2)::numeric,$3::account_type,$4::integer,$5::integer,$6::bool,$7::text,$8::integer,upper($9),$10::text)",
array(
@@ -287,8 +289,10 @@ class Acc_Operation
{
$this->mt=microtime(true);
}
+
// if amount == -1then the triggers will throw an error
//
+
$this->amount=(trim($this->amount)==''||$this->amount==NULL)?0:$this->amount;
$Res=$this->db->exec_sql("insert into jrn
(jr_def_id,jr_montant,jr_comment,".
"jr_date,jr_ech,jr_grpt_id,jr_tech_per,jr_mt,jr_optype) values (".
"$1,$2,$3,".
- [Noalyss-commit] [noalyss] branch master updated (a723604 -> 9e40622), Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 02/12: SQL : improve vw_fiche_attr with index, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 03/12: Task #0001869: Session key : clef de session, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 01/12: Export GL PDF : no row found for an accounting, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 04/12: Bug : if all the quantity are NULL, then we have only one row in jrn,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 05/12: Generate document : DESCRIPTION for invoice (e_comm), Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 08/12: code cleaning and replace $_SERVER['SCRIPT_FILENAME'] by $_SERVER['PHP_SELF'] SCRIPT_FILENAME in a FPM environment is the CGI script, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 09/12: Card : attribute 54 is now a column for each card, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 10/12: javascript message , use function htmlspecialchar instead of escape_xml, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 06/12: Bug : DESCRIPTION tag, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 12/12: Tache #1844 Menu : ouverture menu par défaut, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 11/12: Correct bug #0001882: predefined operation ODS not visible, Dany De Bontridder, 2021/01/15
- [Noalyss-commit] [noalyss] 07/12: Card : attribute 54 is now a column for each card, Dany De Bontridder, 2021/01/15