Experiment ORDER_ENABLE_NEGATIVE

This commit is contained in:
Laurent Destailleur 2020-02-18 20:55:22 +01:00
parent 6a97b1b9c8
commit 18b99254a1

View File

@ -2556,7 +2556,7 @@ if ($action == 'create' && $usercancreate)
}
// Valid
if ($object->statut == Commande::STATUS_DRAFT && $object->total_ttc >= 0 && $numlines > 0 && $usercanvalidate)
if ($object->statut == Commande::STATUS_DRAFT && ($object->total_ttc >= 0 || ! empty($conf->global->ORDER_ENABLE_NEGATIVE)) && $numlines > 0 && $usercanvalidate)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a>';
}
@ -2631,7 +2631,7 @@ if ($action == 'create' && $usercancreate)
// Create bill and Classify billed
// 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) {
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a></div>';
}