diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 0fd0b719cd7..230ef4c3734 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -540,7 +540,7 @@ if ($action == 'create') { print ''; print ''; - // Date document creation + // Date document export print ''; print ''.$langs->trans("DateExport").''; print ''; @@ -548,7 +548,7 @@ if ($action == 'create') { print ''; print ''; - // Date document creation + // Date document validation print ''; print ''.$langs->trans("DateValidation").''; print ''; @@ -607,6 +607,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 { @@ -647,11 +648,14 @@ 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 put 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 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 7db9ab237dc..5cf97dd97e1 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(); @@ -1650,11 +1654,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); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f74974a26d9..82c15392349 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 '
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 03f9e63219c..1cdcfcdc54c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -315,7 +315,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)); } /** 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..0c89d14992c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -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) { 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/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); 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); } 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) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0f7ad23acb0..28c08631278 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -915,8 +915,8 @@ class Societe extends CommonObject $sql .= ", accountancy_code_sell"; } $sql .= ") VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".((int) $this->entity).", '".$this->db->idate($now)."'"; - $sql .= ", ".(!empty($this->typent_id) ? ((int) $this->typent_id) : "null"); $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"); $sql .= ", ".((int) $this->status); $sql .= ", ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null"); @@ -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 {