* Copyright (C) 2010-2011 Laurent Destailleur * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry * * 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 * the Free Software Foundation; either version 3 of the License, or * (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 * along with this program. If not, see . * * Need to have following variables defined: * $object (invoice, order, ...) * $conf * $langs * $dateSelector * $forceall (0 by default, 1 for supplier invoices/orders) * $element (used to test $user->rights->$element->creer) * $permtoedit (used to replace test $user->rights->$element->creer) * $senderissupplier (0 by default, 1 for supplier invoices/orders) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) * * $type, $text, $description, $line */ global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins; $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal', 'askpricesupplier','commande'))) $usemargins=1; if (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; if (empty($senderissupplier)) $senderissupplier=0; if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; if (empty($usemargins)) $usemargins=0; ?> > global->MAIN_VIEW_LINE_NUMBER)) { ?>
info_bits & 2) == 2) { ?> trans("ShowReduc"),'reduc').' '; if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); //else $txt=$langs->trans("Discount"); print $txt; ?> description) { 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); } } } else { if ($line->fk_product > 0) { echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); // Show range echo get_date_range($line->date_start, $line->date_end); // Add description in form if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; } } else { if ($type==1) $text = img_object($langs->trans('Service'),'service'); else $text = img_object($langs->trans('Product'),'product'); if (! empty($line->label)) { $text.= ' '.$line->label.''; echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); } else { if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); echo $text.' '.dol_htmlentitiesbr($line->description); } // Show range echo get_date_range($line->date_start,$line->date_end); } } ?> element == 'askpricesupplier') { ?> ref_fourn; ?> tva_tx,'%',$line->info_bits); ?> subprice); ?> pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> info_bits & 2) != 2) && $line->special_code != 3) { // 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;"')." "; echo $line->qty; } else echo ' '; ?> global->PRODUCT_USE_UNITS) { print ''; $label = $line->getLabelOfUnit('short'); if ($label !== '') { print $langs->trans($label); } print ''; } ?> remise_percent) && $line->special_code != 3) { ?> remise_percent,$langs); ?>   situation_cycle_ref) { $coldisplay++; print '' . $line->situation_percent . '%'; } if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> pa_ht); ?> global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?> global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> marque_tx, null, null, null, null, $rounding).'%'; ?> special_code == 3) { ?> trans('Option'); ?> total_ht); ?> statut == 0 && ($object_rights->creer)) { ?> info_bits & 2) == 2) { ?> id.'#line_'.$line->id; ?>"> situation_counter == 1 || !$this->situation_cycle_ref) { print 'id . '">'; print img_delete(); print ''; } ?> 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref)) { ?> 0) { ?> id; ?>"> id; ?>"> browser->phone)?' class="tdlineupdown"':''); ?>> showOptionals($extrafieldsline,'view',array('style'=>$bcdd[$var],'colspan'=>$coldisplay)); } ?>