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('Description').' | '; - print ''.$langs->trans('VAT').' | '; - print ''.$langs->trans('PriceUHT').' | '; - print ''.$langs->trans('Qty').' | '; - print ''.$langs->trans('ReductionShort').' | '; - print ''.$langs->trans('TotalHTShort').' | '; - print ''; - print " | |||||||
| ';
- 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 ' | ';
- }
- else
- {
- 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 " | \n"; - } - - // VAT - print ''.vatrate($objp->tva_tx,'%',$objp->info_bits).' | '; - - // Unit price - print ''.price($objp->subprice)." | \n"; - print ''; - if (($objp->info_bits & 2) != 2) - { - print $objp->qty; - } - else print ' '; - print ' | '; - - // Remise percent (negative or positive) - if (!empty($objp->remise_percent)) - { - print ''.dol_print_reduction($objp->remise_percent,$langs)." | \n"; - } - else - { - print ''; - } - - // Montant total HT - print ' | '.price($objp->total_ht)." | \n"; - - // Icone d'edition et suppression - if ($object->statut == 0 && $user->rights->facture->creer) - { - print ''; - if (($objp->info_bits & 2) == 2) - { - // Ligne remise predefinie, on permet pas modif - } - else - { - print 'id.'&action=editline&rowid='.$objp->rowid.'#'.$objp->rowid.'">'; - print img_edit(); - print ''; - } - print ' | '; - print ''; - print 'id.'&action=delete_product_line&rowid='.$objp->rowid.'">'; - print img_delete(); - print ' | '; - if ($num_lignes > 1) - { - print ''; - if ($i > 0) - { - print 'id.'&action=up&rowid='.$objp->rowid.'">'; - print img_up(); - print ''; - } - if ($i < $num_lignes-1) - { - print 'id.'&action=down&rowid='.$objp->rowid.'">'; - print img_down(); - print ''; - } - print ' | '; - } - } - else - { - print ''; - } - print ' | ||