From 4262d666cab9708e1c45588ceebb3ac2074fcfd8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?This=20Charl=C3=A8ne?=
<1179011+defrance@users.noreply.github.com>
Date: Mon, 5 Sep 2022 16:15:13 +0200
Subject: [PATCH 1/6] PHP V8 warning
and $objectidnext = $object->getIdReplacingInvoice(); not present
---
htdocs/fourn/facture/card.php | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index c2fc4e8511a..b928cc5bdf9 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2642,6 +2642,8 @@ if ($action == 'create') {
/*
* View card
*/
+ $objectidnext = $object->getIdReplacingInvoice();
+
$head = facturefourn_prepare_head($object);
$titre = $langs->trans('SupplierInvoice');
@@ -2934,7 +2936,7 @@ if ($action == 'create') {
}
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
}
- if (isset($facidnext) && $facidnext > 0) {
+ if (isset($objectidnext) && $objectidnext > 0) {
$facthatreplace = new FactureFournisseur($db);
$facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')';
@@ -3266,7 +3268,7 @@ if ($action == 'create') {
}
$sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,';
- $sql .= ' c.id as paiement_type,';
+ $sql .= ' c.id as paiement_type, c.code as payment_code,';
$sql .= ' pf.amount,';
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
@@ -3303,7 +3305,7 @@ if ($action == 'create') {
$paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
$paymentstatic->num_payment = $objp->num_payment;
- $paymentstatic->payment_code = $objp->payment_code;
+ $paymentstatic->paiementcode = $objp->payment_code;
print '
';
print '| ';
@@ -3648,7 +3650,7 @@ if ($action == 'create') {
|| ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id))
|| ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discount->id)))
&& ($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED)) { // A paid invoice (partially or completely)
- if (!$facidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice
+ if (!$objectidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice
print ''.$langs->trans('ReOpen').'';
} else {
if ($usercancreate) {
From e1a1ce55517ce522e1749d76ce5764543ea3b829 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?This=20Charl=C3=A8ne?=
<1179011+defrance@users.noreply.github.com>
Date: Mon, 5 Sep 2022 17:31:30 +0200
Subject: [PATCH 2/6] php V8 warning
---
htdocs/fourn/facture/note.php | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index 682d92b4515..eebd40e5b95 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -179,11 +179,13 @@ if ($object->id > 0) {
}
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')';
}
+ /*
if ($facidnext > 0) {
$facthatreplace = new FactureFournisseur($db);
$facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')';
}
+ */
print ' |
';
// Label
@@ -197,13 +199,13 @@ if ($object->id > 0) {
// Amount Local Taxes
//TODO: Place into a function to control showing by country or study better option
- if ($societe->localtax1_assuj == "1") { //Localtax1
- print '| '.$langs->transcountry("AmountLT1", $societe->country_code).' | ';
+ if ($mysoc->localtax1_assuj == "1") { //Localtax1
+ print '
| '.$langs->transcountry("AmountLT1", $mysoc->country_code).' | ';
print ''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).' | ';
print '
';
}
- if ($societe->localtax2_assuj == "1") { //Localtax2
- print '| '.$langs->transcountry("AmountLT2", $societe->country_code).' | ';
+ if ($mysoc->localtax2_assuj == "1") { //Localtax2
+ print '
| '.$langs->transcountry("AmountLT2", $mysoc->country_code).' | ';
print ''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).' | ';
print '
';
}
From a13f232d2d577859ddc2df9319a815a34cbecf16 Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Tue, 6 Sep 2022 05:42:04 +0200
Subject: [PATCH 3/6] FIX #22057
---
htdocs/compta/resultat/clientfourn.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index ed4dac6c3f3..3658fdbda6b 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
// Load translation files required by the page
From bfb93609dd0a1d5ce7546db1bcb0da8efe1a18a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?This=20Charl=C3=A8ne?=
<1179011+defrance@users.noreply.github.com>
Date: Wed, 7 Sep 2022 08:56:02 +0200
Subject: [PATCH 4/6] php V8 Warning
---
htdocs/compta/facture/card.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index d8db9191c32..27ad83d35d4 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -2237,8 +2237,9 @@ if (empty($reshook)) {
$desc = $product_desc;
$type = GETPOST('type');
$fk_unit = GETPOST('units', 'alpha');
- $pu_ht_devise = price2num($price_ht_devise, 'MU');
}
+
+ $pu_ht_devise = price2num($price_ht_devise, 'MU');
// Margin
$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');
@@ -2286,10 +2287,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (!empty-$conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
+ if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
From 0886f8557967071952693d7c3fe1067032d66cdf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?This=20Charl=C3=A8ne?=
<1179011+defrance@users.noreply.github.com>
Date: Wed, 7 Sep 2022 08:57:51 +0200
Subject: [PATCH 5/6] Update card.php
---
htdocs/compta/facture/card.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 27ad83d35d4..f60f1da089d 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -659,10 +659,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
- if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+ if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
+ if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
From 967e2033193105c54297a4fcb31a6740b0aea6c4 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Wed, 7 Sep 2022 13:55:02 +0200
Subject: [PATCH 6/6] Fix fetch missing fields
---
htdocs/fourn/facture/card.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index b928cc5bdf9..75aa5898574 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2643,7 +2643,7 @@ if ($action == 'create') {
* View card
*/
$objectidnext = $object->getIdReplacingInvoice();
-
+
$head = facturefourn_prepare_head($object);
$titre = $langs->trans('SupplierInvoice');
@@ -3305,7 +3305,10 @@ if ($action == 'create') {
$paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
$paymentstatic->num_payment = $objp->num_payment;
+
$paymentstatic->paiementcode = $objp->payment_code;
+ $paymentstatic->type_code = $objp->payment_code;
+ $paymentstatic->type_label = $objp->payment_type;
print '';
print '| ';
|