diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e1beb363b1e..634c83b9836 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1398,13 +1398,13 @@ if ($id > 0 || ! empty($ref)) $var=true; // Add free products/services - $propal->showAddFreeProductForm(); + $propal->showAddFreeProductForm(0,$mysoc,$soc); // Add predefined products/services if ($conf->product->enabled || $conf->service->enabled) { $var=!$var; - $propal->showAddPredefinedProductForm(); + $propal->showAddPredefinedProductForm(0,$mysoc,$soc); } // Hook of thirdparty module diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 976d2e72d6d..574b40ee048 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -58,8 +58,6 @@ $socid=0; if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'commande',$comid,''); -$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE; - $mesg=isset($_GET['mesg'])?$_GET['mesg']:''; $commande = new Commande($db); @@ -1677,13 +1675,13 @@ else { $var=true; - $commande->showAddFreeProductForm(1); + $commande->showAddFreeProductForm(1,$mysoc,$soc); // Add predefined products/services if ($conf->product->enabled || $conf->service->enabled) { $var=!$var; - $commande->showAddPredefinedProductForm(1); + $commande->showAddPredefinedProductForm(1,$mysoc,$soc); } // Hook of thirdparty module diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 29f66257a4c..0ee34dc5845 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1380,18 +1380,18 @@ if ($_GET['action'] == 'create') require_once(DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'); $classname = ucfirst($subelement); - $object = new $classname($db); - $object->fetch($_GET['originid']); - $object->fetch_thirdparty(); + $objectsrc = new $classname($db); + $objectsrc->fetch($_GET['originid']); + $objectsrc->fetch_thirdparty(); - $projectid = (!empty($object->fk_project)?$object->fk_project:''); - $ref_client = (!empty($object->ref_client)?$object->ref_client:''); + $projectid = (!empty($objectsrc->fk_project)?$object->fk_project:''); + $ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:''); - $soc = $object->client; - $cond_reglement_id = (!empty($object->cond_reglement_id)?$object->cond_reglement_id:(!empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); - $mode_reglement_id = (!empty($object->mode_reglement_id)?$object->mode_reglement_id:(!empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); - $remise_percent = (!empty($object->remise_percent)?$object->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); - $remise_absolue = (!empty($object->remise_absolue)?$object->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); + $soc = $objectsrc->client; + $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); + $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); + $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); + $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; } } @@ -1640,9 +1640,9 @@ if ($_GET['action'] == 'create') print ''.$langs->trans('NotePublic').''; print ''; print ''; @@ -1653,52 +1653,51 @@ if ($_GET['action'] == 'create') print ''.$langs->trans('NotePrivate').''; print ''; print ''; } - if (is_object($object)) + if (is_object($objectsrc)) { // TODO for compatibility if ($_GET['origin'] == 'contrat') { // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva - $object->remise_absolue=$remise_absolue; - $object->remise_percent=$remise_percent; - $object->update_price(); + $objectsrc->remise_absolue=$remise_absolue; + $objectsrc->remise_percent=$remise_percent; + $objectsrc->update_price(); } print "\n"; print "\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''; - print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''; + print ''; - print ''.$langs->trans($classname).''.$object->getNomUrl(1).''; - print ''.$langs->trans('TotalHT').''.price($object->total_ht).''; - print ''.$langs->trans('TotalVAT').''.price($object->total_tva).""; + print ''.$langs->trans($classname).''.$objectsrc->getNomUrl(1).''; + print ''.$langs->trans('TotalHT').''.price($objectsrc->total_ht).''; + print ''.$langs->trans('TotalVAT').''.price($objectsrc->total_tva).""; if ($mysoc->pays_code=='ES') { if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { - print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($object->total_localtax1).""; + print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($objectsrc->total_localtax1).""; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { - print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($object->total_localtax2).""; + print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($objectsrc->total_localtax2).""; } } - print ''.$langs->trans('TotalTTC').''.price($object->total_ttc).""; + print ''.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc).""; } else { - // Show deprecated optional form to add product line here if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) { @@ -2652,288 +2651,6 @@ else print ''; - /* - - $sql = 'SELECT l.fk_product, l.product_type, l.description, l.qty, l.rowid, l.tva_tx,'; - $sql.= ' l.fk_remise_except,'; - $sql.= ' l.remise_percent, l.subprice, l.info_bits,'; - $sql.= ' l.total_ht, l.total_tva, l.total_ttc,'; - $sql.= ' l.date_start,'; - $sql.= ' l.date_end,'; - $sql.= ' l.product_type,'; - $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; - $sql.= ' p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; - $sql.= ' WHERE l.fk_facture = '.$object->id; - $sql.= ' ORDER BY l.rang ASC, l.rowid'; - - $resql = $db->query($sql); - if ($resql) - { - $num_lignes = $db->num_rows($resql); - $i = 0; $total = 0; - - $product_static=new Product($db); - - print '
'; - - if ($num_lignes) - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - } - $var=true; - while ($i < $num_lignes) - { - $objp = $db->fetch_object($resql); - $var=!$var; - - // Show product and description - $type=$objp->product_type?$objp->product_type:$objp->fk_product_type; - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($objp->date_start)) $type=1; - if (! empty($objp->date_end)) $type=1; - - // Show line - if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) - { - print ''; - if ($objp->fk_product > 0) - { - print ''; - } - else - { - print '\n"; - } - - // VAT - print ''; - - // Unit price - print '\n"; - print ''; - - // Remise percent (negative or positive) - if (!empty($objp->remise_percent)) - { - print '\n"; - } - else - { - print ''; - } - - // Montant total HT - print '\n"; - - // Icone d'edition et suppression - if ($object->statut == 0 && $user->rights->facture->creer) - { - print ''; - print ''; - if ($num_lignes > 1) - { - print ''; - } - } - else - { - print ''; - } - print ''; - } - - // Ligne en mode update - if ($_GET['action'] == 'editline' && $user->rights->facture->creer && $_GET['rowid'] == $objp->rowid) - { - print 'rowid.'" method="post">'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // VAT - print ''; - - // Unit price - print ''; - - - print ''; - - print ''; - - print ''; - print '' . "\n"; - if ($conf->service->enabled) - { - print ''; - print ''; - print ''; - } - print "\n"; - } - - $total = $total + ($objp->qty * $objp->price); - $i++; - } - - $db->free($resql); - } - else - { - dol_print_error($db); - } - - */ - $result = $object->getLinesArray(); if (!empty($object->lines)) @@ -2949,13 +2666,13 @@ else { $var=true; - $object->showAddFreeProductForm(1); + $object->showAddFreeProductForm(1,$mysoc,$soc); // Add predefined products/services if ($conf->product->enabled || $conf->service->enabled) { $var=!$var; - $object->showAddPredefinedProductForm(1); + $object->showAddPredefinedProductForm(1,$mysoc,$soc); } // Hook of thirdparty module diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1096832c27a..75dbd2184a8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -506,7 +506,7 @@ class CommonObject // TODO uniformise code if ($this->origin == 'shipping') $this->origin = 'expedition'; if ($this->origin == 'delivery') $this->origin = 'livraison'; - + $object = $this->origin; $classname = ucfirst($object); @@ -1285,11 +1285,12 @@ class CommonObject * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects. * @param $dateSelector 1=Show also date range input fields */ - function showAddPredefinedProductForm($dateSelector=0) + function showAddPredefinedProductForm($dateSelector,$seller,$buyer) { global $conf,$langs; global $html,$bcnd,$var; + // Use global variables + $dateSelector + $seller and $buyer include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_create.tpl.php'); } @@ -1299,11 +1300,12 @@ class CommonObject * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects. * @param $dateSelector 1=Show also date range input fields */ - function showAddFreeProductForm($dateSelector=0) + function showAddFreeProductForm($dateSelector,$seller,$buyer) { global $conf,$langs; global $html,$bcnd,$var; + // Use global variables + $dateSelector + $seller and $buyer include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_create.tpl.php'); } @@ -1360,7 +1362,7 @@ class CommonObject * Return HTML with object lines list * FIXME This must be moved into a html.class file instead of a business class. */ - function printLinesList($dateSelector=0) + function printLinesList($dateSelector=0,$seller,$buyer) { $num = count($this->lines); $var = true; @@ -1376,7 +1378,7 @@ class CommonObject } else { - $this->printLine($line,$var,$num,$i,$dateSelector); + $this->printLine($line,$var,$num,$i,$dateSelector,$seller,$buyer); } $i++; @@ -1390,10 +1392,12 @@ class CommonObject * @param $num Number of line * @param $i * @param $dateSelector 1=Show also date range input fields + * @param $seller Object of seller third party + * @param $buyer Object of buyer third party * TODO This must be moved into a html.class file instead of a business class. * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects. */ - function printLine($line,$var=true,$num=0,$i=0,$dateSelector=0) + function printLine($line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer) { global $conf,$langs,$user; global $html,$bc; @@ -1425,11 +1429,13 @@ class CommonObject $text.= ' - '.$line->product_label; $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description)); + // Use global variables + $seller and $buyer include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php'); } else { - include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_view.tpl.php'); + // Use global variables + $dateSelector + $seller and $buyer + include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_view.tpl.php'); } } @@ -1438,11 +1444,13 @@ class CommonObject { if ($line->fk_product > 0) { - include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_edit.tpl.php'); + // Use global variables + $dateSelector + $seller and $buyer + include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_edit.tpl.php'); } else { - include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_edit.tpl.php'); + // Use global variables + $dateSelector + $seller and $buyer + include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_edit.tpl.php'); } } } diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e610453276f..dd3c855a450 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -357,7 +357,7 @@ class Conf $this->defaulttx='0'; // Taux par defaut des factures clients } else { - $this->defaulttx=''; // Pas de taux par defaut des factures clients, le premier sera pris + $this->defaulttx=''; // Pas de taux par defaut des factures clients, le plus élevé sera pris } // $this->liste_limit = constante de taille maximale des listes @@ -409,7 +409,7 @@ class Conf $this->format_date_hour_short="%d/%m/%Y %H:%M"; $this->format_date_hour_text_short="%d %b %Y %H:%M"; $this->format_date_hour_text="%d %B %Y %H:%M"; - + // Limites decimales si non definie (peuvent etre egale a 0) if (! isset($this->global->MAIN_MAX_DECIMALS_UNIT)) $this->global->MAIN_MAX_DECIMALS_UNIT=5; if (! isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT=2; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dd908c0ff85..f2acb217843 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2405,7 +2405,6 @@ class Form global $langs,$conf,$mysoc; $return=''; - $txtva=array(); $libtva=array(); $nprtva=array(); @@ -2415,7 +2414,7 @@ class Form $defaultnpr=(preg_match('/\*/',$selectedrate) ? 1 : $defaultnpr); $defaulttx=str_replace('*','',$selectedrate); - //print $societe_vendeuse."-".$societe_acheteuse; + // Check parameters if (is_object($societe_vendeuse) && ! $societe_vendeuse->pays_code) { if ($societe_vendeuse->id == $mysoc->id) @@ -2429,29 +2428,44 @@ class Form return $return; } + //var_dump($societe_acheteuse); + //print "name=$name, selectedrate=$selectedrate, seller=".$societe_vendeuse->pays_code." buyer=".$societe_acheteuse->pays_code." idprod=$idprod, info_bits=$info_bits"; + //exit; + + // Get list of all VAT rates to show + // First we defined code_pays to use to find list if (is_object($societe_vendeuse)) { - if ($societe_vendeuse->isInEEC() && (! empty($societe_vendeuse->tva_intra)) - && preg_match('/^([A-Z][A-Z])/',$societe_vendeuse->tva_intra,$reg)) - { - $code_pays=$reg[1]; - } - else - { - $code_pays=$societe_vendeuse->pays_code; - } + $code_pays="'".$societe_vendeuse->pays_code."'"; } else { - $code_pays=$mysoc->pays_code; // Pour compatibilite ascendente + $code_pays="'".$mysoc->pays_code."'"; // Pour compatibilite ascendente } - - // Recherche liste des codes TVA du pays vendeur - $sql = "SELECT t.taux,t.recuperableonly"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_pays."'"; - $sql .= " AND t.active = 1"; - $sql .= " ORDER BY t.taux ASC, t.recuperableonly ASC"; + if (! empty($conf->global->SERVICES_ARE_ECOMMERCE_200238EC)) + { + // We also add the buyer + if (! $idprod) // We don't know type of product + { + $code_pays.=",'".$societe_acheteuse->pays_code."'"; + } + else + { + $prodstatic=new Product($this->db); + $prodstatic->fetch($idprod); + if ($prodstatic->type == 1) // We know product is a service + { + $code_pays.=",'".$societe_acheteuse->pays_code."'"; + } + } + } + // Now we get list + $sql = "SELECT DISTINCT t.taux, t.recuperableonly"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; + $sql.= " WHERE t.fk_pays = p.rowid"; + $sql.= " AND t.active = 1"; + $sql.= " AND p.code in (".$code_pays.")"; + $sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC"; $resql=$this->db->query($sql); if ($resql) @@ -2491,8 +2505,7 @@ class Form } $nbdetaux = sizeof($txtva); - - if (sizeof($txtva)) + if ($nbdetaux > 0) { $return.= ' @@ -72,9 +71,9 @@ if ($conf->global->PRODUIT_USE_MARKUP) $colspan = 'colspan="2"'; diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php index 77f4335cec0..b06ead55fae 100644 --- a/htdocs/core/tpl/freeproductline_edit.tpl.php +++ b/htdocs/core/tpl/freeproductline_edit.tpl.php @@ -40,10 +40,10 @@ ?> - - + + - + - + - + @@ -68,9 +68,9 @@ > diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index d8f7e72fbec..40556c106a6 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -78,9 +78,9 @@ $colspan = 'colspan="3"'; diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php index dccd12b351e..3e559073998 100644 --- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php @@ -30,7 +30,7 @@ > - - + + - + - + - + @@ -77,9 +77,9 @@ > diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 164f09e91b5..d9d34d9f38f 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -2634,7 +2634,7 @@ function get_default_tva($societe_vendeuse, $societe_acheteuse, $idprod=0) if (!is_object($societe_vendeuse)) return -1; if (!is_object($societe_acheteuse)) return -1; - dol_syslog("get_default_tva: seller use vat=".$societe_vendeuse->tva_assuj.", seller country=".$societe_vendeuse->pays_code.", seller in cee=".$societe_vendeuse->isInEEC().", buyer country=".$societe_acheteuse->pays_code.", buyer in cee=".$societe_acheteuse->isInEEC().", idprod=".$idprod); + dol_syslog("get_default_tva: seller use vat=".$societe_vendeuse->tva_assuj.", seller country=".$societe_vendeuse->pays_code.", seller in cee=".$societe_vendeuse->isInEEC().", buyer country=".$societe_acheteuse->pays_code.", buyer in cee=".$societe_acheteuse->isInEEC().", idprod=".$idprod.", SERVICES_ARE_ECOMMERCE_200238EC=".$conf->global->SERVICES_ARE_ECOMMERCE_200238EC); // Si vendeur non assujeti a TVA (tva_assuj vaut 0/1 ou franchise/reel) if (is_numeric($societe_vendeuse->tva_assuj) && ! $societe_vendeuse->tva_assuj) return 0;
'.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('Qty').''.$langs->trans('ReductionShort').''.$langs->trans('TotalHTShort').' 
'; - print ''; // ancre pour retourner sur la ligne - - // Show product and description - $product_static->type=$objp->fk_product_type; - $product_static->id=$objp->fk_product; - $product_static->ref=$objp->product_ref; - $product_static->libelle=$objp->product_label; - $text=$product_static->getNomUrl(1); - $text.= ' - '.$objp->product_label; - $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)); - print $html->textwithtooltip($text,$description,3,'','',$i); - - // Show range - print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end)); - - // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) print ($objp->description && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; - - print '
'; - print ''; // ancre pour retourner sur la ligne - - if (($objp->info_bits & 2) == 2) - { - print ''; - print img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount"); - print ''; - if ($objp->description) - { - if ($objp->description == '(CREDIT_NOTE)') - { - $discount=new DiscountAbsolute($db); - $discount->fetch($objp->fk_remise_except); - print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); - } - elseif ($objp->description == '(DEPOSIT)') - { - $discount=new DiscountAbsolute($db); - $discount->fetch($objp->fk_remise_except); - print ' - '.$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); - } - else - { - print ' - '.nl2br($objp->description); - } - } - } - else - { - if ($type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - print $text.' '.nl2br($objp->description); - - // Show range - print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end)); - } - print "'.vatrate($objp->tva_tx,'%',$objp->info_bits).''.price($objp->subprice)."'; - if (($objp->info_bits & 2) != 2) - { - print $objp->qty; - } - else print ' '; - print ''.dol_print_reduction($objp->remise_percent,$langs)." '.price($objp->total_ht)."'; - if (($objp->info_bits & 2) == 2) - { - // Ligne remise predefinie, on permet pas modif - } - else - { - print 'rowid.'#'.$objp->rowid.'">'; - print img_edit(); - print ''; - } - print ''; - print 'rowid.'">'; - print img_delete(); - print ''; - if ($i > 0) - { - print 'rowid.'">'; - print img_up(); - print ''; - } - if ($i < $num_lignes-1) - { - print 'rowid.'">'; - print img_down(); - print ''; - } - print ' 
'; - print ''; // ancre pour retourner sur la ligne - - // Show product and description - if ($objp->fk_product > 0) - { - print ''; - $product_static->type=$objp->fk_product_type; - $product_static->id=$objp->fk_product; - $product_static->ref=$objp->product_ref; - $product_static->libelle=$objp->product_label; - $text=$product_static->getNomUrl(1); - $text.= ' - '.$objp->product_label; - print $text; - print '
'; - } - else - { - print $html->select_type_of_lines($objp->product_type,'type',1); - if ($conf->product->enabled && $conf->service->enabled) print '
'; - } - - // Description - Editor wysiwyg - $nbrows=ROWS_2; - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('desc',$objp->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); - $doleditor->Create(); - print '
'; - print $html->select_tva('np_tva_tx',$objp->tva_tx,$mysoc,$soc,'',$objp->info_bits); - print ''; - if (($objp->info_bits & 2) != 2) - { - print ''; - } - else print ' '; - print ''; - if (($objp->info_bits & 2) != 2) - { - print '%'; - } - else print ' '; - print ''; - print '
'.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - print $html->select_date($db->jdate($objp->date_start),'date_start',$usehm,$usehm,$objp->date_start?0:1,"updateligne"); - print ' '.$langs->trans('to').' '; - print $html->select_date($db->jdate($objp->date_end),'date_end',$usehm,$usehm,$objp->date_end?0:1,"updateligne"); - print '
tva_assuj == "0") echo '0'; - else $html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $soc); + else $html->select_tva('np_tva_tx', $conf->defaulttx, $seller, $buyer); ?> trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - echo $html->select_date('','date_start',$usehm,$usehm,1,"addproduct"); + echo $html->select_date('','date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct"); echo ' '.$langs->trans('to').' '; - echo $html->select_date('','date_end',$usehm,$usehm,1,"addproduct"); + echo $html->select_date('','date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct"); ?>
select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); ?>select_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?> info_bits & 2) != 2) { ?> @@ -51,7 +51,7 @@   info_bits & 2) != 2) { ?> % @@ -59,7 +59,7 @@   ">
">
trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne"); + echo $html->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 $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne"); + echo $html->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"); ?>
trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - echo $html->select_date('','date_start_predef',$usehm,$usehm,1,"addpredefinedproduct"); + echo $html->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 $html->select_date('','date_end_predef',$usehm,$usehm,1,"addpredefinedproduct"); + echo $html->select_date('','date_end_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); ?>
- + select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); ?>select_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?> info_bits & 2) != 2) { ?> @@ -60,7 +60,7 @@   info_bits & 2) != 2) { ?> % @@ -68,7 +68,7 @@   ">
">
trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne"); + echo $html->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 $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne"); + echo $html->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"); ?>