dolibarr  16.0.5
info.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
24 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28 
29 // Load translation files required by the page
30 $langs->loadLangs(array('compta', 'bills'));
31 
32 $id = GETPOST('id', 'int');
33 $action = GETPOST('action', 'aZ09');
34 
35 $object = new Tva($db);
36 
37 // Security check
38 $socid = GETPOST('socid', 'int');
39 if ($user->socid) {
40  $socid = $user->socid;
41 }
42 $result = restrictedArea($user, 'tax', '', 'tva', 'charges');
43 
44 
45 /*
46  * Actions
47  */
48 
49 if ($action == 'setlib' && $user->rights->tax->charges->creer) {
50  $object->fetch($id);
51  $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY');
52  if ($result < 0) {
53  setEventMessages($object->error, $object->errors, 'errors');
54  }
55 }
56 
57 
58 /*
59  * View
60  */
61 
62 $title = $langs->trans("VAT")." - ".$langs->trans("Info");
63 $help_url = '';
64 llxHeader("", $title, $helpurl);
65 
66 $object = new Tva($db);
67 $object->fetch($id);
68 $object->info($id);
69 
70 $head = vat_prepare_head($object);
71 
72 print dol_get_fiche_head($head, 'info', $langs->trans("VATPayment"), -1, 'payment');
73 
74 $morehtmlref = '<div class="refidno">';
75 // Label of social contribution
76 $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
77 $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
78 $morehtmlref .= '</div>';
79 
80 $linkback = '<a href="'.DOL_URL_ROOT.'/compta/tva/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
81 
82 dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
83 
84 print '<div class="fichecenter">';
85 print '<div class="underbanner clearboth"></div>';
86 
87 print '<br>';
88 
89 print '<table width="100%"><tr><td>';
90 dol_print_object_info($object);
91 print '</td></tr></table>';
92 
93 print '</div>';
94 
95 print dol_get_fiche_end();
96 
97 llxFooter();
98 
99 $db->close();
restrictedArea
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
vat_prepare_head
vat_prepare_head($object)
Prepare array with list of tabs.
Definition: vat.lib.php:33
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2046
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:116
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
dol_print_object_info
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
Definition: functions2.lib.php:205
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
Tva
Put here description of your class.
Definition: tva.class.php:35