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

This commit is contained in:
Laurent Destailleur 2019-08-10 01:36:50 +02:00
commit 31fa26c2be
3 changed files with 34 additions and 5 deletions

View File

@ -130,7 +130,8 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action == 'BILL_VALIDATE')
{
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id );
$ret = 0;
// First classify billed the order to allow the proposal classify process
if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER))
{
@ -151,7 +152,6 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
}
return $ret;
}
// Second classify billed the proposal.
@ -174,8 +174,9 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
}
return $ret;
}
return $ret;
}
// classify billed order & billed propososal

View File

@ -1017,6 +1017,34 @@ if (empty($reshook))
}
}
if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid)
{
$object = new ExpenseReport($db);
$object->fetch($id);
$result = $object->set_unpaid($user);
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
}
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
{
$object = new ExpenseReport($db);

View File

@ -568,7 +568,7 @@ else
}
// Other attributes
if ($action = 'create_delivery') {
if ($action == 'create_delivery') {
// copy from expedition
$expeditionExtrafields = new Extrafields($db);
$expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element);
@ -681,7 +681,7 @@ else
$mode = ($object->statut == 0) ? 'edit' : 'view';
$line = new LivraisonLigne($db);
$line->fetch_optionals($object->lines[$i]->id);
if ($action = 'create_delivery') {
if ($action == 'create_delivery') {
$srcLine = new ExpeditionLigne($db);
$expeditionLineExtrafields = new Extrafields($db);
$expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element);