mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-17 23:11:29 +01:00
Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts: htdocs/core/actions_massactions.inc.php htdocs/core/lib/functions.lib.php htdocs/expensereport/class/expensereport.class.php
This commit is contained in:
@@ -1376,48 +1376,49 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.fk_adherent, c.subscription, c.note, c.fk_bank,";
|
$sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note, c.fk_bank,";
|
||||||
$sql.= " c.tms as datem,";
|
$sql .= " c.tms as datem,";
|
||||||
$sql.= " c.datec as datec,";
|
$sql .= " c.datec as datec,";
|
||||||
$sql.= " c.dateadh as dateh,";
|
$sql .= " c.dateadh as dateh,";
|
||||||
$sql.= " c.datef as datef";
|
$sql .= " c.datef as datef";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."subscription as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."subscription as c";
|
||||||
$sql.= " WHERE c.fk_adherent = ".$this->id;
|
$sql .= " WHERE c.fk_adherent = ".$this->id;
|
||||||
$sql.= " ORDER BY c.dateadh";
|
$sql .= " ORDER BY c.dateadh";
|
||||||
dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG);
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->subscriptions=array();
|
$this->subscriptions = array();
|
||||||
|
|
||||||
$i=0;
|
$i = 0;
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
if ($i==0)
|
if ($i == 0)
|
||||||
{
|
{
|
||||||
$this->first_subscription_date=$this->db->jdate($obj->datec);
|
$this->first_subscription_date = $this->db->jdate($obj->datec);
|
||||||
$this->first_subscription_date_start=$this->db->jdate($obj->dateh);
|
$this->first_subscription_date_start = $this->db->jdate($obj->dateh);
|
||||||
$this->first_subscription_date_end=$this->db->jdate($obj->datef);
|
$this->first_subscription_date_end = $this->db->jdate($obj->datef);
|
||||||
$this->first_subscription_amount=$obj->subscription;
|
$this->first_subscription_amount = $obj->subscription;
|
||||||
}
|
}
|
||||||
$this->last_subscription_date=$this->db->jdate($obj->datec);
|
$this->last_subscription_date = $this->db->jdate($obj->datec);
|
||||||
$this->last_subscription_date_start=$this->db->jdate($obj->datef);
|
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
|
||||||
$this->last_subscription_date_end=$this->db->jdate($obj->datef);
|
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
|
||||||
$this->last_subscription_amount=$obj->subscription;
|
$this->last_subscription_amount = $obj->subscription;
|
||||||
|
|
||||||
$subscription=new Subscription($this->db);
|
$subscription = new Subscription($this->db);
|
||||||
$subscription->id=$obj->rowid;
|
$subscription->id = $obj->rowid;
|
||||||
$subscription->fk_adherent=$obj->fk_adherent;
|
$subscription->fk_adherent = $obj->fk_adherent;
|
||||||
$subscription->amount=$obj->subscription;
|
$subscription->fk_type = $obj->fk_type;
|
||||||
$subscription->note=$obj->note;
|
$subscription->amount = $obj->subscription;
|
||||||
$subscription->fk_bank=$obj->fk_bank;
|
$subscription->note = $obj->note;
|
||||||
$subscription->datem=$this->db->jdate($obj->datem);
|
$subscription->fk_bank = $obj->fk_bank;
|
||||||
$subscription->datec=$this->db->jdate($obj->datec);
|
$subscription->datem = $this->db->jdate($obj->datem);
|
||||||
$subscription->dateh=$this->db->jdate($obj->dateh);
|
$subscription->datec = $this->db->jdate($obj->datec);
|
||||||
$subscription->datef=$this->db->jdate($obj->datef);
|
$subscription->dateh = $this->db->jdate($obj->dateh);
|
||||||
|
$subscription->datef = $this->db->jdate($obj->datef);
|
||||||
|
|
||||||
$this->subscriptions[]=$subscription;
|
$this->subscriptions[] = $subscription;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@@ -1425,7 +1426,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error().' sql='.$sql;
|
$this->error = $this->db->error().' sql='.$sql;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -691,11 +691,11 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
|||||||
|
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
|
$desc = ($lines[$i]->desc ? $lines[$i]->desc : '');
|
||||||
// If we build one invoice for several order, we must put the invoice of order on the line
|
// If we build one invoice for several order, we must put the invoice of order on the line
|
||||||
if (!empty($createbills_onebythird))
|
if (!empty($createbills_onebythird))
|
||||||
{
|
{
|
||||||
$desc = dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
|
$desc = dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($lines[$i]->subprice < 0)
|
if ($lines[$i]->subprice < 0)
|
||||||
|
|||||||
@@ -1882,6 +1882,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
|
|||||||
$format = str_replace('%A', '__A__', $format);
|
$format = str_replace('%A', '__A__', $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Analyze date
|
// Analyze date
|
||||||
$reg = array();
|
$reg = array();
|
||||||
if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
||||||
|
|||||||
@@ -1015,6 +1015,8 @@ class ExpenseReport extends CommonObject
|
|||||||
public function fetch_lines()
|
public function fetch_lines()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';
|
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';
|
||||||
|
|||||||
Reference in New Issue
Block a user