Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
f6c42053a4
@ -87,6 +87,7 @@ class FormVentilation extends Form
|
|||||||
if ($usecache && ! empty($this->options_cache[$usecache]))
|
if ($usecache && ! empty($this->options_cache[$usecache]))
|
||||||
{
|
{
|
||||||
$options = $this->options_cache[$usecache];
|
$options = $this->options_cache[$usecache];
|
||||||
|
$selected=$selectid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
|
||||||
|
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
@ -38,7 +39,7 @@ $refund=GETPOST("refund","int");
|
|||||||
if (empty($refund)) $refund=0;
|
if (empty($refund)) $refund=0;
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
$socid = GETPOST('socid','int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||||
|
|
||||||
@ -179,8 +180,9 @@ if ($action == 'delete')
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
$title=$langs->trans("VAT") . " - " . $langs->trans("Card");
|
||||||
llxHeader();
|
$help_url='';
|
||||||
|
llxHeader("",$title,$helpurl);
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
@ -242,7 +244,7 @@ if ($action == 'create')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
||||||
print $form->select_date($datep,"datep",'','','','add',1,1);
|
print $form->select_date($datep,"datep",'','','','add',1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -263,7 +265,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("BankAccount").'</td><td>';
|
||||||
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
|
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -296,20 +298,10 @@ if ($action == 'create')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// View mode
|
||||||
/* ************************************************************************** */
|
|
||||||
/* */
|
|
||||||
/* Barre d'action */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
$h = 0;
|
$head=vat_prepare_head($object);
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id;
|
|
||||||
$head[$h][1] = $langs->trans('Card');
|
|
||||||
$head[$h][2] = 'card';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment');
|
dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment');
|
||||||
|
|
||||||
@ -317,7 +309,7 @@ if ($id)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $object->ref;
|
print $object->ref;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -325,19 +317,19 @@ if ($id)
|
|||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
|
print '<td>'.$langs->trans("DatePayment").'</td><td>';
|
||||||
print dol_print_date($object->datep,'day');
|
print dol_print_date($object->datep,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
|
print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
|
||||||
print '</td><td colspan="3">';
|
print '</td><td>';
|
||||||
print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
|
print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
|
||||||
//print dol_print_date($object->datev,'day');
|
//print dol_print_date($object->datev,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($object->amount).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||||
|
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
@ -348,7 +340,7 @@ if ($id)
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td>';
|
||||||
print $bankline->getNomUrl(1,0,'showall');
|
print $bankline->getNomUrl(1,0,'showall');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -356,14 +348,12 @@ if ($id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('colspan' => ' colspan="3"');
|
$reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action buttons
|
* Action buttons
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -671,4 +671,52 @@ class Tva extends CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Informations of vat payment object
|
||||||
|
*
|
||||||
|
* @param int $id Id of vat payment
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function info($id)
|
||||||
|
{
|
||||||
|
$sql = "SELECT t.rowid, t.tms as datec, t.fk_user_creat";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||||
|
$sql.= " WHERE t.rowid = ".$id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::info", LOG_DEBUG);
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
if ($this->db->num_rows($result))
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$this->id = $obj->rowid;
|
||||||
|
|
||||||
|
if ($obj->fk_user_creat) {
|
||||||
|
$cuser = new User($this->db);
|
||||||
|
$cuser->fetch($obj->fk_user_creat);
|
||||||
|
$this->user_creation = $cuser;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($obj->fk_user_modif) {
|
||||||
|
$muser = new User($this->db);
|
||||||
|
$muser->fetch($obj->fk_user_modif);
|
||||||
|
$this->user_modification = $muser;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->date_creation = $this->db->jdate($obj->datec);
|
||||||
|
$this->date_modification = $this->db->jdate($obj->datec);
|
||||||
|
$this->import_key = $obj->import_key;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->free($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
64
htdocs/compta/tva/info.php
Normal file
64
htdocs/compta/tva/info.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/compta/tva/info.php
|
||||||
|
* \ingroup tax
|
||||||
|
* \brief Page with info about vat
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
$langs->load("compta");
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
|
$id=GETPOST('id','int');
|
||||||
|
$action=GETPOST("action");
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid','int');
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
$title=$langs->trans("VAT") . " - " . $langs->trans("Info");
|
||||||
|
$help_url='';
|
||||||
|
llxHeader("",$title,$helpurl);
|
||||||
|
|
||||||
|
$object = new Tva($db);
|
||||||
|
$object->fetch($id);
|
||||||
|
$object->info($id);
|
||||||
|
|
||||||
|
$head = vat_prepare_head($object);
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'info', $langs->trans("VATPayment"), 0, 'payment');
|
||||||
|
|
||||||
|
print '<table width="100%"><tr><td>';
|
||||||
|
dol_print_object_info($object);
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -42,9 +42,11 @@ if ($resql) // This can fail when class is used on old database (during migra
|
|||||||
if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp;
|
if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
if ($obj->type!='separate') {
|
||||||
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||||
$this->export_entities_array[$r][$fieldname]=$keyforelement;
|
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
||||||
|
$this->export_entities_array[$r][$fieldname]=$keyforelement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add axtra fields
|
// End add axtra fields
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.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
|
||||||
@ -41,16 +41,6 @@ function loan_prepare_head($object)
|
|||||||
$head[$tab][2] = 'card';
|
$head[$tab][2] = 'card';
|
||||||
$tab++;
|
$tab++;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
|
||||||
{
|
|
||||||
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
|
|
||||||
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
|
|
||||||
$head[$tab][1] = $langs->trans("Notes");
|
|
||||||
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
|
|
||||||
$head[$tab][2] = 'note';
|
|
||||||
$tab++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
@ -68,6 +58,16 @@ function loan_prepare_head($object)
|
|||||||
$head[$tab][2] = 'documents';
|
$head[$tab][2] = 'documents';
|
||||||
$tab++;
|
$tab++;
|
||||||
|
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||||
|
{
|
||||||
|
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
|
||||||
|
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
|
||||||
|
$head[$tab][1] = $langs->trans("Notes");
|
||||||
|
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
|
||||||
|
$head[$tab][2] = 'note';
|
||||||
|
$tab++;
|
||||||
|
}
|
||||||
|
|
||||||
$head[$tab][0] = DOL_URL_ROOT.'/loan/info.php?id='.$object->id;
|
$head[$tab][0] = DOL_URL_ROOT.'/loan/info.php?id='.$object->id;
|
||||||
$head[$tab][1] = $langs->trans("Info");
|
$head[$tab][1] = $langs->trans("Info");
|
||||||
$head[$tab][2] = 'info';
|
$head[$tab][2] = 'info';
|
||||||
|
|||||||
57
htdocs/core/lib/vat.lib.php
Normal file
57
htdocs/core/lib/vat.lib.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/lib/vat.lib.php
|
||||||
|
* \ingroup tax
|
||||||
|
* \brief Library for tax module (VAT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare array with list of tabs
|
||||||
|
*
|
||||||
|
* @param Object $object Object related to tabs
|
||||||
|
* @return array Array of tabs to show
|
||||||
|
*/
|
||||||
|
function vat_prepare_head($object)
|
||||||
|
{
|
||||||
|
global $db, $langs, $conf;
|
||||||
|
|
||||||
|
$tab = 0;
|
||||||
|
$head = array();
|
||||||
|
|
||||||
|
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id;
|
||||||
|
$head[$tab][1] = $langs->trans('Card');
|
||||||
|
$head[$tab][2] = 'card';
|
||||||
|
$tab++;
|
||||||
|
|
||||||
|
// Show more tabs from modules
|
||||||
|
// Entries must be declared in modules descriptor with line
|
||||||
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
|
complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat');
|
||||||
|
|
||||||
|
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id;
|
||||||
|
$head[$tab][1] = $langs->trans("Info");
|
||||||
|
$head[$tab][2] = 'info';
|
||||||
|
$tab++;
|
||||||
|
|
||||||
|
complete_head_from_modules($conf,$langs,$object,$head,$tab,'vat','remove');
|
||||||
|
|
||||||
|
return $head;
|
||||||
|
}
|
||||||
@ -1428,26 +1428,6 @@ else
|
|||||||
//$cols = 3;
|
//$cols = 3;
|
||||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
|
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
|
||||||
|
|
||||||
// Public note
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
|
||||||
print '<td valign="top">';
|
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
|
||||||
print $doleditor->Create(1);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Private note
|
|
||||||
if (empty($user->societe_id)) {
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
|
|
||||||
print '<td valign="top">';
|
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
|
||||||
print $doleditor->Create(1);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -1624,14 +1604,6 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("NotePublic").'</td>';
|
|
||||||
print '<td>'.$object->note_public.'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("NotePrivate").'</td>';
|
|
||||||
print '<td>'.$object->note_private.'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("AmountHT").'</td>';
|
print '<td>'.$langs->trans("AmountHT").'</td>';
|
||||||
@ -2280,7 +2252,7 @@ print '<div class="fichehalfleft">';
|
|||||||
* Generate documents
|
* Generate documents
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($user->rights->expensereport->export && $action != 'edit')
|
if($user->rights->expensereport->export && $action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
|
|||||||
@ -300,7 +300,7 @@ if ($search_ref) $sql .= natural_search('cf.ref', $search_ref);
|
|||||||
if ($search_refsupp) $sql.= natural_search("cf.ref_supplier", $search_refsupp);
|
if ($search_refsupp) $sql.= natural_search("cf.ref_supplier", $search_refsupp);
|
||||||
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||||
if ($search_request_author) $sql.= " AND u.login LIKE '%".$db->escape($search_request_author)."%'";
|
if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ;
|
||||||
if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed;
|
if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed;
|
||||||
|
|
||||||
//Required triple check because statut=0 means draft filter
|
//Required triple check because statut=0 means draft filter
|
||||||
@ -379,7 +379,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -503,7 +502,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['cf.fk_author']['checked'])) print_liste_field_titre($arrayfields['cf.fk_author']['label'],$_SERVER["PHP_SELF"],"u.login","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['cf.fk_author']['checked'])) print_liste_field_titre($arrayfields['cf.fk_author']['label'],$_SERVER["PHP_SELF"],"cf.fk_author","",$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'],$_SERVER["PHP_SELF"],"cf.date_commande","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'],$_SERVER["PHP_SELF"],"cf.date_commande","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'],$_SERVER["PHP_SELF"],'cf.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'],$_SERVER["PHP_SELF"],'cf.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'],$_SERVER["PHP_SELF"],"cf.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'],$_SERVER["PHP_SELF"],"cf.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
@ -757,7 +756,7 @@ if ($resql)
|
|||||||
$userstatic->firstname = $obj->firstname;
|
$userstatic->firstname = $obj->firstname;
|
||||||
$userstatic->login = $obj->login;
|
$userstatic->login = $obj->login;
|
||||||
$userstatic->photo = $obj->photo;
|
$userstatic->photo = $obj->photo;
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['u.login']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
if ($userstatic->id) print $userstatic->getNomUrl(1);
|
||||||
|
|||||||
@ -399,12 +399,6 @@ if ($id > 0)
|
|||||||
// Rate
|
// Rate
|
||||||
print '<tr><td>'.$langs->trans("Rate").'</td><td>'.$object->rate.' %</td></tr>';
|
print '<tr><td>'.$langs->trans("Rate").'</td><td>'.$object->rate.' %</td></tr>';
|
||||||
|
|
||||||
// Note Private
|
|
||||||
print '<tr><td>'.$langs->trans('NotePrivate').'</td><td>'.nl2br($object->note_private).'</td></tr>';
|
|
||||||
|
|
||||||
// Note Public
|
|
||||||
print '<tr><td>'.$langs->trans('NotePublic').'</td><td>'.nl2br($object->note_public).'</td></tr>';
|
|
||||||
|
|
||||||
// Accountancy account capital
|
// Accountancy account capital
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("LoanAccountancyCapitalCode");
|
print $langs->trans("LoanAccountancyCapitalCode");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user