diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 737ff059eee..aca1e0b7e3b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1241,7 +1241,7 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects((empty($societe->id) ? '' : $societe->id), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' '; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 00723597521..7e873e168ad 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -901,7 +901,7 @@ if (empty($reshook)) { $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; - $tva_tx = (GETPOST('tva_tx') ? price2num(GETPOST('tva_tx')) : 0); + $tva_tx = (GETPOST('tva_tx') ? price2num(preg_replace('/\s*\(.*\)/', '', GETPOST('tva_tx'))) : 0); } else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f1423ffa12b..3c3e0eb2972 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1697,8 +1697,8 @@ if ($action == 'create' && $usercancreate) { if ($socid > 0) { // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; - print img_picto('', 'contact'); - print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); + print img_picto('', 'contact', 'class="pictofixedwidth"'); + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Ligne info remises tiers @@ -1755,7 +1755,7 @@ if ($action == 'create' && $usercancreate) { // Shipping Method if (!empty($conf->expedition->enabled)) { print ''.$langs->trans('SendingMethod').''; - print img_picto('', 'object_dollyrevert', 'class="pictofixedwidth"'); + print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a7d237bc780..44cc5c6effd 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -359,7 +359,7 @@ class Commande extends CommonOrder 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>304), + 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>304), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 927da1bf17a..34df7bcf097 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1333,6 +1333,11 @@ class FactureRec extends CommonInvoice $facture->status = self::STATUS_DRAFT; $facture->date = (empty($facturerec->date_when) ? $now : $facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; + if (!empty($facturerec->fk_multicurrency)) { + $facture->fk_multicurrency = $facturerec->fk_multicurrency; + $facture->multicurrency_code = $facturerec->multicurrency_code; + $facture->multicurrency_tx = $facturerec->multicurrency_tx; + } $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) { diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index ce9ae57864d..994ba5c42f3 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -129,8 +129,12 @@ if ($action == "importSignature") { $pdf->AddPage(); $pagecount = $pdf->setSourceFile($upload_dir.$ref.".pdf"); // original PDF - $tppl = $pdf->importPage(1); - $pdf->useTemplate($tppl); + for ($i=1;$i<($pagecount+1);$i++) { + if ($i>1) $pdf->AddPage(); + $tppl=$pdf->importPage($i); + $pdf->useTemplate($tppl); + } + $pdf->Image($upload_dir.$filename, 129, 239.6, 60, 15); // FIXME Position will be wrong with non A4 format. Use a value from width and height of page minus relative offset. $pdf->Close(); $pdf->Output($newpdffilename, "F"); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index e88b42950f3..1173ef50f81 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -848,7 +848,7 @@ abstract class CommonInvoice extends CommonObject */ public function buildZATCAQRString() { - global $conf; + global $conf, $mysoc; $tmplang = new Translate('', $conf); $tmplang->setDefaultLang('en_US'); @@ -885,8 +885,8 @@ abstract class CommonInvoice extends CommonObject */ // Using TLV format - $s = pack('C1', 1).pack('C1', strlen($this->thirdparty->name)).$this->thirdparty->name; - $s .= pack('C1', 2).pack('C1', strlen($this->thirdparty->tva_intra)).$this->thirdparty->tva_intra; + $s = pack('C1', 1).pack('C1', strlen($this->thirdparty->name)).$mysoc->name; + $s .= pack('C1', 2).pack('C1', strlen($this->thirdparty->tva_intra)).$mysoc->tva_intra; $s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring; $s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring; $s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index a4232095f4b..4583ca6b7d0 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -971,13 +971,15 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, * @param Societe $fromcompany Object company * @param int $marge_basse Margin bottom we use for the autobreak * @param int $marge_gauche Margin left (no more used) - * @param int $page_hauteur Page height (no more used) + * @param int $page_hauteur Page height * @param Object $object Object shown in PDF * @param int $showdetails Show company adress details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) * @param int $hidefreetext 1=Hide free text, 0=Show free text + * @param int $page_largeur Page width + * @param int $watermark Watermark text to print on page * @return int Return height of bottom margin including footer text */ -function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails = 0, $hidefreetext = 0) +function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails = 0, $hidefreetext = 0, $page_largeur = 0, $watermark = '') { global $conf, $user, $mysoc, $hookmanager; @@ -1275,6 +1277,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $pdf->MultiCell(15, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); } + // Show Draft Watermark + if (!empty($watermark)) { + pdf_watermark($pdf, $outputlangs, $page_hauteur, $page_largeur, 'mm', $watermark); + } + return $marginwithfooter; } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index b579c9b0059..80ed0b345ba 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1465,6 +1465,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($command) { $sql .= " AND command = '".$this->db->escape($command)."'"; } + if ($parameters) { + $sql .= " AND params = '".$this->db->escape($parameters)."'"; + } $sql .= " AND entity = ".((int) $entity); // Must be exact entity $now = dol_now(); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 56ae5f5af7e..bdda6f26862 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -163,6 +163,7 @@ class pdf_einstein extends ModelePDFCommandes $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -235,6 +236,11 @@ class pdf_einstein extends ModelePDFCommandes // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->COMMANDE_DRAFT_WATERMARK; + } + global $outputlangsbis; $outputlangsbis = null; if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { @@ -1284,11 +1290,6 @@ class pdf_einstein extends ModelePDFCommandes pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->COMMANDE_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1533,6 +1534,6 @@ class pdf_einstein extends ModelePDFCommandes // phpcs:enable global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1a7e28d3bd4..212d324acaf 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -168,6 +168,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -219,6 +220,11 @@ class pdf_eratosthene extends ModelePDFCommandes // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->COMMANDE_DRAFT_WATERMARK; + } + global $outputlangsbis; $outputlangsbis = null; if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { @@ -1451,11 +1457,6 @@ class pdf_eratosthene extends ModelePDFCommandes pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->COMMANDE_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1718,7 +1719,7 @@ class pdf_eratosthene extends ModelePDFCommandes // phpcs:enable global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index a038705ea22..982a63dade8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -140,6 +140,8 @@ class pdf_espadon extends ModelePdfExpedition $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->option_logo = 1; // Display logo + $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -180,6 +182,11 @@ class pdf_espadon extends ModelePdfExpedition // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "orders", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->SHIPPING_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->SHIPPING_DRAFT_WATERMARK; + } + global $outputlangsbis; $outputlangsbis = null; if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { @@ -947,11 +954,6 @@ class pdf_espadon extends ModelePdfExpedition pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->SHIPPING_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->SHIPPING_DRAFT_WATERMARK); - } - //Prepare next $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1186,7 +1188,7 @@ class pdf_espadon extends ModelePdfExpedition { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'SHIPPING_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'SHIPPING_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } /** diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 64d8a2c65e6..e1da387d1ad 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -141,6 +141,8 @@ class pdf_rouget extends ModelePdfExpedition $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->option_logo = 1; // Display logo + $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -214,6 +216,11 @@ class pdf_rouget extends ModelePdfExpedition // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch", "other")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->SHIPPING_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->SHIPPING_DRAFT_WATERMARK; + } + $nblines = count($object->lines); // Loop on each lines to detect if there is at least one image to show @@ -892,11 +899,6 @@ class pdf_rouget extends ModelePdfExpedition pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->SHIPPING_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->SHIPPING_DRAFT_WATERMARK); - } - //Prepare la suite $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1131,6 +1133,6 @@ class pdf_rouget extends ModelePdfExpedition { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'SHIPPING_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'SHIPPING_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 55f96b489e1..1bb5400acc7 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -169,6 +169,7 @@ class pdf_crabe extends ModelePDFFactures $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -248,6 +249,11 @@ class pdf_crabe extends ModelePDFFactures // Load translation files required by the page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->FACTURE_DRAFT_WATERMARK; + } + global $outputlangsbis; $outputlangsbis = null; if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { @@ -1717,11 +1723,6 @@ class pdf_crabe extends ModelePDFFactures pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->FACTURE_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -2047,6 +2048,6 @@ class pdf_crabe extends ModelePDFFactures { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 70c02ade03e..bc4dad25f91 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -170,6 +170,7 @@ class pdf_sponge extends ModelePDFFactures $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -233,6 +234,11 @@ class pdf_sponge extends ModelePDFFactures $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies")); } + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->FACTURE_DRAFT_WATERMARK; + } + $nblines = count($object->lines); $hidetop = 0; @@ -1943,11 +1949,6 @@ class pdf_sponge extends ModelePDFFactures pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->FACTURE_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -2273,7 +2274,7 @@ class pdf_sponge extends ModelePDFFactures { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } /** diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 29d0cc8cac4..8c07dbb64f3 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -148,6 +148,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->option_condreg = 0; // Display payment terms $this->option_multilang = 1; // Available in several languages $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -187,6 +188,11 @@ class pdf_soleil extends ModelePDFFicheinter // Load traductions files required by page $outputlangs->loadLangs(array("main", "interventions", "dict", "companies")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->FICHINTER_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->FICHINTER_DRAFT_WATERMARK; + } + if ($conf->ficheinter->dir_output) { $object->fetch_thirdparty(); @@ -560,11 +566,6 @@ class pdf_soleil extends ModelePDFFicheinter pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - //Affiche le filigrane brouillon - Print Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->FICHINTER_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->FICHINTER_DRAFT_WATERMARK); - } - //Prepare next $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -739,6 +740,6 @@ class pdf_soleil extends ModelePDFFicheinter { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'FICHINTER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'FICHINTER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } } diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index bd8621a7a5b..515f641c202 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -134,9 +134,20 @@ class modRecruitment extends DolibarrModules // Example: $this->const=array(1 => array('RECRUITMENT_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1), // 2 => array('RECRUITMENT_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) // ); - $this->const = array( - // 1 => array('RECRUITMENT_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) - ); + $r = 0; + $this->const[$r][0] = "RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "mod_recruitmentjobposition_standard"; + $this->const[$r][3] = 'Name of manager to generate recruitment job position ref number'; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "mod_recruitmentcandidature_standard"; + $this->const[$r][3] = 'Name of manager to generate recruitment candidature ref number'; + $this->const[$r][4] = 0; + $r++; // Some keys to add into the overwriting translation tables /*$this->overwrite_translation = array( diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index bcfd91fe0f1..511677d742b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -159,6 +159,7 @@ class pdf_azur extends ModelePDFPropales $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -241,6 +242,11 @@ class pdf_azur extends ModelePDFPropales $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); } + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->PROPALE_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->PROPALE_DRAFT_WATERMARK; + } + $nblines = count($object->lines); // Loop on each lines to detect if there is at least one image to show @@ -1474,11 +1480,6 @@ class pdf_azur extends ModelePDFPropales pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->PROPALE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->PROPALE_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1729,7 +1730,7 @@ class pdf_azur extends ModelePDFPropales { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 49db078e39d..47af81d8aa2 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -162,6 +162,7 @@ class pdf_cyan extends ModelePDFPropales $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -215,6 +216,11 @@ class pdf_cyan extends ModelePDFPropales // Load translation files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->PROPALE_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->PROPALE_DRAFT_WATERMARK; + } + global $outputlangsbis; $outputlangsbis = null; if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { @@ -1545,11 +1551,6 @@ class pdf_cyan extends ModelePDFPropales pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->PROPALE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->PROPALE_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1817,7 +1818,7 @@ class pdf_cyan extends ModelePDFPropales { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } /** diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index a9d6bb9f00b..7d234e6bd95 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -63,6 +63,8 @@ class pdf_squille extends ModelePdfReception $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->option_logo = 1; // Display logo + $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -105,7 +107,7 @@ class pdf_squille extends ModelePdfReception /** * Function to build pdf onto disk * - * @param Object $object Object reception to generate (or id if old method) + * @param Reception $object Object reception to generate (or id if old method) * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -130,6 +132,11 @@ class pdf_squille extends ModelePdfReception $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal", "deliveries", "receptions", "productbatch", "sendings")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->RECEPTION_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->RECEPTION_DRAFT_WATERMARK; + } + $nblines = count($object->lines); // Loop on each lines to detect if there is at least one image to show @@ -817,11 +824,6 @@ class pdf_squille extends ModelePdfReception pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->RECEPTION_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->RECEPTION_DRAFT_WATERMARK); - } - //Prepare la suite $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1055,6 +1057,6 @@ class pdf_squille extends ModelePdfReception { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'RECEPTION_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'RECEPTION_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } } 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 e64f0ab632d..6b47240016f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -154,6 +154,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; //Support add of a watermark on drafts + $this->watermark = ''; // Get source company $this->emetteur = $mysoc; @@ -204,7 +205,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Function to build pdf onto disk * - * @param Object $object Object to generate + * @param SupplierProposal $object Object to generate * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -228,6 +229,11 @@ class pdf_aurore extends ModelePDFSupplierProposal // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal")); + // Show Draft Watermark + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK))) { + $this->watermark = $conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK; + } + $nblines = count($object->lines); // Loop on each lines to detect if there is at least one image to show @@ -1283,11 +1289,6 @@ class pdf_aurore extends ModelePDFSupplierProposal pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); - // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK); - } - $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); @@ -1495,6 +1496,6 @@ class pdf_aurore extends ModelePDFSupplierProposal { global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - return pdf_pagefoot($pdf, $outputlangs, 'SUPPLIER_PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); + return pdf_pagefoot($pdf, $outputlangs, 'SUPPLIER_PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark); } } diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d83a1438f1a..dcf6681df0e 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -135,7 +135,7 @@ $arrayfields = array( 'f.fk_statut'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000), 'fd.description'=>array('label'=>"DescriptionOfLine", 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), 'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), - 'fd.duree'=>array('label'=>'DurationOfLine', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), + 'fd.duree'=>array('label'=>'DurationOfLine', 'type'=> 'duration', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), //type duration is here because in database, column 'duree' is double ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -768,7 +768,6 @@ if ($resql) { } if (!$i) { $totalarray['type'][$totalarray['nbfield']] = 'duration'; - $totalarray['pos'][$totalarray['nbfield']] = 'fd.duree'; } $totalarray['val']['fd.duree'] += $obj->duree; } @@ -792,6 +791,8 @@ if ($resql) { $i++; } + + // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 67f5fe68161..f742a04a619 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1520,7 +1520,7 @@ class MoLine extends CommonObjectLine 'role' =>array('type'=>'varchar(10)', 'label'=>'Role', 'enabled'=>1, 'visible'=>-1, 'position'=>145), 'fk_mrp_production' =>array('type'=>'integer', 'label'=>'Fk mrp production', 'enabled'=>1, 'visible'=>-1, 'position'=>150), 'fk_stock_movement' =>array('type'=>'integer', 'label'=>'StockMovement', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>160), + 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>160), 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>165), 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>170), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>-1, 'position'=>175), diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index d978c0fbb94..42279fe3a97 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -115,7 +115,7 @@ class RecruitmentJobPosition extends CommonObject 'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>3,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>101, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>102, 'notnull'=>0, 'visible'=>0,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-4,), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),