From 2edebbe335b84183065140e5985f1aa00862abe1 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 5 Jan 2026 16:34:24 +0100
Subject: [PATCH 01/15] BUG : Share note fails
---
include/class/noalyss_user.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/class/noalyss_user.class.php b/include/class/noalyss_user.class.php
index 43b37a283..b27357aba 100644
--- a/include/class/noalyss_user.class.php
+++ b/include/class/noalyss_user.class.php
@@ -1216,7 +1216,7 @@ class Noalyss_User
$repo_cnx=$db_repository;
}
$array=$repo_cnx->get_array($sql, array($p_dossier));
- if ($repo->size()==0)
+ if ($repo_cnx->size()==0)
{
throw new \Exception('noalyss_user.get_list error inaccessible folders',1186);
}
From 3282551f15372ce66d98a4dda73a0032feae53cf Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 6 Jan 2026 19:44:19 +0100
Subject: [PATCH 02/15] Improve record_log
---
include/lib/ac_common.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index 82d295005..00267e441 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -1398,7 +1398,8 @@ function record_log($p_message)
if ($handle_log == false )
{
-
+ if ( isset ($_SERVER['REMOTE_ADDR']) ) error_log(sprintf("origin %s\n",$_SERVER['REMOTE_ADDR']));
+ if ( isset ($_SERVER['HTTP_USER_AGENT']) ) error_log(sprintf("agent %s\n",$_SERVER['HTTP_USER_AGENT']));
if ( gettype ($p_message) == "object" && method_exists($p_message,"getTraceAsString") == 1) {
$exc=$p_message;
do {
@@ -1417,6 +1418,9 @@ function record_log($p_message)
error_log("noalyss GET [".json_encode($_GET,0,10)."]");
error_log("_POST [".json_encode($_POST,0,10)."]",0);
} else {
+ if ( isset ($_SERVER['REMOTE_ADDR']) ) fwrite($handle_log,sprintf("origin %s\n",$_SERVER['REMOTE_ADDR']));
+ if ( isset ($_SERVER['HTTP_USER_AGENT']) ) fwrite($handle_log,sprintf("agent %s\n",$_SERVER['HTTP_USER_AGENT']));
+
if ( gettype ($p_message) == "object" && method_exists($p_message,"getTraceAsString") == 1) {
error_log("noalyss exception ".$p_message->getMessage(),0);
From f60896de6fb2860704770114ec58047a83f519d6 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 13 Jan 2026 16:02:56 +0100
Subject: [PATCH 03/15] If there is no Name use Official one
---
include/XMLDocument/xml_reader.class.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 2497cbfff..2a77ef219 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -229,6 +229,9 @@ abstract class XML_Reader
$result = [];
$result['ID'] = $this->get_node_value("//cac:AccountingCustomerParty[1]/cac:Party[1]/cbc:EndpointID[1]");
$result['name'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PartyName[1]/cbc:Name[1]');
+ if ($result['name'] == '') {
+ $result['name'] = $this->get_node_value("//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:RegistrationName[1]");
+ }
$result['street'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:StreetName[1]');
$result['city'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:CityName[1]');
$result['postcode'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]');
@@ -247,6 +250,9 @@ abstract class XML_Reader
$result = [];
$result['ID'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cbc:EndpointID[1]");
$result['name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyName[1]/cbc:Name[1]");
+ if ($result['name'] == '') {
+ $result['name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:RegistrationName[1]");
+ }
$result['street'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:StreetName[1]");
$result['city'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:CityName[1]");
$result['postcode'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]");
From 04e49ff5e36d51ae01a90a74933596aa0fb8fd8e Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 13 Jan 2026 16:11:02 +0100
Subject: [PATCH 04/15] Cosmetic
---
html/css/style-classic7.css | 11 ++++++-----
include/class/tva_rate_mtable.class.php | 1 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index d8057d772..6f5dc35e3 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -72,6 +72,7 @@ BODY {
--bg-inner-box:#DCE1EF;
--underline-menu:#d7e8ee;
--bg-slide:#c5d5e8;
+ --end-level1:#eb7c7e;
}
input{
font-family: 'OpenSansRegular';
@@ -2089,7 +2090,7 @@ div.box {
div.box {
width: 35rem;
max-height: 30%;
- height: 45vh;
+ height: 40rem;
}
}
@@ -2513,6 +2514,7 @@ td.cut {
}
td.box {
border-left: #9999ff solid 1px;
+ border-radius: 10px 0px;
}
/****************************************************************************
@@ -3973,8 +3975,7 @@ h2.h-section {
.nav-item.li-active.nav-item-underline::before {
transform: scale(1);
background-color: #d03100;
- background-image: linear-gradient(to right,#cc0000 0%,red 20%) ;
- background-image: linear-gradient(to right,darkred 0%,red 10%,red 90%,darkred);
+ background-image: linear-gradient(to right,var(--end-level1) 0%,red 10%,red 90%,var(--end-level1));
}
/**
@@ -4171,7 +4172,7 @@ h2.h-section {
}
.topmenu .nav-item.nav-item-underline:hover::before,.topmenu .nav-item.nav-item-underline:focus::before {
transform: scaleX(1) scaleY(1);
- background-image: linear-gradient(to right,darkred,red);
+ background-image: linear-gradient(to right,var(--end-level1),red);
}
@@ -4182,7 +4183,7 @@ h2.h-section {
.topmenu .nav-item.nav-item-underline:hover::before,.topmenu .nav-item.nav-item-underline:focus::before {
transform: scaleX(1) scaleY(1);
- background-image: linear-gradient(to right,darkred 0%,red 30%);
+ background-image: linear-gradient(to right,var(--end-level1) 0%,red 30%);
}
/*.topmenu .nav-item.nav-item-underline::before {
diff --git a/include/class/tva_rate_mtable.class.php b/include/class/tva_rate_mtable.class.php
index 01fdc2d4f..0f9f3f15f 100644
--- a/include/class/tva_rate_mtable.class.php
+++ b/include/class/tva_rate_mtable.class.php
@@ -97,6 +97,7 @@ class Tva_Rate_MTable extends Manage_Table_SQL
'tva_peppol_code'=>_("Code TVA est utilisé pour les factures électroniques, plus d'information dans le manuel"),
'vx_code'=>_("Code exemption pour facture PEPPOL (ubl)")
);
+ $this->setTitle(_("Détail TVA"));
}
/**
From bd83d91efbc3c5764da88c52c530dc59d11a7f70 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 13 Jan 2026 17:00:09 +0100
Subject: [PATCH 05/15] Fix bug : XML reader : filename or description too
large for PDF
---
include/XMLDocument/xml_reader.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 2a77ef219..51ed5667c 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -633,9 +633,9 @@ abstract class XML_Reader
for ($i=0;$i< $nb_result;$i++)
{
$binary=$result[$i]->getBinary_object();
- $pdf->write_cell(50,4,$result[$i]->getId());
- $pdf->write_cell(50,4,$binary->filename);
- $pdf->write_cell(50,4,$result[$i]->getDescription());
+ $pdf->write_multi(50,4,$result[$i]->getId());
+ $pdf->write_multi(50,4,$binary->filename);
+ $pdf->write_multi(50,4,$result[$i]->getDescription());
$pdf->line_new();
}
From be93797369e5b367201a23b56266d67829125fa3 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 13 Jan 2026 17:41:19 +0100
Subject: [PATCH 06/15] Country_code: try to guess it
---
include/constant.php | 2 +-
include/sql/patch/upgrade206.sql | 45 ++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 include/sql/patch/upgrade206.sql
diff --git a/include/constant.php b/include/constant.php
index 85c67c639..6c7b4da38 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -28,7 +28,7 @@ global $version_noalyss;
define('NOALYSS_VERSION', 10000 );
// Database schema version
-define("DBVERSION", 206);
+define("DBVERSION", 207);
// version for MONO_DATABASE
define("MONO_DATABASE", 25);
diff --git a/include/sql/patch/upgrade206.sql b/include/sql/patch/upgrade206.sql
new file mode 100644
index 000000000..76a9a3256
--- /dev/null
+++ b/include/sql/patch/upgrade206.sql
@@ -0,0 +1,45 @@
+begin;
+
+CREATE OR REPLACE FUNCTION guess_country_code()
+ RETURNS void
+ AS
+$$
+declare
+ country_code char(2);
+ x record;
+begin
+ for x in
+ select
+ f1.jft_id
+ ,f1.f_id
+ ,( select f2.ad_value from fiche_detail f2 where f2.f_id=f1.f_id and ad_id= 13) as tva_num
+ ,( select f3.ad_value from fiche_detail f3 where f3.f_id=f1.f_id and ad_id= 16) as country
+ from
+ fiche_detail f1
+ where
+ f1.ad_id=57
+ and coalesce(f1.ad_value,'')=''
+ loop
+ country_code='';
+ case
+ when substr(x.tva_num,1,2) = 'FR' or upper(x.country)='FRANCE' then country_code='FR';
+ when substr(x.tva_num,1,2) = 'BE' or upper(x.country)='BELGIQUE' then country_code='BE';
+ when substr(x.tva_num,1,2) = 'LU' or upper(x.country)='LUXEMBOURG' then country_code='LU';
+ when substr(x.tva_num,1,2) <> '' then country_code=upper(substr(x.tva_num,1,2));
+ else
+ country_code='';
+ end case;
+ raise notice 'tva_num % country % country_code % jft_id %s',x.tva_num,x.country,country_code,x.jft_id;
+ if country_code <> '' then
+ update fiche_detail set ad_value=country_code where jft_id=x.jft_id;
+ end if;
+ end loop;
+end;
+$$
+LANGUAGE plpgsql;
+
+
+select guess_country_code();
+
+insert into version (val,v_description) values (207,'Guess country code ');
+commit;
\ No newline at end of file
From 8069af5a5b18a6a8084ea24e29618e0038db5beb Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Wed, 14 Jan 2026 18:31:20 +0100
Subject: [PATCH 07/15] XML : cosmetic, manage long description and name
---
include/XMLDocument/xml_reader.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 51ed5667c..49c039863 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -503,8 +503,8 @@ abstract class XML_Reader
$nb_inline = count($result);
for ($i = 0; $i < $nb_inline; $i++)
{
- $pdf->write_cell(50, 4, $result[$i]['name']);
- $pdf->write_cell(50, 4, $result[$i]['description']);
+ $pdf->write_multi(50, 4, $result[$i]['name']);
+ $pdf->write_multi(50, 4, $result[$i]['description']);
$pdf->write_cell(25, 4, $result[$i]['tva_percent'], align: 'R');
$pdf->write_cell(5, 4, $result[$i]['tva_id']);
$pdf->write_cell(25, 4, $result[$i]['quantity'], align: 'R');
From 2bfff261a86bcf4cd2d456658665ea3915ddac35 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 16 Jan 2026 07:19:44 +0100
Subject: [PATCH 08/15] XMLReader : fix bug in invoiceline, 1st amount
incorrect
---
.../XMLDocument/xmlinvoice_reader.class.php | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/XMLDocument/xmlinvoice_reader.class.php b/include/XMLDocument/xmlinvoice_reader.class.php
index eb94cdb4a..523ef6d68 100644
--- a/include/XMLDocument/xmlinvoice_reader.class.php
+++ b/include/XMLDocument/xmlinvoice_reader.class.php
@@ -109,17 +109,17 @@ class XMLInvoice_Reader extends XML_Reader
for ($e = 0; $e < $node->length; $e++)
{
$row = [];
- $row ['quantity'] = $this->get_node_value("//cbc:InvoicedQuantity", $e);
- $row ['amount'] = $this->get_node_value("//cbc:LineExtensionAmount", $e);
- $row ['description'] = $this->get_node_value("//cac:Item/cbc:Description", $e);
- $row ['name'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cbc:Name", $e);
- $row ['unit_price'] = $this->get_node_value("//cac:InvoiceLine/cac:Price/cbc:PriceAmount", $e);
- $row ['tva_id'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
- $row ['tva_percent'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
-
+ $row ['quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->textContent;
+ $row ['code_quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->getAttribute('unitCode');
+ $row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent; // $this->get_node_value("//cbc:LineExtensionAmount", $e);
+ $row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent; //$this->get_node_value("//cac:Item/cbc:Description", $e);
+ $row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Item/cbc:Name", $e);
+ $row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Price/cbc:PriceAmount", $e);
+ $row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
+ $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
$result[] = $row;
- return $result;
}
+ return $result;
}
/**
* @brief return the code of the document
From 941ec89c7e5e58a08d6f59eb2f9d288243e1d8ac Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 16 Jan 2026 12:49:43 +0100
Subject: [PATCH 09/15] XMLREADER: improve appearance PDF + contact name
---
include/XMLDocument/xml_reader.class.php | 123 ++++++++++++------
.../xmlcreditnote_reader.class.php | 17 ++-
.../XMLDocument/xmlinvoice_reader.class.php | 12 +-
3 files changed, 98 insertions(+), 54 deletions(-)
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 49c039863..2995a374f 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -258,7 +258,20 @@ abstract class XML_Reader
$result['postcode'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]");
$result['country_code'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cac:Country[1]/cbc:IdentificationCode[1]");
$result['company_id'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyTaxScheme[1]/cbc:CompanyID[1]");
+ if ($result['company_id'] == "" ) {
+ $result['company_id'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:CompanyID[1]");
+ }
$result['scheme'] = $this->get_node("//cac:AccountingSupplierParty[1]/cac:Party[1]/cbc:EndpointID[1]")[0]->getAttribute("schemeID");
+ /**
+ * get contact
+
+ Facturation NOALYSS
+ invoice@noalyss
+
+ */
+ $result['contact_name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:Contact[1]/cbc:Name[1]");
+ $result['contact_mail'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:Contact[1]/cbc:ElectronicMail");
+
return $result;
}
@@ -416,6 +429,7 @@ abstract class XML_Reader
public function to_pdf(): PDF
{
//$pdf = new PDF($cn);
+
$pdf = new PDF();
$result = $this->get_info();
$info=$result;
@@ -426,7 +440,7 @@ abstract class XML_Reader
// 180 mm large
$pdf->setFont("DejaVu", "B", 16);
$pdf->write_cell(20, 10, "");
- $pdf->write_cell(170, 10, _("Résumé facture"),1,0,'C');
+ $pdf->write_cell(170, 10, _("Résumé document"),1,0,'C');
$pdf->line_new(10);
$pdf->setFont("DejaVu", "", 7);
$pdf->write(4, sprintf(_("Document ID %s"), $result['id']));
@@ -445,77 +459,98 @@ abstract class XML_Reader
$pdf->ln(10);
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Fournisseur"));
- $pdf->line_new(12);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$supplier = $this->get_supplier();
$pdf->setFont("DejaVu", "", 7);
- $pdf->write_cell(60, 4, $supplier['name']);
- $pdf->write_cell(60, 4, $supplier['company_id']);
- $pdf->write_cell(60, 4,$supplier['scheme'].":". $supplier['ID']);
- $pdf->line_new();
- $pdf->write_cell(60, 4, $supplier['street']);
- $pdf->write_cell(30, 4, $supplier['postcode']);
- $pdf->write_cell(60, 4, $supplier['city']);
+ $pdf->write_multi(50, 4, $supplier['name']);
+ $pdf->write_multi(50, 4, $supplier['street']);
+ $pdf->write_multi(30, 4, $supplier['postcode']);
+ $pdf->write_multi(50, 4, $supplier['city']);
$pdf->write_cell(20, 4, $supplier['country_code']);
- $pdf->line_new(10);
+ $pdf->line_new();
+ if ( $supplier['contact_name'] != '') {
+ $pdf->write_multi(60, 4, "contact name:".$supplier['contact_name']);
+ $pdf->write_multi(50, 4, $supplier['contact_mail']);
+ $pdf->line_new();
+ }
+ $pdf->write_cell(50, 4, $supplier['company_id']);
+ $pdf->write_cell(50, 4,'PEPPOL ID:'.$supplier['scheme'].":". $supplier['ID']);
+ $pdf->line_new(6);
$customer = $this->get_customer();
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Client"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
- $pdf->write_cell(60, 4, $customer['name']);
- $pdf->write_cell(60, 4, $customer['company_id']);
- $pdf->write_cell(60, 4, $customer['scheme'].":".$customer['ID']);
+ $pdf->write_multi(50, 4, $customer['name']);
+ $pdf->write_multi(50, 4, $customer['street']);
+ $pdf->write_multi(30, 4, $customer['postcode']);
+ $pdf->write_multi(50, 4, $customer['city']);
+ $pdf->write_multi(20, 4, $customer['country_code']);
$pdf->line_new();
- $pdf->write_cell(60, 4, $customer['street']);
- $pdf->write_cell(40, 4, $customer['postcode']);
- $pdf->write_cell(60, 4, $customer['city']);
- $pdf->write_cell(20, 4, $customer['country_code']);
- $pdf->line_new(10);
+ $pdf->write_cell(50, 4, $customer['company_id']);
+ $pdf->write_cell(50, 4, 'PEPPOL ID:'.$customer['scheme'].":".$customer['ID']);
+ $pdf->line_new(6);
/**
* note invoice
*/
if ( $info['info']['note'] != "")
{
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("Notes"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
- $pdf->write_multi(50, 4,$info['info']['note']);
+ $pdf->write_multi(130, 8,$info['info']['note']);
$pdf->line_new(10);
}
/**
* ITEM
*/
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Articles"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_invoiceLine();
$pdf->write_cell(50, 4, _("Code"), border: 'B');
- $pdf->write_cell(50, 4, _("Description"), border: 'B');
- $pdf->write_cell(30, 4, _("TVA"), border: 'B', align: 'R');
- $pdf->write_cell(25, 4, _("Quantité"), border: 'B', align: 'R');
- $pdf->write_cell(25, 4, _("Montant HT"), border: 'B', align: 'R');
+ $pdf->write_cell(60, 4, _("Description"), border: 'B');
+ $pdf->write_cell(20, 4, _("TVA"), border: 'B', align: 'R');
+ $pdf->write_cell(20, 4, _("Prix unitaire"), border: 'B', align: 'R');
+ $pdf->write_cell(20, 4, _("Quantité"), border: 'B', align: 'R');
+ $pdf->write_cell(20, 4, _("Montant HT"), border: 'B', align: 'R');
$pdf->line_new();
$nb_inline = count($result);
for ($i = 0; $i < $nb_inline; $i++)
{
- $pdf->write_multi(50, 4, $result[$i]['name']);
- $pdf->write_multi(50, 4, $result[$i]['description']);
- $pdf->write_cell(25, 4, $result[$i]['tva_percent'], align: 'R');
- $pdf->write_cell(5, 4, $result[$i]['tva_id']);
- $pdf->write_cell(25, 4, $result[$i]['quantity'], align: 'R');
- $pdf->write_cell(25, 4, nbm($result[$i]['amount']), align: 'R');
+ if ( $result[$i]['description'] == '') {
+ $pdf->write_multi(110, 4, $result[$i]['name']);
+ }else {
+ $pdf->write_multi(50, 4, $result[$i]['name']);
+ $pdf->write_multi(60, 4, $result[$i]['description']);
+ }
+ $pdf->write_cell(20, 4, $result[$i]['tva_percent'], align: 'R');
+ //$pdf->write_cell(5, 4, $result[$i]['tva_id']);
+ $pdf->write_cell(20, 4, $result[$i]['unit_price'], align: 'R');
+ $pdf->write_cell(20, 4, $result[$i]['quantity'], align: 'R');
+ $pdf->write_cell(20, 4, nbm($result[$i]['amount']), align: 'R');
$pdf->line_new();
}
$pdf->line_new(10);
-
+
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("Totaux"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_amount_summary();
// @TODO DNY : Qu'est-ce que LineExtension Amount ??
@@ -541,9 +576,11 @@ abstract class XML_Reader
$nb_inline = count($result);
if ( !empty ($result ))
{
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("Charge et déduction"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$pdf->write_cell(20, 4, _("code"), align: 'L', border: '1');
$pdf->write_cell(20, 4, _("Type"), border: '1');
@@ -570,13 +607,15 @@ abstract class XML_Reader
$pdf->line_new();
}
}
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("TVA"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_taxes();
$pdf->write_cell(25, 4, _("% Taxe"), align: 'R', border: 'B');
- $pdf->write_cell(5, 4, _("Code taxe"), border: 'B');
+ $pdf->write_cell(30, 4, _("Code taxe"), border: 'B');
$pdf->write_cell(50, 4, _("Base"), align: 'R', border: 'B');
$pdf->write_cell(50, 4, _("Taxe"), align: 'R', border: 'B');
$pdf->line_new();
@@ -585,7 +624,7 @@ abstract class XML_Reader
{
$pdf->write_cell(25, 4, $result[$i]['tax_percent'], align: 'R');
$pdf->write_cell(5, 4, $result[$i]['tax_id']);
- $pdf->write_cell(25, 4, $result[$i]['vatex']);
+ $pdf->write_multi(25, 4, $result[$i]['vatex']);
$pdf->write_cell(50, 4, nbm($result[$i]['taxable_amount']), align: 'R');
$pdf->write_cell(50, 4, nbm($result[$i]['tax']), align: 'R');
@@ -595,8 +634,11 @@ abstract class XML_Reader
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Paiement"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
+
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_payment_mean();
$pdf->write_cell(50, 4, _("Code"));
@@ -618,6 +660,7 @@ abstract class XML_Reader
$pdf->write_multi(140, 4, str_replace(["\n", "\r", "\t"], " ", $result['note'][$i]));
$pdf->line_new();
}
+ $pdf->line_new(6);
/**
* display name of embedded from files
* @var $result(array of Document_Reference)
@@ -625,9 +668,11 @@ abstract class XML_Reader
$result=$this->get_embedded_document();
if ( count($result) > 0)
{
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60,4,_('Documents inclus'));
$pdf->line_new();
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$nb_result=count($result);
for ($i=0;$i< $nb_result;$i++)
diff --git a/include/XMLDocument/xmlcreditnote_reader.class.php b/include/XMLDocument/xmlcreditnote_reader.class.php
index d2f845bab..7e20b0801 100644
--- a/include/XMLDocument/xmlcreditnote_reader.class.php
+++ b/include/XMLDocument/xmlcreditnote_reader.class.php
@@ -143,15 +143,14 @@ class XMLCreditNote_Reader extends XML_Reader
for ($e = 0; $e < $node->length; $e++)
{
$row = [];
- $xml = simplexml_import_dom($node->item($e));
- $row ['quantity'] = $this->get_node_value("//cbc:CreditedQuantity", $e);
- $row ['amount'] = $this->get_node_value("//cbc:LineExtensionAmount", $e);
- $row ['description'] = $this->get_node_value("//cac:Item/cbc:Description", $e);
- $row ['name'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cbc:Name", $e);
- $row ['unit_price'] = $this->get_node_value("//cac:CreditNoteLine/cac:Price/cbc:PriceAmount", $e);
- $row ['tva_id'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
- $row ['tva_percent'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
-
+ $row ['quantity'] = $node->item($e)->getElementsByTagName("CreditedQuantity")->item(0)->textContent;
+ $row ['code_quantity'] = $node->item($e)->getElementsByTagName("CreditedQuantity")->item(0)->getAttribute('unitCode');
+ $row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent;
+ $row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent;
+ $row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent;
+ $row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent;
+ $row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent;
+ $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)->textContent;
$result[] = $row;
}
return $result;
diff --git a/include/XMLDocument/xmlinvoice_reader.class.php b/include/XMLDocument/xmlinvoice_reader.class.php
index 523ef6d68..b8c3518b7 100644
--- a/include/XMLDocument/xmlinvoice_reader.class.php
+++ b/include/XMLDocument/xmlinvoice_reader.class.php
@@ -111,12 +111,12 @@ class XMLInvoice_Reader extends XML_Reader
$row = [];
$row ['quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->textContent;
$row ['code_quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->getAttribute('unitCode');
- $row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent; // $this->get_node_value("//cbc:LineExtensionAmount", $e);
- $row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent; //$this->get_node_value("//cac:Item/cbc:Description", $e);
- $row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Item/cbc:Name", $e);
- $row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Price/cbc:PriceAmount", $e);
- $row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
- $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)->textContent; //$this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
+ $row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent;
+ $row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent;
+ $row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent;
+ $row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent;
+ $row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent;
+ $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)->textContent;
$result[] = $row;
}
return $result;
From b2773cbe453d40e1d28bbaf15ea16db72c903661 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 16 Jan 2026 14:55:57 +0100
Subject: [PATCH 10/15] XMLREADER: PDF add logo
---
include/XMLDocument/xml_reader.class.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 2995a374f..bd67b4a38 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -439,9 +439,12 @@ abstract class XML_Reader
$pdf->AddPage();
// 180 mm large
$pdf->setFont("DejaVu", "B", 16);
- $pdf->write_cell(20, 10, "");
+ $pdf->line_new(2);
+ $pdf->write_cell(10, 10, "");
$pdf->write_cell(170, 10, _("Résumé document"),1,0,'C');
- $pdf->line_new(10);
+ $pdf->line_new(20);
+ $pdf->Image(NOALYSS_URL.'/image/logo10000.png', 10, 10, 20, 0, 'PNG');
+
$pdf->setFont("DejaVu", "", 7);
$pdf->write(4, sprintf(_("Document ID %s"), $result['id']));
$pdf->ln();
From 6f0c69c0bc6371bb227f480719e0176cb6797ca2 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 16 Jan 2026 15:04:14 +0100
Subject: [PATCH 11/15] XMLREADER : improve appearance
---
include/XMLDocument/xml_reader.class.php | 53 +++++++++++++++---------
include/lib/pdf_core.class.php | 2 +-
2 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index bd67b4a38..45063cbc5 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -409,6 +409,7 @@ abstract class XML_Reader
$result['InvoiceTypeCode'] =$this->get_document_type_code();
$result['DocumentCurrencyCode'] = $this->get_node_value('cbc:DocumentCurrencyCode');
$result['BuyerReference'] = $this->get_node_value('cbc:BuyerReference');
+ $result['OrderReference'] = $this->get_node_value('//cac:OrderReference[1]/cbc:ID[1]');
$result['ActualDeliveryDate'] = $this->get_node_value('//cac:Delivery[1]/cbc:ActualDeliveryDate[1]');
$result['info']=array();
@@ -440,61 +441,73 @@ abstract class XML_Reader
// 180 mm large
$pdf->setFont("DejaVu", "B", 16);
$pdf->line_new(2);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(10, 10, "");
$pdf->write_cell(170, 10, _("Résumé document"),1,0,'C');
$pdf->line_new(20);
- $pdf->Image(NOALYSS_URL.'/image/logo10000.png', 10, 10, 20, 0, 'PNG');
+ $pdf->Image(NOALYSS_HOME.'/image/logo10000.png', 10, 10, 20, 0, 'PNG');
$pdf->setFont("DejaVu", "", 7);
+ $pdf->SetTextColor(0,0,0);
$pdf->write(4, sprintf(_("Document ID %s"), $result['id']));
$pdf->ln();
- $pdf->write(4, sprintf(_("Date facture %s"), $result['IssueDate']));
- $pdf->ln();
- $pdf->write(4, sprintf(_("Date échéance %s"), $result['DueDate']));
- $pdf->ln();
+ $pdf->setFont("DejaVu", "B", 8);
+ $pdf->write_cell(20,4,_('Date'));
+ $pdf->print_row();
+ $pdf->setFont("DejaVuCond", "", 7);
+ $pdf->write_multi(38,4, sprintf(_(" Facture %s"), $result['IssueDate']));
+ $pdf->write_multi(38,4, sprintf(_("Echéance %s"), $result['DueDate']));
+ $pdf->write_multi(38,4, sprintf(_("Livraison %s"), $result['ActualDeliveryDate']));
+ $pdf->line_new();
$pdf->write(4, sprintf(_("Type et code document %s"), $result['InvoiceTypeCode']));
$pdf->ln();
$pdf->write(4, sprintf(_("Devise document %s"), $result['DocumentCurrencyCode']));
$pdf->ln();
$pdf->write(4, sprintf(_("Référence client %s"), $result['BuyerReference']));
$pdf->ln();
- $pdf->write(4, sprintf(_("Date Livraison %s"), $result['ActualDeliveryDate']));
+ $pdf->write(4, sprintf(_("Référence commande %s"), $result['OrderReference']));
$pdf->ln(10);
$pdf->setFont("DejaVu", "B", 12);
$pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Fournisseur"));
$pdf->line_new(6);
- $pdf->SetTextColor(0,0,0);
$supplier = $this->get_supplier();
- $pdf->setFont("DejaVu", "", 7);
- $pdf->write_multi(50, 4, $supplier['name']);
- $pdf->write_multi(50, 4, $supplier['street']);
+ $pdf->setFont("DejaVu", "B", 8);
+ $pdf->write_multi(10, 4, "");
+ $pdf->write_multi(150, 4, $supplier['name']);
+ $pdf->line_new();
+ $pdf->SetTextColor(0,0,0);
+ $pdf->setFont("DejaVuCond", "", 7);
+ $pdf->write_multi(70, 4, $supplier['street']);
$pdf->write_multi(30, 4, $supplier['postcode']);
$pdf->write_multi(50, 4, $supplier['city']);
- $pdf->write_cell(20, 4, $supplier['country_code']);
+ $pdf->write_cell(10, 4, $supplier['country_code']);
$pdf->line_new();
- if ( $supplier['contact_name'] != '') {
- $pdf->write_multi(60, 4, "contact name:".$supplier['contact_name']);
- $pdf->write_multi(50, 4, $supplier['contact_mail']);
- $pdf->line_new();
- }
$pdf->write_cell(50, 4, $supplier['company_id']);
$pdf->write_cell(50, 4,'PEPPOL ID:'.$supplier['scheme'].":". $supplier['ID']);
- $pdf->line_new(6);
+ $pdf->line_new();
+ if ( $supplier['contact_name'] != '' || $supplier['contact_mail'] != '') {
+ $pdf->write_multi(100, 4, "contact: ".$supplier['contact_name']." ". $supplier['contact_mail']);
+ $pdf->line_new();
+ }
+ $pdf->line_new(4);
$customer = $this->get_customer();
$pdf->setFont("DejaVu", "B", 12);
$pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Client"));
$pdf->line_new(6);
+ $pdf->setFont("DejaVu", "B", 8);
+ $pdf->write_multi(10, 4, "");
+ $pdf->write_multi(150, 4, $customer['name']);
+ $pdf->line_new();
$pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
- $pdf->write_multi(50, 4, $customer['name']);
- $pdf->write_multi(50, 4, $customer['street']);
+ $pdf->write_multi(70, 4, $customer['street']);
$pdf->write_multi(30, 4, $customer['postcode']);
$pdf->write_multi(50, 4, $customer['city']);
- $pdf->write_multi(20, 4, $customer['country_code']);
+ $pdf->write_multi(10, 4, $customer['country_code']);
$pdf->line_new();
$pdf->write_cell(50, 4, $customer['company_id']);
$pdf->write_cell(50, 4, 'PEPPOL ID:'.$customer['scheme'].":".$customer['ID']);
diff --git a/include/lib/pdf_core.class.php b/include/lib/pdf_core.class.php
index 3c95170ae..5950079a7 100644
--- a/include/lib/pdf_core.class.php
+++ b/include/lib/pdf_core.class.php
@@ -210,7 +210,7 @@ class PDF_Core extends TFPDF
* @see TFPDF::SetFontSize()
* @return void
*/
- protected function print_row()
+ function print_row()
{
static $e=0;
$e++;
From 677eacafd383b8f392cc23c10c57dbfbcfa29202 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sun, 18 Jan 2026 16:57:23 +0100
Subject: [PATCH 12/15] Appearance: add invoice or a file, additional document
---
html/css/style-classic7.css | 10 ++++++++++
include/XMLDocument/xml_reader.class.php | 2 --
include/class/acc_ledger_purchase.class.php | 6 ++++--
include/class/acc_ledger_sale.class.php | 16 +++++++++++-----
4 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index 6f5dc35e3..6883b0842 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -2501,6 +2501,8 @@ ul.aligned-block li {
padding: 2rem;
border:1px solid navy;
margin-right:1rem;
+ width: 20rem;
+
}
/***************************************************************************
* column in the dashboard
@@ -4259,6 +4261,8 @@ span.nb-round {
.bt-center {
margin-bottom: 2rem;
+ float:inherit;
+ clear:both;
}
@@ -4288,4 +4292,10 @@ span.nb-round {
#module_setting .selectedcell {
background-color:beige;
+}
+
+#facturation_div_id{
+ height:auto;
+ float:left
+
}
\ No newline at end of file
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 45063cbc5..30b8f8fb4 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -397,8 +397,6 @@ abstract class XML_Reader
/**
*
* @return array
- * @TODODNY
- * Implémenter les allowances
*/
function get_info(): array
{
diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php
index 2ba56b493..6dbf25fcb 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -1988,7 +1988,6 @@ EOF;
}
$r.='';
- $r.='
';
if ( $g_parameter->MY_ANALYTIC!='nu' && !$p_summary) // use of AA
$r.='';
@@ -2125,6 +2124,7 @@ EOF;
$file=new IFile();
$file->setAlertOnSize(true);
$file->table=0;
+ $r.=''._("Facture").'
';
$r.=_("Ajoutez une pièce justificative ");
$r.=$file->input("pj","");
@@ -2141,11 +2141,13 @@ EOF;
$r.=$doc_gen->input().'
';
}
$r.='';
+ $r.=''._("Documents supplémentaires").'
';
$r.=$this->input_supplemental_document();
$r.='';
$obj=new IText();
+ $obj->size=50;
$r.=_('Numero de bon de commande : ').$obj->input('bon_comm').'
';
- $r.=_('Autre information : ').$obj->input('other_info').'
';
+ $r.=_('Communication').$obj->input('other_info').'
';
$r.='
';
$r.='';
return $r;
diff --git a/include/class/acc_ledger_sale.class.php b/include/class/acc_ledger_sale.class.php
index 6a6a7b265..5ba62f1c4 100644
--- a/include/class/acc_ledger_sale.class.php
+++ b/include/class/acc_ledger_sale.class.php
@@ -1282,14 +1282,16 @@ EOF;
$r.=''.td($other_tax_label).td(hb($other_tax_amount),'class="num"');
}
if ( $other_tax_amount!="") {$tot=bcadd($tot,$other_tax_amount,2);}
- $r.='
'.td(_('Total TVAC')).td(hb($tot),'class="num"');
+ $r.='
'.td(_('Total TVAC')).td(hb($tot),'class="num"').'
';
$r.='';
} else {
+ $r.='';
if ( ! empty($other_tax_label) ) {
$r.=''.td($other_tax_label).td(hb($other_tax_amount),'class="num"');
}
if ( $other_tax_amount!="") {$tot=bcadd($tot,$other_tax_amount,2);}
- $r.='
Total '.hb($tot);
+ $r.='
'.td(_('Total ')).td(hb($tot),'class="num"');
+ $r.='
';
}
$r.='';
@@ -1374,13 +1376,13 @@ EOF;
*/
public function extra_info() {
- $r = '';
+ $r = '
';
// check for upload piece
$file = new IFile();
$file->table = 0;
$file->setAlertOnSize(true);
- $r.='
';
+ $r.='
'._("Facture").'
';
// add a receipt
$r.=_("Ajoutez une pièce justificative ");
$r.=$file->input("pj", "");
@@ -1398,11 +1400,15 @@ EOF;
" union select -2,'"._("Z - Facture PDF Standard")."' ".
" order by 2");
$r.=$doc_gen->input() . '
';
+ $r.='
'._("Documents supplémentaires").'
';
+ // add a receipt
$r.=$this->input_supplemental_document();
- $r.='
';
$obj = new IText();
+ $obj->size=50;
+ $r.='
';
$r.=_('Numero de bon de commande') . $obj->input('bon_comm') . '
';
+
$r.=_('Communication') . $obj->input('other_info') . '
';
$r.='
';
$r.='
';
From e32dcc660e5ff03e0b0a2ec0db8d02ba3323cace Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 19 Jan 2026 15:30:21 +0100
Subject: [PATCH 13/15] VAT : adapt standard invoice for not subject to VAT
---
include/class/invoice_pdf.class.php | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/class/invoice_pdf.class.php b/include/class/invoice_pdf.class.php
index 3dffd3c04..9a7615999 100644
--- a/include/class/invoice_pdf.class.php
+++ b/include/class/invoice_pdf.class.php
@@ -263,22 +263,25 @@ class Invoice_PDF extends \PDF
}
$this->write_multi($col['quantity'], 4, nbm($this->data['e_quant' . $i]), '', 'R',fill:$fill);
$this->write_multi($col['price'], 4, nbm($this->data['e_march' . $i . '_price']), '', 'R',fill:$fill);
- $this->write_multi($col['vat_code'], 4, $this->data['e_march' . $i . '_tva_id'], '', 'C',fill:$fill);
- $x = $this->data['e_march' . $i . '_tva_id'];
- if (!isset($a_tva_amount[$x]))
+ if (isset ($this->data['e_march' . $i . '_tva_id']))
{
- $a_tva_amount[$x] = 0;
+ $this->write_multi($col['vat_code'], 4, $this->data['e_march' . $i . '_tva_id'], '', 'C',fill:$fill);
+ $x = $this->data['e_march' . $i . '_tva_id'];
+ if (!isset($a_tva_amount[$x]))
+ {
+ $a_tva_amount[$x] = 0;
+ }
+ $a_tva_amount[$x] = bcadd($a_tva_amount[$x], $this->data["e_march" . $i . "_tva_amount"], 2);
+ $tot_vat = bcadd($tot_vat
+ , $this->data['e_march' . $i . '_tva_amount']
+ , 2);
}
- $a_tva_amount[$x] = bcadd($a_tva_amount[$x], $this->data["e_march" . $i . "_tva_amount"], 2);
$tot_amount = bcadd($tot_amount
, bcmul($this->data['e_march' . $i . '_price']
, $this->data['e_quant' . $i]
, 2
)
, 2);
- $tot_vat = bcadd($tot_vat
- , $this->data['e_march' . $i . '_tva_amount']
- , 2);
$this->line_new(4);
if ($this->GetY()>250) {
$this->AddPage();
From 0029d787cd5f57ba45a2ebe2c02e3af77d7329ba Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 19 Jan 2026 16:23:29 +0100
Subject: [PATCH 14/15] Fix Bug : order and communication not set in XML UBL21
---
include/XMLDocument/xmlinvoice.class.php | 2 +-
include/compta_ven.inc.php | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/XMLDocument/xmlinvoice.class.php b/include/XMLDocument/xmlinvoice.class.php
index 52244fc32..d681f6c71 100644
--- a/include/XMLDocument/xmlinvoice.class.php
+++ b/include/XMLDocument/xmlinvoice.class.php
@@ -257,7 +257,7 @@ abstract class XMLInvoice extends \DOMDocument
}
}
- $result['info']['communication']=($result['info']['communication']=="")?$result['id']:"";
+ $result['info']['communication']=($result['info']['communication']=="")?$result['id']:$result['info']['communication'];
$result['document']=$this->fill_document($jr_id);
/**
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index b052e04c8..024052918 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -158,6 +158,10 @@ if ( isset($_POST['record']) )
$Ledger=new Acc_Ledger_Sale($cn,$post_jrn);
try {
$internal=$Ledger->insert($_POST);
+
+ /* Save the additional information into jrn_info */
+ $obj=new Acc_Ledger_Info($cn);
+ $obj->save_extra($Ledger->jr_id,$_POST);
$Ledger->upload_supplemental_document($Ledger->jr_id);
// var $receipt (string) contains the name of the file name of
// the invoice (document created), if empty there
@@ -290,9 +294,6 @@ if ( isset($_POST['record']) )
}
- /* Save the additional information into jrn_info */
- $obj=new Acc_Ledger_Info($cn);
- $obj->save_extra($Ledger->jr_id,$_POST);
/* save followup */
$Ledger->save_followup($http->request("action_gestion","string",""));
From dfaf4c40763f6a642550f8f4adf913a4b0bc709e Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 19 Jan 2026 16:34:25 +0100
Subject: [PATCH 15/15] Fix cosmetic : align properly amount in widget
invoice-customer-supplier
---
include/widget/invoice/invoice-display.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/widget/invoice/invoice-display.php b/include/widget/invoice/invoice-display.php
index 6870ef6a2..6a38b2f4b 100644
--- a/include/widget/invoice/invoice-display.php
+++ b/include/widget/invoice/invoice-display.php
@@ -49,7 +49,7 @@ foreach ($array as $item):
=h($item['jr_comment'])?>
=h($item['jr_date'])?>
-
+
=nbm($item['jr_montant'],2)?>