2
0
forked from Wavyzz/dolibarr

New: [ task #498 ] - final part

This commit is contained in:
Regis Houssin
2012-08-25 15:21:34 +02:00
parent d88abe8df0
commit f322ec50ed
22 changed files with 710 additions and 641 deletions

View File

@@ -64,8 +64,8 @@ if ($action == 'updateMask')
if (isset($res))
{
if ($res < 0)
setEventMessage($langs->trans("SetupSaved"));
if ($res < 0)
setEventMessage($langs->trans("SetupSaved"));
else
setEventMessage($langs->trans("Error"), 'errors');
}
@@ -87,9 +87,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
$draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if ($res < 0)
setEventMessage($langs->trans("SetupSaved"));
else
if ($res < 0)
setEventMessage($langs->trans("SetupSaved"));
else
setEventMessage($langs->trans("Error"), 'errors');
}
@@ -153,22 +153,22 @@ else if ($action == 'del')
}
}
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->EXPEDITION_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->EXPEDITION_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
else if ($action == 'setmodel')

View File

@@ -645,10 +645,10 @@ else if ($action == "addline" && $user->rights->propal->creer)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
$error++;
}
if (empty($idprod) && ! GETPOST('product_desc'))
{
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors');
$error++;
if (empty($idprod) && ! GETPOST('product_desc'))
{
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors');
$error++;
}
if (! $error && (GETPOST('qty') >= 0) && (GETPOST('product_desc') || ! empty($idprod)))
@@ -723,27 +723,27 @@ else if ($action == "addline" && $user->rights->propal->creer)
} else {
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
}
else
{
$desc = $prod->description;
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
}
else
{
$desc = $prod->description;
}
$desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?"<br />\n":"\n") : "";
$desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?"<br />\n":"\n") : "";
$desc.= GETPOST('product_desc');
}
@@ -762,11 +762,11 @@ else if ($action == "addline" && $user->rights->propal->creer)
}
// Margin
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
$localtax2_tx= get_localtax($tva_tx, 2, $object->client);
$info_bits=0;
@@ -822,7 +822,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
unset($_POST['qty']);
unset($_POST['type']);
unset($_POST['idprod']);
unset($_POST['idprod']);
unset($_POST['remise_percent']);
unset($_POST['price_ht']);
unset($_POST['price_ttc']);
@@ -858,8 +858,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$localtax2_rate=get_localtax($vat_rate,2,$object->client);
$pu_ht=GETPOST('price_ht');
// Add buying price
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
// Add buying price
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
// Define special_code for special lines
@@ -881,22 +881,22 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):'');
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).getCurrencySymbol($conf->currency), 'errors');
$error++;
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).getCurrencySymbol($conf->currency), 'errors');
$error++;
}
}
else
{
$type = GETPOST('type');
$label = (GETPOST('product_label') ? GETPOST('product_label'):'');
// Check parameters
if (GETPOST('type') < 0) {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++;
}
else
{
$type = GETPOST('type');
$label = (GETPOST('product_label') ? GETPOST('product_label'):'');
// Check parameters
if (GETPOST('type') < 0) {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++;
}
}
if (! $error)
@@ -920,49 +920,49 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$label
);
if ($result >= 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
if ($result >= 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['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($id); // Reload to get new records
$ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager);
}
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['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
{
setEventMessage($object->error, 'errors');
else
{
setEventMessage($object->error, 'errors');
}
}
}
else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel'))
{
Header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition
exit;
else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel'))
{
Header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition
exit;
}
// Generation doc (depuis lien ou depuis cartouche doc)

View File

@@ -587,22 +587,22 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$price_base_type = $prod->price_base_type;
}
// Update if prices fields are defined
if (GETPOST('update_price') && (GETPOST('price_ht') || GETPOST('price_ttc')))
{
$price_ht=price2num(GETPOST('price_ht'), 'MU');
$price_ttc=price2num(GETPOST('price_ttc'), 'MU');
if ($price_base_type == 'TTC' && $price_ttc != $pu_ttc)
{
$pu_ttc = $price_ttc;
$pu_ht = price2num($price_ttc / (1 + ($prod->tva_tx / 100)),'MU');
}
else if ($price_base_type != 'TTC' && $price_ht != $pu_ht)
{
$pu_ht = $price_ht;
$pu_ttc = price2num($price_ht * (1 + ($prod->tva_tx / 100)),'MU');
}
// Update if prices fields are defined
if (GETPOST('update_price') && (GETPOST('price_ht') || GETPOST('price_ttc')))
{
$price_ht=price2num(GETPOST('price_ht'), 'MU');
$price_ttc=price2num(GETPOST('price_ttc'), 'MU');
if ($price_base_type == 'TTC' && $price_ttc != $pu_ttc)
{
$pu_ttc = $price_ttc;
$pu_ht = price2num($price_ttc / (1 + ($prod->tva_tx / 100)),'MU');
}
else if ($price_base_type != 'TTC' && $price_ht != $pu_ht)
{
$pu_ht = $price_ht;
$pu_ttc = price2num($price_ht * (1 + ($prod->tva_tx / 100)),'MU');
}
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different
@@ -619,36 +619,36 @@ else if ($action == 'addline' && $user->rights->commande->creer)
}
}
if (GETPOST('update_desc')) {
$desc = (GETPOST('product_desc')?GETPOST('product_desc'):'');
} else {
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
}
else
{
$desc = $prod->description;
}
$desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?"<br />\n":"\n") : "";
$desc.= GETPOST('product_desc');
}
if (GETPOST('update_desc')) {
$desc = (GETPOST('product_desc')?GETPOST('product_desc'):'');
} else {
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
}
else
{
$desc = $prod->description;
}
$desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?"<br />\n":"\n") : "";
$desc.= GETPOST('product_desc');
}
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):'');
$type = $prod->type;
@@ -664,7 +664,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
}
// Margin
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
// Local Taxes
@@ -676,61 +676,61 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$info_bits=0;
if ($tva_npr) $info_bits |= 0x01;
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('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');
}
else
{
// Insert line
$result = $object->addline(
$object->id,
$desc,
$pu_ht,
GETPOST('qty'),
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$idprod,
GETPOST('remise_percent'),
$info_bits,
0,
$price_base_type,
$pu_ttc,
$date_start,
$date_end,
$type,
-1,
setEventMessage($mesg, 'errors');
}
else
{
// Insert line
$result = $object->addline(
$object->id,
$desc,
$pu_ht,
GETPOST('qty'),
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$idprod,
GETPOST('remise_percent'),
$info_bits,
0,
GETPOST('fk_parent_line'),
$price_base_type,
$pu_ttc,
$date_start,
$date_end,
$type,
-1,
0,
GETPOST('fk_parent_line'),
$fournprice,
$buyingprice,
$label
);
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
$outputlangs = $langs;
$newlang=GETPOST('lang_id','alpha');
if (! empty($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['idprod']);
unset($_POST['remise_percent']);
$label
);
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
$outputlangs = $langs;
$newlang=GETPOST('lang_id','alpha');
if (! empty($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['idprod']);
unset($_POST['remise_percent']);
unset($_POST['price_ht']);
unset($_POST['price_ttc']);
unset($_POST['tva_tx']);
@@ -738,12 +738,12 @@ else if ($action == 'addline' && $user->rights->commande->creer)
unset($_POST['product_label']);
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
}
else
{
setEventMessage($object->error, 'errors');
}
unset($_POST['buying_price']);
}
else
{
setEventMessage($object->error, 'errors');
}
}
}
}
@@ -833,34 +833,34 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
if ($result >= 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// 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
// 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['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['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

View File

@@ -68,7 +68,7 @@ $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','al
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$origin=GETPOST('origin','alpha');
$origin=GETPOST('origin','alpha');
$originid=(GETPOST('originid','int')?GETPOST('originid','int'):GETPOST('origin_id','int')); // For backward compatibility
//PDF
@@ -985,9 +985,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
}
$ret=$object->fetch_thirdparty();
// Clean parameters
$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'));
// Clean parameters
$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
@@ -1018,22 +1018,22 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$price_base_type = $prod->price_base_type;
}
// Update if prices fields are defined
if (GETPOST('update_price') && (GETPOST('price_ht') || GETPOST('price_ttc')))
{
$price_ht=price2num(GETPOST('price_ht'), 'MU');
$price_ttc=price2num(GETPOST('price_ttc'), 'MU');
if ($price_base_type == 'TTC' && $price_ttc != $pu_ttc)
{
$pu_ttc = $price_ttc;
$pu_ht = price2num($price_ttc / (1 + ($prod->tva_tx / 100)),'MU');
}
else if ($price_base_type != 'TTC' && $price_ht != $pu_ht)
{
$pu_ht = $price_ht;
$pu_ttc = price2num($price_ht * (1 + ($prod->tva_tx / 100)),'MU');
}
// Update if prices fields are defined
if (GETPOST('update_price') && (GETPOST('price_ht') || GETPOST('price_ttc')))
{
$price_ht=price2num(GETPOST('price_ht'), 'MU');
$price_ttc=price2num(GETPOST('price_ttc'), 'MU');
if ($price_base_type == 'TTC' && $price_ttc != $pu_ttc)
{
$pu_ttc = $price_ttc;
$pu_ht = price2num($price_ttc / (1 + ($prod->tva_tx / 100)),'MU');
}
else if ($price_base_type != 'TTC' && $price_ht != $pu_ht)
{
$pu_ht = $price_ht;
$pu_ttc = price2num($price_ht * (1 + ($prod->tva_tx / 100)),'MU');
}
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different
@@ -1050,34 +1050,34 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
}
}
if (GETPOST('update_desc')) {
$desc = (GETPOST('product_desc')?GETPOST('product_desc'):'');
} else {
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
}
else
{
$desc = $prod->description;
}
$desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?"<br />\n":"\n") : "";
$desc.= GETPOST('product_desc');
if (GETPOST('update_desc')) {
$desc = (GETPOST('product_desc')?GETPOST('product_desc'):'');
} else {
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
}
else
{
$desc = $prod->description;
}
$desc.= ($desc && GETPOST('product_desc')) ? ((dol_textishtml($desc) || dol_textishtml(GETPOST('product_desc')))?"<br />\n":"\n") : "";
$desc.= GETPOST('product_desc');
}
if (! empty($prod->customcode) || ! empty($prod->country_code))
@@ -1104,75 +1104,75 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$type=GETPOST('type');
}
// Margin
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
// Margin
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
$localtax2_tx= get_localtax($tva_tx, 2, $object->client);
$info_bits=0;
if ($tva_npr) $info_bits |= 0x01;
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('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');
}
else
{
// Insert line
$result = $object->addline(
$id,
$desc,
$pu_ht,
GETPOST('qty'),
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$idprod,
GETPOST('remise_percent'),
$date_start,
$date_end,
0,
$info_bits,
'',
$price_base_type,
$pu_ttc,
$type,
-1,
0,
'',
0,
GETPOST('fk_parent_line'),
$fournprice,
setEventMessage($mesg, 'errors');
}
else
{
// Insert line
$result = $object->addline(
$id,
$desc,
$pu_ht,
GETPOST('qty'),
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$idprod,
GETPOST('remise_percent'),
$date_start,
$date_end,
0,
$info_bits,
'',
$price_base_type,
$pu_ttc,
$type,
-1,
0,
'',
0,
GETPOST('fk_parent_line'),
$fournprice,
$buyingprice,
$label
$label
);
if ($result > 0)
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
$outputlangs = $langs;
$newlang=GETPOST('lang_id','alpha');
if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$ret=$object->fetch($id); // Reload to get new records
// Define output language
$outputlangs = $langs;
$newlang=GETPOST('lang_id','alpha');
if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$ret=$object->fetch($id); // Reload to get new records
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager);
}
unset($_POST['qty']);
unset($_POST['type']);
unset($_POST['idprod']);
unset($_POST['remise_percent']);
unset($_POST['qty']);
unset($_POST['type']);
unset($_POST['idprod']);
unset($_POST['remise_percent']);
unset($_POST['price_ht']);
unset($_POST['price_ttc']);
unset($_POST['tva_tx']);
@@ -1180,14 +1180,14 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
unset($_POST['product_label']);
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
}
else
{
setEventMessage($object->error, 'errors');
}
$action='';
unset($_POST['buying_price']);
}
else
{
setEventMessage($object->error, 'errors');
}
$action='';
}
}
}
@@ -1200,7 +1200,7 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
// Clean parameters
$date_start='';
$date_end='';
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$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(GETPOST('product_desc'));
$pu_ht=GETPOST('price_ht');
@@ -1234,22 +1234,22 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):'');
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).getCurrencySymbol($conf->currency), 'errors');
$error++;
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
{
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).getCurrencySymbol($conf->currency), 'errors');
$error++;
}
}
else
{
$type = GETPOST('type');
$label = (GETPOST('product_label') ? GETPOST('product_label'):'');
// Check parameters
if (GETPOST('type') < 0) {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++;
}
else
{
$type = GETPOST('type');
$label = (GETPOST('product_label') ? GETPOST('product_label'):'');
// Check parameters
if (GETPOST('type') < 0) {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++;
}
}
// Update line
@@ -1276,41 +1276,41 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
$label
);
if ($result >= 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
if ($result >= 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// 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);
// 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($id); // Reload to get new records
$ret=$object->fetch($id); // Reload to get new records
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager);
}
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['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
{
setEventMessage($object->error, 'errors');
}
else
{
setEventMessage($object->error, 'errors');
}
}
}

View File

@@ -62,27 +62,27 @@ $object = new FactureRec($db);
// Create predefined invoice
if ($action == 'add')
{
if (! GETPOST('titre'))
{
if (! GETPOST('titre'))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors');
$action = "create";
$error++;
$error++;
}
if (! $error)
{
$object->titre = GETPOST('titre', 'alpha');
$object->note = GETPOST('comment');
if ($object->create($user, $id) > 0)
{
$id = $object->id;
$action = '';
}
else
{
setEventMessage($object->error, 'errors');
$action = "create";
$object->titre = GETPOST('titre', 'alpha');
$object->note = GETPOST('comment');
if ($object->create($user, $id) > 0)
{
$id = $object->id;
$action = '';
}
else
{
setEventMessage($object->error, 'errors');
$action = "create";
}
}
}
@@ -165,12 +165,12 @@ if ($action == 'create')
print '<br>';
$title = $langs->trans("ProductsAndServices");
if (empty($conf->service->enabled))
$title = $langs->trans("Products");
else if (empty($conf->product->enabled))
$title = $langs->trans("Services");
$title = $langs->trans("ProductsAndServices");
if (empty($conf->service->enabled))
$title = $langs->trans("Products");
else if (empty($conf->product->enabled))
$title = $langs->trans("Services");
print_titre($title);
/*
@@ -470,14 +470,14 @@ else
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
if (! empty($object->lines[$i]->label)) {
$text.= ' <strong>'.$object->lines[$i]->label.'</strong>';
print $form->textwithtooltip($text,dol_htmlentitiesbr($object->lines[$i]->desc),3,'','',$i);
} else {
print $text.' '.nl2br($object->lines[$i]->desc);
if (! empty($object->lines[$i]->label)) {
$text.= ' <strong>'.$object->lines[$i]->label.'</strong>';
print $form->textwithtooltip($text,dol_htmlentitiesbr($object->lines[$i]->desc),3,'','',$i);
} else {
print $text.' '.nl2br($object->lines[$i]->desc);
}
// Show range
@@ -517,15 +517,15 @@ else
* List mode
*/
$sql = "SELECT s.nom, s.rowid as socid, f.titre, f.total, f.rowid as facid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql .= " AND s.rowid = ".$socid;
//$sql .= " ORDER BY $sortfield $sortorder, rowid DESC ";
// $sql .= $db->plimit($limit + 1,$offset);
$sql = "SELECT s.nom, s.rowid as socid, f.titre, f.total, f.rowid as facid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql .= " AND s.rowid = ".$socid;
//$sql .= " ORDER BY $sortfield $sortorder, rowid DESC ";
// $sql .= $db->plimit($limit + 1,$offset);
$result = $db->query($sql);
if ($result)

View File

@@ -2581,13 +2581,13 @@ abstract class CommonObject
if (! empty($line->date_start)) $type=1; // deprecated
if (! empty($line->date_end)) $type=1; // deprecated
if ($line->fk_product > 0)
{
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;
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
$text=$product_static->getNomUrl(1);
}
@@ -2624,18 +2624,18 @@ abstract class CommonObject
$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)
// 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)
{
$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;
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
$res=include $tpl; // for debug
}
if ($res) break;
}
}
@@ -2643,23 +2643,23 @@ abstract class CommonObject
if ($this->statut == 0 && $action == 'editline' && $selected == $line->id)
{
$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").'"';
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)
{
$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;
}
if ($res) break;
}
}
}
@@ -2804,11 +2804,11 @@ abstract class CommonObject
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir)
{
$tpl = dol_buildpath($reldir.'/originproductline.tpl.php');
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
$res=include $tpl; // for debug
$tpl = dol_buildpath($reldir.'/originproductline.tpl.php');
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
$res=include $tpl; // for debug
}
if ($res) break;
}

View File

@@ -1111,8 +1111,8 @@ class Form
else if ($hidelabel > 1) {
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
else $placeholder=' title="'.$langs->trans("RefOrLabel").'"';
if ($hidelabel == 2) {
print img_picto($langs->trans("Search"), 'search');
if ($hidelabel == 2) {
print img_picto($langs->trans("Search"), 'search');
}
}
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';

View File

@@ -127,11 +127,11 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$product_static=new Product($db);
$expedition=new Expedition($db);
$sql = "SELECT obj.rowid, obj.fk_product, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked";
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked";
$sql.= ", ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line";
$sql.= ", e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,";
//if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,";
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.description as product_desc';
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
@@ -204,11 +204,11 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$outputlangs->setDefaultLang($newlang);
}
$label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product;
$label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label;
}
else
{
$label = $objp->product;
$label = (! empty($objp->label)?$objp->label:$objp->product_label);
}
print '<td>';
@@ -217,19 +217,18 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$product_static->type=$objp->fk_product_type;
$product_static->id=$objp->fk_product;
$product_static->ref=$objp->ref;
$product_static->libelle=$label;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description));
print $form->textwithtooltip($text,$description,3,'','',$i);
// Show range
print_date_range($objp->date_start,$objp->date_end);
// Add description in form
if ($conf->global->PRODUIT_DESC_IN_FORM)
if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
{
print ($objp->description && $objp->description!=$objp->product)?'<br>'.dol_htmlentitiesbr($objp->description):'';
print (! empty($objp->description) && $objp->description!=$objp->product)?'<br>'.dol_htmlentitiesbr($objp->description):'';
}
print '</td>';
@@ -239,7 +238,13 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
print "<td>";
if ($objp->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($objp->description);
if (! empty($objp->label)) {
$text.= ' <strong>'.$objp->label.'</strong>';
print $form->textwithtooltip($text,$objp->description,3,'','',$i);
} else {
print $text.' '.nl2br($objp->description);
}
// Show range
print_date_range($objp->date_start,$objp->date_end);

View File

@@ -1,11 +1,11 @@
<?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -173,8 +173,8 @@ class modCommande extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("commande","commande","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"DateOrder",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"OrderShortStatusInvoicee",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'Label');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"DateOrder",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"OrderShortStatusInvoicee",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Linelabel",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@@ -84,11 +84,11 @@ class modExpedition extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "EXPEDITION_ADDON_NUMBER";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_expedition_safor";
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des expeditions';
$this->const[$r][4] = 0;
$this->const[$r][0] = "EXPEDITION_ADDON_NUMBER";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_expedition_safor";
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des expeditions';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "LIVRAISON_ADDON_PDF";

View File

@@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@@ -174,8 +174,8 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"LineLabel",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menentr <jmenent@2byte.es>
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -169,8 +169,8 @@ class modPropale extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("propale","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','cp.code'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'Label');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','cp.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','cp.code'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"LineLabel",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','cp.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@@ -121,22 +121,22 @@ if (! empty($conf->margin->enabled)) {
echo $form->select_type_of_lines((GETPOST('type')?GETPOST('type'):-1), 'type', 1);
echo '<span id="product_ref_area" class="hideobject">&nbsp;<label for="product_ref">'.$langs->trans("Ref").'</label>';
echo '<span id="product_ref_area" class="hideobject">&nbsp;<label for="product_ref">'.$langs->trans("Ref").'</label>';
echo '<input id="product_ref" name="product_ref" size="20" value="'.GETPOST('product_ref').'"></span>';
echo '&nbsp;<label for="product_label">'.$langs->trans("Label").'</label>';
echo '<input id="product_label" name="product_label" size="40" value="'.GETPOST('product_label').'">';
echo '<input type="hidden" id="origin_label_cache" name="origin_label_cache" value="" />';
if (is_object($hookmanager))
{
$parameters=array('fk_parent_line'=>GETPOST('fk_parent_line'));
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
echo '<input type="hidden" id="origin_label_cache" name="origin_label_cache" value="" />';
if (is_object($hookmanager))
{
$parameters=array('fk_parent_line'=>GETPOST('fk_parent_line'));
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
}
?>
</td>
<tr <?php echo $bcnd[$var]; ?>>
<tr <?php echo $bcnd[$var]; ?>>
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
<?php

View File

@@ -62,31 +62,31 @@
{
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 (! empty($conf->global->PRODUIT_DESC_IN_FORM))
{
print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
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 (! empty($conf->global->PRODUIT_DESC_IN_FORM))
{
print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
}
} 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 (! empty($line->label)) {
$text.= ' <strong>'.$line->label.'</strong>';
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
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.= ' <strong>'.$line->label.'</strong>';
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);
}
}

View File

@@ -854,7 +854,7 @@ class Expedition extends CommonObject
{
// TODO: recuperer les champs du document associe a part
$sql = "SELECT cd.rowid, cd.fk_product, cd.description, cd.qty as qty_asked";
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked";
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice";
$sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
@@ -893,8 +893,8 @@ class Expedition extends CommonObject
$line->ref = $obj->product_ref; // TODO deprecated
$line->product_ref = $obj->product_ref;
$line->product_label = $obj->product_label;
//$line->label = $obj->product_label;
$line->libelle = $obj->product_label; // TODO deprecated
$line->label = $obj->custom_label;
$line->description = $obj->description;
$line->qty_asked = $obj->qty_asked;
$line->qty_shipped = $obj->qty_shipped;

View File

@@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -543,6 +543,7 @@ llxHeader('',$langs->trans('Sending'),'Expedition');
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
$product_static = new Product($db);
if ($action == 'create2')
{
@@ -700,8 +701,6 @@ if ($action == 'create')
print "</tr>\n";
}
$product_static = new Product($db);
$var=true;
$indiceAsked = 0;
while ($indiceAsked < $numAsked)
@@ -733,9 +732,8 @@ if ($action == 'create')
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
$product_static->libelle=$line->product_label;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$line->product_label;
$text.= ' - '.(! empty($line->label)?$line->label:$line->product_label);
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->desc));
print $form->textwithtooltip($text,$description,3,'','',$i);
@@ -755,7 +753,13 @@ if ($action == 'create')
print "<td>";
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($line->desc);
if (! empty($line->label)) {
$text.= ' <strong>'.$line->label.'</strong>';
print $form->textwithtooltip($text,$line->desc,3,'','',$i);
} else {
print $text.' '.nl2br($line->desc);
}
// Show range
print_date_range($db->jdate($line->date_start),$db->jdate($line->date_end));
@@ -1205,23 +1209,22 @@ else
$label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label;
}
else
$label = $lines[$i]->product_label;
$label = (! empty($lines[$i]->label)?$lines[$i]->label:$lines[$i]->product_label);
print '<td>';
// Affiche ligne produit
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$lines[$i]->fk_product.'">';
if ($lines[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
$text.= ' '.$lines[$i]->ref.'</a>';
// Show product and description
$product_static->type=$lines[$i]->fk_product_type;
$product_static->id=$lines[$i]->fk_product;
$product_static->ref=$lines[$i]->ref;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($lines[$i]->description));
//print $description;
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->description));
print $form->textwithtooltip($text,$description,3,'','',$i);
print_date_range($lines[$i]->date_start,$lines[$i]->date_end);
if ($conf->global->PRODUIT_DESC_IN_FORM)
if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
{
print ($lines[$i]->description && $lines[$i]->description!=$lines[$i]->product)?'<br>'.dol_htmlentitiesbr($lines[$i]->description):'';
print (! empty($lines[$i]->description) && $lines[$i]->description!=$lines[$i]->product)?'<br>'.dol_htmlentitiesbr($lines[$i]->description):'';
}
}
else
@@ -1229,7 +1232,14 @@ else
print "<td>";
if ($lines[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($lines[$i]->description);
if (! empty($lines[$i]->label)) {
$text.= ' <strong>'.$lines[$i]->label.'</strong>';
print $form->textwithtooltip($text,$lines[$i]->description,3,'','',$i);
} else {
print $text.' '.nl2br($lines[$i]->description);
}
print_date_range($lines[$i]->date_start,$lines[$i]->date_end);
print "</td>\n";
}
@@ -1473,7 +1483,7 @@ else
}
}
$db->close();
llxFooter();
?>
$db->close();
?>

View File

@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -29,11 +29,25 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (! empty($conf->projet->enabled))
require DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->stock->enabled))
require DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (! empty($conf->propal->enabled)) {
if (! class_exists('Propal')) {
require DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
}
if (! empty($conf->commande->enabled)) {
if (! class_exists('Commande')) {
require DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
}
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
if (! class_exists('Product')) {
require DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
}
$langs->load('orders');
$langs->load("companies");
@@ -350,7 +364,7 @@ if ($id > 0 || ! empty($ref))
*/
print '<table class="liste" width="100%">';
$sql = "SELECT cd.rowid, cd.fk_product, cd.product_type, cd.description,";
$sql = "SELECT cd.rowid, cd.fk_product, cd.product_type, cd.label, cd.description,";
$sql.= " cd.price, cd.tva_tx, cd.subprice,";
$sql.= " cd.qty,";
$sql.= ' cd.date_start,';
@@ -423,7 +437,7 @@ if ($id > 0 || ! empty($ref))
$label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label;
}
else
$label = $objp->product_label;
$label = (! empty($objp->label)?$objp->label:$objp->product_label);
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
@@ -432,7 +446,6 @@ if ($id > 0 || ! empty($ref))
$product_static->type=$objp->fk_product_type;
$product_static->id=$objp->fk_product;
$product_static->ref=$objp->ref;
$product_static->libelle=$label;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
@@ -454,7 +467,13 @@ if ($id > 0 || ! empty($ref))
print "<td>";
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($objp->description);
if (! empty($objp->label)) {
$text.= ' <strong>'.$objp->label.'</strong>';
print $form->textwithtooltip($text,$objp->description,3,'','',$i);
} else {
print $text.' '.nl2br($objp->description);
}
// Show range
print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end));
@@ -588,7 +607,7 @@ if ($id > 0 || ! empty($ref))
// Bouton expedier avec gestion des stocks
if ($conf->stock->enabled && ($commande->statut > 0 && $commande->statut < 3))
if (! empty($conf->stock->enabled) && ($commande->statut > 0 && $commande->statut < 3))
{
if ($user->rights->expedition->creer)
{

View File

@@ -79,7 +79,7 @@ if (! empty($idprod))
{
$label.= price($objp->fprice).getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
$title.= price($objp->fprice);
$title.= price($objp->fprice);
$title.= getCurrencySymbol($conf->currency)."/";
$price = $objp->fprice;

View File

@@ -171,4 +171,14 @@ CountryOrigin=Origin country
HiddenIntoCombo=Hidden into select lists
Nature=Nature
ProductCodeModel=Product code model
ServiceCodeModel=Service code model
ServiceCodeModel=Service code model
AddThisProductCard=Create product card
HelpAddThisProductCard=This option allows you to create or clone a product if it does not exist.
AddThisServiceCard=Create service card
HelpAddThisServiceCard=This option allows you to create or clone a service if it does not exist.
UpdateOriginalProductLabel=Edit label
HelpUpdateOriginalProductLabel=<strong>This option allows you to change the label.</strong><br>Disabling this option will replace the original label.
UpdateOriginalProductDescription=Edit description
HelpUpdateOriginalProductDescription=<strong>This option allows you to change the description.</strong><br>If you have already entered text, it will be automatically placed after.<br>Disabling this option will remove the original description in the editor,<br>but keep the text entered previously.
UpdateOriginalProductPrice=Edit price
HelpUpdateOriginalProductPrice=<strong>This option allows you to change the price.</strong><br>Calculation of VAT will automatically,<br>based on excl. tax if you entered an excl. tax amount<br>, based on incl. tax if you entered an incl. tax amount.<br>Disabling this option will replace the original price.

View File

@@ -173,12 +173,12 @@ Nature=Nature
ProductCodeModel=Modèle de code produit
ServiceCodeModel=Modèle de code service
AddThisProductCard=Créer fiche produit
HelpAddThisProductCard=
HelpAddThisProductCard=Cette option permet de créer ou de cloner une fiche produit si elle n'existe pas.
AddThisServiceCard=Créer fiche service
HelpAddThisServiceCard=
HelpAddThisServiceCard=Cette option permet de créer ou de cloner une fiche service si elle n'existe pas.
UpdateOriginalProductLabel=Modifier le libellé
HelpUpdateOriginalProductLabel=
HelpUpdateOriginalProductLabel=<strong>Cette option permet de modifier le libellé.</strong><br>La desactivation de cette option replacera le libellé d'origine.
UpdateOriginalProductDescription=Modifier la description
HelpUpdateOriginalProductDescription=
HelpUpdateOriginalProductDescription=<strong>Cette option permet de modifier la description.</strong><br>Si vous avez déjà entré un texte, il sera placé à la suite automatiquement.<br>La desactivation de cette option supprimera le description d'origine dans l'éditeur,<br>mais conservera le texte rentré précédemment.
UpdateOriginalProductPrice=Modifier le prix
HelpUpdateOriginalProductPrice=
HelpUpdateOriginalProductPrice=<strong>Cette option permet de modifier le prix.</strong><br>Le calcul de la TVA se fera automatiquement,<br>soit sur la base du prix HT si vous rentré un montant HT,<br>soit sur la base du prix TTC si vous rentré un montant TTC.<br>La désactivation de cette option replacera le prix d'origine.

View File

@@ -665,8 +665,8 @@ class Livraison extends CommonObject
$this->lines = array();
$sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped,";
$sql.= " cd.qty as qty_asked,";
$sql.= " p.ref, p.fk_product_type as fk_product_type, p.label as label, p.description as product_desc";
$sql.= " cd.qty as qty_asked, cd.label as custom_label,";
$sql.= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc";
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on p.rowid = ld.fk_product";
$sql.= " WHERE ld.fk_origin_line = cd.rowid";
@@ -684,19 +684,21 @@ class Livraison extends CommonObject
$obj = $this->db->fetch_object($resql);
$line->description = $obj->description;
$line->fk_product = $obj->fk_product;
$line->qty_asked = $obj->qty_asked;
$line->qty_shipped = $obj->qty_shipped;
$line->label = $obj->custom_label;
$line->description = $obj->description;
$line->fk_product = $obj->fk_product;
$line->qty_asked = $obj->qty_asked;
$line->qty_shipped = $obj->qty_shipped;
$line->ref = $obj->ref;
$line->libelle = $obj->label; // Label produit
$line->label = $obj->label;
$line->product_desc = $obj->product_desc; // Description produit
$line->product_type = $obj->fk_product_type;
$line->ref = $obj->product_ref; // deprecated
$line->libelle = $obj->product_label; // deprecated
$line->product_label = $obj->product_label; // Product label
$line->product_ref = $obj->product_ref; // Product ref
$line->product_desc = $obj->product_desc; // Product description
$line->product_type = $obj->fk_product_type;
$line->price = $obj->price;
$line->total_ht = $obj->total_ht;
$line->price = $obj->price;
$line->total_ht = $obj->total_ht;
$this->lines[$i] = $line;

View File

@@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
*
* 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
@@ -30,20 +30,23 @@ require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
if ($conf->product->enabled || $conf->service->enabled) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if ($conf->expedition_bon->enabled) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
if ($conf->stock->enabled) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (! empty($conf->expedition_bon->enabled))
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
if (! empty($conf->stock->enabled))
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (!$user->rights->expedition->livraison->lire) accessforbidden();
$langs->load("sendings");
$langs->load("bills");
$langs->load('deliveries');
$action=GETPOST('action', 'alpha');
$confirm=GETPOST('confirm', 'alpha');
// Security check
$id = isset($_GET["id"])?$_GET["id"]:'';
$id = GETPOST('id', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'expedition',$id,'livraison','livraison');
@@ -53,7 +56,7 @@ $result=restrictedArea($user,'expedition',$id,'livraison','livraison');
* Actions
*/
if ($_POST["action"] == 'add')
if ($action == 'add')
{
$db->begin();
@@ -89,22 +92,23 @@ if ($_POST["action"] == 'add')
if ($ret > 0)
{
$db->commit();
Header("Location: fiche.php?id=".$delivery->id);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$delivery->id);
exit;
}
else
{
setEventMessage($delivery->error, 'errors');
$db->rollback();
$mesg='<div class="error">'.$delivery->error.'</div>';
$_GET["commande_id"]=$_POST["commande_id"];
$_GET["action"]='create';
$action='create';
}
}
if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $user->rights->expedition->livraison->valider)
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->livraison->valider)
{
$object = new Livraison($db);
$object->fetch($_GET["id"]);
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->valid($user);
@@ -131,10 +135,10 @@ if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $
}
}
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->expedition->livraison->supprimer)
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->livraison->supprimer)
{
$object = new Livraison($db);
$object->fetch($_GET["id"]);
$object->fetch($id);
$object->fetch_thirdparty();
$db->begin();
@@ -155,10 +159,10 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' &&
/*
* Build document
*/
if ($_REQUEST['action'] == 'builddoc') // En get ou en post
if ($action == 'builddoc') // En get ou en post
{
$object = new Livraison($db);
$object->fetch($_REQUEST['id']);
$object->fetch($id);
$object->fetch_thirdparty();
if ($_REQUEST['model'])
@@ -220,7 +224,7 @@ $formfile = new FormFile($db);
* Mode creation
*
*********************************************************************/
if ($_GET["action"] == 'create')
if ($action == 'create')
{
print_fiche_titre($langs->trans("CreateADeliveryOrder"));
@@ -233,7 +237,7 @@ if ($_GET["action"] == 'create')
$commande = new Commande($db);
$commande->livraison_array();
if ( $commande->fetch($_GET["commande_id"]))
if ($commande->fetch($_GET["commande_id"]))
{
$soc = new Societe($db);
$soc->fetch($commande->socid);
@@ -329,24 +333,24 @@ if ($_GET["action"] == 'create')
$product->fetch($line->fk_product);
$product->load_stock();
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$commande->fetch_thirdparty();
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (empty($newlang)) $newlang=$commande->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$commande->fetch_thirdparty();
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (empty($newlang)) $newlang=$commande->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $product->libelle;
}
else
$label = $product->libelle;
$label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $product->label;
}
else
$label = (! empty($line->label)?$line->label:$product->label);
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.$label;
@@ -355,7 +359,19 @@ if ($_GET["action"] == 'create')
}
else
{
print "<td>".nl2br($line->description)."</td>\n";
print "<td>";
if ($line->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
if (! empty($line->label)) {
$text.= ' <strong>'.$line->label.'</strong>';
print $form->textwithtooltip($text,$line->description,3,'','',$i);
} else {
print $text.' '.nl2br($line->description);
}
print_date_range($lines[$i]->date_start,$lines[$i]->date_end);
print "</td>\n";
}
print '<td align="center">'.$line->qty.'</td>';
@@ -426,10 +442,10 @@ else
/* */
/* *************************************************************************** */
{
if ($_GET["id"] > 0)
if ($id > 0)
{
$delivery = new Livraison($db);
$result = $delivery->fetch($_GET["id"]);
$result = $delivery->fetch($id);
$delivery->fetch_thirdparty();
$expedition=new Expedition($db);
@@ -441,7 +457,7 @@ else
$delivery->fetch_origin();
}
if ( $delivery->id > 0)
if ($delivery->id > 0)
{
$soc = new Societe($db);
$soc->fetch($delivery->socid);
@@ -453,7 +469,7 @@ else
* Confirmation de la suppression
*
*/
if ($_GET["action"] == 'delete')
if ($action == 'delete')
{
$expedition_id = $_GET["expid"];
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1);
@@ -464,7 +480,7 @@ else
* Confirmation de la validation
*
*/
if ($_GET["action"] == 'valid')
if ($action == 'valid')
{
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$delivery->ref),'confirm_valid','','',1);
if ($ret == 'html') print '<br>';
@@ -570,24 +586,24 @@ else
$product = new Product($db);
$product->fetch($delivery->lines[$i]->fk_product);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$delivery->fetch_thirdparty();
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (empty($newlang)) $newlang=$delivery->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$delivery->fetch_thirdparty();
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (empty($newlang)) $newlang=$delivery->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $delivery->lines[$i]->product_label;
}
else
$label = $delivery->lines[$i]->product_label;
$label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $delivery->lines[$i]->product_label;
}
else
$label = ( ! empty($delivery->lines[$i]->label)?$delivery->lines[$i]->label:$delivery->lines[$i]->product_label);
print '<td>';
@@ -595,15 +611,15 @@ else
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$delivery->lines[$i]->fk_product.'">';
if ($delivery->lines[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
$text.= ' '.$delivery->lines[$i]->ref.'</a>';
$text.= ' '.$delivery->lines[$i]->product_ref.'</a>';
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($delivery->lines[$i]->description));
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($delivery->lines[$i]->description));
//print $description;
print $form->textwithtooltip($text,$description,3,'','',$i);
print_date_range($delivery->lines[$i]->date_start,$delivery->lines[$i]->date_end);
if ($conf->global->PRODUIT_DESC_IN_FORM)
if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
{
print ($delivery->lines[$i]->description && $delivery->lines[$i]->description!=$delivery->lines[$i]->label)?'<br>'.dol_htmlentitiesbr($delivery->lines[$i]->description):'';
print (! empty($delivery->lines[$i]->description) && $delivery->lines[$i]->description!=$delivery->lines[$i]->product_label)?'<br>'.dol_htmlentitiesbr($delivery->lines[$i]->description):'';
}
}
else
@@ -611,7 +627,14 @@ else
print "<td>";
if ($delivery->lines[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($delivery->lines[$i]->description);
if (! empty($delivery->lines[$i]->label)) {
$text.= ' <strong>'.$delivery->lines[$i]->label.'</strong>';
print $form->textwithtooltip($text,$delivery->lines[$i]->description,3,'','',$i);
} else {
print $text.' '.nl2br($delivery->lines[$i]->description);
}
print_date_range($objp->date_start,$objp->date_end);
print "</td>\n";
}
@@ -700,7 +723,7 @@ else
}
}
$db->close();
llxFooter();
?>
$db->close();
?>