[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 17/26: Bug #0002048: PRINTJRN : export CSV et
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 17/26: Bug #0002048: PRINTJRN : export CSV et PDF cosmetic : remove currency data if the currency is EUR |
Date: |
Wed, 11 Aug 2021 11:08:14 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 9118337bd41812dd2ee0ec1388743391d5f4cd72
Author: Dany wm De Bontridder <danydb@noalyss.eu>
AuthorDate: Fri Jul 30 21:51:48 2021 +0200
Bug #0002048: PRINTJRN : export CSV et PDF
cosmetic : remove currency data if the currency is EUR
---
include/class/print_ledger_misc.class.php | 6 +-
include/constant.php | 2 +-
include/sql/patch/upgrade164.sql | 116 +++++++++++++++++++++
.../acc_ledger_history_purchase_oneline.php | 2 +
.../template/acc_ledger_history_sale_oneline.php | 2 +
5 files changed, 126 insertions(+), 2 deletions(-)
diff --git a/include/class/print_ledger_misc.class.php
b/include/class/print_ledger_misc.class.php
index 10410cb..77a7774 100644
--- a/include/class/print_ledger_misc.class.php
+++ b/include/class/print_ledger_misc.class.php
@@ -94,7 +94,11 @@ class Print_Ledger_Misc extends Print_Ledger
$positive = $this->cn->get_value("select qf_amount from
quant_fin ".
" where jr_id=".$row['jr_id']);
}
-
$this->write_cell(20,5,nbm(bcadd($row['sum_ocvat_amount'],$row['sum_ocamount']),2).$row['cr_code_iso'],0,0,'R');
+ if ( $row['currency_id'] != 0 ) {
+
$this->write_cell(20,5,nbm(bcadd($row['sum_ocvat_amount'],$row['sum_ocamount']),2).$row['cr_code_iso'],0,0,'R');
+ } else {
+ $this->write_cell(20,5,"");
+ }
$this->write_cell(15,5,nbm($positive),0,0,'R');
$this->line_new(5);
diff --git a/include/constant.php b/include/constant.php
index 8a5449d..bda9ea5 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -116,7 +116,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
if ( ! defined ("SYSINFO_DISPLAY")) {
define ("SYSINFO_DISPLAY",TRUE);
}
-define ("DBVERSION",164);
+define ("DBVERSION",165);
define ("MONO_DATABASE",25);
define ("DBVERSIONREPO",20);
define ('NOTFOUND','--not found--');
diff --git a/include/sql/patch/upgrade164.sql b/include/sql/patch/upgrade164.sql
new file mode 100644
index 0000000..e40c4a5
--- /dev/null
+++ b/include/sql/patch/upgrade164.sql
@@ -0,0 +1,116 @@
+begin;
+CREATE OR REPLACE VIEW public.v_detail_sale
+AS WITH m AS (
+ SELECT sum(quant_sold_1.qs_price) AS htva,
+ sum(quant_sold_1.qs_vat) AS tot_vat,
+ sum(quant_sold_1.qs_vat_sided) AS tot_tva_np,
+ jrn_1.jr_id
+ FROM quant_sold quant_sold_1
+ JOIN jrnx jrnx_1 USING (j_id)
+ JOIN jrn jrn_1 ON jrnx_1.j_grpt = jrn_1.jr_grpt_id
+ GROUP BY jrn_1.jr_id
+)
+ SELECT jrn.jr_id,
+ jrn.jr_date,
+ jrn.jr_date_paid,
+ jrn.jr_ech,
+ jrn.jr_tech_per,
+ jrn.jr_comment,
+ jrn.jr_pj_number,
+ jrn.jr_internal,
+ jrn.jr_def_id,
+ jrnx.j_poste,
+ jrnx.j_text,
+ jrnx.j_qcode,
+ jrn.jr_rapt,
+ quant_sold.qs_fiche AS item_card,
+ a.name AS item_name,
+ quant_sold.qs_client,
+ b.vw_name AS tiers_name,
+ b.quick_code,
+ tva_rate.tva_label,
+ tva_rate.tva_comment,
+ tva_rate.tva_both_side,
+ quant_sold.qs_vat_sided AS vat_sided,
+ quant_sold.qs_vat_code AS vat_code,
+ quant_sold.qs_vat AS vat,
+ quant_sold.qs_price AS price,
+ quant_sold.qs_quantite AS quantity,
+ quant_sold.qs_price / quant_sold.qs_quantite AS price_per_unit,
+ m.htva,
+ m.tot_vat,
+ m.tot_tva_np,
+ oc.oc_amount,
+ oc.oc_vat_amount,
+ ( SELECT currency.cr_code_iso
+ FROM currency
+ WHERE jrn.currency_id = currency.id) AS cr_code_iso
+ FROM jrn
+ JOIN jrnx ON jrn.jr_grpt_id = jrnx.j_grpt
+ JOIN quant_sold USING (j_id)
+ JOIN vw_fiche_name a ON quant_sold.qs_fiche = a.f_id
+ JOIN vw_fiche_attr b ON quant_sold.qs_client = b.f_id
+ left JOIN tva_rate ON quant_sold.qs_vat_code = tva_rate.tva_id
+ JOIN m ON m.jr_id = jrn.jr_id
+ LEFT JOIN operation_currency oc ON oc.j_id = jrnx.j_id;
+
+CREATE OR REPLACE VIEW public.v_detail_purchase
+AS WITH m AS (
+ SELECT sum(quant_purchase_1.qp_price) AS htva,
+ sum(quant_purchase_1.qp_vat) AS tot_vat,
+ sum(quant_purchase_1.qp_vat_sided) AS tot_tva_np,
+ jrn_1.jr_id
+ FROM quant_purchase quant_purchase_1
+ JOIN jrnx jrnx_1 USING (j_id)
+ JOIN jrn jrn_1 ON jrnx_1.j_grpt = jrn_1.jr_grpt_id
+ GROUP BY jrn_1.jr_id
+)
+ SELECT jrn.jr_id,
+ jrn.jr_date,
+ jrn.jr_date_paid,
+ jrn.jr_ech,
+ jrn.jr_tech_per,
+ jrn.jr_comment,
+ jrn.jr_pj_number,
+ jrn.jr_internal,
+ jrn.jr_def_id,
+ jrnx.j_poste,
+ jrnx.j_text,
+ jrnx.j_qcode,
+ jrn.jr_rapt,
+ quant_purchase.qp_fiche AS item_card,
+ a.name AS item_name,
+ quant_purchase.qp_supplier,
+ b.vw_name AS tiers_name,
+ b.quick_code,
+ tva_rate.tva_label,
+ tva_rate.tva_comment,
+ tva_rate.tva_both_side,
+ quant_purchase.qp_vat_sided AS vat_sided,
+ quant_purchase.qp_vat_code AS vat_code,
+ quant_purchase.qp_vat AS vat,
+ quant_purchase.qp_price AS price,
+ quant_purchase.qp_quantite AS quantity,
+ quant_purchase.qp_price / quant_purchase.qp_quantite AS
price_per_unit,
+ quant_purchase.qp_nd_amount AS non_ded_amount,
+ quant_purchase.qp_nd_tva AS non_ded_tva,
+ quant_purchase.qp_nd_tva_recup AS non_ded_tva_recup,
+ m.htva,
+ m.tot_vat,
+ m.tot_tva_np,
+ oc.oc_amount,
+ oc.oc_vat_amount,
+ ( SELECT currency.cr_code_iso
+ FROM currency
+ WHERE jrn.currency_id = currency.id) AS cr_code_iso
+ FROM jrn
+ JOIN jrnx ON jrn.jr_grpt_id = jrnx.j_grpt
+ JOIN quant_purchase USING (j_id)
+ JOIN vw_fiche_name a ON quant_purchase.qp_fiche = a.f_id
+ JOIN vw_fiche_attr b ON quant_purchase.qp_supplier = b.f_id
+ left JOIN tva_rate ON quant_purchase.qp_vat_code = tva_rate.tva_id
+ JOIN m ON m.jr_id = jrn.jr_id
+ LEFT JOIN operation_currency oc ON oc.j_id = jrnx.j_id;
+
+insert into version (val,v_description) values (165,'Fix bug for company
without VAT');
+commit ;
diff --git a/include/template/acc_ledger_history_purchase_oneline.php
b/include/template/acc_ledger_history_purchase_oneline.php
index fcae528..8409d1b 100644
--- a/include/template/acc_ledger_history_purchase_oneline.php
+++ b/include/template/acc_ledger_history_purchase_oneline.php
@@ -120,8 +120,10 @@ for ($i=0;$i<$nb_data;$i++):
<?=nbm($this->data[$i]['tvac'])?>
</td>
<td class="num">
+ <?php if ( $this->data[$i]['currency_id'] != '0') : ?>
<?=nbm (
bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount']),4)?>
<?=$this->data[$i]['cr_code_iso']?>
+ <?php endif;?>
</td>
<td>
diff --git a/include/template/acc_ledger_history_sale_oneline.php
b/include/template/acc_ledger_history_sale_oneline.php
index 61da0c1..eb78b4a 100644
--- a/include/template/acc_ledger_history_sale_oneline.php
+++ b/include/template/acc_ledger_history_sale_oneline.php
@@ -100,8 +100,10 @@ for ($i=0;$i<$nb_data;$i++):
<?=nbm($this->data[$i]['tvac'])?>
</td>
<td class="num">
+ <?php if ( $this->data[$i]['cr_code_iso'] != 0) : ?>
<?=nbm (
bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount']),4)?>
<?=$this->data[$i]['cr_code_iso']?>
+ <?php endif;?>
</td>
<td>
- [Noalyss-commit] [noalyss] 16/26: cosmetic : flashing color for h2.error, (continued)
- [Noalyss-commit] [noalyss] 16/26: cosmetic : flashing color for h2.error, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 24/26: Code cleaning Improve doc and test, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 15/26: Bug in print_ledger_purchase for company w/o vat, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 14/26: Code cleaning : extra information are now a fonction, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 25/26: Improve code : Card_Property is separated from Card (Fiche) , add more phpunit tests, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 18/26: Task #0002046: Improve COMPTA/MENUACH/ACH, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 20/26: Code cleaning : remove useless class gestion_sold gestion_purchase and gestion_table, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 21/26: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 23/26: translate, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 26/26: Code cleaning : remove Fic_Attr , replace by Attr_Def_SQL, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 17/26: Bug #0002048: PRINTJRN : export CSV et PDF cosmetic : remove currency data if the currency is EUR,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 13/26: Translation, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 22/26: code cleaning rename class Acc_Ledger_Sold to Acc_Ledger_Sale , improve doc , improve phpunit test, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 09/26: Documentation, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 11/26: Task #0002050: stay in mobile menu, Dany De Bontridder, 2021/08/11