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

@@ -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');
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

@@ -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

@@ -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

@@ -4,7 +4,7 @@
* 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) 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

@@ -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

@@ -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');
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');
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

@@ -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');
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

@@ -172,3 +172,13 @@ HiddenIntoCombo=Hidden into select lists
Nature=Nature
ProductCodeModel=Product 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,15 +684,17 @@ class Livraison extends CommonObject
$obj = $this->db->fetch_object($resql);
$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->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;

View File

@@ -2,8 +2,8 @@
/* 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>
* Copyright (C) 2005-2010 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
@@ -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);
@@ -343,10 +347,10 @@ if ($_GET["action"] == 'create')
$outputlangs->setDefaultLang($newlang);
}
$label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $product->libelle;
$label = (! empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $product->label;
}
else
$label = $product->libelle;
$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>';
@@ -587,7 +603,7 @@ else
$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($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');
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();
?>