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"';
158 print
'<input type="text" name="line_desc" class="marginrightonly minwidth300 valignmiddle" id="line_desc" value="';
160 if ($line_type ==
'subtotal') {
161 print
' readonly="readonly"';
166 if ($line_type ==
'title') {
167 $predefinedtitles = $this->getPredefinedTitles();
168 if (!empty($predefinedtitles)) {
171 print $form->selectarray(
'line_predefinedtitle', $predefinedtitles,
'', 1, 0, 0,
'onchange="var o = this.options[this.selectedIndex]; if (o.value && o.value != \'-1\') { jQuery(\'#line_desc\').val(o.text); }"', 0, 0, 0,
'',
'minwidth100');
175 if ($line_type !=
'text') {
176 $depth_array = $this->getPossibleLevels($langs);
177 print $form->selectarray(
'line_depth', $depth_array, abs($line->qty), 0, 0, 0,
'', 0, 0, $disabled);
180 print
'<input type="hidden" name="line_depth" value="' . $line->qty .
'">';
182 print
'<div><ul class="ecmjqft">';
183 foreach ($line_options as $key => $value) {
184 if (in_array($line_type, $value[
'type'])) {
185 if ($line_type ==
'title') {
186 print
'<li><label for="' . $key .
'">' . $langs->trans($value[
'trans_key']) .
'</label>';
187 print
'<input style="float: left;margin-top: 9px;" id="' . $key .
'" type="checkbox" name="' . $key .
'" value="' . $value[
'value'] .
'" ';
188 print $value[
'checked'] ?
'checked' :
'';
191 if ($line_type ==
'subtotal') {
192 print
'<input style="float: left;margin-top: 9px;" id="' . $key .
'" type="hidden" name="' . $key .
'" value="' . $value[
'value'] .
'">';
196 print
'</ul></div></td>';
197 print
'<td colspan="' . $colspan .
'" class="right"></td>';
199 print
'<input type="text" readonly name="line_desc" id="line_desc" value="';
206<td
class=
"center valignmiddle" colspan=
"4">
207 <input
type=
"submit" class=
"reposition button buttongen button-save" id=
"savelinebutton marginbottomonly" name=
"save" value=
"<?php echo $langs->trans("Save
"); ?>"><br>
208 <input
type=
"submit" class=
"reposition button buttongen button-cancel" id=
"cancellinebutton" name=
"cancel" value=
"<?php echo $langs->trans("Cancel
"); ?>">
212<!-- END PHP TEMPLATE objectline_edit.tpl.php -->
if(! $sortfield) if(! $sortorder) $object
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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)
$conf db name
Only used if Module[ID]Name translation string is not found.