Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New classify billed order without invoice #29614

Merged
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions htdocs/admin/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@
print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE');
print '</td></tr>';


// Allow external download
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
Expand Down
9 changes: 9 additions & 0 deletions htdocs/admin/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,15 @@
print '</td></tr>';
print '</form>';

// Disallow to classify billed an order without invoice, only if module invoice is enable
if (isModEnabled('invoice')) {
print '<tr class="oddeven"><td>'.$langs->trans("InvoiceClassifyBilledSupplierOrderWithoutInvoice"). '&nbsp;' ;
print $form->textwithpicto('', $langs->trans("InvoiceClassifyBilledSupplierOrderWithoutInvoiceHelp"), 1, 'help') . '</td>';
print '<td class="left" colspan="2">';
print ajax_constantonoff('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER');
print '</td></tr>';
}

/*
// Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation.
// TODO Must be implemented by PDF templates
Expand Down
8 changes: 8 additions & 0 deletions htdocs/admin/supplier_order.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,14 @@
print "</td>\n";
print "</tr>\n";


// Disallow to classify billed a supplier order without invoice
print '<tr class="oddeven"><td>'.$langs->trans("SupplierOrderClassifyBilledWithoutInvoice"). '&nbsp;' ;
print $form->textwithpicto('', $langs->trans("SupplierOrderClassifyBilledWithoutInvoiceHelp"), 1, 'help') . '</td>';
print '<td class="left" colspan="2">';
print ajax_constantonoff('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER');
print '</td></tr>';

print '</table></div><br>';

print '</form>';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/commande/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -3055,12 +3055,12 @@
// 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&amp;token='.newToken().'&amp;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&amp;token='.newToken().'&amp;id='.$object->id, '');
}
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/commande/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,7 @@
if (!isModEnabled('invoice')) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'">'.$langs->trans("ClassifyBilled").'</a>';
} 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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'">'.$langs->trans("ClassifyBilled").'</a>';
}
Expand Down
5 changes: 5 additions & 0 deletions htdocs/langs/en_US/admin.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,11 @@ InvoiceOptionCategoryOfOperations=Display the mention "category of operations" o
InvoiceOptionCategoryOfOperationsHelp=Depending on the situation, the mention will appear in the form:<br>- Category of operations: Delivery of goods<br>- Category of operations: Provision of services<br>- 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
Expand Down