Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 15.0

This commit is contained in:
Laurent Destailleur 2022-05-22 12:39:23 +02:00
commit 8e2b082a21
26 changed files with 142 additions and 91 deletions

View File

@ -1237,7 +1237,7 @@ if ($action == 'create') {
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td id="project-input-container">';
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 '&nbsp;<a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.(empty($societe->id) ? '' : $societe->id).'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">';
print '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';

View File

@ -838,7 +838,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 = '';

View File

@ -1632,8 +1632,8 @@ if ($action == 'create' && $usercancreate) {
if ($socid > 0) {
// Contacts (ask contact only if thirdparty already defined).
print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
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 '</td></tr>';
// Ligne info remises tiers
@ -1670,8 +1670,8 @@ if ($action == 'create' && $usercancreate) {
// Terms of the settlement
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
print img_picto('', 'paiment');
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
print img_picto('', 'payment', 'class="pictofixedwidth"');
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1, 0, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Payment mode
@ -1690,7 +1690,7 @@ if ($action == 'create' && $usercancreate) {
// Shipping Method
if (!empty($conf->expedition->enabled)) {
print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
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 '</td></tr>';
}

View File

@ -347,7 +347,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),

View File

@ -1310,6 +1310,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) {

View File

@ -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");

View File

@ -188,7 +188,7 @@ function societe_prepare_head(Societe $object)
// Related items
if ((!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
&& empty($conf->global->THIRPARTIES_DISABLE_RELATED_OBJECT_TAB)) {
&& empty($conf->global->THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB)) {
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Referers");
$head[$h][2] = 'consumption';

View File

@ -973,13 +973,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;
@ -1232,6 +1234,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;
}

View File

@ -1430,6 +1430,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();

View File

@ -164,6 +164,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;
@ -236,6 +237,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) {
@ -1282,11 +1288,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);
@ -1531,6 +1532,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);
}
}

View File

@ -169,6 +169,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;
@ -220,6 +221,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) {
@ -1449,11 +1455,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);
@ -1716,7 +1717,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);
}

View File

@ -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);
}
/**

View File

@ -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"));
// 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);
}
}

View File

@ -170,6 +170,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;
@ -249,6 +250,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) {
@ -1718,11 +1724,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);
@ -2048,6 +2049,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);
}
}

View File

@ -171,6 +171,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;
@ -234,6 +235,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;
@ -1944,11 +1950,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);
@ -2274,7 +2275,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);
}
/**

View File

@ -149,6 +149,7 @@ class pdf_soleil extends ModelePDFFicheinter
$this->option_codeproduitservice = 0; // Display product-service code
$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;
@ -188,6 +189,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();
@ -561,11 +567,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);
@ -732,6 +733,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);
}
}

View File

@ -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(

View File

@ -160,6 +160,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;
@ -242,6 +243,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
@ -1466,11 +1472,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);
@ -1715,7 +1716,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

View File

@ -163,6 +163,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;
@ -216,6 +217,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) {
@ -1538,11 +1544,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);
@ -1804,7 +1805,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);
}
/**

View File

@ -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);
}
}

View File

@ -155,6 +155,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;
@ -205,7 +206,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
@ -229,6 +230,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
@ -1284,11 +1290,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);
@ -1496,6 +1497,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);
}
}

View File

@ -13,7 +13,13 @@ if (isset($totalarray['pos'])) {
while ($i < $totalarray['nbfield']) {
$i++;
if (!empty($totalarray['pos'][$i])) {
print '<td class="right">'.price(!empty($totalarray['val'][$totalarray['pos'][$i]])?$totalarray['val'][$totalarray['pos'][$i]]:0).'</td>';
if (!empty($totalarray['type'][$i])) {
if ($totalarray['type'][$i] == 'duration') {
print '<td class="right">'.(!empty($totalarray['val'][$totalarray['pos'][$i]])? convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]]): '00:00').'</td>';
}
} else {
print '<td class="right">' . price(!empty($totalarray['val'][$totalarray['pos'][$i]]) ? $totalarray['val'][$totalarray['pos'][$i]] : 0) . '</td>';
}
} else {
if ($i == 1) {
if (is_null($limit) || $num < $limit) {

View File

@ -132,7 +132,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';
@ -737,9 +737,8 @@ if ($resql) {
print '<td class="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'fd.duree';
$totalarray['type'][$totalarray['nbfield']] = $arrayfields['fd.duree']['type']; //pass the type for the list_print_total.tpl.php to manage durations
}
$totalarray['val']['fd.duree'] += $obj->duree;
}
@ -763,6 +762,8 @@ if ($resql) {
$i++;
}
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';

View File

@ -195,7 +195,7 @@ class CommandeFournisseur extends CommonOrder
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35),
'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefSupplier', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-2, 'position'=>50),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'date_approve' =>array('type'=>'datetime', 'label'=>'Date approve', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'date_approve2' =>array('type'=>'datetime', 'label'=>'Date approve2', 'enabled'=>1, 'visible'=>-1, 'position'=>65),

View File

@ -1435,7 +1435,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),

View File

@ -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,),