38 if (empty($object) || !is_object($object))
40 print "Error, template page can't be called as URL";
45 global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax;
47 if (empty($dateSelector)) $dateSelector = 0;
48 if (empty($forceall)) $forceall = 0;
49 if (empty($senderissupplier)) $senderissupplier = 0;
50 if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0;
51 if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax = 0;
54 $domData =
' data-element="'.$line->element.
'"';
55 $domData .=
' data-id="'.$line->id.
'"';
56 $domData .=
' data-qty="'.$line->qty.
'"';
57 $domData .=
' data-product_type="'.$line->product_type.
'"';
60 $objectline =
new BOMLine($object->db);
63 print "<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->\n";
64 print '<tr id="row-'.$line->id.
'" class="drag drop oddeven" '.$domData.
' >';
65 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
66 print '<td class="linecolnum center">'.($i + 1).
'</td>';
69 print '<td class="linecoldescription minwidth300imp">';
70 print '<div id="line_'.$line->id.
'"></div>';
72 $tmpproduct =
new Product($object->db);
73 $tmpproduct->fetch($line->fk_product);
74 print $tmpproduct->getNomUrl(1);
75 print ' - '.$tmpproduct->label;
77 print '<td class="linecolqty nowrap right">';
79 echo
price($line->qty, 0,
'', 0, 0);
82 if (!empty($conf->global->PRODUCT_USE_UNITS))
84 print '<td class="linecoluseunit nowrap left">';
85 $label = $tmpproduct->getLabelOfUnit(
'long');
87 print $langs->trans($label);
92 print '<td class="linecolqtyfrozen nowrap right">';
94 echo $line->qty_frozen ?
yn($line->qty_frozen) :
'';
96 print '<td class="linecoldisablestockchange nowrap right">';
98 echo $line->disable_stock_change ?
yn($line->disable_stock_change) :
'';
101 print '<td class="linecolefficiency nowrap right">';
103 echo $line->efficiency;
106 print '<td class="linecolcost nowrap right">';
108 echo
price($line->total_cost);
111 if ($this->status == 0 && ($object_rights->write) && $action !=
'selectlines') {
112 print '<td class="linecoledit center">';
114 if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
116 print '<a class="editfielda reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$this->
id.
'&action=editline&lineid='.$line->id.
'">'.
img_edit().
'</a>';
120 print '<td class="linecoldelete center">';
122 if (($line->fk_prev_id == null) && empty($disableremove)) {
124 print '<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$this->
id.
'&action=deleteline&token='.
newToken().
'&lineid='.$line->id.
'">';
130 if ($num > 1 && $conf->browser->layout !=
'phone' && empty($disablemove)) {
131 print '<td class="linecolmove tdlineupdown center">';
134 print '<a class="lineupdown" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$this->
id.
'&action=up&rowid='.$line->id.
'">';
135 echo
img_up(
'default', 0,
'imgupforline');
139 print '<a class="lineupdown" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$this->
id.
'&action=down&rowid='.$line->id.
'">';
140 echo
img_down(
'default', 0,
'imgdownforline');
145 print '<td '.(($conf->browser->layout !=
'phone' && empty($disablemove)) ?
' class="linecolmove tdlineupdown center"' :
' class="linecolmove center"').
'></td>';
149 print '<td colspan="3"></td>';
150 $coldisplay = $coldisplay + 3;
153 if ($action ==
'selectlines') {
154 print '<td class="linecolcheck center">';
155 print '<input type="checkbox" class="linecheckbox" name="line_checkbox['.($i + 1).
']" value="'.$line->id.
'" >';
162 if (!empty($extrafields))
164 print $line->showOptionals($extrafields,
'view', array(
'style'=>
'class="drag drop oddeven"',
'colspan'=>$coldisplay),
'',
'', 1);
167 print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Class to manage products or services.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
img_down($titlealt= 'default', $selected=0, $moreclass= '')
Show down arrow logo.
img_up($titlealt= 'default', $selected=0, $moreclass= '')
Show top arrow logo.
print
Draft customers invoices.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
img_delete($titlealt= 'default', $other= 'class="pictodelete"', $morecss= '')
Show delete logo.