From 2edebbe335b84183065140e5985f1aa00862abe1 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 5 Jan 2026 16:34:24 +0100
Subject: [PATCH 01/63] 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 97d82bb204435b64a0512eede3a25b00c75befe2 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 6 Jan 2026 19:44:19 +0100
Subject: [PATCH 02/63] 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 3282551f15372ce66d98a4dda73a0032feae53cf Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 6 Jan 2026 19:44:19 +0100
Subject: [PATCH 03/63] 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 04/63] 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 05/63] 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 06/63] 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 07/63] 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 08/63] 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 09/63] 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 10/63] 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 11/63] 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 12/63] 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 13/63] 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 14/63] 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 15/63] 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 16/63] 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)?>
From 940ab1556696c8a4458b8e1f5fc1886befe7bdc4 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 19 Jan 2026 20:59:11 +0100
Subject: [PATCH 17/63] Improve standard invoice add BANK BIC and Bank Comm
---
include/class/invoice_pdf.class.php | 38 ++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/include/class/invoice_pdf.class.php b/include/class/invoice_pdf.class.php
index 9a7615999..5a710471b 100644
--- a/include/class/invoice_pdf.class.php
+++ b/include/class/invoice_pdf.class.php
@@ -321,21 +321,51 @@ class Invoice_PDF extends \PDF
$this->line_new();
$iban = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
['COMPANY_BANK_IBAN']);
- if ($this->data['e_ech'] != "" && $iban != "")
+ if ($this->data['e_ech'] != "" ){
+ $this->write_multi(150, 4,
+ sprintf(_("Paiement avant le %s "),
+ $this->data['e_ech']
+ )
+ );
+ $this->line_new();
+ }
+
+ $this->SetFont("DejaVu", "B", 9);
+ $this->write_multi(80, 4, _("Paiement"));
+ $this->line_new();
+ $this->SetFont("DejaVu", "", 7);
+ if ( $iban != "")
{
$info = ($this->data["other_info"] == "") ? $this->data["e_pj"] : $this->data["other_info"];
$bic = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
- ['COMPANY_BANK_IBAN']);
+ ['COMPANY_BANK_BIC']);
$this->write_multi(150, 4,
- sprintf(_("Paiement avant le %s sur le compte %s (BIC %s) avec comme message %s"),
- $this->data['e_ech']
+ sprintf(_(" compte %s (BIC %s) ")
, $iban
, $bic
+
+ )
+ );
+ $this->line_new();
+ }
+ $this->write_multi(150, 4,_("Montant ").nbm(bcadd($tot_amount, $tot_vat, 2),2));
+ $this->line_new();
+ if ( $this->data["other_info"] != ""){
+ $this->write_multi(150, 4,
+ sprintf(_(" Communication: %s")
, $this->data["other_info"]
)
);
$this->line_new();
}
+ if ($this->data["bon_comm"] != "") {
+ $this->write_multi(150, 4,
+ sprintf(_(" Bon de commande: %s")
+ , $this->data["bon_comm"]
+ )
+ );
+ $this->line_new();
+ }
$this->Output($this->dirname . DIRECTORY_SEPARATOR . $this->filename, "F");
}
}
From 995545e290abdab8d1993a5a9c424949b18a6c4c Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 19 Jan 2026 20:59:11 +0100
Subject: [PATCH 18/63] Improve standard invoice add BANK BIC and Bank Comm
---
include/class/invoice_pdf.class.php | 38 ++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/include/class/invoice_pdf.class.php b/include/class/invoice_pdf.class.php
index 9a7615999..5a710471b 100644
--- a/include/class/invoice_pdf.class.php
+++ b/include/class/invoice_pdf.class.php
@@ -321,21 +321,51 @@ class Invoice_PDF extends \PDF
$this->line_new();
$iban = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
['COMPANY_BANK_IBAN']);
- if ($this->data['e_ech'] != "" && $iban != "")
+ if ($this->data['e_ech'] != "" ){
+ $this->write_multi(150, 4,
+ sprintf(_("Paiement avant le %s "),
+ $this->data['e_ech']
+ )
+ );
+ $this->line_new();
+ }
+
+ $this->SetFont("DejaVu", "B", 9);
+ $this->write_multi(80, 4, _("Paiement"));
+ $this->line_new();
+ $this->SetFont("DejaVu", "", 7);
+ if ( $iban != "")
{
$info = ($this->data["other_info"] == "") ? $this->data["e_pj"] : $this->data["other_info"];
$bic = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
- ['COMPANY_BANK_IBAN']);
+ ['COMPANY_BANK_BIC']);
$this->write_multi(150, 4,
- sprintf(_("Paiement avant le %s sur le compte %s (BIC %s) avec comme message %s"),
- $this->data['e_ech']
+ sprintf(_(" compte %s (BIC %s) ")
, $iban
, $bic
+
+ )
+ );
+ $this->line_new();
+ }
+ $this->write_multi(150, 4,_("Montant ").nbm(bcadd($tot_amount, $tot_vat, 2),2));
+ $this->line_new();
+ if ( $this->data["other_info"] != ""){
+ $this->write_multi(150, 4,
+ sprintf(_(" Communication: %s")
, $this->data["other_info"]
)
);
$this->line_new();
}
+ if ($this->data["bon_comm"] != "") {
+ $this->write_multi(150, 4,
+ sprintf(_(" Bon de commande: %s")
+ , $this->data["bon_comm"]
+ )
+ );
+ $this->line_new();
+ }
$this->Output($this->dirname . DIRECTORY_SEPARATOR . $this->filename, "F");
}
}
From bc8c8e8fa8449fd7bb2c7745b8ce7d168df76047 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 20 Jan 2026 16:51:24 +0100
Subject: [PATCH 19/63] Fix Bug : level was not set if AC not selected
---
html/do.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/html/do.php b/html/do.php
index 2f1ec3f12..b3d6a4039 100644
--- a/html/do.php
+++ b/html/do.php
@@ -73,6 +73,8 @@ if ( ! $cn->exist_table('version')) {
echo '';
return;
}
+global $level;
+$level=0;
/**
* if access_mode is MOBILE than force it to mobile.php
@@ -322,6 +324,7 @@ else
$_GET['ac']=$default;
$_POST['ac']=$default;
$_REQUEST['ac']=$default;
+
show_module($menu_id);
$all[0] = $default;
show_menu($menu_id);
From 878bfd435bccc4c1f6442505651ace3198212185 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 20 Jan 2026 16:51:41 +0100
Subject: [PATCH 20/63] Fix Bug : cannot save if ANC_FILTER is empty
---
include/class/noalyss_parameter_folder.class.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/class/noalyss_parameter_folder.class.php b/include/class/noalyss_parameter_folder.class.php
index 22d7921ad..6dc26d363 100644
--- a/include/class/noalyss_parameter_folder.class.php
+++ b/include/class/noalyss_parameter_folder.class.php
@@ -109,6 +109,7 @@ EOF;
function check_anc_filter($p_value):void
{
$tmp_value=$p_value;
+
$tmp_value=preg_replace("/[0-9]|,/", '', $p_value);
if ( $tmp_value != "") {
throw new Exception (sprintf(_("Valeur invalide %s"),$tmp_value),1000);
@@ -167,6 +168,7 @@ EOF;
function save($p_attr)
{
try {
+ if ( trim($this->MY_ANC_FILTER) == "") $this->MY_ANC_FILTER="6,7";
$value=$this->check($p_attr,$this->$p_attr);
// check if the parameter does exist
From 0ddcaffc0a16c36b1e3a1f4290d974c450b039bc Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 20 Jan 2026 18:24:10 +0100
Subject: [PATCH 21/63] SQL Install comptability
---
include/sql/account_repository/data.sql | 10 ++--------
include/sql/account_repository/schema.sql | 10 +++-------
include/sql/mod1/data.sql | 12 +++---------
include/sql/mod1/schema.sql | 18 ++----------------
include/sql/mod2/data.sql | 10 +++-------
include/sql/mod2/schema.sql | 10 +++-------
6 files changed, 16 insertions(+), 54 deletions(-)
diff --git a/include/sql/account_repository/data.sql b/include/sql/account_repository/data.sql
index 7495da312..5fc01c77e 100644
--- a/include/sql/account_repository/data.sql
+++ b/include/sql/account_repository/data.sql
@@ -1,17 +1,11 @@
set search_path = public,comptaproc,pg_catalog ;
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
-SET xmloption = content;
SET client_min_messages = warning;
-SET row_security = off;
-
+SET escape_string_warning = off;
diff --git a/include/sql/account_repository/schema.sql b/include/sql/account_repository/schema.sql
index 3218ac824..830347513 100644
--- a/include/sql/account_repository/schema.sql
+++ b/include/sql/account_repository/schema.sql
@@ -1,15 +1,11 @@
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
-SET xmloption = content;
SET client_min_messages = warning;
-SET row_security = off;
+SET escape_string_warning = off;
+
CREATE FUNCTION public.limit_user() RETURNS trigger
diff --git a/include/sql/mod1/data.sql b/include/sql/mod1/data.sql
index 62e870ec7..a76b83b5f 100644
--- a/include/sql/mod1/data.sql
+++ b/include/sql/mod1/data.sql
@@ -1,17 +1,11 @@
set search_path = public,comptaproc,pg_catalog ;
-
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
-SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
-SET xmloption = content;
SET client_min_messages = warning;
-SET row_security = off;
+SET escape_string_warning = off;
+
SELECT pg_catalog.lo_create('2346174');
diff --git a/include/sql/mod1/schema.sql b/include/sql/mod1/schema.sql
index afc0887fe..f44dc527f 100644
--- a/include/sql/mod1/schema.sql
+++ b/include/sql/mod1/schema.sql
@@ -1,28 +1,14 @@
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
-SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
-SET xmloption = content;
SET client_min_messages = warning;
-SET row_security = off;
+SET escape_string_warning = off;
CREATE SCHEMA comptaproc;
-
-
-<<<<<<< HEAD
-=======
-
-
-
->>>>>>> review-stash
CREATE SCHEMA tva_belge;
diff --git a/include/sql/mod2/data.sql b/include/sql/mod2/data.sql
index 806144100..d116b3b60 100644
--- a/include/sql/mod2/data.sql
+++ b/include/sql/mod2/data.sql
@@ -1,16 +1,12 @@
set search_path = public,comptaproc,pg_catalog ;
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
-SET xmloption = content;
SET client_min_messages = warning;
-SET row_security = off;
+SET escape_string_warning = off;
+
SELECT pg_catalog.lo_create('2351550');
diff --git a/include/sql/mod2/schema.sql b/include/sql/mod2/schema.sql
index b47e34817..2d1b8f525 100644
--- a/include/sql/mod2/schema.sql
+++ b/include/sql/mod2/schema.sql
@@ -1,15 +1,11 @@
-SET statement_timeout = 0;
-SET lock_timeout = 0;
-SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SELECT pg_catalog.set_config('search_path', '', false);
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
-SET xmloption = content;
SET client_min_messages = warning;
-SET row_security = off;
+SET escape_string_warning = off;
+
CREATE SCHEMA comptaproc;
From ccbbcf5eda1b4263021433254e32b15b8a522d26 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Wed, 21 Jan 2026 16:36:21 +0100
Subject: [PATCH 22/63] Javascript correct Layer for Dialog Box
---
html/js/accounting_item.js | 2 +-
html/js/card.js | 4 ++--
html/js/gestion.js | 4 ++--
html/js/modele_document.js | 2 +-
html/js/noalyss_script.js | 30 +++++++++++++++---------------
5 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index d8f18af0a..841e69a68 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -273,7 +273,7 @@ function search_account_card(p_obj)
onSuccess: function (req){
var pos=calcy(50);
- var obj={id:"search_account_div",cssclass:"inner_box",style:"top:"+pos+"px",
+ var obj={id:"search_account_div",cssclass:"inner_box",style:"top:"+pos+"px;z-index:"+get_next_layer(),
html:req.responseText};
add_div(obj);
remove_waiting_box();
diff --git a/html/js/card.js b/html/js/card.js
index 1ca042912..3f690e4d2 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -1215,7 +1215,7 @@ function modify_card(p_fiche_id)
nTop = 170;
}
var str_top = fixed_position(250, nTop)
- var str_style = str_top + ";width:45em;height:auto;position:absolute";
+ var str_style = str_top + ";width:45em;height:auto;position:absolute"+"; z-index:"+get_next_layer();
var popup = {'id': content, 'cssclass': 'inner_box', 'style': str_style, 'html': loading(), 'drag': false};
@@ -1383,7 +1383,7 @@ function linked_card_option(p_action_person_id,p_dossier) {
},
onSuccess:function(req) {
remove_waiting_box();
- add_div({ "id":"d_linked_card_option",cssclass:"inner_box",style:"position:fixed;top:30%;min-width:20rem;width:auto;",drag:0});
+ add_div({ "id":"d_linked_card_option",cssclass:"inner_box",style:"position:fixed;top:30%;min-width:20rem;width:auto;z-index:"+get_next_layer(),drag:0});
id$("d_linked_card_option").update(req.responseText);
}
diff --git a/html/js/gestion.js b/html/js/gestion.js
index 6de51f234..44d6d7665 100644
--- a/html/js/gestion.js
+++ b/html/js/gestion.js
@@ -282,7 +282,7 @@ function action_show(p_dossier)
parameters : {gDossier:p_dossier,'op':'action_show'},
onSuccess : function(p_xml, p_text) {
remove_waiting_box();
- add_div({id: 'action_list_div', style:"position:fixed;top:1%;width:90%;left:5%" , cssclass: 'inner_box'});
+ add_div({id: 'action_list_div', style:"position:fixed;top:1%;width:90%;left:5%;z-index:"+get_next_layer() , cssclass: 'inner_box'});
$('action_list_div').innerHTML=p_xml.responseText;
var table_followup=document.getElementById('event_followup');
if ( table_followup) { sorttable.makeSortable(table_followup); }
@@ -312,7 +312,7 @@ function action_add(p_dossier) {
onSuccess : function(p_xml, p_text) {
if (p_xml.responseText === 'NOCONX') { reconnect();return;}
remove_waiting_box();
- add_div({id: 'action_add_div',style:'top:25px',
+ add_div({id: 'action_add_div',style:'top:25px;z-index:'+get_next_layer(),
cssclass: 'inner_box'});
$('action_add_div').innerHTML=p_xml.responseText;
p_xml.responseText.evalScripts();
diff --git a/html/js/modele_document.js b/html/js/modele_document.js
index 3813caf9e..644b4d911 100644
--- a/html/js/modele_document.js
+++ b/html/js/modele_document.js
@@ -25,7 +25,7 @@ function modifyModeleDocument(p_value,dossier)
id='det'+layer;
var pos_y=posY+offsetY-20;
var pos_x=posX+offsetX+40;
- var style="position:absolute;top:"+pos_y+"px;left:10%;width:80%";
+ var style="position:absolute;top:"+pos_y+"px;left:10%;width:80%;z-index:"+get_next_layer();
var popup={'id':'mod_doc',
'cssclass':'inner_box',
'html': loading(),
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index 714f61a4a..8d46b46c4 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -579,7 +579,7 @@ function cat_doc_change(p_dt_id, p_dossier) {
var queryString = "gDossier=" + p_dossier + "&op=mod_cat_doc" + "&dt_id=" + p_dt_id;
var nTop = calcy(posY);
var nLeft = "200px";
- var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:50em;height:auto";
+ var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:50em;height:auto"+"; z-index:"+get_next_layer();
removeDiv('change_doc_div');
waiting_box();
@@ -1170,7 +1170,7 @@ function display_periode(p_dossier, p_id) {
'id': 'mod_periode',
'cssclass': 'inner_box',
'html': loading(),
- 'style': 'width:30em',
+ 'style': 'width:30em'+"; z-index:"+get_next_layer(),
'drag': true
};
if (!document.getElementById('mod_periode')) {
@@ -1295,7 +1295,7 @@ function fill_box(req) {
function mod_predf_op(dossier_id, od_id, p_ledger) {
var target = "mod_predf_op";
removeDiv(target);
- var str_style = "top:10%;left:2%;width:96%";
+ var str_style = "top:10%;left:2%;width:96%;"+"; z-index:"+get_next_layer();
var div = {id: target, cssclass: 'inner_box', style: str_style, html: loading(), drag: 1};
@@ -1582,7 +1582,7 @@ function mod_menu(gdossier, pm_id) {
waiting_box();
removeDiv('divdm' + pm_id);
var qs = "op=det_menu&gDossier=" + gdossier + "&pm_id=" + pm_id + "&ctl=divdm" + pm_id;
- var pos = fixed_position(50, 250);
+ var pos = fixed_position(50, 250)+"; z-index:"+get_next_layer();
var action = new Ajax.Request('ajax_misc.php',
{
method: 'get',
@@ -1690,7 +1690,7 @@ function add_menu(obj) {
waiting_box();
removeDiv('divdm' + p_id);
- var pos = fixed_position(250, 150) + ";width:50%;";
+ var pos = fixed_position(250, 150) + ";width:50%;"+"; z-index:"+get_next_layer();
var action = new Ajax.Request('ajax_misc.php',
{
method: 'get',
@@ -1736,7 +1736,7 @@ function add_plugin(p_dossier) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
id$('divplugin').innerHTML = req.responseText;
} catch (e) {
@@ -1766,7 +1766,7 @@ function mod_plugin(p_dossier, me_code) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
id$('divplugin').innerHTML = req.responseText;
@@ -1791,7 +1791,7 @@ function create_menu(p_dossier) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({
id: "divmenu",
drag: 1,
@@ -1820,7 +1820,7 @@ function modify_menu(p_dossier, me_code) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({
id: "divmenu",
drag: 1,
@@ -2603,7 +2603,7 @@ function show_tag(p_dossier, p_ac, p_tag_id, p_post) {
code_html = unescape_xml(code_html);
remove_waiting_box();
var posy = calcy(250);
- add_div({id: 'tag_div', cssclass: 'inner_box', drag: 0, style: "position:fixed;top:15%;"});
+ add_div({id: 'tag_div', cssclass: 'inner_box', drag: 0, style: "position:fixed;top:15%; z-index:"+get_next_layer()});
id$('tag_div').innerHTML = code_html;
try {
code_html.evalScripts();
@@ -2670,7 +2670,7 @@ function action_tag_select(p_dossier, ag_id) {
}
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- var pos = fixed_position(35, 229);
+ var pos = fixed_position(35, 229)+"; z-index:"+get_next_layer();
add_div({id: 'tag_div', style: pos, cssclass: 'inner_box tag', drag: 0});
remove_waiting_box();
@@ -2806,7 +2806,7 @@ function search_display_tag(p_dossier, p_prefix, p_object) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- add_div({id: p_prefix + 'tag_div', style: 'left:10%;width:70%', cssclass: 'inner_box', drag: 1});
+ add_div({id: p_prefix + 'tag_div', style: 'left:10%;width:70%;z-index:'+get_next_layer(), cssclass: 'inner_box', drag: 1});
id$(p_prefix + 'tag_div').style.top = calcy(200) + "px"
id$(p_prefix + 'tag_div').style.left = 20 + "%";
remove_waiting_box();
@@ -2966,7 +2966,7 @@ function calendar_zoom(obj) {
obj.outdiv = 'calendar_zoom_div';
}
if (id$(obj.outdiv) == undefined) {
- var str_style = 'top:10%;min-height:60rem';
+ var str_style = 'top:10%;min-height:60rem'+"; z-index:"+get_next_layer();
// var str_style = fixed_position(0, 120);
add_div({
id: obj.outdiv,
@@ -3464,7 +3464,7 @@ var Periode = function (p_ledger) {
var y = 100;
add_div({
"id": "mod_periode",
- "style": "position:fixed;top:" + y + "px;width:50%",
+ "style": "position:fixed;top:" + y + "px;width:50%"+"; z-index:"+get_next_layer(),
"cssclass": "inner_box",
'html': "wait"
});
@@ -4026,7 +4026,7 @@ var operation_tag = function (p_div) {
}
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- var pos = fixed_position(35, 229);
+ var pos = fixed_position(35, 229)+"; z-index:"+get_next_layer();
add_div({id: 'tag_div', style: pos, cssclass: 'inner_box tag', drag: 0});
remove_waiting_box();
From 359938ccd227f8d04b5826106980997f7229eca0 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Wed, 21 Jan 2026 16:37:07 +0100
Subject: [PATCH 23/63] VAT id 0%
---
include/XMLDocument/xmlinvoice_reader.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/XMLDocument/xmlinvoice_reader.class.php b/include/XMLDocument/xmlinvoice_reader.class.php
index b8c3518b7..6379cf524 100644
--- a/include/XMLDocument/xmlinvoice_reader.class.php
+++ b/include/XMLDocument/xmlinvoice_reader.class.php
@@ -115,8 +115,8 @@ class XMLInvoice_Reader extends XML_Reader
$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;
+ $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 8e9bc7577e32c64ae7dd805ff69a175d63f6dac2 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Thu, 22 Jan 2026 06:18:07 +0100
Subject: [PATCH 24/63] Mistype UBL21BEL
---
include/class/tva_rate_mtable.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/class/tva_rate_mtable.class.php b/include/class/tva_rate_mtable.class.php
index 0f9f3f15f..f985670d1 100644
--- a/include/class/tva_rate_mtable.class.php
+++ b/include/class/tva_rate_mtable.class.php
@@ -454,17 +454,17 @@ class Tva_Rate_MTable extends Manage_Table_SQL
}
// if vatex is set then code invoice must be different from S and Z
- if ( $g_parameter->MY_INVOICE_FORMAT == 'UBL21BE' && trim($this->table->vx_code??"") != "" && in_array($this->table->tva_peppol_code,['S','Z'] ))
+ if ( $g_parameter->MY_INVOICE_FORMAT == 'UBL21BEL' && trim($this->table->vx_code??"") != "" && in_array($this->table->tva_peppol_code,['S','Z'] ))
{
$this->set_error("vx_code",_("Le code d'exemption TVA ne peut être utilisé avec ce code Facture électronique UBL "));
}
// if vatex is set then code invoice must be different from S and Z
- if ( $g_parameter->MY_INVOICE_FORMAT == 'UBL21BE' && trim($this->table->vx_code??"") != "" && $this->table->tva_peppol_code=="")
+ if ( $g_parameter->MY_INVOICE_FORMAT == 'UBL21BEL' && trim($this->table->vx_code??"") != "" && $this->table->tva_peppol_code=="")
{
$this->set_error("vx_code",_("Le code d'exemption TVA n' pas de sens sans code Facture électronique"));
}
// if tva_peppol_code is not S or Z then a VATEX code must be supplied
- if ( $g_parameter->MY_INVOICE_FORMAT == 'UBL21BE'
+ if ( $g_parameter->MY_INVOICE_FORMAT == 'UBL21BEL'
&& ! in_array($this->table->tva_peppol_code??"",["Z","S"])
&& trim($this->table->vx_code??"" ) =="")
{
From 4b2adca0cd49d7cb1aab5468175a03a8f53101c7 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Thu, 22 Jan 2026 15:28:01 +0100
Subject: [PATCH 25/63] Fix Bug : compatibility postgresql 16
---
include/sql/account_repository/data.sql | 10 ++++--
include/sql/account_repository/schema.sql | 10 ++++--
include/sql/mod1/data.sql | 37 ++++++++++++++++++++---
include/sql/mod1/make-sql | 2 +-
include/sql/mod1/schema.sql | 11 +++++--
include/sql/mod2/data.sql | 10 ++++--
include/sql/mod2/make-sql | 4 +--
include/sql/mod2/schema.sql | 10 ++++--
8 files changed, 73 insertions(+), 21 deletions(-)
diff --git a/include/sql/account_repository/data.sql b/include/sql/account_repository/data.sql
index 5fc01c77e..7495da312 100644
--- a/include/sql/account_repository/data.sql
+++ b/include/sql/account_repository/data.sql
@@ -1,11 +1,17 @@
set search_path = public,comptaproc,pg_catalog ;
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
+SET xmloption = content;
SET client_min_messages = warning;
-SET escape_string_warning = off;
+SET row_security = off;
+
diff --git a/include/sql/account_repository/schema.sql b/include/sql/account_repository/schema.sql
index 830347513..3218ac824 100644
--- a/include/sql/account_repository/schema.sql
+++ b/include/sql/account_repository/schema.sql
@@ -1,11 +1,15 @@
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
+SET xmloption = content;
SET client_min_messages = warning;
-SET escape_string_warning = off;
-
+SET row_security = off;
CREATE FUNCTION public.limit_user() RETURNS trigger
diff --git a/include/sql/mod1/data.sql b/include/sql/mod1/data.sql
index a76b83b5f..f15f5c971 100644
--- a/include/sql/mod1/data.sql
+++ b/include/sql/mod1/data.sql
@@ -1,22 +1,49 @@
set search_path = public,comptaproc,pg_catalog ;
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET escape_string_warning = off;
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
+SET check_function_bodies = false;
+SET xmloption = content;
+SET client_min_messages = warning;
+SET row_security = off;
SELECT pg_catalog.lo_create('2346174');
+
+
+
SELECT pg_catalog.lo_create('2346176');
+
+
+
SELECT pg_catalog.lo_create('2346177');
+
+
+
SELECT pg_catalog.lo_create('2346178');
+
+
+
SELECT pg_catalog.lo_create('2346179');
+
+
+
SELECT pg_catalog.lo_create('2346181');
+
+
+
SELECT pg_catalog.lo_create('2346476');
+
+
+
+
INSERT INTO public.action (ac_id, ac_description, ac_module, ac_code) VALUES (800, 'Ajout de fiche', 'fiche', 'FICADD');
INSERT INTO public.action (ac_id, ac_description, ac_module, ac_code) VALUES (805, 'Création, modification et effacement de fiche', 'fiche', 'FIC');
INSERT INTO public.action (ac_id, ac_description, ac_module, ac_code) VALUES (910, 'création, modification et effacement de catégorie de fiche', 'fiche', 'FICCAT');
diff --git a/include/sql/mod1/make-sql b/include/sql/mod1/make-sql
index f7116ea34..8b725ae28 100755
--- a/include/sql/mod1/make-sql
+++ b/include/sql/mod1/make-sql
@@ -9,7 +9,7 @@ export TEMPLATE=${DOMAIN}mod1
psql -X $TEMPLATE -c "delete from user_local_pref"
psql -X $TEMPLATE -c "delete from user_local_pref"
-pg_dump -Ox -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
+pg_dump -O -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
sed -i -e "/COMMENT ON EXTENSION/d" schema.sql
sed -i -e "/CREATE EXTENSION/d" schema.sql
sed -ne '0,/ADD CONSTRAINT/p' schema.sql > tmpSchema.sql
diff --git a/include/sql/mod1/schema.sql b/include/sql/mod1/schema.sql
index f44dc527f..fdabc9401 100644
--- a/include/sql/mod1/schema.sql
+++ b/include/sql/mod1/schema.sql
@@ -1,14 +1,21 @@
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
+SET xmloption = content;
SET client_min_messages = warning;
-SET escape_string_warning = off;
+SET row_security = off;
CREATE SCHEMA comptaproc;
+
+
CREATE SCHEMA tva_belge;
diff --git a/include/sql/mod2/data.sql b/include/sql/mod2/data.sql
index d116b3b60..806144100 100644
--- a/include/sql/mod2/data.sql
+++ b/include/sql/mod2/data.sql
@@ -1,12 +1,16 @@
set search_path = public,comptaproc,pg_catalog ;
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
+SET xmloption = content;
SET client_min_messages = warning;
-SET escape_string_warning = off;
-
+SET row_security = off;
SELECT pg_catalog.lo_create('2351550');
diff --git a/include/sql/mod2/make-sql b/include/sql/mod2/make-sql
index eec26117c..5adf3172e 100755
--- a/include/sql/mod2/make-sql
+++ b/include/sql/mod2/make-sql
@@ -9,7 +9,7 @@ export TEMPLATE=${DOMAIN}mod2
psql -X $TEMPLATE -c "delete from user_local_pref"
psql -X $TEMPLATE -c "delete from user_local_pref"
-pg_dump -Ox -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
+pg_dump -O -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
sed -i -e "/COMMENT ON EXTENSION/d" schema.sql
sed -i -e "/CREATE EXTENSION/d" schema.sql
sed -ne '0,/ADD CONSTRAINT/p' schema.sql > tmpSchema.sql
@@ -17,5 +17,5 @@ sed -ne '/ADD CONSTRAINT/,$p' schema.sql |sed -e '1d' > constraint.sql
cp tmpSchema.sql schema.sql
echo "set search_path = public,comptaproc,pg_catalog ;" > data.sql
-pg_dump -Ox -U dany --data-only --column-inserts -O ${TEMPLATE}|sed "/^--/d" | sed -e "/SET search_path/d" >> data.sql
+pg_dump -O -U dany --data-only --column-inserts -O ${TEMPLATE}|sed "/^--/d" | sed -e "/SET search_path/d" >> data.sql
diff --git a/include/sql/mod2/schema.sql b/include/sql/mod2/schema.sql
index 2d1b8f525..b47e34817 100644
--- a/include/sql/mod2/schema.sql
+++ b/include/sql/mod2/schema.sql
@@ -1,11 +1,15 @@
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
+SET xmloption = content;
SET client_min_messages = warning;
-SET escape_string_warning = off;
-
+SET row_security = off;
CREATE SCHEMA comptaproc;
From 5bc593b4b0f6981a01d61c6da325631a041353cc Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sat, 24 Jan 2026 09:48:36 +0100
Subject: [PATCH 26/63] Fix Bug : XML UBL21 fails if customer name contains an
ampersand
---
include/XMLDocument/invoiceubl21.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php
index cc3ce03fd..0d7fa1605 100644
--- a/include/XMLDocument/invoiceubl21.class.php
+++ b/include/XMLDocument/invoiceubl21.class.php
@@ -235,7 +235,7 @@ class InvoiceUBL21 extends XMLInvoice {
// LegalEntity
$ple=$this->createElement('cac:PartyLegalEntity');
///@todo customer = name doit être fiche
- $ple->appendChild($this->createElement("cbc:RegistrationName", $this->data['customer']['name']??"ERROR"));
+ $ple->appendChild($this->createElement("cbc:RegistrationName", htmlspecialchars($this->data['customer']['name'],ENT_XML1,'UTF-8')));
///@todo customer_vat_id = numéro de TVA doit être dans fiche
$ple->appendChild($this->createElement("cbc:CompanyID", $this->data['customer']['customer_vat_id']??"ERROR"));
From 4b804a6426eb6ecddcf24ad3d8226221e04086fa Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 26 Jan 2026 13:19:09 +0100
Subject: [PATCH 27/63] Bug PEPPOL: set percent to 0 if autoreverse
---
include/XMLDocument/xmlinvoice.class.php | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/include/XMLDocument/xmlinvoice.class.php b/include/XMLDocument/xmlinvoice.class.php
index d681f6c71..0edaef1ee 100644
--- a/include/XMLDocument/xmlinvoice.class.php
+++ b/include/XMLDocument/xmlinvoice.class.php
@@ -292,7 +292,10 @@ abstract class XMLInvoice extends \DOMDocument
$VAT_SubTotal[$idx_subtotal]=array();
$VAT_SubTotal[$idx_subtotal]['idx']=$idx;
$VAT_SubTotal[$idx_subtotal]['vat_code']=$result['operation'][$i]['vat_code'] ;
- $VAT_SubTotal[$idx_subtotal]['percent']=$percent;
+ if ( $acc_tva->tva_both_side == 1 )
+ $VAT_SubTotal[$idx_subtotal]['percent']=0;
+ else
+ $VAT_SubTotal[$idx_subtotal]['percent']=$percent;
$VAT_SubTotal[$idx_subtotal]['vatex']=$acc_tva->vx_code;
$VAT_SubTotal[$idx_subtotal]['amount']=$VAT_SubTotal[$idx_subtotal]['vat']=0;
@@ -302,12 +305,19 @@ abstract class XMLInvoice extends \DOMDocument
* @todo Pour les intracomm , quel taux utilisé ? 0 ou 21%
*/
$VAT_SubTotal[$n]['amount']=bcadd($VAT_SubTotal[$n]['amount'],$result['operation'][$i]['price']);
- $VAT_SubTotal[$n]['vat']=bcadd($VAT_SubTotal[$n]['vat'],$result['operation'][$i]['vat']);
- $VAT_SubTotal[$n]['vat']=bcsub($VAT_SubTotal[$n]['vat'],$result['operation'][$i]['vat_reversed']);
+ if ( $acc_tva->tva_both_side == 0 )
+ $VAT_SubTotal[$n]['vat']=bcadd($VAT_SubTotal[$n]['vat'],$result['operation'][$i]['vat']);
+
$result['TaxableAmount']=bcadd( $result['TaxableAmount'],$result['operation'][$i]['price']);
- $result['TaxAmount']=bcadd( $result['TaxAmount'],$result['operation'][$i]['vat']);
- $result['TaxAmount']=bcsub( $result['TaxAmount'],$result['operation'][$i]['vat_reversed']);
+
+ // $result['TaxAmount']=bcsub( $result['TaxAmount'],$result['operation'][$i]['vat_reversed']);
$result['operation'][$i]['vat_percent']=$percent;
+ if ( $acc_tva->tva_both_side == 1 )
+ {
+ $result['operation'][$i]['vat_percent']=0;
+ }else {
+ $result['TaxAmount']=bcadd( $result['TaxAmount'],$result['operation'][$i]['vat']);
+ }
}
$result['subTotalVAT']=$VAT_SubTotal;
$result['LineExtensionAmount']= $result['TaxableAmount'];
From 4835d163c5120cc07057b1bc53d73b986dd2fb57 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 26 Jan 2026 13:45:20 +0100
Subject: [PATCH 28/63] Fix Bug Intracomm
---
include/XMLDocument/invoiceubl21.class.php | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php
index 0d7fa1605..546da3074 100644
--- a/include/XMLDocument/invoiceubl21.class.php
+++ b/include/XMLDocument/invoiceubl21.class.php
@@ -245,6 +245,31 @@ class InvoiceUBL21 extends XMLInvoice {
$customer->appendChild($customer_party);
return $customer;
}
+ /**
+ * @brief Delivery Date is mandatory for INTRACOMM , so by default
+ * we set the invoice date
+
+
+ 2026-01-06
+
+
+ */
+ function build_deliveryDate()
+ {
+ $delivery=$this->createElement("cac:Delivery");
+ $delivery->appendChild($this->createElement("cbc:ActualDeliveryDate",$this->data['issue_date']));
+ //(cac:Delivery/cac:DeliveryLocation/cac:Address/cac:Country/cbc:IdentificationCode//
+ $loc= $this->createElement("cac:DeliveryLocation");
+ $addr=$this->createElement('cac:Address');
+ $country=$this->createElement("cac:Country");
+ $country->appendChild($this->createElement("cbc:IdentificationCode", $this->data['customer']['country']));
+ $addr->appendChild($country);
+ $loc->appendChild($addr);
+ $delivery->appendChild($loc);
+
+ return $delivery;
+ }
+ /**
/**
* @brief Build XML Block for payment
* @code
@@ -659,6 +684,9 @@ class InvoiceUBL21 extends XMLInvoice {
// add the customer
$root->appendChild($this->build_customer());
+ // add delivery date
+ $root->appendChild($this->build_deliveryDate());
+
// add the payment if there is a bank account
if ( $company['COMPANY_BANK_IBAN'] != "")
$root->appendChild($this->build_paymentInfo());
From c8f7f420a36270f3f8f285f2c533ba3a3220bc72 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 27 Jan 2026 16:38:20 +0100
Subject: [PATCH 29/63] Cosmetic followup - detail and summary
---
include/ajax/ajax_view_action.php | 4 ++--
include/class/fiche.class.php | 2 +-
include/class/follow_up.class.php | 3 ++-
include/template/follow_up-display.php | 4 ++--
include/template/follow_up_detail_display.php | 3 ++-
5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/ajax/ajax_view_action.php b/include/ajax/ajax_view_action.php
index fa68d473a..2af8c37d5 100644
--- a/include/ajax/ajax_view_action.php
+++ b/include/ajax/ajax_view_action.php
@@ -38,8 +38,8 @@ if ( ($g_user->can_write_action($ag_id) == true || $g_user->can_read_action($ag_
{
$menu=new Default_Menu();
echo $act->Display('READ', false, "ajax", "");
- //$action=HtmlInput::array_to_string(array("gDossier","ag_id"), $_GET)."&ac=FOLLOW&sa=detail";
- $action= "do.php?".http_build_query(array("gDossier"=>Dossier::id(),"ag_id"=>$ag_id,"ac"=>$menu->get('code_follow'),"sa"=>"detail"));
+
+ $action= NOALYSS_URL."/do.php?".http_build_query(array("gDossier"=>Dossier::id(),"ag_id"=>$ag_id,"ac"=>$menu->get('code_follow'),"sa"=>"detail"));
$code='ok';
?>
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 3729e33a8..8ea43a022 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -1503,7 +1503,7 @@ class Fiche
$solde=abs(bcsub($deb,$cred));
$side=($deb > $cred)?'Débit':'Crédit';
$r.='';
- $r.=td("").td("").td("").td("").td("Totaux").td(nbm($deb),'class="num"').td(nbm($cred),'class="num"').td(" $side ".nbm($solde),'class="num"');
+ $r.=td("").td("").td("").td("").td("").td("Totaux").td(nbm($deb),'class="num"').td(nbm($cred),'class="num"').td(" $side ".nbm($solde),'class="num"');
$r.='
';
$r.="";
$r.="";
diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php
index 4cd537e27..bf4a978ed 100644
--- a/include/class/follow_up.class.php
+++ b/include/class/follow_up.class.php
@@ -283,7 +283,8 @@ class Follow_Up
$title->name="ag_title";
$title->value=$this->ag_title;
$title->size=60;
- $title->style='style="font-size:2rem;font-weight:bold"';
+ $title->style='style="font-size:2rem;font-weight:bold"';
+ $title->css_size="45rem";
// Priority of the ag_priority
diff --git a/include/template/follow_up-display.php b/include/template/follow_up-display.php
index 3c69974dc..5685138ff 100644
--- a/include/template/follow_up-display.php
+++ b/include/template/follow_up-display.php
@@ -38,11 +38,11 @@ $dossier_id=Dossier::id();
*
*/
?>
-
+
-
+
diff --git a/include/template/follow_up_detail_display.php b/include/template/follow_up_detail_display.php
index 25852f565..cee2a6cdb 100644
--- a/include/template/follow_up_detail_display.php
+++ b/include/template/follow_up_detail_display.php
@@ -40,7 +40,7 @@ $option_detail= Document_Option::option_operation_detail($document_type);
// default menu for invoice
$menu=new Default_Menu();
?>
-
+
@@ -249,4 +249,5 @@ $menu=new Default_Menu();
+
From 43c686d64e47c1db8dff217c405fb1e569cb07f1 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Wed, 28 Jan 2026 10:22:35 +0100
Subject: [PATCH 30/63] XML Peppol : correct negative amount
---
include/XMLDocument/invoiceubl21.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php
index 546da3074..b4098626e 100644
--- a/include/XMLDocument/invoiceubl21.class.php
+++ b/include/XMLDocument/invoiceubl21.class.php
@@ -475,6 +475,7 @@ class InvoiceUBL21 extends XMLInvoice {
$result->appendChild($this->createElement("cbc:ID", $i));
$amount=sprintf("%.2f",$row['price']);
+ if ( $row['quantity'] > 0 && $amount < 0 ) $row['quantity'] =bcsub(0,$row['quantity'] ,4);
$result->appendChild(
$this->createElement("cbc:InvoicedQuantity", sprintf("%.2f",$row['quantity'])))
->setAttribute("unitCode", $row["code_quantity"]);
From 3dd44178f040e8742dbac86130d2c9754d402dec Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sat, 31 Jan 2026 23:04:39 +0100
Subject: [PATCH 31/63] XML description cannot be empty
---
include/XMLDocument/xmlinvoice.class.php | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/XMLDocument/xmlinvoice.class.php b/include/XMLDocument/xmlinvoice.class.php
index 0edaef1ee..84509ea73 100644
--- a/include/XMLDocument/xmlinvoice.class.php
+++ b/include/XMLDocument/xmlinvoice.class.php
@@ -208,8 +208,16 @@ abstract class XMLInvoice extends \DOMDocument
$card=new \Fiche($this->cn,$operation->det->array[$i]['qs_fiche']);
$result['operation'][$i]['qcode']=$card->get_attribute(ATTR_DEF_QUICKCODE);
$result['operation'][$i]['name']=$card->get_attribute(ATTR_DEF_NAME);
- $result['operation'][$i]['description']=($operation->det->array[$i]['j_text']=="")?$card->get_attribute(9):$operation->det->array[$i]['j_text'];
-
+ $result['operation'][$i]['description']=$operation->det->array[$i]['j_text'];
+ if ($operation->det->array[$i]['j_text'] == "")
+ {
+ $a=$card->get_attribute(9);
+ if ( $a != "") {
+ $result['operation'][$i]['description']=$a;
+ }else {
+ $result['operation'][$i]['description']=$result['operation'][$i]['name'];
+ }
+ }
// get the type of unity, if not found then it will be EA
$x= $card->get_attribute(ATTR_DEF_QUANTITY_TYPE,0);
$result['operation'][$i]['code_quantity']=($x===false||$x=="")?"EA":$x;
From 70c3244684d1edf28ab21a5fc59c8df38db043d5 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 2 Feb 2026 11:01:45 +0100
Subject: [PATCH 32/63] cosmetic : follow-up title
---
html/css/style-classic7.css | 3 +++
1 file changed, 3 insertions(+)
diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index 6883b0842..91148a26b 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -4298,4 +4298,7 @@ span.nb-round {
height:auto;
float:left
+}
+#ag_title {
+ width:80%;
}
\ No newline at end of file
From 27687e9153f5943c1605d9a0a455a8d2dcb04fc1 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 3 Feb 2026 23:53:17 +0100
Subject: [PATCH 33/63] Fix Bug : duplicate operation doesn't allow to add more
items
---
include/class/acc_operation.class.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/class/acc_operation.class.php b/include/class/acc_operation.class.php
index 3ac02140f..d4f5eed8f 100644
--- a/include/class/acc_operation.class.php
+++ b/include/class/acc_operation.class.php
@@ -910,7 +910,7 @@ EOF;
// retrieve all info about operation
$operation = $this->get_quant();
$array=$operation->compute_array();
-
+
global $g_user;
$a_code=$this->db->get_array("select code from v_menu_dependency vmd where me_code=$1 and p_id=$2",
array( $operation->signature,$g_user->get_profile()));
@@ -1013,6 +1013,8 @@ EOF;
echo \Noalyss\Dbg::hidden_info("operation->det", $operation->det);
echo \Noalyss\Dbg::hidden_info("array", $array);
}
+ $ledger=new \Acc_Ledger($this->db,$operation->det->jr_def_id);
+ $array['nb_item']=max($ledger->get_min_row(),$array['nb_item']);
// transform the operation into hidden element
$r.=HtmlInput::simple_array_to_hidden($array);
$r.=HtmlInput::hidden("e_comm",$operation->det->jr_comment);
From a5a092bfc6880f11bb87a5ab87c91425a4cda768 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 6 Feb 2026 16:52:35 +0100
Subject: [PATCH 34/63] Bug Filter save and load when NO VAT
---
html/js/acc_ledger.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index b19270895..fb7736fcd 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -1539,7 +1539,9 @@ function save_filter(p_div, p_dossier) {
// Get all elt from the form
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- eltValue[idx] = id$(p_div + elt[i]).value;
+ eltValue[idx] = null;
+ if ( document.getElementById(p_div+elt[i]) )
+ eltValue[idx]=id$(p_div + elt[i]).value;
}
if (eltValue['amount_min'] == "") eltValue["amount_min"] = 0;
@@ -1602,7 +1604,9 @@ function load_filter(p_div, p_dossier, p_filter_id) {
, 'p_currency_code', 'tva_id_search'];
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- id$(p_div + idx).value = answer[elt[i]];
+
+ if ( document.getElementById(p_div + idx))
+ id$(p_div + idx).value = answer[elt[i]];
}
// fillup the r_jrn array
var eltLedgerId = id$("ledger_id" + p_div);
From 1f18993e5881b99ccd742b1b3f5ec390657df2cc Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 6 Feb 2026 16:52:35 +0100
Subject: [PATCH 35/63] Bug Filter save and load when NO VAT
---
html/js/acc_ledger.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index b19270895..fb7736fcd 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -1539,7 +1539,9 @@ function save_filter(p_div, p_dossier) {
// Get all elt from the form
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- eltValue[idx] = id$(p_div + elt[i]).value;
+ eltValue[idx] = null;
+ if ( document.getElementById(p_div+elt[i]) )
+ eltValue[idx]=id$(p_div + elt[i]).value;
}
if (eltValue['amount_min'] == "") eltValue["amount_min"] = 0;
@@ -1602,7 +1604,9 @@ function load_filter(p_div, p_dossier, p_filter_id) {
, 'p_currency_code', 'tva_id_search'];
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- id$(p_div + idx).value = answer[elt[i]];
+
+ if ( document.getElementById(p_div + idx))
+ id$(p_div + idx).value = answer[elt[i]];
}
// fillup the r_jrn array
var eltLedgerId = id$("ledger_id" + p_div);
From 02a938a08fd84c28f4f21adcd17c1ed9049562c5 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Fri, 6 Feb 2026 19:23:30 +0100
Subject: [PATCH 36/63] Warning when no percent
---
include/XMLDocument/xmlcreditnote_reader.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/XMLDocument/xmlcreditnote_reader.class.php b/include/XMLDocument/xmlcreditnote_reader.class.php
index 7e20b0801..848ca78de 100644
--- a/include/XMLDocument/xmlcreditnote_reader.class.php
+++ b/include/XMLDocument/xmlcreditnote_reader.class.php
@@ -150,7 +150,7 @@ class XMLCreditNote_Reader extends XML_Reader
$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;
+ $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)?->textContent;
$result[] = $row;
}
return $result;
From a046e447e7441b54916ee53de8d0ef043dda39c5 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Tue, 10 Feb 2026 13:02:11 +0100
Subject: [PATCH 37/63] If VAT percent is not set, because there is no VAT
---
include/XMLDocument/xmlinvoice_reader.class.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/XMLDocument/xmlinvoice_reader.class.php b/include/XMLDocument/xmlinvoice_reader.class.php
index 6379cf524..eafb539cc 100644
--- a/include/XMLDocument/xmlinvoice_reader.class.php
+++ b/include/XMLDocument/xmlinvoice_reader.class.php
@@ -164,7 +164,12 @@ class XMLInvoice_Reader extends XML_Reader
$row ['taxable_amount'] = $xml->xpath("//cbc:TaxableAmount")[$e] . "";
$row ['tax'] = $xml->xpath("//cbc:TaxAmount")[$e] . "";
$row ['tax_id'] = $xml->xpath("//cac:TaxCategory/cbc:ID")[$e] . "";
- $row ['tax_percent'] = $xml->xpath("//cac:TaxCategory/cbc:Percent")[$e] . "";
+ $row ['tax_percent'] =0;
+ $r=$xml->xpath("//cac:TaxCategory/cbc:Percent");
+ if ( isset($r[$e]) )
+ {
+ $row ['tax_percent'] = $xml->xpath("//cac:TaxCategory/cbc:Percent")[$e] . "";
+ }
if (isset($xml->xpath("//cac:InvoiceLine/cac:Item/cbc:Name")[$e]))
{
$row ['name'] =$xml->xpath("//cac:InvoiceLine/cac:Item/cbc:Name")[$e]."";
From 2b1727b7ed8ff9cfe0c479026257ce9bac9437b1 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sat, 14 Feb 2026 15:50:17 +0100
Subject: [PATCH 38/63] Bug : upgrade fails because account_repository has
changed
---
include/class/noalyss_user.class.php | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/include/class/noalyss_user.class.php b/include/class/noalyss_user.class.php
index b27357aba..c0920209b 100644
--- a/include/class/noalyss_user.class.php
+++ b/include/class/noalyss_user.class.php
@@ -401,7 +401,32 @@ class Noalyss_User
$sql_cond=" where use_id=$1";
$sql_array=array($this->id);
}
- $sql="select use_id,
+ /**
+ * mono version
+ */
+ if ( $this->repository->exist_table("repo_version")) {
+ $repo_version = $this->repository->get_value("select val from repo_version");
+ } else {
+ $repo_version = $this->repository->get_value("select val from version");
+ }
+ /**
+ * when upgrading , ACCOUNT_REPOSITORY is not yet upgraded
+ */
+ if ( $repo_version < 21)
+ {
+ $sql="select use_id,
+ use_first_name,
+ use_name,
+ use_login,
+ use_active,
+ use_admin,
+ use_pass,
+ use_email
+ from ac_users ";
+ $row=array();
+ $row['use_auth_method']=$row['use_otp_secret']="";
+ } else {
+ $sql="select use_id,
use_first_name,
use_name,
use_login,
@@ -412,6 +437,7 @@ class Noalyss_User
use_auth_method,
use_otp_secret
from ac_users ";
+ }
$Res=$this->repository->exec_sql($sql.$sql_cond, $sql_array);
if (($Max=Database::num_row($Res))==0)
return -1;
From a803b8dc6681eff2a74952bc5edaeb92d422c6c3 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sat, 14 Feb 2026 16:20:16 +0100
Subject: [PATCH 39/63] config LOCALE add comment
---
include/lib/config_file.php | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/lib/config_file.php b/include/lib/config_file.php
index 07fe9c4e9..dbc7bec13 100644
--- a/include/lib/config_file.php
+++ b/include/lib/config_file.php
@@ -165,7 +165,13 @@ function display_file_config($p_array, $from_setup = 1, $p_os = 1)
echo PHP_EOL;
print ('define ("NOALYSS_ADMIN_PASSWORD","' . $cpassword_admin . '");');
echo PHP_EOL;
-
+ echo "
+ /*
+ * LOCALE 0 means no language change , on some PHP installation
+ * you cannot change the language
+ */
+ ";
+ echo PHP_EOL;
print ('define ("LOCALE",' . $clocale . ');');
echo PHP_EOL;
echo "
From b4f226ab9cd27274e1fa39465bd61291d0b78068 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sat, 14 Feb 2026 16:22:09 +0100
Subject: [PATCH 40/63] set version 10.001
---
include/constant.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/constant.php b/include/constant.php
index 6c7b4da38..e9642d1dc 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -25,7 +25,7 @@
global $version_noalyss;
// version
-define('NOALYSS_VERSION', 10000 );
+define('NOALYSS_VERSION', 10001 );
// Database schema version
define("DBVERSION", 207);
From 607ab626c57a62f66ea6ebbfc9eb1633f3776488 Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Sat, 21 Feb 2026 08:54:14 +0100
Subject: [PATCH 41/63] Bug 2449 : cannot remove a profil if a profil for
smartphone exists
---
include/profile.inc.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/profile.inc.php b/include/profile.inc.php
index f34d3223a..978ad3bcc 100644
--- a/include/profile.inc.php
+++ b/include/profile.inc.php
@@ -204,7 +204,9 @@ if (isset($_POST['delete_profil']))
{
throw new Exception('On ne peut pas effacer le profil par défaut');
}
- $new_id=$cn->get_value("delete from profile
+ $cn->exec_sql("delete from profile_mobile
+ where p_id=$1 ", array($p_id));
+ $cn->exec_sql("delete from profile
where p_id=$1 ", array($p_id));
$cn->commit();
}
From da510358406fa76247087fa76a00045dc7c5868d Mon Sep 17 00:00:00 2001
From: sparkyx
Date: Mon, 23 Feb 2026 16:54:13 +0100
Subject: [PATCH 42/63] Cosmetic add button to close to navigator and bookmark
---
include/ajax/ajax_bookmark.php | 11 +++++++++--
include/ajax/ajax_navigator.php | 6 +++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/include/ajax/ajax_bookmark.php b/include/ajax/ajax_bookmark.php
index d0557fb67..03028d47d 100644
--- a/include/ajax/ajax_bookmark.php
+++ b/include/ajax/ajax_bookmark.php
@@ -124,8 +124,15 @@ echo _("Menu actuel")." : ".hb($_GET['ac']);
echo HtmlInput::array_to_hidden(array("gDossier","ac"), $_REQUEST);
?>
-
-
+
+ -
+ =\HtmlInput::button_hide("bookmark_div")?>
+
+ -
+
+
+
+
diff --git a/include/ajax/ajax_navigator.php b/include/ajax/ajax_navigator.php
index 867c70885..00b8beefd 100644
--- a/include/ajax/ajax_navigator.php
+++ b/include/ajax/ajax_navigator.php
@@ -113,7 +113,11 @@ for ($i=0;$i<$nMax;$i++):
-
+
+ -
+ =\HtmlInput::button_hide("navi_div")?>
+
+
- input();
- ?>
+
+ input(); ?>
+
+
+ value; ?>
+
+
dt_id) == "ONE_EDIT" )
{
+ echo '';
}
-
- if ( count($acomment) > 0
+ //------------------------------------------------
+ // Multiple comments
+ //------------------------------------------------
+
+ if ( count($acomment) > 0
&& Document_Option::can_add_comment($ag_id)
&& Document_Option::option_comment($this->dt_id) == "SOME_FIXED")
{
echo h2(_("Commentaire"));
-
+ echo '
+
-