dolibarr  7.0.0-beta
info.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
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 <http://www.gnu.org/licenses/>.
16  */
17 
24 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28 if (! empty($conf->projet->enabled))
29 {
30  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
31  require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
32 }
33 
34 $langs->load("compta");
35 $langs->load("bills");
36 
37 $id=GETPOST('id','int');
38 $action=GETPOST('action','aZ09');
39 
40 // Security check
41 $socid = GETPOST('socid','int');
42 if ($user->societe_id) $socid=$user->societe_id;
43 $result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
44 
45 $object = new ChargeSociales($db);
46 
47 
48 /*
49  * Actions
50  */
51 
52 if ($action == 'setlib' && $user->rights->tax->charges->creer)
53 {
54  $object->fetch($id);
55  $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
56  if ($result < 0)
57  setEventMessages($object->error, $object->errors, 'errors');
58 }
59 
60 
61 /*
62  * View
63  */
64 
65 $form = new Form($db);
66 
67 if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
68 
69 $title = $langs->trans("SocialContribution") . ' - ' . $langs->trans("Info");
70 $help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:M&oacute;dulo Impuestos y cargas sociales (IVA, impuestos)';
71 llxHeader("",$title,$help_url);
72 
73 $object->fetch($id);
74 $object->info($id);
75 
76 $head = tax_prepare_head($object);
77 
78 dol_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill');
79 
80 $morehtmlref='<div class="refidno">';
81 // Label of social contribution
82 $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
83 $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
84 // Project
85 if (! empty($conf->projet->enabled))
86 {
87  $langs->load("projects");
88  $morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
89  if (! empty($object->fk_project)) {
90  $proj = new Project($db);
91  $proj->fetch($object->fk_project);
92  $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
93  $morehtmlref.=$proj->ref;
94  $morehtmlref.='</a>';
95  } else {
96  $morehtmlref.='';
97  }
98 }
99 $morehtmlref.='</div>';
100 
101 $linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
102 
103 $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
104 
105 dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
106 
107 print '<div class="fichecenter">';
108 print '<div class="underbanner clearboth"></div>';
109 
110 print '<br>';
111 
112 print '<table width="100%"><tr><td>';
113 dol_print_object_info($object);
114 print '</td></tr></table>';
115 
116 print '</div>';
117 
118 llxFooter();
119 
120 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
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.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
Class to manage building of HTML components.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
llxHeader()
Empty header.
Definition: wrapper.php:46
tax_prepare_head(ChargeSociales $object)
Prepare array with list of tabs.
Definition: tax.lib.php:37
print
Draft customers invoices.
Definition: index.php:91
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
Check permissions of a user to show a page and an object.