Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
This commit is contained in:
commit
f0dddae6d1
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -122,7 +122,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
}
|
||||
if (isset($_POST['orders_to_invoice']))
|
||||
{
|
||||
$orders_id = GETPOST('orders_to_invoice','',1);
|
||||
$orders_id = GETPOST('orders_to_invoice','',2);
|
||||
$nn = count($orders_id);
|
||||
$ii = 0;
|
||||
|
||||
|
||||
@ -209,7 +209,26 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if (count($listofqualifiedinvoice) > 0)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email .'>';
|
||||
|
||||
$fromtype = GETPOST('fromtype');
|
||||
if ($fromtype === 'user') {
|
||||
$from = $user->getFullName($langs) .' <'.$user->email.'>';
|
||||
}
|
||||
elseif ($fromtype === 'company') {
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
|
||||
}
|
||||
elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
|
||||
$tmp=explode(',', $user->email_aliases);
|
||||
$from = trim($tmp[($reg[1] - 1)]);
|
||||
}
|
||||
elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) {
|
||||
$tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
|
||||
$from = trim($tmp[($reg[1] - 1)]);
|
||||
}
|
||||
else {
|
||||
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
|
||||
}
|
||||
|
||||
$replyto = $from;
|
||||
$subject = GETPOST('subject');
|
||||
$message = GETPOST('message');
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
@ -1744,10 +1744,10 @@ else if ($id || $ref)
|
||||
{
|
||||
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
|
||||
$sql.= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
|
||||
$sql.= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, 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_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
|
||||
$sql.= ' p.description as product_desc';
|
||||
$sql.= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, 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_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
|
||||
$sql.= ', p.description as product_desc';
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql.= ", ".MAIN_DB_PREFIX.$origin."det as obj";
|
||||
|
||||
@ -350,10 +350,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->fk_parent_line = $objp->fk_parent_line;
|
||||
$line->special_code = $objp->special_code;
|
||||
$line->fk_parent_line = $objp->fk_parent_line;
|
||||
|
||||
$this->rang = $objp->rang;
|
||||
$line->rang = $objp->rang;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
@ -1399,7 +1399,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
if ($prod->fetch($fk_product) > 0)
|
||||
{
|
||||
$product_type = $prod->type;
|
||||
$label = $prod->libelle;
|
||||
$label = $prod->label;
|
||||
|
||||
// We use 'none' instead of $fourn_ref, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
|
||||
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
|
||||
@ -1501,7 +1501,6 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->line->product_type=$product_type;
|
||||
$this->line->remise_percent=$remise_percent;
|
||||
$this->line->subprice=$pu_ht;
|
||||
$this->line->rang=$this->rang;
|
||||
$this->line->info_bits=$info_bits;
|
||||
|
||||
$this->line->vat_src_code=$vat_src_code;
|
||||
@ -3093,7 +3092,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
$sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_unit,";
|
||||
$sql.= " fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc";
|
||||
$sql.= ")";
|
||||
$sql.= " VALUES (".$this->fk_commande.", '" . $this->db->escape($this->product_label) . "','" . $this->db->escape($this->desc) . "',";
|
||||
$sql.= " VALUES (".$this->fk_commande.", '" . $this->db->escape($this->label) . "','" . $this->db->escape($this->desc) . "',";
|
||||
$sql.= " ".($this->date_start?"'".$this->db->idate($this->date_start)."'":"null").",";
|
||||
$sql.= " ".($this->date_end?"'".$this->db->idate($this->date_end)."'":"null").",";
|
||||
if ($this->fk_product) { $sql.= $this->fk_product.","; }
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
@ -116,7 +116,7 @@ if (($action == 'create' || $action == 'add') && ! $error) {
|
||||
$_GET['originid'] = $orders_id[0];
|
||||
}
|
||||
if (isset($_POST['orders_to_invoice'])) {
|
||||
$orders_id = GETPOST('orders_to_invoice','',1);
|
||||
$orders_id = GETPOST('orders_to_invoice','',2);
|
||||
$nn = count($orders_id);
|
||||
$ii = 0;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user