diff --git a/ChangeLog b/ChangeLog
index 3ae461decb3..e8b5cc4b203 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,8 @@ For users:
- New: [ task #1016 ] Can define a specific numbering for deposits
- New: [ task #918 ] Stock replenishment
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count
+- New : Add pdf link into supplier invoice list and supplier order list
+- New : Genrate auto the PDF for supplier invoice
For translators:
- Qual: Normalized sort order of all languages files with english reference files.
diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php
index 5b5b0dd7279..f8eecb486ad 100644
--- a/htdocs/comm/propal/class/propalestats.class.php
+++ b/htdocs/comm/propal/class/propalestats.class.php
@@ -62,10 +62,11 @@ class PropaleStats extends Stats
$object=new Propal($this->db);
$this->from = MAIN_DB_PREFIX.$object->table_element." as p";
- //$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
+ $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl";
$this->field='total_ht';
-
+ $this->field_line='total_ht';
+
$this->where.= " p.fk_statut > 0";
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
$this->where.= " AND p.entity = ".$conf->entity;
@@ -182,5 +183,29 @@ class PropaleStats extends Stats
return $this->_getAllByYear($sql);
}
+
+
+ /**
+ * Return nb, amount of predefined product for year
+ *
+ * @param int $year Year to scan
+ * @return array Array of values
+ */
+ function getAllByProduct($year)
+ {
+ global $user;
+
+ $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
+ $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
+ //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= " WHERE ".$this->where;
+ $sql.= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
+ $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
+ $sql.= " GROUP BY product.ref";
+ $sql.= $this->db->order('nb','DESC');
+ $sql.= $this->db->plimit(20);
+
+ return $this->_getAllByProduct($sql);
+ }
}
?>
diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php
index 9609a4e9440..930c6ca4587 100644
--- a/htdocs/commande/class/commandestats.class.php
+++ b/htdocs/commande/class/commandestats.class.php
@@ -66,16 +66,18 @@ class CommandeStats extends Stats
{
$object=new Commande($this->db);
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
- //$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
+ $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl";
$this->field='total_ht';
+ $this->field_line='total_ht';
$this->where.= " c.fk_statut > 0"; // Not draft and not cancelled
}
if ($mode == 'supplier')
{
$object=new CommandeFournisseur($this->db);
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
- //$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
+ $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl";
$this->field='total_ht';
+ $this->field_line='total_ht';
$this->where.= " c.fk_statut > 2"; // Only approved & ordered
}
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
@@ -191,6 +193,30 @@ class CommandeStats extends Stats
return $this->_getAllByYear($sql);
}
+
+ /**
+ * Return nb, amount of predefined product for year
+ *
+ * @param int $year Year to scan
+ * @return array Array of values
+ */
+ function getAllByProduct($year)
+ {
+ global $user;
+
+ $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
+ $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
+ //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= " WHERE ".$this->where;
+ $sql.= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid";
+ $sql.= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
+ $sql.= " GROUP BY product.ref";
+ $sql.= $this->db->order('nb','DESC');
+ $sql.= $this->db->plimit(20);
+
+ return $this->_getAllByProduct($sql);
+ }
+
}
?>
\ No newline at end of file
diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php
index 7f33f66fd8b..a402f2a70c4 100644
--- a/htdocs/compta/facture/class/facturestats.class.php
+++ b/htdocs/compta/facture/class/facturestats.class.php
@@ -209,6 +209,7 @@ class FactureStats extends Stats
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE ".$this->where;
$sql.= " AND f.rowid = tl.fk_facture AND tl.fk_product = product.rowid";
+ $sql.= " AND f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " GROUP BY product.ref";
$sql.= $this->db->order('nb','DESC');
$sql.= $this->db->plimit(20);
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index 8fccc4fd8a0..9311832d3be 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -86,29 +86,40 @@ class box_graph_product_distribution extends ModeleBoxes
$param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year';
$param_showinvoicenb='DOLUSERCOOKIE_param'.$this->boxcode.'showinvoicenb';
$param_showpropalnb='DOLUSERCOOKIE_param'.$this->boxcode.'showpropalnb';
+ $param_showordernb='DOLUSERCOOKIE_param'.$this->boxcode.'showordernb';
$showinvoicenb=GETPOST($param_showinvoicenb,'alpha',4);
$showpropalnb=GETPOST($param_showpropalnb,'alpha',4);
- if (empty($showinvoicenb) && empty($showpropalnb)) { $showpropalnb=1; $showinvoicenb=1; }
+ $showordernb=GETPOST($param_showordernb,'alpha',4);
+ if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb=1; $showinvoicenb=1; $showordernb=1; }
$nowarray=dol_getdate(dol_now(),true);
$year=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']);
+ $paramtitle=$langs->trans("Products").'/'.$langs->trans("Services");
+ if (empty($conf->produit->enabled)) $paramtitle=$langs->trans("Services");
+ if (empty($conf->service->enabled)) $paramtitle=$langs->trans("Products");
+
if ($user->rights->facture->lire)
{
-
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
- include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
+
$mode='customer';
$userid=0;
- $WIDTH=(($showinvoicenb && $showpropalnb) || ! empty($conf->dol_optimize_smallscreen))?'256':'320';
+ $WIDTH=(($showinvoicenb && $showpropalnb) || ! empty($conf->dol_optimize_smallscreen))?'160':'320';
$HEIGHT='192';
-
- $stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
-
+
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showinvoicenb)
{
- $data1 = $stats->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24)));
-
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
+
+ $showpointvalue = 1;
+ $stats_invoice = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0));
+ $data1 = $stats_invoice->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24)));
+ if (empty($data1))
+ {
+ $showpointvalue=0;
+ $data1=array(array(0=>$langs->trans("None"),1=>1));
+ }
$filenamenb = $dir."/prodserforinvoice-".$year.".png";
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=productstats&file=prodserforinvoice-'.$year.'.png';
@@ -119,13 +130,16 @@ class box_graph_product_distribution extends ModeleBoxes
$px1->SetData($data1);
unset($data1);
$px1->SetPrecisionY(0);
- $i=0;$tot=count($data2);$legend=array();
+ $i=0;$tot=count($data1);$legend=array();
while ($i <= $tot)
{
- $legend[]=$data2[$i][0];
+ $legend[]=$data1[$i][0];
$i++;
}
$px1->SetLegend($legend);
+ $px1->setShowLegend(0);
+ $px1->setShowPointValue($showpointvalue);
+ $px1->setShowPercent(0);
$px1->SetMaxValue($px1->GetCeilMaxValue());
$px1->SetWidth($WIDTH);
$px1->SetHeight($HEIGHT);
@@ -136,22 +150,31 @@ class box_graph_product_distribution extends ModeleBoxes
$px1->SetCssPrefix("cssboxes");
//$px1->mode='depth';
$px1->SetType(array('pie'));
- $px1->SetTitle($langs->trans("BoxProductDistributionFor",$langs->trans("ProductsServices"),$langs->transnoentitiesnoconv("Invoices")));
-
+ $px1->SetTitle($langs->trans("BoxProductDistributionFor",$paramtitle,$langs->transnoentitiesnoconv("Invoices")));
+
$px1->draw($filenamenb,$fileurlnb);
}
}
}
-/* if ($user->rights->propal->lire)
+ if ($user->rights->propal->lire)
{
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showpropalnb)
{
- $data2 = $stats->getAmountByMonthWithPrevYear($year,(GETPOST('action')==$refreshaction?-1:(3600*24)));
-
+ include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
+
+ $showpointvalue = 1;
+ $stats_proposal = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0));
+ $data2 = $stats_proposal->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24)));
+ if (empty($data2))
+ {
+ $showpointvalue = 0;
+ $data2=array(array(0=>$langs->trans("None"),1=>1));
+ }
+
$filenamenb = $dir."/prodserforpropal-".$year.".png";
- $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=prodserforpropal-'.$year.'.png';
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=proposalstats&file=prodserforpropal-'.$year.'.png';
$px2 = new DolGraph();
$mesg = $px2->isGraphKo();
@@ -167,6 +190,9 @@ class box_graph_product_distribution extends ModeleBoxes
$i++;
}
$px2->SetLegend($legend);
+ $px2->setShowLegend(0);
+ $px2->setShowPointValue($showpointvalue);
+ $px2->setShowPercent(0);
$px2->SetMaxValue($px2->GetCeilMaxValue());
$px2->SetWidth($WIDTH);
$px2->SetHeight($HEIGHT);
@@ -175,14 +201,67 @@ class box_graph_product_distribution extends ModeleBoxes
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
- $px2->mode='depth';
- $px2->SetTitle($langs->trans("BoxProductDistributionFor",$langs->trans("ProductsServices"),$langs->transnoentitiesnoconv("Proposals")));
+ //$px2->mode='depth';
+ $px2->SetType(array('pie'));
+ $px2->SetTitle($langs->trans("BoxProductDistributionFor",$paramtitle,$langs->transnoentitiesnoconv("Proposals")));
$px2->draw($filenamenb,$fileurlnb);
}
}
}
- */
+
+ if ($user->rights->commande->lire)
+ {
+ // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
+ if ($showordernb)
+ {
+ include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
+
+ $showpointvalue = 1;
+ $stats_order = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0));
+ $data3 = $stats_order->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24)));
+ if (empty($data3))
+ {
+ $showpointvalue = 0;
+ $data3=array(array(0=>$langs->trans("None"),1=>1));
+ }
+
+ $filenamenb = $dir."/prodserfororder-".$year.".png";
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=prodserfororder-'.$year.'.png';
+
+ $px3 = new DolGraph();
+ $mesg = $px3->isGraphKo();
+ if (! $mesg)
+ {
+ $px3->SetData($data3);
+ unset($data3);
+ $px3->SetPrecisionY(0);
+ $i=0;$tot=count($data3);$legend=array();
+ while ($i <= $tot)
+ {
+ $legend[]=$data3[$i][0];
+ $i++;
+ }
+ $px3->SetLegend($legend);
+ $px3->setShowLegend(0);
+ $px3->setShowPointValue($showpointvalue);
+ $px3->setShowPercent(0);
+ $px3->SetMaxValue($px3->GetCeilMaxValue());
+ $px3->SetWidth($WIDTH);
+ $px3->SetHeight($HEIGHT);
+ //$px3->SetYLabel($langs->trans("AmountOfBillsHT"));
+ $px3->SetShading(3);
+ $px3->SetHorizTickIncrement(1);
+ $px3->SetPrecisionY(0);
+ $px3->SetCssPrefix("cssboxes");
+ //$px3->mode='depth';
+ $px3->SetType(array('pie'));
+ $px3->SetTitle($langs->trans("BoxProductDistributionFor",$paramtitle,$langs->transnoentitiesnoconv("Orders")));
+ $px3->draw($filenamenb,$fileurlnb);
+ }
+ }
+ }
+
if (! $mesg)
{
$stringtoshow='';
@@ -197,33 +276,39 @@ class box_graph_product_distribution extends ModeleBoxes
$stringtoshow.='
';
$stringtoshow.='';
- if ($showinvoicenb && $showpropalnb)
- {
- $stringtoshow.='';
- $stringtoshow.='
';
- }
+ //if ($showinvoicenb && $showpropalnb && $showordernb)
+ //{
+ $stringtoshow.='
';
+ $stringtoshow.='
';
+ //}
if ($showinvoicenb) $stringtoshow.=$px1->show();
- if ($showinvoicenb && $showpropalnb)
- {
+ //if ($showinvoicenb && $showpropalnb)
+ //{
$stringtoshow.='
';
- $stringtoshow.='
';
- }
-// if ($showpropalnb) $stringtoshow.=$px2->show();
- if ($showinvoicenb && $showpropalnb)
- {
+ $stringtoshow.='
';
+ //}
+ if ($showpropalnb) $stringtoshow.=$px2->show();
+ //if ($showinvoicenb && $showpropalnb)
+ //{
$stringtoshow.='
';
+ $stringtoshow.='
';
+ //}
+ if ($showordernb) $stringtoshow.=$px3->show();
+ //if ($showinvoicenb && $showpropalnb)
+ //{
+ $stringtoshow.='
';
$stringtoshow.='
';
- }
+ //}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 9c6cc5b424e..54ec78a8287 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -68,7 +68,10 @@ class DolGraph
var $Legend=array();
var $LegendWidthMin=0;
-
+ var $showlegend=1;
+ var $showpointvalue=1;
+ var $showpercent=0;
+
var $graph; // Objet Graph (Artichow, Phplot...)
var $error;
@@ -234,6 +237,7 @@ class DolGraph
*
* @param array $data Data
* @return void
+ * @see draw_jflot for syntax of data array
*/
function SetData($data)
{
@@ -379,7 +383,41 @@ class DolGraph
return $this->error;
}
+ /**
+ * Show legend or not
+ *
+ * @param int $showlegend 1=Show legend (default), 0=Hide legend
+ * @return void
+ */
+ function setShowLegend($showlegend)
+ {
+ $this->showlegend=$showlegend;
+ }
+ /**
+ * Show pointvalue or not
+ *
+ * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value
+ * @return void
+ */
+ function setShowPointValue($showpointvalue)
+ {
+ $this->showpointvalue=$showpointvalue;
+ }
+
+ /**
+ * Show percent or not
+ *
+ * @param int $showpercent 1=Show percent for each point, as tooltip or inline, 0=Hide percent (default)
+ * @return void
+ */
+ function setShowPercent($showpercent)
+ {
+ $this->showpercent=$showpercent;
+ }
+
+
+
/**
* Define background color of complete image
*
@@ -766,14 +804,13 @@ class DolGraph
// Works with line but not with bars
//if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x
-
$i=$firstlot;
$serie=array();
while ($i < $nblot) // Loop on each serie
{
$values=array(); // Array with horizontal y values (specific values of a serie) for each abscisse x
$serie[$i]="var d".$i." = [];\n";
-
+
// Fill array $values
$x=0;
foreach($this->data as $valarray) // Loop on each x
@@ -816,7 +853,12 @@ class DolGraph
{
$datacolor=array();
foreach($this->datacolor as $val) $datacolor[]="#".sprintf("%02x%02x%02x",$val[0],$val[1],$val[2]);
-
+
+ $urltemp=''; // TODO Add support for url link into labels
+ $showlegend=$this->showlegend;
+ $showpointvalue=$this->showpointvalue;
+ $showpercent=$this->showpercent;
+
$this->_stringtoshow.= '
function plotWithOptions_'.$tag.'() {
$.plot($("#placeholder_'.$tag.'"), d0,
@@ -833,11 +875,13 @@ class DolGraph
var number=series.data[0][1];
return \'';
$this->_stringtoshow.='
\';
},
background: {
@@ -894,9 +938,12 @@ class DolGraph
var x = item.datapoint[0].toFixed(2);
var y = item.datapoint[1].toFixed(2);
var z = item.series.xaxis.ticks[item.dataIndex].label;
-
+ ';
+ if ($this->showpointvalue > 0) $this->_stringtoshow.='
showTooltip_'.$tag.'(item.pageX, item.pageY,
item.series.label + "
" + z + " => " + y);
+ ';
+ $this->_stringtoshow.='
}
}
else {
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index ef8422a7dbc..43a06fead4e 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -144,7 +144,7 @@ class FormActions
global $bc;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
-
+
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 38558c2e5fe..428cddcf0ca 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1451,47 +1451,63 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
// To work with non standard path
if ($objecttype == 'facture' || $objecttype == 'invoice') {
- $classpath = 'compta/facture/class'; $module='facture'; $subelement='facture';
+ $classpath = 'compta/facture/class';
+ $module='facture';
+ $subelement='facture';
}
if ($objecttype == 'commande' || $objecttype == 'order') {
- $classpath = 'commande/class'; $module='commande'; $subelement='commande';
+ $classpath = 'commande/class';
+ $module='commande';
+ $subelement='commande';
}
if ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
if ($objecttype == 'shipping') {
- $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
+ $classpath = 'expedition/class';
+ $subelement = 'expedition';
+ $module = 'expedition_bon';
}
if ($objecttype == 'delivery') {
- $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
- }
- if ($objecttype == 'invoice_supplier') {
- $classpath = 'fourn/class';
- }
- if ($objecttype == 'order_supplier') {
- $classpath = 'fourn/class';
+ $classpath = 'livraison/class';
+ $subelement = 'livraison';
+ $module = 'livraison_bon';
}
if ($objecttype == 'contract') {
- $classpath = 'contrat/class'; $module='contrat'; $subelement='contrat';
+ $classpath = 'contrat/class';
+ $module='contrat';
+ $subelement='contrat';
}
if ($objecttype == 'member') {
- $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent';
+ $classpath = 'adherents/class';
+ $module='adherent';
+ $subelement='adherent';
}
if ($objecttype == 'cabinetmed_cons') {
- $classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
+ $classpath = 'cabinetmed/class';
+ $module='cabinetmed';
+ $subelement='cabinetmedcons';
}
if ($objecttype == 'fichinter') {
- $classpath = 'fichinter/class'; $module='ficheinter'; $subelement='fichinter';
+ $classpath = 'fichinter/class';
+ $module='ficheinter';
+ $subelement='fichinter';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
if ($objecttype == 'invoice_supplier') {
- $classfile = 'fournisseur.facture'; $classname='FactureFournisseur';
+ $classfile = 'fournisseur.facture';
+ $classname='FactureFournisseur';
+ $classpath = 'fourn/class';
+ $module='fournisseur';
}
if ($objecttype == 'order_supplier') {
- $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur';
+ $classfile = 'fournisseur.commande';
+ $classname='CommandeFournisseur';
+ $classpath = 'fourn/class';
+ $module='fournisseur';
}
if (! empty($conf->$module->enabled))
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 1e932d64827..1876d181339 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -1812,6 +1812,16 @@ elseif (! empty($object->id))
* Linked object block
*/
$somethingshown=$object->showLinkedObjectBlock();
+
+ print '
';
+
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ $formactions=new FormActions($db);
+ $somethingshown=$formactions->showactions($object,'order_supplier',$socid);
+
+ print '
';
//print '
';
print '';
diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php
index 478bf76f86f..9715bb52ca7 100644
--- a/htdocs/fourn/commande/liste.php
+++ b/htdocs/fourn/commande/liste.php
@@ -23,9 +23,11 @@
* \brief List of suppliers orders
*/
+
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("orders");
@@ -65,6 +67,7 @@ if ($socid > 0)
llxHeader('',$title);
$commandestatic=new CommandeFournisseur($db);
+$formfile = new FormFile($db);
if ($sortorder == "") $sortorder="DESC";
@@ -154,6 +157,7 @@ if ($resql)
$var=true;
$userstatic = new User($db);
+ $objectstatic=new CommandeFournisseur($db);
while ($i < min($num,$conf->liste_limit))
{
@@ -163,7 +167,11 @@ if ($resql)
print " ";
// Ref
- print '| '.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.' | '."\n";
+ print ''.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'';
+ $filename=dol_sanitizeFileName($obj->ref);
+ $filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
+ print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
+ print ' | '."\n";
// Company
print ''.img_object($langs->trans("ShowCompany"),"company").' ';
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index aaf36409b81..ebcb324f557 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -28,6 +28,10 @@
* \brief Page for supplier invoice card (view, edit, validate)
*/
+error_reporting(E_ALL);
+ini_set('display_errors', true);
+ini_set('html_errors', false);
+
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
@@ -456,6 +460,16 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
else
{
$db->commit();
+
+ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
+ $result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if ($result <= 0)
+ {
+ dol_print_error($db,$result);
+ exit;
+ }
+ }
+
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
@@ -608,7 +622,14 @@ elseif ($action == 'addline')
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
- //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
+ $result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if ($result <= 0)
+ {
+ dol_print_error($db,$result);
+ exit;
+ }
+ }
unset($_POST['qty']);
unset($_POST['type']);
@@ -659,7 +680,14 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
- //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
+ $result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ if ($result <= 0)
+ {
+ dol_print_error($db,$result);
+ exit;
+ }
+ }
$action='';
}
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 80c20a821ba..820aaadb573 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur
* Copyright (C) 2005-2013 Regis Houssin
* Copyright (C) 2013 Philippe Grand
+ * Copyright (C) 2013 Florian Henry
*
* 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,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.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.'/core/class/html.formfile.class.php';
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
@@ -99,6 +101,7 @@ if ($mode == 'search')
$now=dol_now();
$form=new Form($db);
$htmlother=new FormOther($db);
+$formfile = new FormFile($db);
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
@@ -252,6 +255,9 @@ if ($resql)
$facturestatic->ref=$obj->ref;
$facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1);
+ $filename=dol_sanitizeFileName($obj->ref);
+ $filedir=$conf->fournisseur->dir_output.'/facture' . '/' . dol_sanitizeFileName($obj->facid).'/0/'.dol_sanitizeFileName($obj->ref);
+ print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print " | \n";
print ''.dol_trunc($obj->ref_supplier,10)." | ";
print ''.dol_print_date($db->jdate($obj->datef),'day').' | ';
diff --git a/htdocs/langs/ca_ES/commercial.lang b/htdocs/langs/ca_ES/commercial.lang
index dc796ad2bef..f40ef35e89d 100644
--- a/htdocs/langs/ca_ES/commercial.lang
+++ b/htdocs/langs/ca_ES/commercial.lang
@@ -81,7 +81,7 @@ ActionAC_SHIP=Enviament expedició per correu
ActionAC_SUP_ORD=Enviament comanda a proveïdor per correu
ActionAC_SUP_INV=Enviament factura de proveïdor per correu
ActionAC_OTH=Altra
-# ActionAC_OTH_AUTO=Other (automatically inserted events)
+ActionAC_OTH_AUTO=Altra (esdeveniments inserits automàticament)
ActionAC_MANUAL=Esdeveniments creats manualment
ActionAC_AUTO=Esdeveniments creats automàticament
Stats=Estadístiques de venda
diff --git a/htdocs/langs/ca_ES/dict.lang b/htdocs/langs/ca_ES/dict.lang
index 0ab12a2e38c..225dc9f6280 100644
--- a/htdocs/langs/ca_ES/dict.lang
+++ b/htdocs/langs/ca_ES/dict.lang
@@ -1,4 +1,4 @@
-# Dolibarr language file - ca_ES - dict
+# Dolibarr language file - ca_ES - dict
CHARSET=UTF-8
CountryFR=França
CountryBE=Bèlgica
@@ -246,13 +246,13 @@ CountryJE=Jersey
CountryME=Monténégro
CountryBL=Saint-Barthélemy
CountryMF=Saint-Martin
-##### Civilities #####
+##### Civilities #####=undefined
CivilityMME=Senyora
CivilityMR=Senyor
CivilityMLE=Senyoreta
CivilityMTRE=En
CivilityDR=Doctor
-##### Currencies #####
+##### Currencies #####=undefined
Currencyeuros=Euros
CurrencyAUD=Dòlars Aus.
CurrencySingAUD=Dòlar Aus.
@@ -294,7 +294,7 @@ CurrencyXPF=Francs CFP
CurrencySingXPF=Franc CFP
CurrencyCentSingEUR=cèntim
CurrencyThousandthSingTND=mil·lèsim
-#### Input reasons ####=
+#### Input reasons ####
DemandReasonTypeSRC_INTE=Internet
DemandReasonTypeSRC_CAMP_MAIL=Campanya correu
DemandReasonTypeSRC_CAMP_EMAIL=Campanya E-Mailing
@@ -306,7 +306,7 @@ DemandReasonTypeSRC_WOM=Boca a boca
DemandReasonTypeSRC_PARTNER=Soci
DemandReasonTypeSRC_EMPLOYEE=Empleat
DemandReasonTypeSRC_SPONSORING=Patrocinador
-#### Paper formats ####=
+#### Paper formats ####
PaperFormatEU4A0=Format 4A0
PaperFormatEU2A0=Format 2A0
PaperFormatEUA0=Format A0
@@ -317,7 +317,7 @@ PaperFormatEUA4=Format A4
PaperFormatEUA5=Format A5
PaperFormatEUA6=Format A6
PaperFormatUSLETTER=Format carta EE. UU.
-PaperFormatUSLEGAL=
+PaperFormatUSLEGAL=Format legal EE. UU.
PaperFormatUSEXECUTIVE=Format executiu EE. UU.
PaperFormatUSLEDGER=Format tabloide
PaperFormatCAP1=Format canadec P1
diff --git a/htdocs/langs/ca_ES/donations.lang b/htdocs/langs/ca_ES/donations.lang
index 4e18a894944..ad368412004 100644
--- a/htdocs/langs/ca_ES/donations.lang
+++ b/htdocs/langs/ca_ES/donations.lang
@@ -7,6 +7,7 @@ Donor=Donant
Donors=Donants
AddDonation=Afegir donació
NewDonation=Nova donació
+ShowDonation=Mostrar donació
DonationPromise=Promesa de donació
PromisesNotValid=Promeses no validades
PromisesValid=Promeses validades
@@ -24,5 +25,9 @@ DonationStatusPaidShort=Pagada
ValidPromess=Validar promesa
BuildDonationReceipt=Crear rebut
DonationsModels=Model de document de recepció de donació
-LastModifiedDonations=Less %s últimes donacions modificades
-SearchADonation=Cercar una donació
\ No newline at end of file
+LastModifiedDonations=Les %s últimes donacions modificades
+SearchADonation=Cercar una donació
+DonationReceipt=Rebut de donació
+DonationRecipient=Beneficiari
+IConfirmDonationReception=El beneficiari confirma la recepció, com a donació, de la següent quantitat
+ThankYou=Moltes gràcies
diff --git a/htdocs/langs/ca_ES/exports.lang b/htdocs/langs/ca_ES/exports.lang
index 11f2499b342..23ed584b3aa 100644
--- a/htdocs/langs/ca_ES/exports.lang
+++ b/htdocs/langs/ca_ES/exports.lang
@@ -125,7 +125,7 @@ DeskCode=Codi oficina
BankAccountNumber=Número compte
BankAccountNumberKey=Dígit Control
## filters
-# SelectFilterFields=If you want to filter on some values, just input values here.
+SelectFilterFields=Si vol aplicar un filtre sobre alguns valors, introduïu-los aquí.
FilterableFields=Camps filtrables
FilteredFields=Campos filtrats
FilteredFieldsValues=Valors de filtres
diff --git a/htdocs/langs/ca_ES/externalsite.lang b/htdocs/langs/ca_ES/externalsite.lang
index 3210701aec2..e0e8f487817 100644
--- a/htdocs/langs/ca_ES/externalsite.lang
+++ b/htdocs/langs/ca_ES/externalsite.lang
@@ -1,4 +1,5 @@
# Dolibarr language file - ca_ES - externalsite
CHARSET=UTF-8
ExternalSiteSetup=Configuració de l'enllaç al lloc web extern
-ExternalSiteURL=URL del lloc extern
\ No newline at end of file
+ExternalSiteURL=URL del lloc extern
+ExternalSiteModuleNotComplete=El mòdul Lloc web extern no ha estat configurat correctament.
diff --git a/htdocs/langs/ca_ES/ftp.lang b/htdocs/langs/ca_ES/ftp.lang
index 5057fb93b64..80f17c93a15 100644
--- a/htdocs/langs/ca_ES/ftp.lang
+++ b/htdocs/langs/ca_ES/ftp.lang
@@ -9,4 +9,5 @@ FTPFeatureNotSupportedByYourPHP=El seu PHP no suporta les funcions FTP
FailedToConnectToFTPServer=No s'ha pogut connectar amb el servidor FTP (servidor: %s, port %s)
FailedToConnectToFTPServerWithCredentials=No s'ha pogut connectar amb el login/contrasenya FTP configurats
FTPFailedToRemoveFile=No s'ha pogut suprimir el fitxer %s.
-FTPFailedToRemoveDir=No s'ha pogut suprimir la carpeta %s (Comproveu els permisos i que el directori està buit).
\ No newline at end of file
+FTPFailedToRemoveDir=No s'ha pogut suprimir la carpeta %s (Comproveu els permisos i que el directori està buit).
+FTPPassiveMode=Mode passiu
diff --git a/htdocs/langs/ca_ES/languages.lang b/htdocs/langs/ca_ES/languages.lang
index 8a81803a2cf..0d06ed0d78a 100644
--- a/htdocs/langs/ca_ES/languages.lang
+++ b/htdocs/langs/ca_ES/languages.lang
@@ -2,6 +2,7 @@
CHARSET=UTF-8
Language_ar_AR=Àrab
Language_ar_SA=Àrab
+Language_bg_BG=Búlgar
Language_ca_ES=Català
Language_da_DA=Danès
Language_da_DK=Danès
@@ -27,6 +28,7 @@ Language_fr_BE=Francès (Bèlgica)
Language_fr_CA=Francès (Canadà)
Language_fr_CH=Francès (Suïssa)
Language_fr_FR=Francès
+Language_he_IL=Hebreu
Language_hu_HU=Hongarès
Language_is_IS=Islandès
Language_it_IT=Italià
@@ -45,4 +47,4 @@ Language_sl_SI=Eslovè
Language_sv_SV=Suec
Language_sv_SE=Suec
Language_zh_CN=Xinès
-Language_zh_TW=Xinès (Tradicional)
\ No newline at end of file
+Language_zh_TW=Xinès (Tradicional)
diff --git a/htdocs/langs/ca_ES/mailmanspip.lang b/htdocs/langs/ca_ES/mailmanspip.lang
index 085916bbd73..d85c9a2ca5c 100644
--- a/htdocs/langs/ca_ES/mailmanspip.lang
+++ b/htdocs/langs/ca_ES/mailmanspip.lang
@@ -17,12 +17,12 @@ DescADHERENT_SPIP_SERVEUR=Servidor SPIP
DescADHERENT_SPIP_DB=Nom de la base de dades d'SPIP
DescADHERENT_SPIP_USER=Usuari de la base de dades d'SPIP
DescADHERENT_SPIP_PASS=Contrasenya de la base de dades d'SPIP
-# AddIntoSpip=Add into SPIP
-# AddIntoSpipConfirmation=Are you sure you want to add this member into SPIP?
-# AddIntoSpipError=Failed to add the user in SPIP
-# DeleteIntoSpip=Remove from SPIP
-# DeleteIntoSpipConfirmation=Are you sure you want to remove this member from SPIP?
-# DeleteIntoSpipError=Failed to suppress the user from SPIP
-# SPIPConnectionFailed=Failed to connect to SPIP
+AddIntoSpip=Afegir a SPIP
+AddIntoSpipConfirmation=Esteu segur de voler afegir aquest membre a SPIP?
+AddIntoSpipError=S'ha produït un error en afegir el membre a SPIP
+DeleteIntoSpip=Esborrar de SPIP
+DeleteIntoSpipConfirmation=Esteu segur de voler esborrar aquest membre del SPIP?
+DeleteIntoSpipError=S'ha produït un error en suprimir el membre d'SPIP
+SPIPConnectionFailed=Error al connectar amb SPIP
SuccessToAddToMailmanList=Addició de %s a la llista Mailman %s o base SPIP realitzada
SuccessToRemoveToMailmanList=Eliminació de %s de la llista Mailman %s o base SPIP realitzada
diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang
index e749fd0ba2c..4c6902cdf78 100644
--- a/htdocs/langs/ca_ES/other.lang
+++ b/htdocs/langs/ca_ES/other.lang
@@ -8,8 +8,8 @@ ToolsDesc=Aquesta àrea està dedicada al reagrupament de diverses utilitats no
Birthday=Aniversari
BirthdayDate=Data aniversari
DateToBirth=Data de naiximent
-BirthdayAlertOn= alerta aniversari activada
-BirthdayAlertOff= alerta aniversari desactivada
+BirthdayAlertOn=alerta aniversari activada
+BirthdayAlertOff=alerta aniversari desactivada
Notify_FICHINTER_VALIDATE=Validació fitxa intervenció
Notify_FICHINTER_SENTBYMAIL=Enviament fitxa intervenció per e-mail
Notify_BILL_VALIDATE=Validació factura
@@ -24,7 +24,6 @@ Notify_WITHDRAW_EMIT=Emissió domiciliació
Notify_ORDER_SENTBYMAIL=Enviament comanda de client per e-mail
Notify_COMPANY_CREATE=Creació tercer
Notify_PROPAL_SENTBYMAIL=Enviament pressupost per e-mail
-Notify_ORDER_SENTBYMAIL=Enviament comanda de client per e-mail
Notify_BILL_PAYED=Cobrament factura a client
Notify_BILL_CANCEL=Cancel·lació factura a client
Notify_BILL_SENTBYMAIL=Enviament factura a client per e-mail
@@ -152,7 +151,7 @@ EMailTextOrderApproved=Comanda %s aprovada
EMailTextOrderApprovedBy=Comanda %s aprovada per %s
EMailTextOrderRefused=Comanda %s rebutjada
EMailTextOrderRefusedBy=Comanda %s rebutjada per %s
-# EMailTextExpeditionValidated=The shipping %s has been validated.
+EMailTextExpeditionValidated=L'enviament %s ha estat validat.
ImportedWithSet=Lot d'importació (import key)
DolibarrNotification=Notificació automàtica
ResizeDesc=Introduïu l'ample O la nova alçada. La relació es conserva en canviar la mida...
@@ -174,7 +173,6 @@ StartUpload=Transferir
CancelUpload=Cancel·lar transferència
FileIsTooBig=L'arxiu és massa gran
PleaseBePatient=Preguem esperi uns instants...
-
##### Calendar common #####
AddCalendarEntry=Afegir entrada al calendari
NewCompanyToDolibarr=Empresa %s inserida en Dolibarr
diff --git a/htdocs/langs/ca_ES/paypal.lang b/htdocs/langs/ca_ES/paypal.lang
index 041833621ca..88b659fb175 100644
--- a/htdocs/langs/ca_ES/paypal.lang
+++ b/htdocs/langs/ca_ES/paypal.lang
@@ -10,8 +10,8 @@ PAYPAL_API_USER=Nom usuari API
PAYPAL_API_PASSWORD=Contrasenya usuari API
PAYPAL_API_SIGNATURE=Signatura API
PAYPAL_API_INTEGRAL_OR_PAYPALONLY=Proposar pagament integral (Targeta+Paypal) o només Paypal
-# PaypalModeIntegral=Integral
-# PaypalModeOnlyPaypal=PayPal only
+PaypalModeIntegral=Integral
+PaypalModeOnlyPaypal=Només PayPal
PAYPAL_CSS_URL=Url opcional del full d'estil CSS de la pàgina de pagament
ThisIsTransactionId=Identificador de la transacció: %s
PAYPAL_ADD_PAYMENT_URL=Afegir la url del pagament Paypal en enviar un document per e-mail
diff --git a/htdocs/langs/ca_ES/suppliers.lang b/htdocs/langs/ca_ES/suppliers.lang
index d7e2dd1fd28..541ae6200b1 100644
--- a/htdocs/langs/ca_ES/suppliers.lang
+++ b/htdocs/langs/ca_ES/suppliers.lang
@@ -26,7 +26,7 @@ RefSupplierShort=Ref. proveïdor
Availability=Disponibilitat
ExportDataset_fournisseur_1=Factures de proveïdors i línies de factura
ExportDataset_fournisseur_2=Factures proveïdors i pagaments
-# ExportDataset_fournisseur_3=Supplier orders and order lines
+ExportDataset_fournisseur_3=Comandes de proveïdors i línies de comanda
ApproveThisOrder=Aprovar aquesta comanda
ConfirmApproveThisOrder=Esteu segur de voler aprovar la comanda a proveïdor %s?
DenyingThisOrder=Denegar aquesta comanda
diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang
index 7ac3a28102a..65fd3dec7cd 100644
--- a/htdocs/langs/en_US/boxes.lang
+++ b/htdocs/langs/en_US/boxes.lang
@@ -85,4 +85,7 @@ BoxSuppliersOrdersPerMonth=Supplier orders per month
BoxProposalsPerMonth=Proposals per month
NoTooLowStockProducts=No product under the low stock limit
BoxProductDistribution=Products/Services distribution
-BoxProductDistributionFor=Distribution of %s for %s
\ No newline at end of file
+BoxProductDistributionFor=Distribution of %s for %s
+ForCustomersInvoices=Customers invoices
+ForCustomersOrders=Customers orders
+ForProposals=Proposals
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang
index 2a163ff382e..48f8459c1bc 100644
--- a/htdocs/langs/fr_FR/boxes.lang
+++ b/htdocs/langs/fr_FR/boxes.lang
@@ -85,4 +85,7 @@ BoxSuppliersOrdersPerMonth=Commandes fournisseurs par mois
BoxProposalsPerMonth=Proposition par mois
NoTooLowStockProducts=Pas de produits sous le seuil de stock minimal
BoxProductDistribution=Répartition des produis/services
-BoxProductDistributionFor=Répartition des %s pour les %s
\ No newline at end of file
+BoxProductDistributionFor=Répartition des %s pour les %s
+ForCustomersInvoices=Factures clients
+ForCustomersOrders=Commandes clients
+ForProposals=Propositions
\ No newline at end of file
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index ba895840b87..ddafc390fde 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -478,6 +478,10 @@ div.ficheaddleft {
dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; }
else print "margin-top: 10px;\n"; ?>
}
+.containercenter {
+display : table;
+margin : 0px auto;
+}
/* ============================================================================== */
|