2010-09-08 18:09:59 +02:00
< ? php
2013-10-12 11:58:38 +02:00
/* Copyright ( C ) 2010 - 2013 Regis Houssin < regis . houssin @ capnetworks . com >
2012-08-23 13:45:51 +02:00
* Copyright ( C ) 2010 - 2011 Laurent Destailleur < eldy @ users . sourceforge . net >
2013-10-30 18:17:37 +01:00
* Copyright ( C ) 2012 - 2013 Christophe Battarel < christophe . battarel @ altairis . fr >
2013-06-10 16:05:41 +02:00
* Copyright ( C ) 2013 Florian Henry < florian . henry @ open - concept . pro >
2010-09-08 18:09:59 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2010-09-08 18:09:59 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:45:11 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2010-09-08 18:09:59 +02:00
*
2013-03-22 17:10:17 +01:00
* To use this template , the following var must be defined
* $type , $text , $description , $line
2010-09-08 18:09:59 +02:00
*/
?>
2013-06-10 16:05:41 +02:00
< ? php $coldisplay = 0 ; ?>
2012-08-23 13:45:51 +02:00
<!-- BEGIN PHP TEMPLATE objectline_view . tpl . php -->
2010-10-02 22:47:55 +02:00
< tr < ? php echo 'id="row-' . $line -> id . '" ' . $bcdd [ $var ]; ?> >
2011-12-16 18:31:54 +01:00
< ? php if ( ! empty ( $conf -> global -> MAIN_VIEW_LINE_NUMBER )) { ?>
2013-06-10 16:05:41 +02:00
< td align = " center " >< ? php $coldisplay ++ ; ?> <?php echo ($i+1); ?></td>
2011-12-16 18:31:54 +01:00
< ? php } ?>
2013-06-10 16:05:41 +02:00
< td >< ? php $coldisplay ++ ; ?> <div id="<?php echo $line->rowid; ?>"></div>
2010-09-08 18:09:59 +02:00
< ? php if (( $line -> info_bits & 2 ) == 2 ) { ?>
< a href = " <?php echo DOL_URL_ROOT.'/comm/remx.php?id='. $this->socid ; ?> " >
2011-11-16 18:58:11 +01:00
< ? php
$txt = '' ;
print img_object ( $langs -> trans ( " ShowReduc " ), 'reduc' ) . ' ' ;
if ( $line -> description == '(DEPOSIT)' ) $txt = $langs -> trans ( " Deposit " );
//else $txt=$langs->trans("Discount");
print $txt ;
?>
2010-09-08 18:09:59 +02:00
</ a >
2011-11-16 18:58:11 +01:00
< ? php
if ( $line -> description )
{
2013-03-22 17:10:17 +01:00
if ( $line -> description == '(CREDIT_NOTE)' && $objp -> fk_remise_except > 0 )
{
$discount = new DiscountAbsolute ( $this -> db );
$discount -> fetch ( $line -> fk_remise_except );
echo ( $txt ? ' - ' : '' ) . $langs -> transnoentities ( " DiscountFromCreditNote " , $discount -> getNomUrl ( 0 ));
}
elseif ( $line -> description == '(DEPOSIT)' && $objp -> fk_remise_except > 0 )
{
$discount = new DiscountAbsolute ( $this -> db );
$discount -> fetch ( $line -> fk_remise_except );
echo ( $txt ? ' - ' : '' ) . $langs -> transnoentities ( " DiscountFromDeposit " , $discount -> getNomUrl ( 0 ));
// Add date of deposit
if ( ! empty ( $conf -> global -> INVOICE_ADD_DEPOSIT_DATE )) echo ' (' . dol_print_date ( $discount -> datec ) . ')' ;
}
else
{
echo ( $txt ? ' - ' : '' ) . dol_htmlentitiesbr ( $line -> description );
2010-09-08 18:09:59 +02:00
}
2011-11-16 18:58:11 +01:00
}
2013-03-22 17:10:17 +01:00
}
else
{
if ( $line -> fk_product > 0 ) {
2012-08-23 13:45:51 +02:00
2013-10-12 11:58:38 +02:00
echo $form -> textwithtooltip ( $text , $description , 3 , '' , '' , $i , 0 ,( ! empty ( $line -> fk_parent_line ) ? img_picto ( '' , 'rightarrow' ) : '' ));
2012-08-25 15:21:34 +02:00
2013-03-22 17:10:17 +01:00
// Show range
echo get_date_range ( $line -> date_start , $line -> date_end );
2012-08-25 15:21:34 +02:00
2013-03-22 17:10:17 +01:00
// Add description in form
if ( ! empty ( $conf -> global -> PRODUIT_DESC_IN_FORM ))
{
print ( ! empty ( $line -> description ) && $line -> description != $line -> product_label ) ? '<br>' . dol_htmlentitiesbr ( $line -> description ) : '' ;
}
2012-08-22 17:42:40 +02:00
2013-03-22 17:10:17 +01:00
} else {
2012-08-25 15:21:34 +02:00
2013-03-22 17:10:17 +01:00
if ( $type == 1 ) $text = img_object ( $langs -> trans ( 'Service' ), 'service' );
else $text = img_object ( $langs -> trans ( 'Product' ), 'product' );
2012-08-25 15:21:34 +02:00
2013-03-22 17:10:17 +01:00
if ( ! empty ( $line -> label )) {
$text .= ' <strong>' . $line -> label . '</strong>' ;
2013-10-12 11:58:38 +02:00
echo $form -> textwithtooltip ( $text , dol_htmlentitiesbr ( $line -> description ), 3 , '' , '' , $i , 0 ,( ! empty ( $line -> fk_parent_line ) ? img_picto ( '' , 'rightarrow' ) : '' ));
2013-03-22 17:10:17 +01:00
} else {
2013-10-12 11:58:38 +02:00
if ( ! empty ( $line -> fk_parent_line )) echo img_picto ( '' , 'rightarrow' );
2013-03-22 17:10:17 +01:00
echo $text . ' ' . dol_htmlentitiesbr ( $line -> description );
2012-08-23 13:45:51 +02:00
}
2013-03-22 17:10:17 +01:00
// Show range
echo get_date_range ( $line -> date_start , $line -> date_end );
2011-11-16 18:58:11 +01:00
}
2013-03-22 17:10:17 +01:00
}
?>
2010-09-08 18:09:59 +02:00
</ td >
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
2010-09-18 16:44:57 +02:00
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo price($line->subprice); ?></td>
2010-09-08 18:09:59 +02:00
2012-08-27 19:11:44 +02:00
< ? php if ( $conf -> global -> MAIN_FEATURES_LEVEL > 1 ) { ?>
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> </td>
2012-08-27 19:11:44 +02:00
< ? php } ?>
2012-08-22 17:42:40 +02:00
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?>
2012-10-04 16:26:33 +02:00
< ? php if ((( $line -> info_bits & 2 ) != 2 ) && $line -> special_code != 3 ) {
2012-10-06 23:13:46 +02:00
// I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
2012-10-04 16:26:33 +02:00
echo $line -> qty ;
} else echo ' ' ; ?>
2010-09-08 18:09:59 +02:00
</ td >
2010-09-18 16:44:57 +02:00
2010-09-08 18:09:59 +02:00
< ? php if ( ! empty ( $line -> remise_percent ) && $line -> special_code != 3 ) { ?>
2013-06-10 16:05:41 +02:00
< td align = " right " >< ? php $coldisplay ++ ; ?> <?php echo dol_print_reduction($line->remise_percent,$langs); ?></td>
2010-09-08 18:09:59 +02:00
< ? php } else { ?>
2013-06-10 16:05:41 +02:00
< td >< ? php $coldisplay ++ ; ?> </td>
2012-08-22 17:42:40 +02:00
< ? php }
2012-07-18 15:52:15 +02:00
2013-05-17 15:02:27 +02:00
if ( ! empty ( $conf -> margin -> enabled ) && empty ( $user -> societe_id )) {
2013-10-30 18:17:37 +01:00
$rounding = min ( $conf -> global -> MAIN_MAX_DECIMALS_UNIT , $conf -> global -> MAIN_MAX_DECIMALS_TOT );
2012-07-18 15:52:15 +02:00
?>
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo price($line->pa_ht); ?></td>
2013-08-20 12:11:19 +02:00
< ? php if ( ! empty ( $conf -> global -> DISPLAY_MARGIN_RATES ) && $user -> rights -> margins -> liretous ) { ?>
2013-11-01 17:58:38 +01:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
2012-08-22 17:42:40 +02:00
< ? php
2013-04-16 01:13:20 +02:00
}
2013-08-20 12:11:19 +02:00
if ( ! empty ( $conf -> global -> DISPLAY_MARK_RATES ) && $user -> rights -> margins -> liretous ) { ?>
2013-11-01 17:58:38 +01:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
2012-07-18 15:52:15 +02:00
< ? php } } ?>
2010-09-18 16:44:57 +02:00
2010-09-08 18:09:59 +02:00
< ? php if ( $line -> special_code == 3 ) { ?>
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo $langs->trans('Option'); ?></td>
2010-09-08 18:09:59 +02:00
< ? php } else { ?>
2013-06-10 16:05:41 +02:00
< td align = " right " class = " nowrap " >< ? php $coldisplay ++ ; ?> <?php echo price($line->total_ht); ?></td>
2010-09-08 18:09:59 +02:00
< ? php } ?>
< ? php if ( $this -> statut == 0 && $user -> rights -> $element -> creer ) { ?>
2013-06-10 16:05:41 +02:00
< td align = " center " >< ? php $coldisplay ++ ; ?>
2010-09-08 18:09:59 +02:00
< ? php if (( $line -> info_bits & 2 ) == 2 ) { ?>
< ? php } else { ?>
< a href = " <?php echo $_SERVER["PHP_SELF"] .'?id='. $this->id .'&action=editline&lineid='. $line->id .'#'. $line->id ; ?> " >
< ? php echo img_edit (); ?>
</ a >
< ? php } ?>
</ td >
2010-09-18 16:44:57 +02:00
2013-06-10 16:05:41 +02:00
< td align = " center " >< ? php $coldisplay ++ ; ?>
2010-09-08 18:09:59 +02:00
< a href = " <?php echo $_SERVER["PHP_SELF"] .'?id='. $this->id .'&action=ask_deleteline&lineid='. $line->id ; ?> " >
< ? php echo img_delete (); ?>
</ a >
</ td >
2010-09-18 16:44:57 +02:00
2013-04-16 01:13:20 +02:00
< ? php if ( $num > 1 && empty ( $conf -> browser -> phone )) { ?>
2013-06-10 16:05:41 +02:00
< td align = " center " class = " tdlineupdown " >< ? php $coldisplay ++ ; ?>
2010-09-08 18:09:59 +02:00
< ? php if ( $i > 0 ) { ?>
2010-09-18 17:00:40 +02:00
< a class = " lineupdown " href = " <?php echo $_SERVER["PHP_SELF"] .'?id='. $this->id .'&action=up&rowid='. $line->id ; ?> " >
2010-09-08 18:09:59 +02:00
< ? php echo img_up (); ?>
</ a >
< ? php } ?>
< ? php if ( $i < $num - 1 ) { ?>
2010-09-18 17:00:40 +02:00
< a class = " lineupdown " href = " <?php echo $_SERVER["PHP_SELF"] .'?id='. $this->id .'&action=down&rowid='. $line->id ; ?> " >
2010-09-08 18:09:59 +02:00
< ? php echo img_down (); ?>
</ a >
< ? php } ?>
</ td >
2010-10-02 22:47:55 +02:00
< ? php } else { ?>
2013-06-10 16:05:41 +02:00
< td align = " center " < ? php echo ( empty ( $conf -> browser -> phone ) ? ' class="tdlineupdown"' : '' ); ?> ><?php $coldisplay++; ?></td>
2010-09-08 18:09:59 +02:00
< ? php } ?>
< ? php } else { ?>
2013-06-10 16:05:41 +02:00
< td colspan = " 3 " >< ? php $coldisplay = $coldisplay + 3 ; ?> </td>
2010-09-08 18:09:59 +02:00
< ? php } ?>
2013-06-10 16:05:41 +02:00
< ? php
//Line extrafield
if ( ! empty ( $extrafieldsline )) {
print $line -> showOptionals ( $extrafieldsline , 'view' , array ( 'style' => $bcdd [ $var ], 'colspan' => $coldisplay ));
}
?>
2010-09-08 18:09:59 +02:00
</ tr >
2012-08-23 13:45:51 +02:00
<!-- END PHP TEMPLATE objectline_view . tpl . php -->