dolibarr 18.0.6
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
38if (empty($object) || !is_object($object)) {
39 print "Error, template page can't be called as URL";
40 exit;
41}
42
43print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
44
45// Title line
46print "<thead>\n";
47
48print '<tr class="liste_titre nodrag nodrop">';
49
50// Adds a line numbering column
51if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
52 print '<th class="linecolnum center">&nbsp;</th>';
53}
54
55// Description
56print '<th class="linecoldescription">'.$langs->trans('Description').'</th>';
57
58// Supplier ref
59if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') {
60 print '<th class="linerefsupplier maxwidth125"><span id="title_fourn_ref">'.$langs->trans("SupplierRef").'</span></th>';
61}
62
63// VAT
64print '<th class="linecolvat right nowraponall">';
65if (!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
71if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_proposal', 'order_supplier', 'invoice_supplier')) && $object->status == $object::STATUS_DRAFT) {
72 global $mysoc;
73
74 if (empty($disableedit) && GETPOST('mode', 'aZ09') != 'vatforalllines') {
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}
85print '</th>';
86
87// Price HT
88print '<th class="linecoluht right nowraponall">'.$langs->trans('PriceUHT').'</th>';
89
90// Multicurrency
91if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
92 print '<th class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</th>';
93}
94
95if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) {
96 print '<th class="right nowraponall">'.$langs->trans('PriceUTTC').'</th>';
97}
98
99// Qty
100print '<th class="linecolqty right">'.$langs->trans('Qty').'</th>';
101
102// Unit
103if (!empty($conf->global->PRODUCT_USE_UNITS)) {
104 print '<th class="linecoluseunit left">'.$langs->trans('Unit').'</th>';
105}
106
107// Reduction short
108print '<th class="linecoldiscount right nowraponall">';
109print $langs->trans('ReductionShort');
110
111if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) {
112 global $mysoc;
113
114 if (empty($disableedit) && GETPOST('mode', 'aZ09') != 'remiseforalllines') {
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}
125print '</th>';
126
127// Fields for situation invoice
128if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
129 print '<th class="linecolcycleref right">'.$langs->trans('Progress').'</th>';
130 print '<th class="linecolcycleref2 right">'.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).'</th>';
131}
132
133// Purchase price
134if ($usemargins && isModEnabled('margin') && empty($user->socid)) {
135 if (!empty($user->rights->margins->creer)) {
136 if ($conf->global->MARGIN_TYPE == "1") {
137 print '<th class="linecolmargin1 margininfos right width75">'.$langs->trans('BuyingPrice').'</th>';
138 } else {
139 print '<th class="linecolmargin1 margininfos right width75">'.$langs->trans('CostPrice').'</th>';
140 }
141 }
142
143 if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {
144 print '<th class="linecolmargin2 margininfos right width75">'.$langs->trans('MarginRate');
145 if ($user->hasRight("propal", "creer")) {
146 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?mode=marginforalllines&id='.$object->id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickmarginforalllines opacitymedium paddingleft cursorpointer"').'</a>';
147 if (GETPOST('mode', 'aZ09') == 'marginforalllines') {
148 print '<div class="classmarginforalllines inline-block nowraponall">';
149 print '<input type="number" name="marginforalllines" min="0" max="999.9" value="20.0" step="0.1" class="width50"><label>%</label>';
150 print '<input class="inline-block button smallpaddingimp" type="submit" name="submitforallmargins" value="'.$langs->trans("Update").'">';
151 print '</div>';
152 }
153 }
154 print '</th>';
155 }
156 if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {
157 print '<th class="linecolmargin2 margininfos right width75">'.$langs->trans('MarkRate').'</th>';
158 }
159}
160
161// Total HT
162print '<th class="linecolht right">'.$langs->trans('TotalHTShort').'</th>';
163
164// Multicurrency
165if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
166 print '<th class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</th>';
167}
168
169if ($outputalsopricetotalwithtax) {
170 print '<th class="right" style="width: 80px">'.$langs->trans('TotalTTCShort').'</th>';
171}
172
173if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
174 print '<th class="linecolasset"></th>';
175}
176
177print '<th class="linecoledit"></th>'; // No width to allow autodim
178
179print '<th class="linecoldelete" style="width: 10px"></th>';
180
181print '<th class="linecolmove" style="width: 10px"></th>';
182
183if ($action == 'selectlines') {
184 print '<th class="linecolcheckall center">';
185 print '<input type="checkbox" class="linecheckboxtoggle" />';
186 print '<script>$(document).ready(function() {$(".linecheckboxtoggle").click(function() {var checkBoxes = $(".linecheckbox");checkBoxes.prop("checked", this.checked);})});</script>';
187 print '</th>';
188}
189
190print "</tr>\n";
191print "</thead>\n";
192
193print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.