dolibarr 23.0.3
objectline_edit.tpl.php
1<?php
2/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2012 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) 2018-2024 Frédéric France <frederic.france@free.fr>
9 * Copyright (C) 2024 Vincent Maury <vmaury@timgroup.fr>
10 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
11 * Copyright (C) 2025 Nick Fragoulis
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 *
26 * Need to have the following variables defined:
27 * $object (invoice, order, ...)
28 * $conf
29 * $langs
30 * $seller, $buyer
31 * $dateSelector
32 * $forceall (0 by default, 1 for supplier invoices/orders)
33 * $senderissupplier (0 by default, 1 for supplier invoices/orders)
34 * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
35 */
36
37require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php";
38
53// Protection to avoid direct call of template
54if (empty($object) || !is_object($object)) {
55 print "Error, template page can't be called as URL";
56 exit(1);
57}
58
59'
60@phan-var-force receptionlinebatch $line
61@phan-var-force CommonObject $this
62@phan-var-force CommonObject $object
63@phan-var-force int $i
64@phan-var-force bool $var
65@phan-var-force Societe $buyer
66@phan-var-force Societe $seller
67';
68
69global $forceall, $filtertype;
70
71if (empty($forceall)) {
72 $forceall = 0;
73}
74
75if (empty($filtertype)) {
76 $filtertype = 0;
77}
78
79$formproduct = new FormProduct($object->db);
80$form = new Form($object->db);
81
82// Define colspan for the button 'Add'
83$colspan = 3;
84
85// Lines for extrafield
86$objectline = new ReceptionLineBatch($this->db);
87
88print "<!-- BEGIN PHP TEMPLATE reception/tpl/objectline_edit.tpl.php -->\n";
89
90$coldisplay = 0;
91print '<tr class="oddeven tredited">';
92// Adds a line numbering column
93if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
94 print '<td class="linecolnum center">'.($i + 1).'</td>';
95 $coldisplay++;
96}
97
98$coldisplay++;
99?>
100 <td>
101 <div id="line_<?php echo $line->id; ?>"></div>
102
103 <input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
104 <input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>">
105 <input type="hidden" id="product_id" name="productid" value="<?php echo(!empty($line->fk_product) ? $line->fk_product : 0); ?>" />
106 <input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
107
108<?php
109// Predefined product/service
110if ($line->fk_product > 0) {
111 $tmpproduct = new Product($object->db);
112 $tmpproduct->fetch($line->fk_product);
113 print $tmpproduct->getNomUrl(1);
114 print ' - '.$tmpproduct->label;
115}
116
117//Line extrafield
118if (!empty($extrafields)) {
119 $temps = $line->showOptionals($extrafields, 'edit', array('class' => 'tredited'), '', '', '1', 'line');
120 if (!empty($temps)) {
121 print '<div style="padding-top: 10px" id="extrafield_lines_area_edit" name="extrafield_lines_area_edit">';
122 print $temps;
123 print '</div>';
124 }
125}
126
127print '</td>';
128
129$coldisplay++;
130
131print '<td class="nobottom linecolqty right">';
132
133if (((int) $line->info_bits & 2) != 2) {
134 print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="'.$line->qty.'">';
135}
136print '</td>';
137
138
139if (getDolGlobalString('PRODUCT_USE_UNITS')) {
140 $unit_type = false;
141 // limit unit select to unit type
142 if (!empty($line->fk_unit) && !getDolGlobalString('MAIN_EDIT_LINE_ALLOW_ALL_UNIT_TYPE')) {
143 include_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
144 $cUnit = new CUnits($line->db);
145 if ($cUnit->fetch((int) $line->fk_unit) > 0) {
146 if (!empty($cUnit->unit_type)) {
147 $unit_type = $cUnit->unit_type;
148 }
149 }
150 }
151 $coldisplay++;
152 print '<td class="left">';
153 print $form->selectUnits(GETPOSTISSET('units') ? GETPOST('units') : $line->fk_unit, "units", 0, $unit_type);
154 print '</td>';
155}
156
157$coldisplay += $colspan;
158print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
159$coldisplay += $colspan;
160print '<input type="submit" class="reposition button buttongen margintoponly marginbottomonly button-save" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
161print '<input type="submit" class="reposition button buttongen margintoponly marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
162print '</td>';
163print '</tr>';
164
165print "<!-- END PHP TEMPLATE objectline_edit.tpl.php -->\n";
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class of dictionary type of thirdparty (used by imports)
Class to manage generation of HTML components Only common components must be here.
Class with static methods for building HTML components related to products Only components common to ...
Class to manage products or services.
Class to manage table commandefournisseurdispatch.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:125
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:128