| ';
- print $form->textwithpicto($langs->trans("INVOICE_SHOW_SHIPPING_ADDRESS"), $langs->trans("INVOICE_SHOW_SHIPPING_ADDRESSMore"));
+ print $form->textwithpicto($langs->trans("InvoiceOptionCategoryOfOperations"), $langs->trans('InvoiceOptionCategoryOfOperationsHelp'), 1);
print ' | ';
+ $arrval = array('0'=>$langs->trans("No"),
+ '1'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes1"),
+ '2'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes2")
+ );
+ print $form->selectarray("INVOICE_CATEGORY_OF_OPERATION", $arrval, $conf->global->INVOICE_CATEGORY_OF_OPERATION, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
+ print ' |
';
+
+ print '| '.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").' | ';
if ($conf->use_javascript_ajax) {
- print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS');
+ print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS);
@@ -181,7 +195,7 @@ if (isModEnabled('reception')) {
print '';
print ' ';
- print '| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' | ';
+ print '| '.$langs->trans("Parameters").' | '.$langs->trans("Value").' | ';
print '';
print $langs->trans("RECEPTION_PDF_HIDE_ORDERED");
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 789a65b93e4..0c628c9d5e8 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -61,9 +61,9 @@ function pdf_admin_prepare_head()
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'pdf_admin');
- if (isModEnabled("propal")) {
+ if (isModEnabled("propal") || isModEnabled('facture') || isModEnabled('reception')) {
$head[$h][0] = DOL_URL_ROOT.'/admin/pdf_other.php';
- $head[$h][1] = $langs->trans("Other");
+ $head[$h][1] = $langs->trans("Others");
$head[$h][2] = 'other';
$h++;
}
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index 1bea6b0db67..57e333cb759 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -10,6 +10,7 @@
* Copyright (C) 2017 Ferran Marcet
* Copyright (C) 2018 Frédéric France
* Copyright (C) 2022 Anthony Berton
+ * Copyright (C) 2022 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1289,6 +1290,16 @@ class pdf_sponge extends ModelePDFFactures
$posy = $pdf->GetY();
}
+ // Show category of operations
+ if ($conf->global->INVOICE_CATEGORY_OF_OPERATION == 2) {
+ $nbCategoryOfOperations = 0;
+ $categoryOfOperations = $outputlangs->trans("MentionCategoryOfOperations") . ': ' . $outputlangs->trans("MentionCategoryOfOperations" . $nbCategoryOfOperations);
+ $pdf->SetXY($this->marge_gauche, $posy);
+ $pdf->writeHTMLCell(80, 5, '', '', $outputlangs->transnoentities($categoryOfOperations), 0, 1);
+
+ $posy = $pdf->GetY() + 1;
+ }
+
// Show if Option VAT debit option is on also if transmitter is french
// Decret n°2099-1299 2022-10-07
// French mention : "Option pour le paiement de la taxe d'après les débits"
@@ -1947,9 +1958,10 @@ class pdf_sponge extends ModelePDFFactures
* @param int $hidebottom Hide bottom bar of array
* @param string $currency Currency code
* @param Translate $outputlangsbis Langs object bis
+ * @param Facture $object Object to show
* @return void
*/
- protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null)
+ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null, $object)
{
global $conf;
@@ -1967,6 +1979,21 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 2);
if (empty($hidetop)) {
+ // Show category of operations
+ if ($conf->global->INVOICE_CATEGORY_OF_OPERATION == 1) {
+ $nbCategoryOfOperations = 0;
+ if (count($object->product_type == 0) >= 1) {
+ $nbCategoryOfOperations = 0;
+ } elseif (count($object->product_type == 1) >= 1) {
+ $nbCategoryOfOperations = 1;
+ } elseif (count($object->product_type == 0) >= 1 && count($object->product_type == 1) >= 1) {
+ $nbCategoryOfOperations = 2;
+ }
+ $categoryOfOperations = $outputlangs->trans("MentionCategoryOfOperations") . ': ' . $outputlangs->trans("MentionCategoryOfOperations" . $nbCategoryOfOperations);
+ $pdf->SetXY($this->marge_gauche, $tab_top - 4);
+ $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations);
+ }
+
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
$titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency));
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 62176a37c41..28205d1dcba 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1442,6 +1442,10 @@ SuppliersPayment=Vendor payments
SupplierPaymentSetup=Vendor payments setup
InvoiceCheckPosteriorDate=Check facture date before validation
InvoiceCheckPosteriorDateHelp=Validating an invoice will be forbidden if its date is anterior to the date of last invoice of same type.
+InvoiceOptionCategoryOfOperations=Display the mention "category of operations" on the invoice.
+InvoiceOptionCategoryOfOperationsHelp=Depending on the situation, the mention will appear in the form: - Category of operations: Delivery of goods - Category of operations: Provision of services - Category of operations: Mixed - Delivery of goods & provision of services
+InvoiceOptionCategoryOfOperationsYes1=Yes, below the address block
+InvoiceOptionCategoryOfOperationsYes2=Yes, in the lower left-hand corner
##### Proposals #####
PropalSetup=Commercial proposals module setup
ProposalsNumberingModules=Commercial proposal numbering models
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index d7c29a82399..183620c72da 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -627,3 +627,7 @@ SendEmailsRemindersOnInvoiceDueDate=Send reminder by email for unpaid invoices
MakePaymentAndClassifyPayed=Record payment
BulkPaymentNotPossibleForInvoice=Bulk payment is not possible for invoice %s (bad type or status)
MentionVATDebitOptionIsOn=Option to pay tax based on debits
+MentionCategoryOfOperations=Category of operations
+MentionCategoryOfOperations0=Delivery of goods
+MentionCategoryOfOperations1=Provision of services
+MentionCategoryOfOperations2=Mixed - Delivery of goods & provision of services
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 03515c9a2e2..aa3cfba0c77 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -215,9 +215,13 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
$conf->global->MAIN_INVERT_SENDER_RECIPIENT = 1;
}
if ($mysoc->country_code == 'FR' && !isset($conf->global->MAIN_PROFID1_IN_ADDRESS)) {
- // For FR, default value of option to show profid SIRET is on by default
+ // For FR, default value of option to show profid SIRET is on by default. Decret n°2099-1299 2022-10-07
$conf->global->MAIN_PROFID1_IN_ADDRESS = 1;
}
+ if ($mysoc->country_code == 'FR' && (!isset($conf->global->INVOICE_CATEGORY_OF_OPERATION) || empty($conf->global->INVOICE_CATEGORY_OF_OPERATION))) {
+ // For FR, default value of option to show category of operations is on by default. Decret n°2099-1299 2022-10-07
+ $conf->global->INVOICE_CATEGORY_OF_OPERATION = 1;
+ }
}
| |