diff --git a/ChangeLog b/ChangeLog index b4056f0740a..47794be2595 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9775,7 +9775,7 @@ For developers: - New: Can add a link on title field of added dictionary. - New: Uniformize code. - New: Add option WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER and - WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER. + ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER. - New: A module can add several css and js. - New: removed deprecated methods ldap::connect, formadmin::select_lang, diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index aa17b9cf8df..cb50a2f15c0 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -826,6 +826,7 @@ print ''; print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE'); print ''; + // Allow external download print ''; print ''.$langs->trans("AllowExternalDownload").''; diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index 687c91f07db..c4cbb354d7f 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -685,6 +685,15 @@ print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0 print ''; print ''; +// Disallow to classify billed an order without invoice, only if module invoice is enable +if (isModEnabled('invoice')) { + print ''.$langs->trans("InvoiceClassifyBilledSupplierOrderWithoutInvoice"). ' ' ; + print $form->textwithpicto('', $langs->trans("InvoiceClassifyBilledSupplierOrderWithoutInvoiceHelp"), 1, 'help') . ''; + print ''; + print ajax_constantonoff('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER'); + print ''; +} + /* // Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. // TODO Must be implemented by PDF templates diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index a3eb2dd468d..1fee99724e4 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -547,6 +547,14 @@ if (isModEnabled('reception')) { print "\n"; print "\n"; + +// Disallow to classify billed a supplier order without invoice +print ''.$langs->trans("SupplierOrderClassifyBilledWithoutInvoice"). ' ' ; +print $form->textwithpicto('', $langs->trans("SupplierOrderClassifyBilledWithoutInvoiceHelp"), 1, 'help') . ''; +print ''; +print ajax_constantonoff('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER'); +print ''; + print '
'; print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 53812891f11..37f228b8ada 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -3055,12 +3055,12 @@ if ($action == 'create' && $usercancreate) { // Set billed or unbilled // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { - if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && !getDolGlobalString('WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) { + if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) { print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&token='.newToken().'&id='.$object->id, ''); } } if ($object->statut > Commande::STATUS_DRAFT && $object->billed) { - if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && !getDolGlobalString('WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) { + if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) { print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"].'?action=classifyunbilled&token='.newToken().'&id='.$object->id, ''); } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b2d373d427b..064a1511850 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2685,7 +2685,7 @@ if ($action == 'create') { if (!isModEnabled('invoice')) { print ''.$langs->trans("ClassifyBilled").''; } else { - if (!empty($object->linkedObjectsIds['invoice_supplier'])) { + if (!empty($object->linkedObjectsIds['invoice_supplier']) || (empty($object->linkedObjectsIds['invoice_supplier']) && !getDolGlobalInt('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER'))) { if ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight("supplier_invoice", "creer")) { print ''.$langs->trans("ClassifyBilled").''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 69feebc3d08..32934370964 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1488,6 +1488,11 @@ InvoiceOptionCategoryOfOperations=Display the mention "category of operations" o 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 +InvoiceClassifyBilledSupplierOrderWithoutInvoice=Disallow to classify billed an order without invoice. +InvoiceClassifyBilledSupplierOrderWithoutInvoiceHelp=Classify billed an order without invoice is allow by default. If this conf is set to true, it will be not. +##### Supplier Orders ##### +SupplierOrderClassifyBilledWithoutInvoice=Disallow to classify billed a supplier order without invoice. +SupplierOrderClassifyBilledWithoutInvoiceHelp=Classify billed a supplier order without invoice is allow by default. If this conf is set to true, it will be not. ##### Proposals ##### PropalSetup=Commercial proposals module setup ProposalsNumberingModules=Commercial proposal numbering models