New: possibility to view/edit notes in invoice card

This commit is contained in:
Regis Houssin 2012-03-16 11:12:59 +01:00
parent 0df083a8d8
commit 1622a86d71
3 changed files with 20 additions and 10 deletions

View File

@ -2738,6 +2738,10 @@ else
print '</table><br>'; print '</table><br>';
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
}
/* /*
* Lines * Lines

View File

@ -72,7 +72,8 @@ class Facture extends CommonObject
var $total_ht=0; var $total_ht=0;
var $total_tva=0; var $total_tva=0;
var $total_ttc=0; var $total_ttc=0;
var $note; var $note; // deprecated
var $note_private;
var $note_public; var $note_public;
//! 0=draft, //! 0=draft,
//! 1=validated (need to be paid), //! 1=validated (need to be paid),
@ -763,7 +764,7 @@ class Facture extends CommonObject
$sql.= ', f.datec as datec'; $sql.= ', f.datec as datec';
$sql.= ', f.date_valid as datev'; $sql.= ', f.date_valid as datev';
$sql.= ', f.tms as datem'; $sql.= ', f.tms as datem';
$sql.= ', f.note, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf'; $sql.= ', f.note as note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf';
$sql.= ', f.fk_facture_source'; $sql.= ', f.fk_facture_source';
$sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet'; $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet';
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
@ -818,7 +819,8 @@ class Facture extends CommonObject
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_projet;
$this->fk_facture_source = $obj->fk_facture_source; $this->fk_facture_source = $obj->fk_facture_source;
$this->note = $obj->note; $this->note = $obj->note_private;
$this->note_private = $obj->note_private; // deprecated
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author; $this->user_author = $obj->fk_user_author;
$this->user_valid = $obj->fk_user_valid; $this->user_valid = $obj->fk_user_valid;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -67,10 +68,13 @@ function facture_prepare_head($object)
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice'); complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
}
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
/*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref); /*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref);