New: Can export customer shipments.

This commit is contained in:
Laurent Destailleur 2012-11-18 15:24:01 +01:00
parent 5f7aefd645
commit 6512fd90a9
12 changed files with 54 additions and 10 deletions

View File

@ -14,7 +14,7 @@ For users:
configured. Show also total number of activated modules.
- New: Can filter list of proposal, order or invoice on sales representative.
- New: Add supplier ref on supplier orders.
- New: Can export supplier orders.
- New: Can export supplier orders and customers shipments.
- New: First change to install external plugins from gui (experimental).
- New: Monaco is like France for default vat calculation
- New: Can list elements (invoices, orders or proposals) on a particular

View File

@ -42,6 +42,8 @@ class modExpedition extends DolibarrModules
*/
function __construct($db)
{
global $conf;
$this->db = $db;
$this->numero = 80;
@ -71,6 +73,8 @@ class modExpedition extends DolibarrModules
// Dependances
$this->depends = array("modCommande");
$this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array('deliveries','sendings');
// Constantes
$this->const = array();
@ -141,6 +145,14 @@ class modExpedition extends DolibarrModules
$this->rights[$r][4] = 'shipping_advance';
$this->rights[$r][5] = 'send';
$r++;
$this->rights[$r][0] = 106;
$this->rights[$r][1] = 'Exporter les expeditions';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'shipment';
$this->rights[$r][5] = 'export';
$r++;
$this->rights[$r][0] = 109;
$this->rights[$r][1] = 'Supprimer les expeditions';
@ -180,6 +192,25 @@ class modExpedition extends DolibarrModules
$this->rights[$r][4] = 'livraison';
$this->rights[$r][5] = 'supprimer';
// Exports
//--------
$r=0;
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("expedition","shipment","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','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note'=>"Note",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note'=>"Text",'ed.qty'=>"Number");
$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.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.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 ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'expedition as c, '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd)';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity;
}

View File

@ -65,6 +65,8 @@ class modProjet extends DolibarrModules
// Dependancies
$this->depends = array();
$this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array('projects');
// Constants
$this->const = array();

View File

@ -58,6 +58,8 @@ $entitytoicon = array(
'product' => 'product',
'warehouse' => 'stock',
'category' => 'category',
'shipment' => 'sending',
'shipment_line'=> 'sending'
);
// Translation code
@ -86,7 +88,9 @@ $entitytolang = array(
'warehouse' => 'Warehouse',
'category' => 'Category',
'other' => 'Other',
'trip' => 'TripsAndExpenses'
'trip' => 'TripsAndExpenses',
'shipment' => 'Shipments',
'shipment_line'=> 'ShipmentLine'
);
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();

View File

@ -79,6 +79,8 @@ alter table llx_propaldet drop column pa_ht;
alter table llx_propaldet drop column marge_tx;
alter table llx_propaldet drop column marque_tx;
alter table llx_expedition add column height_unit integer after height;
ALTER TABLE llx_commande CHANGE COLUMN fk_demand_reason fk_input_reason integer NULL DEFAULT NULL;
ALTER TABLE llx_propal CHANGE COLUMN fk_demand_reason fk_input_reason integer NULL DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_methode_commande fk_input_method integer NULL DEFAULT 0;

View File

@ -1,7 +1,7 @@
-- ===================================================================
-- Copyright (C) 2003-2010 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2008-2010 Regis Houssin <regis@dolibarr.fr>
-- Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
--
-- This program is free software; you can redistribute it and/or modify
@ -42,12 +42,12 @@ create table llx_expedition
tracking_number varchar(50),
fk_statut smallint DEFAULT 0,
height integer,
width integer,
size_units integer,
size integer,
weight_units integer,
weight integer,
height integer, -- height
width integer, -- with
size_units integer, -- unit of all sizes (height, width, depth)
size integer, -- depth
weight_units integer, -- unit of weight
weight integer, -- weight
note text,
model_pdf varchar(255)

View File

@ -115,7 +115,7 @@ CSVFormatDesc=<b>Comma Separated Value</b> file format (.csv).<br>This is a text
Excel95FormatDesc=<b>Excel</b> file format (.xls)<br>This is native Excel 95 format (BIFF5).
Excel2007FormatDesc=<b>Excel</b> file format (.xlsx)<br>This is native Excel 2007 format (SpreadsheetML).
TsvFormatDesc=<b>Tab Separated Value</b> file format (.tsv)<br>This is a text file format where fields are separated by a tabulator [tab].
ExportFieldAutomaticallyAdded=Field <b>%s</b> was automatically added. It will avoid you to have similar lines to be treated as duplicate records (with this field added, all ligne will own its own id and will differ).
ExportFieldAutomaticallyAdded=Field <b>%s</b> was automatically added. It will avoid you to have similar lines to be treated as duplicate records (with this field added, all lines will own their own id and will differ).
CsvOptions=Csv Options
Separator=Separator
Enclosure=Enclosure

View File

@ -24,6 +24,7 @@ ConfirmDeleteInterventionLine=Are you sure you want to delete this intervention
NameAndSignatureOfInternalContact=Name and signature of intervening :
NameAndSignatureOfExternalContact=Name and signature of customer :
DocumentModelStandard=Standard document model for interventions
InterventionCardsAndInterventionLines=Interventions and lines of interventions
ClassifyBilled=Classify "Billed"
StatusInterInvoiced=Billed
RelatedInterventions=Related interventions

View File

@ -93,6 +93,7 @@ CloneFiles=Clone joined files
ConfirmCloneProject=Are you sure to clone this project ?
ProjectReportDate=Change task date according project start date
ErrorShiftTaskDate=Impossible to shift task date according to new project start date
ProjectsAndTasksLines=Projects and tasks
##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Project leader
TypeContact_project_external_PROJECTLEADER=Project leader

View File

@ -58,6 +58,7 @@ ActionsOnShipping=Events on shipment
LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
RelatedShippings=Related shippings
ShipmentLine=Shipment line
# Sending methods
SendingMethodCATCH=Catch by customer

View File

@ -93,6 +93,7 @@ CloneFiles=Cloner les pièces jointes
ConfirmCloneProject=Êtes-vous sûr de vouloir cloner ce projet ?
ProjectReportDate=Reporter les dates des taches en fonction de la date de départ.
ErrorShiftTaskDate=Une erreur c'est produite dans le report des dates des taches.
ProjectsAndTasksLines=Projets et taches
##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Chef de projet
TypeContact_project_external_PROJECTLEADER=Chef de projet

View File

@ -58,6 +58,7 @@ ActionsOnShipping=Événements sur l'expédition
LinkToTrackYourPackage=Lien pour suivi de votre colis
ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle expédition se fait depuis la fiche commande.
RelatedShippings=Expédition(s) associée(s)
ShipmentLine=Ligne d'expédition
# Sending methods
SendingMethodCATCH=Enlèvement par le client