diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 4f043a1dcc5..fd01113de6c 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -360,6 +360,13 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
}
}
+// Classify billed
+if ($_GET["action"] == 'classifybilled')
+{
+ $propal->fetch($_GET["id"]);
+ $propal->cloture($user, 4, '');
+}
+
/*
* Cloture de la propale
*/
@@ -1469,6 +1476,21 @@ if ($id > 0 || ! empty($ref))
print 'id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
}
}
+
+ // Create an invoice and classify billed
+ if ($conf->facture->enabled && $propal->statut == 2 && $user->societe_id == 0)
+ {
+ if ($user->rights->facture->creer)
+ {
+ print ''.$langs->trans("BuildBill").'';
+ }
+
+ $arraypropal=$propal->getInvoiceArrayList();
+ if (is_array($arraypropal) && sizeof($arraypropal) > 0)
+ {
+ print 'id.'&action=classifybilled&socid='.$propal->socid.'">'.$langs->trans("ClassifyBilled").'';
+ }
+ }
// Close
if ($propal->statut == 1 && $user->rights->propale->cloturer)
@@ -1484,7 +1506,7 @@ if ($id > 0 || ! empty($ref))
}
// Delete
- if ($user->rights->propale->supprimer)
+ if ($propal->statut < 4 && $user->rights->propale->supprimer)
{
print 'id.'&action=delete"';
print '>'.$langs->trans('Delete').'';