From b6724f60616413527aaf274c369c3aea3f898ac7 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 7 Jun 2022 16:43:49 +0200 Subject: [PATCH 01/15] FIX #20696 --- htdocs/accountancy/bookkeeping/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index f9ec739e63d..0eaeed73d9e 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -533,23 +533,23 @@ if ($action == 'create') { print ''; print ''.$langs->trans("DateCreation").''; print ''; - print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' '; + print $object->date_creation ? dol_print_date($db->jdate($object->date_creation), 'day') : ' '; print ''; print ''; - // Date document creation + // Date document export print ''; print ''.$langs->trans("DateExport").''; print ''; - print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; + print $object->date_export ? dol_print_date($db->jdate($object->date_export), 'dayhour') : ' '; print ''; print ''; - // Date document creation + // Date document validation print ''; print ''.$langs->trans("DateValidation").''; print ''; - print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; + print $object->date_validation ? dol_print_date($db->jdate($object->date_validation), 'dayhour') : ' '; print ''; print ''; From 0146be0d157198eb1f6f65419e3cbdb2388e8a3d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jun 2022 18:13:21 +0200 Subject: [PATCH 02/15] fix: filter status do not work on peruser action comm --- htdocs/comm/action/peruser.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f74974a26d9..5adf5946f35 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -99,7 +99,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOST("search_status", 'alpha') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' $type = GETPOST("search_type", 'alpha') ?GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); $maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -153,9 +153,10 @@ if ($end_d < $begin_d) { $end_d = $begin_d + 1; } -if ($status == '' && !GETPOSTISSET('status')) { +if ($status == '' && !GETPOSTISSET('search_status')) { $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } + if (empty($mode) && !GETPOSTISSET('mode')) { $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); } @@ -512,7 +513,7 @@ print '
'; if (empty($search_status)) { $search_status = ''; } -print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); +print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
'; @@ -623,6 +624,7 @@ if ($type) { $sql .= " AND ca.id = ".((int) $type); } if ($status == '0') { + $sql .= " AND a.percent = 0"; } if ($status == '-1') { From 70892c18c5e7f1163bf8c05701be20d3c28cb65a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jun 2022 18:14:15 +0200 Subject: [PATCH 03/15] fix: filter status do not work on peruser action comm --- htdocs/comm/action/peruser.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 5adf5946f35..82c15392349 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -624,7 +624,6 @@ if ($type) { $sql .= " AND ca.id = ".((int) $type); } if ($status == '0') { - $sql .= " AND a.percent = 0"; } if ($status == '-1') { From 48fdfe26fa78c0066d3896a3b257d505757a9e2e Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:44:00 +0200 Subject: [PATCH 04/15] Fix: rollback on success create_individual Fix: Societe::create_individual rollback on success --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0f7ad23acb0..beb0f699246 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1078,7 +1078,7 @@ class Societe extends CommonObject } } - if (!empty($error)) { + if (empty($error)) { dol_syslog(get_class($this)."::create_individual success"); $this->db->commit(); } else { From f872585ea26cba4d86dcc11dd2798798e3ba1d87 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 8 Jun 2022 01:02:02 +0200 Subject: [PATCH 05/15] Fix #21150 - Regression Can't insert manual lines Fix #21150 - Regression Can not insert manual lines for automatically created transactions to the general ledger, this was possible before. --- .../accountancy/class/bookkeeping.class.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 5f3def1d3ee..dc4c4992bc0 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1722,6 +1722,38 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { + // Add an empty line when transaction is validated to permit to add new line manually + if ($mode != "_tmp") { + $line = new BookKeepingLine(); + + $line->id = $obj->rowid; + + $line->doc_date = $this->db->jdate($obj->doc_date); + $line->doc_type = $obj->doc_type; + $line->doc_ref = $obj->doc_ref; + $line->fk_doc = $obj->fk_doc; + $line->fk_docdet = $obj->fk_docdet; + $line->thirdparty_code = $obj->thirdparty_code; + $line->subledger_account = $obj->subledger_account; + $line->subledger_label = $obj->subledger_label; + $line->numero_compte = $obj->numero_compte; + $line->label_compte = $obj->label_compte; + $line->label_operation = $obj->label_operation; + $line->debit = $obj->debit; + $line->credit = $obj->credit; + $line->montant = $obj->amount; + $line->amount = $obj->amount; + $line->sens = $obj->sens; + $line->code_journal = $obj->code_journal; + $line->journal_label = $obj->journal_label; + $line->piece_num = $obj->piece_num; + $line->date_creation = $obj->date_creation; + $line->date_modification = $obj->date_modification; + $line->date_export = $obj->date_export; + $line->date_validation = $obj->date_validation; + + $this->linesmvt[] = $line; + } while ($obj = $this->db->fetch_object($result)) { $line = new BookKeepingLine(); From 0641b661183654eaf57e498df590a1410581c125 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 8 Jun 2022 01:39:53 +0200 Subject: [PATCH 06/15] Clean code --- .../accountancy/class/bookkeeping.class.php | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index dc4c4992bc0..000ac06f3c6 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1725,33 +1725,6 @@ class BookKeeping extends CommonObject // Add an empty line when transaction is validated to permit to add new line manually if ($mode != "_tmp") { $line = new BookKeepingLine(); - - $line->id = $obj->rowid; - - $line->doc_date = $this->db->jdate($obj->doc_date); - $line->doc_type = $obj->doc_type; - $line->doc_ref = $obj->doc_ref; - $line->fk_doc = $obj->fk_doc; - $line->fk_docdet = $obj->fk_docdet; - $line->thirdparty_code = $obj->thirdparty_code; - $line->subledger_account = $obj->subledger_account; - $line->subledger_label = $obj->subledger_label; - $line->numero_compte = $obj->numero_compte; - $line->label_compte = $obj->label_compte; - $line->label_operation = $obj->label_operation; - $line->debit = $obj->debit; - $line->credit = $obj->credit; - $line->montant = $obj->amount; - $line->amount = $obj->amount; - $line->sens = $obj->sens; - $line->code_journal = $obj->code_journal; - $line->journal_label = $obj->journal_label; - $line->piece_num = $obj->piece_num; - $line->date_creation = $obj->date_creation; - $line->date_modification = $obj->date_modification; - $line->date_export = $obj->date_export; - $line->date_validation = $obj->date_validation; - $this->linesmvt[] = $line; } while ($obj = $this->db->fetch_object($result)) { From c9049a9c85fac248c6cdf81f70298c90c0d619c2 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 8 Jun 2022 12:35:31 +0200 Subject: [PATCH 07/15] Fix non numeric warning --- htdocs/product/class/productcustomerprice.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index a9444d1c569..64db4a4eb55 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -135,7 +135,7 @@ class Productcustomerprice extends CommonObject $this->price_base_type = trim($this->price_base_type); } if (isset($this->tva_tx)) { - $this->tva_tx = trim($this->tva_tx); + $this->tva_tx = (float) $this->tva_tx; } if (isset($this->recuperableonly)) { $this->recuperableonly = trim($this->recuperableonly); @@ -621,7 +621,7 @@ class Productcustomerprice extends CommonObject $this->price_base_type = trim($this->price_base_type); } if (isset($this->tva_tx)) { - $this->tva_tx = trim($this->tva_tx); + $this->tva_tx = (float) $this->tva_tx; } if (isset($this->recuperableonly)) { $this->recuperableonly = trim($this->recuperableonly); From f0a8765ee6d62fe94d0e2830561174b5726c2a83 Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 8 Jun 2022 16:05:44 +0200 Subject: [PATCH 08/15] FIX #20696 --- htdocs/accountancy/bookkeeping/card.php | 6 +++--- htdocs/accountancy/class/bookkeeping.class.php | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 0eaeed73d9e..148608116e7 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -533,7 +533,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("DateCreation").''; print ''; - print $object->date_creation ? dol_print_date($db->jdate($object->date_creation), 'day') : ' '; + print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' '; print ''; print ''; @@ -541,7 +541,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("DateExport").''; print ''; - print $object->date_export ? dol_print_date($db->jdate($object->date_export), 'dayhour') : ' '; + print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; print ''; print ''; @@ -549,7 +549,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("DateValidation").''; print ''; - print $object->date_validation ? dol_print_date($db->jdate($object->date_validation), 'dayhour') : ' '; + print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; print ''; print ''; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 5f3def1d3ee..5d2a9d63f9a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1649,11 +1649,10 @@ class BookKeeping extends CommonObject $this->doc_date = $this->db->jdate($obj->doc_date); $this->doc_ref = $obj->doc_ref; $this->doc_type = $obj->doc_type; - $this->date_creation = $obj->date_creation; - $this->date_modification = $obj->date_modification; - $this->date_export = $obj->date_export; - $this->date_validation = $obj->date_validated; - $this->date_validation = $obj->date_validation; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->date_export = $this->db->jdate($obj->date_export); + $this->date_validation = $this->db->jdate($obj->date_validation); } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(__METHOD__.$this->error, LOG_ERR); From 7a20b3dceccdc5476b4b4ffec00ee60067b49575 Mon Sep 17 00:00:00 2001 From: bagtaib Date: Wed, 8 Jun 2022 15:35:07 +0200 Subject: [PATCH 09/15] FIX #21140 Conflicts: htdocs/societe/class/societe.class.php --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3d1637019e9..7c5773363c4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -890,7 +890,7 @@ class Societe extends CommonObject $sql .= ", accountancy_code_buy"; $sql .= ", accountancy_code_sell"; } - $sql .= ") VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$this->db->escape($this->entity).", '".$this->db->idate($now)."'"; + $sql .= ") VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".((int) $this->entity).", '".$this->db->idate($now)."'"; $sql .= ", ".(!empty($user->id) ? ((int) $user->id) : "null"); $sql .= ", ".(!empty($this->typent_id) ? ((int) $this->typent_id) : "null"); $sql .= ", ".(!empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'" : "null"); From e10d89dd369b901662f91e3cf9ef011b45a2354d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 03:00:51 +0200 Subject: [PATCH 10/15] Fix regression --- htdocs/accountancy/class/bookkeeping.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 000ac06f3c6..5f3def1d3ee 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1722,11 +1722,6 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { - // Add an empty line when transaction is validated to permit to add new line manually - if ($mode != "_tmp") { - $line = new BookKeepingLine(); - $this->linesmvt[] = $line; - } while ($obj = $this->db->fetch_object($result)) { $line = new BookKeepingLine(); From 900c71b5d6a5e32696a89981672bcb82ae7be3fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 03:07:11 +0200 Subject: [PATCH 11/15] Fix can add an empty line in tmp edit mode of transation --- htdocs/accountancy/bookkeeping/card.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index f9ec739e63d..b05fe8588bc 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -643,11 +643,9 @@ if ($action == 'create') { print "\n"; - // Empty line is the first line of $object->linesmvt - // So we must get the first line (the empty one) and pu it at the end of the array - // in order to display it correctly to the user - $empty_line = array_shift($object->linesmvt); - $object->linesmvt[]= $empty_line; + // Add an empty line + $line = new BookKeepingLine(); + $object->linesmvt[] = $line; foreach ($object->linesmvt as $line) { print ''; From a4ca81d4ceb2e4c1ea3360ae8e327f84eb9a597c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 12:46:13 +0200 Subject: [PATCH 12/15] FIX #21174 --- htdocs/accountancy/bookkeeping/card.php | 12 +++++++++--- htdocs/accountancy/class/bookkeeping.class.php | 4 ++++ htdocs/core/lib/functions.lib.php | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index b05fe8588bc..ad30e232334 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -604,6 +604,7 @@ if ($action == 'create') { print '
'; $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -643,9 +644,14 @@ if ($action == 'create') { print "\n"; - // Add an empty line - $line = new BookKeepingLine(); - $object->linesmvt[] = $line; + // Add an empty line if there is not yet + if (!empty($object->linesmvt[0])) { + $tmpline = $object->linesmvt[0]; + if (!empty($tmpline->numero_compte)) { + $line = new BookKeepingLine(); + $object->linesmvt[] = $line; + } + } foreach ($object->linesmvt as $line) { print ''; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 5f3def1d3ee..32bc27565fc 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -597,9 +597,13 @@ class BookKeeping extends CommonObject if (empty($this->credit)) { $this->credit = 0; } + if (empty($this->montant)) { + $this->montant = 0; + } $this->debit = price2num($this->debit, 'MT'); $this->credit = price2num($this->credit, 'MT'); + $this->montant = price2num($this->montant, 'MT'); $now = dol_now(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19fa4cd5c63..2f9cb532708 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -290,7 +290,7 @@ function dol_shutdown() $depth = $db->transaction_opened; $disconnectdone = $db->close(); } - dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ?LOG_WARNING:LOG_INFO)); + dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO)); } /** From eb7fcb2f9b1eaa3d8c1cbc0e5d0a7a4aa8a3a278 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 10 Jun 2022 13:20:39 +0200 Subject: [PATCH 13/15] Fix reception list for search date extrafield --- htdocs/reception/list.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index b83afc3f37d..8bdaa398d44 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -620,6 +620,22 @@ if ($search_array_options) { foreach ($search_array_options as $key => $val) { $crit = $val; $tmpkey = preg_replace('/search_options_/', '', $key); + if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) { + // date range from list filters is stored as array('start' => , 'end' => ) + // start date + $param .= '&search_options_'.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y'); + $param .= '&search_options_'.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m'); + $param .= '&search_options_'.$tmpkey.'_startday='.dol_print_date($val['start'], '%d'); + $param .= '&search_options_'.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H'); + $param .= '&search_options_'.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M'); + // end date + $param .= '&search_options_'.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y'); + $param .= '&search_options_'.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m'); + $param .= '&search_options_'.$tmpkey.'_endday='.dol_print_date($val['end'], '%d'); + $param .= '&search_options_'.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H'); + $param .= '&search_options_'.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M'); + $val = ''; + } if ($val != '') { $param .= '&search_options_'.$tmpkey.'='.urlencode($val); } From ef959ecddd43f2bf4ecd5aa0db99cf2405f21dba Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 11 Jun 2022 00:18:38 +0200 Subject: [PATCH 14/15] FIX#21093 --- .../modules/commande/doc/pdf_einstein.modules.php | 3 +++ .../modules/commande/doc/pdf_eratosthene.modules.php | 3 +++ .../core/modules/contract/doc/pdf_strato.modules.php | 3 +++ .../core/modules/delivery/doc/pdf_storm.modules.php | 3 +++ .../core/modules/delivery/doc/pdf_typhon.modules.php | 3 +++ .../modules/expedition/doc/pdf_espadon.modules.php | 3 +++ .../modules/expedition/doc/pdf_rouget.modules.php | 3 +++ .../expensereport/doc/pdf_standard.modules.php | 3 +++ htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 11 +++++++---- .../core/modules/facture/doc/pdf_sponge.modules.php | 3 +++ .../core/modules/fichinter/doc/pdf_soleil.modules.php | 3 +++ .../modules/movement/doc/pdf_standard.modules.php | 3 +++ .../core/modules/project/doc/pdf_baleine.modules.php | 3 +++ .../core/modules/project/doc/pdf_beluga.modules.php | 3 +++ .../modules/project/doc/pdf_timespent.modules.php | 3 +++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 3 +++ htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 3 +++ .../modules/reception/doc/pdf_squille.modules.php | 3 +++ .../core/modules/stock/doc/pdf_standard.modules.php | 3 +++ .../modules/supplier_order/doc/pdf_cornas.modules.php | 3 +++ .../supplier_order/doc/pdf_muscadet.modules.php | 3 +++ .../supplier_payment/doc/pdf_standard.modules.php | 3 +++ .../supplier_proposal/doc/pdf_aurore.modules.php | 3 +++ .../mymodule/doc/pdf_standard_myobject.modules.php | 3 +++ .../pdf_standard_recruitmentjobposition.modules.php | 3 +++ 25 files changed, 79 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 27d4fc9870e..069f3d60de9 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -612,6 +612,9 @@ class pdf_einstein extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 161c3c60345..61ed59414bb 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -836,6 +836,9 @@ class pdf_eratosthene extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 69a4d5ce96e..fbc066d8533 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -433,6 +433,9 @@ class pdf_strato extends ModelePDFContract $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 65912a8b9a0..f778711ffdb 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -575,6 +575,9 @@ class pdf_storm extends ModelePDFDeliveryOrder if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 5875814b546..c215a44c606 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -499,6 +499,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 00fa6bbbdc5..39df041bb51 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -708,6 +708,9 @@ class pdf_espadon extends ModelePdfExpedition if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 6b5d2e6fc3d..eededb90d67 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -614,6 +614,9 @@ class pdf_rouget extends ModelePdfExpedition if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index a4e3ab491a5..6f50fa89711 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -478,6 +478,9 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4e5c0431170..95d2b2a4eba 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -618,7 +618,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } $pdf->setPage($pageposafter + 1); } @@ -796,6 +796,9 @@ class pdf_crabe extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { @@ -811,7 +814,7 @@ class pdf_crabe extends ModelePDFFactures } $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } } } @@ -936,7 +939,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); @@ -998,7 +1001,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 228b73d825a..72eb041f873 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -930,6 +930,9 @@ class pdf_sponge extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index bc2b75e219e..7a31553e347 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -419,6 +419,9 @@ class pdf_soleil extends ModelePDFFicheinter if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 48483066e5e..520115ef375 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -706,6 +706,9 @@ class pdf_standard extends ModelePDFMovement if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 776f2f9d1e6..6a4a904a7b5 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -471,6 +471,9 @@ class pdf_baleine extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index f71b0cdb6a7..91de73f9c79 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -736,6 +736,9 @@ class pdf_beluga extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } } diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 991ff794d72..a986f07a143 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -474,6 +474,9 @@ class pdf_timespent extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 6e89c17cb2c..de35f65bf57 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -727,6 +727,9 @@ class pdf_azur extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 50061cacd0a..307b0f40c8f 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -851,6 +851,9 @@ class pdf_cyan extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index c51209fa6c8..aa0d2218763 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -538,6 +538,9 @@ class pdf_squille extends ModelePdfReception $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 1597ee32c18..9336cd149ca 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -484,6 +484,9 @@ class pdf_standard extends ModelePDFStock if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 2be12805685..7e7ae2b3703 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -778,6 +778,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 11ae04993eb..5d12ae3d24b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -660,6 +660,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 003cd999cde..5565b113e83 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -447,6 +447,9 @@ class pdf_standard extends ModelePDFSuppliersPayments if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 362d831f3af..14af31976d8 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -660,6 +660,9 @@ class pdf_aurore extends ModelePDFSupplierProposal if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 1a435d3763d..8976bc1c9ed 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -751,6 +751,9 @@ class pdf_standard_myobject extends ModelePDFMyObject if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index cc215a855ff..556e9fba520 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -678,6 +678,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { From 71ef0749879a05b9015463d98ffa2d0407f2f4b9 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 11 Jun 2022 00:41:15 +0200 Subject: [PATCH 15/15] FIX#21093 --- .../modules/facture/doc/pdf_crabe.modules.php | 8 ++--- htdocs/societe/card.php | 33 ++++--------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 95d2b2a4eba..0c89d14992c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -618,7 +618,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($pageposafter + 1); } @@ -814,7 +814,7 @@ class pdf_crabe extends ModelePDFFactures } $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } } } @@ -939,7 +939,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); @@ -1001,7 +1001,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3ef501aeac6..301e5bfb288 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1139,11 +1139,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country = $tmparray['label']; } $object->forme_juridique_code = GETPOST('forme_juridique_code'); - - // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { - $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency; - } /* Show create form */ $linkback = ""; @@ -1610,11 +1605,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''.$form->editfieldkey('Capital', 'capital', '', $object, 0).''; print ' '; - if (!empty($conf->multicurrency->enabled)) { - print ''.$langs->trans("Currency".$object->multicurrency_code).''; - } else { - print ''.$langs->trans("Currency".$conf->currency).''; - } + print ''.$langs->trans("Currency".$conf->currency).''; + if (!empty($conf->global->MAIN_MULTILANGS)) { print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); @@ -1664,7 +1656,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1); + print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print ''; } @@ -1862,11 +1854,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; } - - // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { - $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code; - } } if ($object->localtax1_assuj == 0) { @@ -2298,11 +2285,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$form->editfieldkey('Capital', 'capital', '', $object, 0).''; print ' '.$langs->trans("Currency".$object->multicurrency_code).''; - } else { - print '"> '.$langs->trans("Currency".$conf->currency).''; - } + print '"> '.$langs->trans("Currency".$conf->currency).''; // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -2357,7 +2340,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1); + print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print ''; } @@ -2780,11 +2763,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''.$langs->trans('Capital').''; if ($object->capital) { - if (!empty($conf->multicurrency->enabled) && !empty($object->multicurrency_code)) { - print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code); - } else { - print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); - } + print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); } else { print ' '; }