dolibarr  16.0.5
objectline_title.tpl.php
1 <?php
2 /* Copyright (C) 2010-2013 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
5  * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
6  * Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
7  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
8  * Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
9  * Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  *
24  * Need to have following variables defined:
25  * $object (invoice, order, ...)
26  * $conf
27  * $langs
28  * $element (used to test $user->rights->$element->creer)
29  * $permtoedit (used to replace test $user->rights->$element->creer)
30  * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
31  * $outputalsopricetotalwithtax
32  * $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
33  *
34  * $type, $text, $description, $line
35  */
36 
37 // Protection to avoid direct call of template
38 if (empty($object) || !is_object($object)) {
39  print "Error, template page can't be called as URL";
40  exit;
41 }
42 
43 print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
44 
45 // Title line
46 print "<thead>\n";
47 
48 print '<tr class="liste_titre nodrag nodrop">';
49 
50 // Adds a line numbering column
51 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
52  print '<td class="linecolnum center">&nbsp;</td>';
53 }
54 
55 // Description
56 print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
57 
58 // Supplier ref
59 if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') {
60  print '<td class="linerefsupplier maxwidth125"><span id="title_fourn_ref">'.$langs->trans("SupplierRef").'</span></td>';
61 }
62 
63 // VAT
64 print '<td class="linecolvat right nowraponall">';
65 if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) {
66  print $langs->trans('Taxes');
67 } else {
68  print $langs->trans('VAT');
69 }
70 
71 if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) {
72  global $mysoc;
73 
74  if (empty($disableedit)) {
75  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?mode=vatforalllines&id='.$object->id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').'</a>';
76  }
77  //print '<script>$(document).ready(function() { $(".clickvatforalllines").click(function() { jQuery(".classvatforalllines").toggle(); }); });</script>';
78  if (GETPOST('mode', 'aZ09') == 'vatforalllines') {
79  print '<div class="classvatforalllines inline-block nowraponall">';
80  print $form->load_tva('vatforalllines', '', $mysoc, $object->thirdparty, 0, 0, '', false, 1);
81  print '<input class="inline-block button smallpaddingimp" type="submit" name="submitforalllines" value="'.$langs->trans("Update").'">';
82  print '</div>';
83  }
84 }
85 print '</td>';
86 
87 // Price HT
88 print '<td class="linecoluht right nowraponall">'.$langs->trans('PriceUHT').'</td>';
89 
90 // Multicurrency
91 if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
92  print '<td class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';
93 }
94 
95 if ($inputalsopricewithtax) {
96  print '<td class="right nowraponall">'.$langs->trans('PriceUTTC').'</td>';
97 }
98 
99 // Qty
100 print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
101 
102 // Unit
103 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
104  print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>';
105 }
106 
107 // Reduction short
108 print '<td class="linecoldiscount right nowraponall">';
109 print $langs->trans('ReductionShort');
110 
111 if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) {
112  global $mysoc;
113 
114  if (empty($disableedit)) {
115  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?mode=remiseforalllines&id='.$object->id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').'</a>';
116  }
117  //print '<script>$(document).ready(function() { $(".clickremiseforalllines").click(function() { jQuery(".classremiseforalllines").toggle(); }); });</script>';
118  if (GETPOST('mode', 'aZ09') == 'remiseforalllines') {
119  print '<div class="remiseforalllines inline-block nowraponall">';
120  print '<input class="inline-block smallpaddingimp width50 right" name="remiseforalllines" value="" placeholder="%">';
121  print '<input class="inline-block button smallpaddingimp" type="submit" name="submitforalllines" value="'.$langs->trans("Update").'">';
122  print '</div>';
123  }
124 }
125 print '</td>';
126 
127 // Fields for situation invoice
128 if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
129  print '<td class="linecolcycleref right">'.$langs->trans('Progress').'</td>';
130  print '<td class="linecolcycleref2 right">'.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).'</td>';
131 }
132 
133 // Purchase price
134 if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid)) {
135  if (!empty($user->rights->margins->creer)) {
136  if ($conf->global->MARGIN_TYPE == "1") {
137  print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('BuyingPrice').'</td>';
138  } else {
139  print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('CostPrice').'</td>';
140  }
141  }
142 
143  if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {
144  print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarginRate').'</td>';
145  }
146  if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {
147  print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarkRate').'</td>';
148  }
149 }
150 
151 // Total HT
152 print '<td class="linecolht right">'.$langs->trans('TotalHTShort').'</td>';
153 
154 // Multicurrency
155 if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
156  print '<td class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';
157 }
158 
159 if ($outputalsopricetotalwithtax) {
160  print '<td class="right" style="width: 80px">'.$langs->trans('TotalTTCShort').'</td>';
161 }
162 
163 if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') {
164  print '<td class="linecolasset"></td>';
165 }
166 
167 print '<td class="linecoledit"></td>'; // No width to allow autodim
168 
169 print '<td class="linecoldelete" style="width: 10px"></td>';
170 
171 print '<td class="linecolmove" style="width: 10px"></td>';
172 
173 if ($action == 'selectlines') {
174  print '<td class="linecolcheckall center">';
175  print '<input type="checkbox" class="linecheckboxtoggle" />';
176  print '<script>$(document).ready(function() {$(".linecheckboxtoggle").click(function() {var checkBoxes = $(".linecheckbox");checkBoxes.prop("checked", this.checked);})});</script>';
177  print '</td>';
178 }
179 
180 print "</tr>\n";
181 print "</thead>\n";
182 
183 print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";
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
img_edit
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Definition: functions.lib.php:4389