From 995c7f13d30972a6a0650317adfefe26d3c9c1b5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Aug 2012 13:45:51 +0200 Subject: [PATCH] New: [ task #498 ] part3 --- htdocs/comm/propal.php | 9 +- htdocs/comm/propal/class/propal.class.php | 4 +- htdocs/commande/class/commande.class.php | 4 +- htdocs/commande/fiche.php | 102 +++---- htdocs/compta/facture.php | 20 +- htdocs/compta/facture/class/facture.class.php | 4 +- htdocs/core/ajax/price.php | 9 +- htdocs/core/class/commonobject.class.php | 135 ++++----- htdocs/core/js/lib_head.js | 2 +- htdocs/core/tpl/freeproductline_edit.tpl.php | 101 ------- ..._create.tpl.php => objectline_add.tpl.php} | 26 +- htdocs/core/tpl/objectline_edit.tpl.php | 260 ++++++++++++++++++ ...e_view.tpl.php => objectline_view.tpl.php} | 46 +++- .../tpl/predefinedproductline_create.tpl.php | 183 ------------ .../tpl/predefinedproductline_edit.tpl.php | 164 ----------- .../tpl/predefinedproductline_view.tpl.php | 112 -------- 16 files changed, 444 insertions(+), 737 deletions(-) delete mode 100644 htdocs/core/tpl/freeproductline_edit.tpl.php rename htdocs/core/tpl/{freeproductline_create.tpl.php => objectline_add.tpl.php} (94%) create mode 100644 htdocs/core/tpl/objectline_edit.tpl.php rename htdocs/core/tpl/{freeproductline_view.tpl.php => objectline_view.tpl.php} (76%) delete mode 100644 htdocs/core/tpl/predefinedproductline_create.tpl.php delete mode 100644 htdocs/core/tpl/predefinedproductline_edit.tpl.php delete mode 100644 htdocs/core/tpl/predefinedproductline_view.tpl.php diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index b74810e2614..4fb76387e61 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1569,7 +1569,7 @@ if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) * Lines */ -if ($conf->use_javascript_ajax && $object->statut == 0) +if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } @@ -1578,7 +1578,8 @@ print ''; // Show object lines $result = $object->getLinesArray(); -if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid,0,$hookmanager); +if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,0,$hookmanager); // Form to add new line if ($object->statut == 0 && $user->rights->propale->creer) @@ -1588,10 +1589,10 @@ if ($object->statut == 0 && $user->rights->propale->creer) $var=true; // Add free or predefined products/services - $object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager); + $object->formAddObjectLine(0,$mysoc,$soc,$hookmanager); $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObject',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b4943a9068f..4cace6ae58c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2764,9 +2764,7 @@ class PropaleLigne // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."propaldet SET"; $sql.= " description='".$this->db->escape($this->desc)."'"; - if (! empty($this->label)) { - $sql.= " , label='".$this->db->escape($this->label)."'"; - } + $sql.= " , label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= " , tva_tx='".price2num($this->tva_tx)."'"; $sql.= " , localtax1_tx=".price2num($this->localtax1_tx); $sql.= " , localtax2_tx=".price2num($this->localtax2_tx); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d209bb4aacd..877fd376942 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3126,9 +3126,7 @@ class OrderLine // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."commandedet SET"; $sql.= " description='".$this->db->escape($this->desc)."'"; - if (empty($this->label)) { - $sql.= " , label='".$this->db->escape($this->label)."'"; - } + $sql.= " , label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= " , tva_tx=".price2num($this->tva_tx); $sql.= " , localtax1_tx=".price2num($this->localtax1_tx); $sql.= " , localtax2_tx=".price2num($this->localtax2_tx); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 3ce4092de33..b06a05b5ac4 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -552,9 +552,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) if (! $error && (GETPOST('qty') >= 0) && (GETPOST('product_desc') || ! empty($idprod))) { // Clean parameters - $suffixe = (! empty($idprod) ? '_predef' : ''); - $date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$suffixe.'month'), GETPOST('date_start'.$suffixe.'day'), GETPOST('date_start'.$suffixe.'year')); - $date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$suffixe.'month'), GETPOST('date_end'.$suffixe.'day'), GETPOST('date_end'.$suffixe.'year')); + $date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $price_base_type = 'HT'; // Ecrase $pu par celui du produit @@ -754,10 +753,10 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' // Clean parameters $date_start=''; $date_end=''; - $date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$suffixe.'month'), GETPOST('date_start'.$suffixe.'day'), GETPOST('date_start'.$suffixe.'year')); - $date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$suffixe.'month'), GETPOST('date_end'.$suffixe.'day'), GETPOST('date_end'.$suffixe.'year')); - $description=dol_htmlcleanlastbr(GETPOST('desc')); - $up_ht=GETPOST('pu')?GETPOST('pu'):GETPOST('subprice'); + $date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + $description=dol_htmlcleanlastbr(GETPOST('product_desc')); + $pu_ht=GETPOST('price_ht'); // Define info_bits $info_bits=0; @@ -769,37 +768,37 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $localtax1_rate=get_localtax($vat_rate,1,$object->client); $localtax2_rate=get_localtax($vat_rate,2,$object->client); - - // ajout prix d'achat - $fk_fournprice = GETPOST('fournprice'); - if (GETPOST('buying_price')) - $pa_ht = GETPOST('buying_price'); - else - $pa_ht = null; + // Add buying price + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); // Check minimum price - if (GETPOST('productid')) + if (GETPOST('productid', 'int')) { - $productid = GETPOST('productid'); + $productid = GETPOST('productid', 'int'); $product = new Product($db); $product->fetch($productid); $type=$product->type; $price_min = $product->price_min; - if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level]; + if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) + $price_min = $product->multiprices_min[$object->client->price_level]; + + $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); if ($price_min && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { - $mesg = '
'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'
' ; + setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).getCurrencySymbol($conf->currency), 'errors'); $error++; } } else { - $type=GETPOST('type'); + $type = GETPOST('type'); + $label = (GETPOST('product_label') ? GETPOST('product_label'):''); // Check parameters if (GETPOST('type') < 0) { - $mesg = '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type"))); $error++; } } @@ -809,7 +808,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $result = $object->updateline( GETPOST('lineid'), $description, - $up_ht, + $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, @@ -822,38 +821,46 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $type, GETPOST('fk_parent_line'), 0, - $fk_fournprice, - $pa_ht + $fournprice, + $buyingprice, + $label ); if ($result >= 0) { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $ret=$object->fetch($object->id); // Reload to get new records + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $ret=$object->fetch($object->id); // Reload to get new records commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['np_price']); - unset($_POST['dp_desc']); - unset($_POST['np_tva_tx']); - unset($_POST['np_buying_price']); } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); } else { - dol_print_error($db,$object->error); - exit; + setEventMessage($object->error, 'errors'); } } } @@ -2114,7 +2121,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $numlines = count($object->lines); - if ($conf->use_javascript_ajax && $object->statut == 0) + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } @@ -2122,7 +2129,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print '
'; // Show object lines - if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid,1,$hookmanager); + if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1,$hookmanager); /* * Form to add new line @@ -2133,10 +2141,10 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G { $var=true; - $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); + $object->formAddObjectLine(1,$mysoc,$soc,$hookmanager); $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObject',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook } } print '
'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b24cdfa6dee..c49f9bce532 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -982,9 +982,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $ret=$object->fetch_thirdparty(); // Clean parameters - $suffixe = (! empty($idprod) ? '_predef' : ''); - $date_start=dol_mktime(GETPOST('date_start'.$suffixe.'hour'), GETPOST('date_start'.$suffixe.'min'), GETPOST('date_start'.$suffixe.'sec'), GETPOST('date_start'.$suffixe.'month'), GETPOST('date_start'.$suffixe.'day'), GETPOST('date_start'.$suffixe.'year')); - $date_end=dol_mktime(GETPOST('date_end'.$suffixe.'hour'), GETPOST('date_end'.$suffixe.'min'), GETPOST('date_end'.$suffixe.'sec'), GETPOST('date_end'.$suffixe.'month'), GETPOST('date_end'.$suffixe.'day'), GETPOST('date_end'.$suffixe.'year')); + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $price_base_type = 'HT'; // Ecrase $pu par celui du produit @@ -1112,7 +1111,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min))) + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').getCurrencySymbol($conf->currency)); setEventMessage($mesg, 'errors'); @@ -1197,8 +1196,8 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa // Clean parameters $date_start=''; $date_end=''; - $date_start=dol_mktime($_POST['date_start'.$suffixe.'hour'],$_POST['date_start'.$suffixe.'min'],$_POST['date_start'.$suffixe.'sec'],$_POST['date_start'.$suffixe.'month'],$_POST['date_start'.$suffixe.'day'],$_POST['date_start'.$suffixe.'year']); - $date_end=dol_mktime($_POST['date_end'.$suffixe.'hour'],$_POST['date_end'.$suffixe.'min'],$_POST['date_end'.$suffixe.'sec'],$_POST['date_end'.$suffixe.'month'],$_POST['date_end'.$suffixe.'day'],$_POST['date_end'.$suffixe.'year']); + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description=dol_htmlcleanlastbr($_POST['desc']); $up_ht=GETPOST('pu')?GETPOST('pu'):GETPOST('subprice'); @@ -2970,7 +2969,7 @@ else if ($id > 0 || ! empty($ref)) */ $result = $object->getLinesArray(); - if ($conf->use_javascript_ajax && $object->statut == 0) + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } @@ -2978,7 +2977,8 @@ else if ($id > 0 || ! empty($ref)) print ''; // Show object lines - if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid,1,$hookmanager); + if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid,1,$hookmanager); /* * Form to add new line @@ -2987,10 +2987,10 @@ else if ($id > 0 || ! empty($ref)) { $var=true; - $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); + $object->formAddObjectLine(1,$mysoc,$soc,$hookmanager); $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObject',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook } print "
\n"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index baf9ee69db4..0ff49cd8f7e 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3420,9 +3420,7 @@ class FactureLigne // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; $sql.= " description='".$this->db->escape($this->desc)."'"; - if (! empty($this->label)) { - $sql.= " , label='".$this->db->escape($this->label)."'"; - } + $sql.= ",label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= ",subprice=".price2num($this->subprice).""; $sql.= ",remise_percent=".price2num($this->remise_percent).""; if ($this->fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except; diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index 55ad60dec95..ba6ebe615e5 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -43,22 +43,23 @@ top_httphead(); //print ''."\n"; // Load original field value -if (! empty($action) && (isset($pu_ht) || isset($pu_ttc)) && isset($tva_tx)) +if (! empty($action) && isset($tva_tx)) { $return=array(); + $price=''; - if ($action == 'get_ttc') { + if ($action == 'get_ttc' && isset($pu_ht) && $pu_ht != '') { $price = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } - else if ($action == 'get_ht') { + else if ($action == 'get_ht' && isset($pu_ttc) && $pu_ttc != '') { $price = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); } - $return['price'] = price($price); + $return['price'] = (isset($price) && $price != '' ? price($price) : ''); echo json_encode($return); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7f5e36e860a..70da921121b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2446,43 +2446,17 @@ abstract class CommonObject /** - * Show add predefined products/services form + * Show add free and predefined products/services form * TODO Edit templates to use global variables and include them directly in controller call * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. * - * @param int $dateSelector 1=Show also date range input fields - * @param Societe $seller Object thirdparty who sell - * @param Societe $buyer Object thirdparty who buy - * @param HookManager $hookmanager Hook manager instance - * @return void - */ - function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false) - { - global $conf,$langs,$object; - global $form,$bcnd,$var; - - // Output template part (modules that overwrite templates must declare this into descriptor) - // Use global variables + $dateSelector + $seller and $buyer - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/predefinedproductline_create.tpl.php'); - if ($res) break; - } - } - - /** - * Show add free products/services form - * TODO Edit templates to use global variables and include them directly in controller call - * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects. - * * @param int $dateSelector 1=Show also date range input fields * @param Societe $seller Object thirdparty who sell * @param Societe $buyer Object thirdparty who buy * @param HookManager $hookmanager Hook manager instance * @return void */ - function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false) + function formAddObjectLine($dateSelector,$seller,$buyer,$hookmanager=false) { global $conf,$user,$langs,$object; global $form,$bcnd,$var; @@ -2492,11 +2466,11 @@ abstract class CommonObject $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); foreach($dirtpls as $reldir) { - // for view errors - if ($conf->file->strict_mode) { - $res=include dol_buildpath($reldir.'/freeproductline_create.tpl.php'); + $tpl = dol_buildpath($reldir.'/objectline_add.tpl.php'); + if (empty($conf->file->strict_mode)) { + $res=@include $tpl; } else { - $res=@include dol_buildpath($reldir.'/freeproductline_create.tpl.php'); + $res=include $tpl; // for debug } if ($res) break; } @@ -2580,8 +2554,6 @@ abstract class CommonObject /** * Return HTML content of a detail line * TODO Move this into an output class file (htmlline.class.php) - * If lines are into a template, title must also be into a template - * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. * * @param string $action GET/POST action * @param array $line Selected object line to output @@ -2601,13 +2573,23 @@ abstract class CommonObject global $form,$bc,$bcdd; $element=$this->element; + $text=''; // Show product and description - $type=$line->product_type?$line->product_type:$line->fk_product_type; - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($line->date_start)) $type=1; - if (! empty($line->date_end)) $type=1; + $type=(! empty($line->product_type)?$line->product_type:$line->fk_product_type); + // Try to enhance type detection using date_start and date_end for free lines where type was not saved. + if (! empty($line->date_start)) $type=1; // deprecated + if (! empty($line->date_end)) $type=1; // deprecated + + if ($line->fk_product > 0) + { + $product_static = new Product($this->db); + + $product_static->type=$line->fk_product_type; + $product_static->id=$line->fk_product; + $product_static->ref=$line->ref; + $text=$product_static->getNomUrl(1); + } // Ligne en mode visu if ($action != 'editline' || $selected != $line->id) @@ -2615,13 +2597,11 @@ abstract class CommonObject // Produit if ($line->fk_product > 0) { - $product_static = new Product($this->db); - // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $this->fetch_thirdparty(); - $prod = new Product($this->db, $line->fk_product); + $prod = new Product($this->db); $outputlangs = $langs; $newlang=''; @@ -2640,59 +2620,46 @@ abstract class CommonObject $label = $line->product_label; } - $product_static->type=$line->fk_product_type; - $product_static->id=$line->fk_product; - $product_static->ref=$line->ref; - $text=$product_static->getNomUrl(1); $text.= ' - '.(! empty($line->label)?$line->label:$label); $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description)); - - // Output template part (modules that overwrite templates must declare this into descriptor) - // Use global variables + $dateSelector + $seller and $buyer - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/predefinedproductline_view.tpl.php'); - if ($res) break; - } } - else + + // Output template part (modules that overwrite templates must declare this into descriptor) + // Use global variables + $dateSelector + $seller and $buyer + $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); + foreach($dirtpls as $reldir) { - // Output template part (modules that overwrite templates must declare this into descriptor) - // Use global variables + $dateSelector + $seller and $buyer - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/freeproductline_view.tpl.php'); - if ($res) break; - } + $tpl = dol_buildpath($reldir.'/objectline_view.tpl.php'); + if (empty($conf->file->strict_mode)) { + $res=@include $tpl; + } else { + $res=include $tpl; // for debug + } + if ($res) break; } } // Ligne en mode update if ($this->statut == 0 && $action == 'editline' && $selected == $line->id) { - if ($line->fk_product > 0) + $label = (! empty($line->label) ? $line->label : (($line->fk_product > 0) ? $line->product_label : '')); + if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("Label").'"'; + else $placeholder=' title="'.$langs->trans("Label").'"'; + + $pu_ttc = price2num($line->subprice * (1 + ($line->tva_tx/100)), 'MU'); + + // Output template part (modules that overwrite templates must declare this into descriptor) + // Use global variables + $dateSelector + $seller and $buyer + $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); + foreach($dirtpls as $reldir) { - // Output template part (modules that overwrite templates must declare this into descriptor) - // Use global variables + $dateSelector + $seller and $buyer - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/predefinedproductline_edit.tpl.php'); - if ($res) break; - } - } - else - { - // Output template part (modules that overwrite templates must declare this into descriptor) - // Use global variables + $dateSelector + $seller and $buyer - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/freeproductline_edit.tpl.php'); - if ($res) break; - } + $tpl = dol_buildpath($reldir.'/objectline_edit.tpl.php'); + if (empty($conf->file->strict_mode)) { + $res=@include $tpl; + } else { + $res=include $tpl; // for debug + } + if ($res) break; } } } diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index dec139510a7..fc408e246e2 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -739,7 +739,7 @@ function hideMessage(fieldId,message) { $.widget("ui.onDelayedKeyup", { _init : function() { var self = this; - $(this.element).keyup(function() { + $(this.element).bind('change keyup input', function() { if(typeof(window['inputTimeout']) != "undefined"){ window.clearTimeout(inputTimeout); } diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php deleted file mode 100644 index 6a5e6e7ef30..00000000000 --- a/htdocs/core/tpl/freeproductline_edit.tpl.php +++ /dev/null @@ -1,101 +0,0 @@ - - * Copyright (C) 2010-2012 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel - * - * 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 2 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: - * $conf - * $langs - * $dateSelector - * $this (invoice, order, ...) - * $line defined - */ -?> - - -
id; ?>" method="POST"> - - - - - - -> - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> -
- - $line,'fk_parent_line'=>$line->fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); - $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); - } - - // editeur wysiwyg - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); - $doleditor->Create(); - ?> - - - load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?> - - - - - info_bits & 2) != 2) { ?> - - -   - - - - - info_bits & 2) != 2) { ?> - % - -   - - - -margin->enabled)) { -?> - - - "> -
"> - - -service->enabled && $dateSelector && $line->product_type == 1) { ?> -> - trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> - select_date($line->date_start,'date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_start?0:1,"updateligne"); - echo ' '.$langs->trans('to').' '; - echo $form->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne"); - ?> - - - - - - diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/objectline_add.tpl.php similarity index 94% rename from htdocs/core/tpl/freeproductline_create.tpl.php rename to htdocs/core/tpl/objectline_add.tpl.php index 5015205f631..a7d5e582fa0 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/objectline_add.tpl.php @@ -235,10 +235,14 @@ $(document).ready(function() { $('#add_service_text').show(); $('#service_duration_area').show(); } - //$('#add_product_area').show(); - $('#addlinebutton').removeAttr('disabled'); + //$('#add_product_area').show(); // TODO for add product card + if (($('#price_ht').val().length > 0) || ($('#price_ttc').val().length > 0)) { + $('#addlinebutton').removeAttr('disabled'); + } else { + $('#addlinebutton').attr('disabled','disabled'); + } } else { - //$('#add_product_area').hide(); + //$('#add_product_area').hide(); // TODO for add product card $('#add_product_checkbox').removeAttr('checked'); $('#addlinebutton').attr('disabled','disabled'); $('#service_duration_area').hide(); @@ -348,6 +352,14 @@ $(document).ready(function() { function(data) { if (data && data.price.length > 0) { $('#price_ttc').val(data.price); + if ($('#select_type').val() >= 0) { + $('#addlinebutton').removeAttr('disabled'); + } else { + $('#addlinebutton').attr('disabled','disabled'); + } + } else { + $('#price_ttc').val(''); + $('#addlinebutton').attr('disabled','disabled'); } }, 'json'); } @@ -362,6 +374,14 @@ $(document).ready(function() { function(data) { if (data && data.price.length > 0) { $('#price_ht').val(data.price); + if ($('#select_type').val() >= 0) { + $('#addlinebutton').removeAttr('disabled'); + } else { + $('#addlinebutton').attr('disabled','disabled'); + } + } else { + $('#price_ht').val(''); + $('#addlinebutton').attr('disabled','disabled'); } }, 'json'); } diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php new file mode 100644 index 00000000000..4238ac8d09a --- /dev/null +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -0,0 +1,260 @@ + + * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * + * 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 2 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: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined + */ +?> + + +
id; ?>" method="POST"> + + + + + + + +> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> +
+ + fk_product > 0) { ?> + + + select_type_of_lines($line->product_type, 'type', 1, 1); ?> + + + fk_product) && empty($line->label)) ? ' disabled="disabled"' : ''); ?>> + + textwithtooltip($langs->trans('UpdateOriginalProductLabel'), $langs->trans('HelpUpdateOriginalProductLabel'),1,0,'','',3); ?> + + +
+ + fk_parent_line); + $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); + $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); + } + + // editeur wysiwyg + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('product_desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?> + + + + + + info_bits & 2) != 2) { ?> + + +   + + + + + info_bits & 2) != 2) { ?> + % + +   + + + + margin->enabled)) { ?> + + + + + + + + ">
+ "> + + + +service->enabled && $dateSelector) { ?> +> + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> + select_date($line->date_start,'date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_start?0:1,"updateligne"); + echo ' '.$langs->trans('to').' '; + echo $form->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne"); + ?> + + + + + + + + diff --git a/htdocs/core/tpl/freeproductline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php similarity index 76% rename from htdocs/core/tpl/freeproductline_view.tpl.php rename to htdocs/core/tpl/objectline_view.tpl.php index 45ebf30fa0b..6d50b776c7f 100644 --- a/htdocs/core/tpl/freeproductline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -1,7 +1,7 @@ - * Copyright (C) 2010-2011 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel * * 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 @@ -19,7 +19,7 @@ */ ?> - + > global->MAIN_VIEW_LINE_NUMBER)) { ?> @@ -60,19 +60,35 @@ } else { - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); - if ($type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); + if ($line->fk_product > 0) { + + echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); + + // Show range + print_date_range($line->date_start, $line->date_end); + + // Add description in form + if ($conf->global->PRODUIT_DESC_IN_FORM) + { + print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; + } - if (! empty($line->label)) { - $text.= ' '.$line->label.''; - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); } else { - echo $text.' '.dol_htmlentitiesbr($line->description); - } - // Show range - print_date_range($line->date_start,$line->date_end); + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); + 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,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); + } else { + echo $text.' '.dol_htmlentitiesbr($line->description); + } + + // Show range + print_date_range($line->date_start,$line->date_end); + } } ?> @@ -148,4 +164,4 @@ - + diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php deleted file mode 100644 index 3450b4134a9..00000000000 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ /dev/null @@ -1,183 +0,0 @@ - - * Copyright (C) 2010-2011 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel - * - * 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 2 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: - * $conf - * $langs - * $dateSelector - * $this (invoice, order, ...) - * $line defined - */ -?> - - - - - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="3"' : ' colspan="2"'); ?>> - trans("AddNewLine").' - '; - if ($conf->service->enabled) - echo $langs->trans('RecordedProductsAndServices'); - else - echo $langs->trans('RecordedProducts'); - ?> - - trans('PriceUHT'); ?> - trans('PriceUTTC'); ?> - trans('Qty'); ?> - trans('ReductionShort'); ?> -margin->enabled)) { -?> - trans('BuyingPrice'); ?> -global->DISPLAY_MARGIN_RATES) - $colspan++; - if($conf->global->DISPLAY_MARK_RATES) - $colspan++; -} -?> -   - - -
" /> - - - - - -> - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="3"' : ' colspan="2"'); ?>> - array( - 'dp_price_ht' => 'price_ht', - 'dp_price_ttc' => 'price_ttc' - ) - ); - $form->select_produits('', 'idprod', '', $conf->product->limit_size, $buyer->price_level, 1, 2, '', 0, $ajaxoptions); - - if (is_object($hookmanager)) - { - $parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]); - $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); - } - - // Editor wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); - $doleditor->Create(); - ?> - - "> - "> - - % -margin->enabled)) { -?> - - - "> - -global->DISPLAY_MARGIN_RATES) - $colspan++; - if($conf->global->DISPLAY_MARK_RATES) - $colspan++; -} -?> - " name="addline"> - - -service->enabled) && $dateSelector) { -if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) - $colspan = 10; -else - $colspan = 9; -if (! empty($conf->margin->enabled)) { - if($conf->global->DISPLAY_MARGIN_RATES) - $colspan++; - if($conf->global->DISPLAY_MARK_RATES) - $colspan++; -} -?> -> - - trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - echo $form->select_date('','date_start_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); - echo ' '.$langs->trans('to').' '; - echo $form->select_date('','date_end_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); - ?> - - - - - -margin->enabled)) { -?> - - - diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php deleted file mode 100644 index 4c9cd208eee..00000000000 --- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php +++ /dev/null @@ -1,164 +0,0 @@ - - * Copyright (C) 2010-2011 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel - * - * 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 2 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: - * $conf - * $langs - * $dateSelector - * $this (invoice, order, ...) - * $line defined - */ -?> - - -
id; ?>" method="POST"> - - - - - -> - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> -
- - - product_type==1) echo img_object($langs->trans('ShowService'),'service'); - else print img_object($langs->trans('ShowProduct'),'product'); - echo ' '.$line->ref; - ?> - - product_label); - echo '
'; - - if (is_object($hookmanager)) - { - $fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line); - $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); - $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); - } - - // editeur wysiwyg - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); - $doleditor->Create(); - ?> - - - load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?> - - - - - - - info_bits & 2) != 2) { ?> - -   - - - - info_bits & 2) != 2) { ?> - % - -   - - -margin->enabled)) { -?> - - - - - - - - ">
- "> - - - -service->enabled && $dateSelector && $line->product_type == 1) { ?> -> - trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> - select_date($line->date_start,'date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_start?0:1,"updateligne"); - echo ' '.$langs->trans('to').' '; - echo $form->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne"); - ?> - - - -margin->enabled)) { -?> - - - diff --git a/htdocs/core/tpl/predefinedproductline_view.tpl.php b/htdocs/core/tpl/predefinedproductline_view.tpl.php deleted file mode 100644 index e7773c48da3..00000000000 --- a/htdocs/core/tpl/predefinedproductline_view.tpl.php +++ /dev/null @@ -1,112 +0,0 @@ - - * Copyright (C) 2010-2011 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel - * - * 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 2 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 . - * - */ -?> - - -> - global->MAIN_VIEW_LINE_NUMBER)) { ?> - - -
- textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); - - // Show range - print_date_range($line->date_start, $line->date_end); - - // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) - { - print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; - } - ?> - - - tva_tx,'%',$line->info_bits); ?> - - subprice); ?> - -   - - - info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty; - else echo ' '; ?> - - - remise_percent) && $line->special_code != 3) { ?> - remise_percent,$langs); ?> - -   - margin->enabled)) { ?> - pa_ht); ?> - global->DISPLAY_MARGIN_RATES) {?> - pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> - global->DISPLAY_MARK_RATES) { ?> - marque_tx).'%'; ?> - - - special_code == 3) { ?> - trans('Option'); ?> - - total_ht); ?> - - - statut == 0 && $user->rights->$element->creer) { ?> - - info_bits & 2) == 2) { ?> - - id.'#'.$line->id; ?>"> - - - - - - - id; ?>"> - - - - - 1) { ?> - - 0) { ?> - id; ?>"> - - - - - id; ?>"> - - - - - -   - - -   - - - -