33@phan-var-force CommonObject $this
34@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal|Fichinter $object
35@phan-var-force CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|PropaleLigne|FichinterLigne $line
40$sub_options = $line->extraparams[
"subtotal"] ?? array();
42$titleshowuponpdf = !empty($sub_options[
'titleshowuponpdf']);
43$titleshowtotalexludingvatonpdf = !empty($sub_options[
'titleshowtotalexludingvatonpdf']);
44$titleforcepagebreak = !empty($sub_options[
'titleforcepagebreak']);
45$subtotalshowtotalexludingvatonpdf = !empty($sub_options[
'subtotalshowtotalexludingvatonpdf']);
48 'titleshowuponpdf' => array(
'type' => array(
'title'),
'value' =>
'on',
'checked' => $titleshowuponpdf,
'trans_key' =>
'ShowUPOnPDF'),
49 'titleshowtotalexludingvatonpdf' => array(
'type' => array(
'title'),
'value' =>
'on',
'checked' => $titleshowtotalexludingvatonpdf,
'trans_key' =>
'ShowTotalExludingVATOnPDF'),
50 'titleforcepagebreak' => array(
'type' => array(
'title'),
'value' =>
'on',
'checked' => $titleforcepagebreak,
'trans_key' =>
'ForcePageBreak'),
51 'subtotalshowtotalexludingvatonpdf' => array(
'type' => array(
'subtotal'),
'value' =>
'on',
'checked' => $subtotalshowtotalexludingvatonpdf,
'trans_key' =>
'ShowTotalExludingVATOnPDF'),
55$line_type = $line->qty > 0 ?
'title' : ($line->qty < 0 ?
'subtotal' :
'text');
57print
"<!-- BEGIN PHP TEMPLATE subtotal_edit.tpl.php -->\n";
59echo
'<tr class="oddeven tredited">';
62 echo
'<td class="linecolnum center">' . ($i + 1) .
'</td>';
69if (!empty(
$object->element) && in_array(
$object->element, array(
'facture',
'facturerec',
'propal',
'commande')) &&
isModEnabled(
'margin') && empty($user->socid)) {
70 if ($user->hasRight(
'margins',
'creer')) {
73 if (
getDolGlobalString(
'DISPLAY_MARGIN_RATES') && $user->hasRight(
'margins',
'liretous')) {
76 if (
getDolGlobalString(
'DISPLAY_MARK_RATES') && $user->hasRight(
'margins',
'liretous')) {
98<td
class=
"linecoldesc minwidth250onall">
99 <div
id=
"line_<?php echo $line->id; ?>"></div>
101 <input
type=
"hidden" name=
"lineid" value=
"<?php echo $line->id; ?>">
102 <input
type=
"hidden" id=
"product_type" name=
"type" value=
"<?php echo $line->product_type; ?>">
103 <input
type=
"hidden" id=
"special_code" name=
"special_code" value=
"<?php echo $line->special_code; ?>">
104 <input
type=
"hidden" id=
"fk_parent_line" name=
"fk_parent_line" value=
"<?php echo $line->fk_parent_line; ?>">
105 <input
type=
"hidden" name=
"action" value=
"update<?php echo $line_type ?>line">
109 $situationinvoicelinewithparent = 0;
110 if ($line->fk_prev_id !=
null && in_array(
$object->element, array(
'facture',
'facturedet'))) {
113 if (
$object->type == $object::TYPE_SITUATION) {
115 $situationinvoicelinewithparent = 1;
122 $situationinvoicelinewithparent = 0;
125 $langs->load(
'subtotals');
128 if (!$situationinvoicelinewithparent) {
129 if ($line_type ==
'text') {
130 print
'<textarea name="line_desc" class="marginrightonly" id="line_desc" rows="4" cols="40">';
134 $predefinedtexts = $this->getPredefinedTexts();
135 if (!empty($predefinedtexts)) {
136 $predefinedtextvalues = array();
137 $predefinedtextsmap = array();
138 foreach ($predefinedtexts as $rowid => $text) {
139 $predefinedtextvalues[$rowid] = $text[
'label'];
140 $predefinedtextsmap[$rowid] = $text[
'content'];
142 print
'<script>var subtotalEditPredefinedTextsMap = ' . json_encode($predefinedtextsmap, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) .
';</script>';
143 print $form->selectarray(
'line_predefinedtext', $predefinedtextvalues,
'', 1, 0, 0,
'onchange="var v = subtotalEditPredefinedTextsMap[jQuery(this).val()]; if (v !== undefined) { jQuery(\'#line_desc\').val(v); }"', 0, 0, 0,
'',
'minwidth100');
149 print
'<textarea name="line_desc" class="marginrightonly minwidth300 valignmiddle" id="line_desc"';
150 if ($line_type ==
'subtotal') {
151 print
' readonly="readonly"';
155 print GETPOSTISSET(
'product_desc') ?
GETPOST(
'product_desc',
'restricthtml') : $line->
description;
158 print
'<input type="text" name="line_desc" class="marginrightonly minwidth300 valignmiddle" id="line_desc" value="';
159 print GETPOSTISSET(
'product_desc') ?
GETPOST(
'product_desc',
'restricthtml') : $line->
description .
'"';
160 if ($line_type ==
'subtotal') {
161 print
' readonly="readonly"';
166 if ($line_type ==
'title') {
167 $predefinedtitles = $this->getPredefinedTitles();
168 if (!empty($predefinedtitles)) {
169 print $form->selectarray(
'line_predefinedtitle', $predefinedtitles,
'', 1, 0, 0,
'onchange="var v = jQuery(this).val(); if (v && v != \'-1\') { jQuery(\'#line_desc\').val(v); }"', 0, 0, 0,
'',
'minwidth100');
173 if ($line_type !=
'text') {
174 $depth_array = $this->getPossibleLevels($langs);
175 print $form->selectarray(
'line_depth', $depth_array, abs($line->qty), 0, 0, 0,
'', 0, 0, $disabled);
178 print
'<input type="hidden" name="line_depth" value="' . $line->qty .
'">';
180 print
'<div><ul class="ecmjqft">';
181 foreach ($line_options as $key => $value) {
182 if (in_array($line_type, $value[
'type'])) {
183 if ($line_type ==
'title') {
184 print
'<li><label for="' . $key .
'">' . $langs->trans($value[
'trans_key']) .
'</label>';
185 print
'<input style="float: left;margin-top: 9px;" id="' . $key .
'" type="checkbox" name="' . $key .
'" value="' . $value[
'value'] .
'" ';
186 print $value[
'checked'] ?
'checked' :
'';
189 if ($line_type ==
'subtotal') {
190 print
'<input style="float: left;margin-top: 9px;" id="' . $key .
'" type="hidden" name="' . $key .
'" value="' . $value[
'value'] .
'">';
194 print
'</ul></div></td>';
195 print
'<td colspan="' . $colspan .
'" class="right"></td>';
197 print
'<input type="text" readonly name="line_desc" id="line_desc" value="';
198 print GETPOSTISSET(
'product_desc') ?
GETPOST(
'product_desc',
'restricthtml') : $line->
description;
204<td
class=
"center valignmiddle" colspan=
"4">
205 <input
type=
"submit" class=
"reposition button buttongen button-save" id=
"savelinebutton marginbottomonly" name=
"save" value=
"<?php echo $langs->trans("Save
"); ?>"><br>
206 <input
type=
"submit" class=
"reposition button buttongen button-cancel" id=
"cancellinebutton" name=
"cancel" value=
"<?php echo $langs->trans("Cancel
"); ?>">
210<!-- END PHP TEMPLATE objectline_edit.tpl.php -->
if(! $sortfield) if(! $sortorder) $object
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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]]]',...
$conf db name
Only used if Module[ID]Name translation string is not found.