Skip to content

Commit

Permalink
Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 9, 2019
2 parents 049a08f + c647195 commit 31fa26c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
Expand Up @@ -130,7 +130,8 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
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))
{
Expand All @@ -151,7 +152,6 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
}
}
}
return $ret;
}

// Second classify billed the proposal.
Expand All @@ -174,8 +174,9 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
}
}
}
return $ret;
}

return $ret;
}

// classify billed order & billed propososal
Expand Down
28 changes: 28 additions & 0 deletions htdocs/expensereport/card.php
Expand Up @@ -1017,6 +1017,34 @@
}
}

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);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/livraison/card.php
Expand Up @@ -568,7 +568,7 @@
}

// 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);
Expand Down Expand Up @@ -681,7 +681,7 @@
$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);
Expand Down

0 comments on commit 31fa26c

Please sign in to comment.