diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 433d6dfa6da01abaf055d518b4540ac20a6d70e4..023f4accce2ba7d17111437d0e6cd8c72c3ec2f6 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1434,6 +1434,7 @@ if ($action == 'create') if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } if ($element == 'contract') { $element = $subelement = 'contrat'; } + if ($element == 'shipping') { $element = $subelement = 'expedition'; } dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 8e3683c89dd0264a0d89ae51a50bebacb88c1e5a..aa249ba3e39455161014e49d1647e90ab355c4b0 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -1258,6 +1258,23 @@ else else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>'; } } + + // Create bill and Classify billed + if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed) + { + if ($user->rights->facture->creer) + { + // TODO until the module is autonomous + //print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>'; + print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->origin.'&originid='.$object->origin_id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>'; + } + + // TODO add alternative status + if ($user->rights->expedition->creer && $object->statut > 2) + { + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>'; + } + } if ($conf->livraison_bon->enabled && $object->statut == 1 && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds)) {