From e4eb8883fece909208a94b22f60d276812600e6b Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Sun, 19 Jan 2020 19:10:10 +0100 Subject: [PATCH 01/21] Fix double display of create credit note button Before: Display of the "Create credit note" button twice for standard invoices when situation invoices are activated. After: Displays a single button "Create a credit note" --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b067adffeca..d83e13da433 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4829,6 +4829,7 @@ elseif ($id > 0 || ! empty($ref)) // For situation invoice with excess received if ($object->statut > Facture::STATUS_DRAFT + && $object->type == Facture::TYPE_SITUATION && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0 && $usercancreate && !$objectidnext From f4cd3236b1563daa1cbc0b390c6311066998ad4e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 19 Jan 2020 21:59:01 +0100 Subject: [PATCH 02/21] Fix : Accounting - error on right --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index e67b19991b0..7ada77d0bd6 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -855,7 +855,7 @@ print ""; print ''; // TODO Replace this with mass delete action -if ($user->rights->mouvements->creer) +if ($user->rights->accounting->mouvements->creer) { print '
' . "\n"; print '' . $langs->trans("DeleteMvt") . ''; From b4758295e149723b629b95a6c3d53c95c2aff749 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 21 Jan 2020 10:59:57 +0100 Subject: [PATCH 03/21] fix stripe/charge.php for connect mode with payment intent --- htdocs/stripe/charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 9d4bf71c040..3483efcaa18 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,7 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); } // The metadata FULLTAG is defined by the online payment page From d6766af35d3e83c4d5132b8791b54c1801b2af02 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 21 Jan 2020 14:17:53 +0100 Subject: [PATCH 04/21] Fix dom and missing param --- htdocs/core/class/commonobject.class.php | 3 ++- htdocs/core/class/html.form.class.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bf39cc1e94d..d4735e4ba8d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5932,7 +5932,8 @@ abstract class CommonObject { $param_list=array_keys($param['options']); // $param_list='ObjectName:classPath' $showempty=(($required && $default != '')?0:1); - $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty); + $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam); + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { list($class,$classfile)=explode(':', $param_list[0]); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f9a6827e49..cb46be383db 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").'
'; + $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; } else { - $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; + $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; } return $return; } From c91ab621b848180c0954043eb0d63e0c8081dfd2 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 21 Jan 2020 17:49:27 +0100 Subject: [PATCH 05/21] FIX length, width and height coherence in product table --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 47b190ed4f7..aa6dd5e08a8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -819,9 +819,9 @@ class Product extends CommonObject $this->height = price2num($this->height); $this->height_units = trim($this->height_units); // set unit not defined - if ($this->length_units) { $this->width_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->width_units = $this->length_units; // Not used yet } - if ($this->length_units) { $this->height_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->height_units = $this->length_units; // Not used yet } // Automated compute surface and volume if not filled if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) { From fd02ed43174281c7e72ab362b672744951bff6cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Jan 2020 20:50:58 +0100 Subject: [PATCH 06/21] Fix label --- htdocs/product/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6bf3beb6dde..9fc5eaa62d4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -922,7 +922,10 @@ if ($resql) // Type if (!empty($arrayfields['p.fk_product_type']['checked'])) { - print ''.$obj->fk_product_type.''; + print ''; + if ($obj->fk_product_type == 0) print $langs->trans("Product"); + else print $langs->trans("Service"); + print ''; if (!$i) $totalarray['nbfield']++; } From a36b0ea4f563e7ce070c1883aefda1790736f424 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Jan 2020 21:36:40 +0100 Subject: [PATCH 07/21] Fix filter on parent account in list of accounting accounts --- htdocs/accountancy/admin/account.php | 16 ++++++++++++---- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 9c4536e94c4..5423ae7b41d 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -27,6 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries")); @@ -180,6 +181,7 @@ if (empty($reshook)) */ $form = new Form($db); +$formaccounting = new FormAccounting($db); llxHeader('', $langs->trans("ListAccounts")); @@ -200,7 +202,7 @@ $sql .= " WHERE asy.rowid = ".$pcgver; //print $sql; if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label); -if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent); +if (strlen(trim($search_accountparent)) && $search_accountparent != '-1') $sql .= natural_search("aa.account_parent", $search_accountparent, 2); if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype); if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype); $sql .= $db->order($sortfield, $sortorder); @@ -232,7 +234,7 @@ if ($resql) if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; if ($search_account) $param .= '&search_account='.urlencode($search_account); if ($search_label) $param .= '&search_label='.urlencode($search_label); - if ($search_accountparent) $param .= '&search_accountparent='.urlencode($search_accountparent); + if ($search_accountparent > 0 || $search_accountparent == '0') $param .= '&search_accountparent='.urlencode($search_accountparent); if ($search_pcgtype) $param .= '&search_pcgtype='.urlencode($search_pcgtype); if ($search_pcgsubtype) $param .= '&search_pcgsubtype='.urlencode($search_pcgsubtype); if ($optioncss != '') $param .= '&optioncss='.$optioncss; @@ -316,8 +318,13 @@ if ($resql) print ''; if (!empty($arrayfields['aa.account_number']['checked'])) print ''; if (!empty($arrayfields['aa.label']['checked'])) print ''; - if (!empty($arrayfields['aa.account_parent']['checked'])) print ''; - if (!empty($arrayfields['aa.pcg_type']['checked'])) print ''; + if (!empty($arrayfields['aa.account_parent']['checked'])) { + print ''; + print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2); + //print ''; + print ''; + } + if (!empty($arrayfields['aa.pcg_type']['checked'])) print ''; if (!empty($arrayfields['aa.pcg_subtype']['checked'])) print ''; if (!empty($arrayfields['aa.active']['checked'])) print ' '; print ''; @@ -339,6 +346,7 @@ if ($resql) $accountstatic = new AccountingAccount($db); $accountparent = new AccountingAccount($db); + $totalarray = array(); $i = 0; while ($i < min($num, $limit)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bc69d809e46..921579df947 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6235,7 +6235,7 @@ class Form $out .= '