From 24a6321d45e9af6210b51aa9081f4825e76c4e45 Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 15 Apr 2013 15:55:10 +0200 Subject: [PATCH] Fix : Add service date limit transfert from propal to order --- htdocs/commande/class/commande.class.php | 3 +++ htdocs/commande/fiche.php | 4 ++-- htdocs/core/class/commonobject.class.php | 29 +++++++++++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b6e11a64065..4612d378908 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -933,6 +933,9 @@ class Commande extends CommonOrder $line->rang = $object->lines[$i]->rang; $line->special_code = $object->lines[$i]->special_code; $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + + $line->date_start = $object->lines[$i]->date_start; + $line->date_end = $object->lines[$i]->date_end; $line->fk_fournprice = $object->lines[$i]->fk_fournprice; $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 150a55923dd..350051705d2 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -329,8 +329,8 @@ else if ($action == 'add' && $user->rights->commande->creer) $lines[$i]->fk_remise_except, 'HT', 0, - $datestart, - $dateend, + $date_start, + $date_end, $product_type, $lines[$i]->rang, $lines[$i]->special_code, diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 124447bb81c..8d2d4a4f5d6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2930,11 +2930,24 @@ abstract class CommonObject global $conf,$langs,$bc; //var_dump($line); - - $date_start=$line->date_debut_prevue; - if ($line->date_debut_reel) $date_start=$line->date_debut_reel; - $date_end=$line->date_fin_prevue; - if ($line->date_fin_reel) $date_end=$line->date_fin_reel; + if (!empty($line->date_start)) + { + $date_start=$line->date_start; + } + else + { + $date_start=$line->date_debut_prevue; + if ($line->date_debut_reel) $date_start=$line->date_debut_reel; + } + if (!empty($line->date_end)) + { + $date_end=$line->date_end; + } + else + { + $date_end=$line->date_fin_prevue; + if ($line->date_fin_reel) $date_end=$line->date_fin_reel; + } $this->tpl['label'] = ''; if (! empty($line->fk_parent_line)) $this->tpl['label'].= img_picto('', 'rightarrow'); @@ -2962,7 +2975,11 @@ abstract class CommonObject else { $this->tpl['label'].= ($line->product_type == -1 ? ' ' : ($line->product_type == 1 ? img_object($langs->trans(''),'service') : img_object($langs->trans(''),'product'))); - $this->tpl['label'].= ($line->label ? ' '.$line->label : ''); + if (!empty($line->desc)) { + $this->tpl['label'].=$line->desc; + }else { + $this->tpl['label'].= ($line->label ? ' '.$line->label : ''); + } // Dates if ($line->product_type == 1 && ($date_start || $date_end)) {