Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
20e6ca74c7
@ -2,6 +2,12 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.6 compared to 3.5.* *****
|
||||
For users:
|
||||
- New: Add list of orders products in tab "consumption" on thirdparties.
|
||||
- New: Add graph stats for suppliers orders in tab "stats" on products.
|
||||
|
||||
|
||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||
For users:
|
||||
- New: Add hidden option BANK_DISABLE_DIRECT_INPUT.
|
||||
|
||||
@ -138,10 +138,12 @@ StatsByNumberOfEntities=Estadístiques en nombre d'identitats referents
|
||||
NumberOfProposals=Nombre de pressupostos en els darrers 12 mesos
|
||||
NumberOfCustomerOrders=Nombre de comandes de clients en els darrers 12 mesos
|
||||
NumberOfCustomerInvoices=Nombre de factures a clients en els darrers 12 mesos
|
||||
NumberOfSupplierOrders=Nombre de comandes a proveïdors en els darrers 12 mesos
|
||||
NumberOfSupplierInvoices=Nombre de factures de proveïdors en els darrers 12 mesos
|
||||
NumberOfUnitsProposals=Nombre d'unitats en els pressupostos en els darrers 12 mesos
|
||||
NumberOfUnitsCustomerOrders=Nombre d'unitats en les comandes de clients en els darrers 12 mesos
|
||||
NumberOfUnitsCustomerInvoices=Nombre d'unitats en les factures a clients en els darrers 12 mesos
|
||||
NumberOfUnitsSupplierInvoices=Nombre d'unitats en les comandes a proveïdors en els darrers 12 mesos
|
||||
NumberOfUnitsSupplierInvoices=Nombre d'unitats en les factures de proveïdors en els darrers 12 mesos
|
||||
EMailTextInterventionValidated=Fitxa intervenció %s validada
|
||||
EMailTextInvoiceValidated=Factura %s validada
|
||||
|
||||
@ -138,10 +138,12 @@ StatsByNumberOfEntities=Statistics in number of referring entities
|
||||
NumberOfProposals=Number of proposals on last 12 month
|
||||
NumberOfCustomerOrders=Number of customer orders on last 12 month
|
||||
NumberOfCustomerInvoices=Number of customer invoices on last 12 month
|
||||
NumberOfSupplierOrders=Number of supplier orders on last 12 month
|
||||
NumberOfSupplierInvoices=Number of supplier invoices on last 12 month
|
||||
NumberOfUnitsProposals=Number of units on proposals on last 12 month
|
||||
NumberOfUnitsCustomerOrders=Number of units on customer orders on last 12 month
|
||||
NumberOfUnitsCustomerInvoices=Number of units on customer invoices on last 12 month
|
||||
NumberOfUnitsSupplierOrders=Number of units on supplier orders on last 12 month
|
||||
NumberOfUnitsSupplierInvoices=Number of units on supplier invoices on last 12 month
|
||||
EMailTextInterventionValidated=The intervention %s has been validated.
|
||||
EMailTextInvoiceValidated=The invoice %s has been validated.
|
||||
|
||||
@ -138,10 +138,12 @@ StatsByNumberOfEntities=Estadísticas en número de identidades referentes
|
||||
NumberOfProposals=Número de presupuestos en los últimos 12 meses
|
||||
NumberOfCustomerOrders=Número de pedidos de clientes en los últimos 12 meses
|
||||
NumberOfCustomerInvoices=Número de facturas a clientes en los últimos 12 meses
|
||||
NumberOfSupplierOrders=Número de pedidos a proveedores en los últimos 12 meses
|
||||
NumberOfSupplierInvoices=Número de facturas de proveedores en los últimos 12 meses
|
||||
NumberOfUnitsProposals=Número de unidades en los presupuestos en los últimos 12 meses
|
||||
NumberOfUnitsCustomerOrders=Número de unidades en los pedidos de clientes en los últimos 12 meses
|
||||
NumberOfUnitsCustomerInvoices=Número de unidades en las facturas a clientes en los últimos 12 meses
|
||||
NumberOfUnitsSupplierOrders=Número de unidades en los pedidos a proveedores en los últimos 12 meses
|
||||
NumberOfUnitsSupplierInvoices=Número de unidades en las facturas de proveedores en los últimos 12 meses
|
||||
EMailTextInterventionValidated=Ficha intervención %s validada
|
||||
EMailTextInvoiceValidated=Factura %s validada
|
||||
|
||||
@ -138,10 +138,12 @@ StatsByNumberOfEntities=Statistiques en nombre d'entités référentes
|
||||
NumberOfProposals=Nombre de propositions commerciales sur les 12 derniers mois
|
||||
NumberOfCustomerOrders=Nombre de commandes clients sur les 12 derniers mois
|
||||
NumberOfCustomerInvoices=Nombre de factures clients sur les 12 derniers mois
|
||||
NumberOfSupplierOrders=Nombre de commandes fournisseurs sur les 12 derniers mois
|
||||
NumberOfSupplierInvoices=Nombre de factures fournisseurs sur les 12 derniers mois
|
||||
NumberOfUnitsProposals=Nombre d'unités sur les propositions commerciales des 12 derniers mois
|
||||
NumberOfUnitsCustomerOrders=Nombre d'unités sur les commandes clients des 12 derniers mois
|
||||
NumberOfUnitsCustomerInvoices=Nombre d'unités sur les factures clients des 12 derniers mois
|
||||
NumberOfUnitsSupplierOrders=Nombre d'unités sur les commandes fournisseur des 12 derniers mois
|
||||
NumberOfUnitsSupplierInvoices=Nombre d'unités sur les factures fournisseurs des 12 derniers mois
|
||||
EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée.
|
||||
EMailTextInvoiceValidated=La facture %s vous concernant a été validée.
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2007-2011 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
@ -1829,6 +1829,33 @@ class Product extends CommonObject
|
||||
|
||||
return $this->_get_stats($sql,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return nb of units or orders in which product is included
|
||||
*
|
||||
* @param int $socid Limit count on a particular third party id
|
||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||
*/
|
||||
function get_nb_ordersupplier($socid,$mode)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$sql = "SELECT sum(d.qty), date_format(c.date_commande, '%Y%m')";
|
||||
if ($mode == 'bynumber') $sql.= ", count(DISTINCT c.rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as d, ".MAIN_DB_PREFIX."commande_fournisseur as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->fournisseur->lire && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE c.rowid = d.fk_commande";
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY date_format(c.date_commande,'%Y%m')";
|
||||
$sql.= " ORDER BY date_format(c.date_commande,'%Y%m') DESC";
|
||||
|
||||
return $this->_get_stats($sql,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lie un produit associe au produit/service
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (c) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2013 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
|
||||
@ -142,6 +143,9 @@ if (! empty($id) || ! empty($ref))
|
||||
'invoices' =>array('modulepart'=>'productstats_invoices',
|
||||
'file' => $object->id.'/invoices12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))),
|
||||
'orderssuppliers'=>array('modulepart'=>'productstats_orderssuppliers',
|
||||
'file' => $object->id.'/orderssuppliers12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders"):$langs->transnoentitiesnoconv("NumberOfSupplierOrders"))),
|
||||
'invoicessuppliers'=>array('modulepart'=>'productstats_invoicessuppliers',
|
||||
'file' => $object->id.'/invoicessuppliers12m.png',
|
||||
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices"))),
|
||||
@ -165,6 +169,7 @@ if (! empty($id) || ! empty($ref))
|
||||
if ($key == 'orders') $graph_data = $object->get_nb_order($socid,$mode);
|
||||
if ($key == 'invoices') $graph_data = $object->get_nb_vente($socid,$mode);
|
||||
if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode);
|
||||
if ($key == 'orderssuppliers') $graph_data = $object->get_nb_ordersupplier($socid,$mode);
|
||||
|
||||
if (is_array($graph_data))
|
||||
{
|
||||
@ -204,6 +209,7 @@ if (! empty($id) || ! empty($ref))
|
||||
if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue;
|
||||
if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue;
|
||||
if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue;
|
||||
if ($graphfiles == 'orders_suppliers' && ! $user->rights->fournisseur->commande->lire) continue;
|
||||
|
||||
|
||||
if ($i % 2 == 0)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012-2013 Philippe Berthet <berthet@systune.be>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* Version V1.1 Initial version of Philippe Berthet
|
||||
* Version V2 Change to be compatible with 3.4 and enhanced to be more generic
|
||||
@ -30,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
|
||||
@ -173,7 +175,15 @@ $thirdTypeSelect='customer';
|
||||
}
|
||||
if ($type_element == 'order')
|
||||
{
|
||||
// TODO
|
||||
$documentstatic=new Commande($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, "1" as doc_type, f.date_commande as datePrint, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande as f,".MAIN_DB_PREFIX."commandedet as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_commande = f.rowid";
|
||||
$where.= " AND f.entity = ".$conf->entity;
|
||||
$datePrint = 'f.date_creation';
|
||||
$doc_number='f.ref';
|
||||
$thirdTypeSelect='customer';
|
||||
|
||||
}
|
||||
if ($type_element == 'supplier_order')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user