New # 786 : can link project from supplier invoice creation

This commit is contained in:
Maxime Kohlhaas 2013-04-20 14:33:00 +02:00
parent 129da11a52
commit ef13ea8690
2 changed files with 14 additions and 0 deletions

View File

@ -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.",";

View File

@ -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;
@ -1153,6 +1156,15 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
$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>';