Skip to content
Snippets Groups Projects
Commit ef13ea86 authored by Maxime Kohlhaas's avatar Maxime Kohlhaas
Browse files

New # 786 : can link project from supplier invoice creation

parent 129da11a
No related branches found
No related tags found
No related merge requests found
......@@ -141,6 +141,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", fk_soc";
$sql.= ", datec";
$sql.= ", datef";
$sql.= ", fk_projet";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ", fk_user_author";
......@@ -154,6 +155,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '".$this->db->idate($this->date)."'";
$sql.= ", ".$this->fk_project;
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", ".$user->id.",";
......
......@@ -41,6 +41,8 @@ if (!empty($conf->produit->enabled))
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load('bills');
......@@ -271,6 +273,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
// Creation facture
$object->ref = $_POST['ref'];
$object->ref_supplier = $_POST['ref_supplier'];
$object->fk_project = GETPOST('projectid');
$object->socid = $_POST['socid'];
$object->libelle = $_POST['libelle'];
$object->date = $datefacture;
......@@ -1154,6 +1157,15 @@ if ($action == 'create')
$form->select_date($datedue,'ech','','','',"add",1,1);
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
select_projects(-1, $projectid, 'projectid');
print '</td></tr>';
}
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
print '<td>';
$doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment