Merge remote-tracking branch 'Dolibarr/develop' into develop
This commit is contained in:
commit
974c0d1d37
@ -35,7 +35,7 @@ Restler 3.0.0RC6 LGPL-3+ Yes
|
|||||||
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
||||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||||
Stripe 4.7.0 MIT licence Yes Library for Stripe module
|
Stripe 6.34.5 MIT licence Yes Library for Stripe module
|
||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
jQuery 3.3.1 MIT License Yes JS library
|
jQuery 3.3.1 MIT License Yes JS library
|
||||||
|
|||||||
@ -9,7 +9,6 @@ define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
|
|||||||
define('DOL_URL_ROOT', '/');
|
define('DOL_URL_ROOT', '/');
|
||||||
|
|
||||||
// Load the main.inc.php file to have finctions llx_Header and llx_Footer defined
|
// Load the main.inc.php file to have finctions llx_Header and llx_Footer defined
|
||||||
if (! defined("NOLOGIN")) define("NOLOGIN",'1');
|
if (! defined("NOLOGIN")) define("NOLOGIN", '1');
|
||||||
global $conf, $langs, $user, $db;
|
global $conf, $langs, $user, $db;
|
||||||
include_once __DIR__ . '/../../htdocs/main.inc.php';
|
include_once __DIR__ . '/../../htdocs/main.inc.php';
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class AccountancyExport
|
|||||||
public static $EXPORT_TYPE_COGILOG = 8;
|
public static $EXPORT_TYPE_COGILOG = 8;
|
||||||
public static $EXPORT_TYPE_AGIRIS = 9;
|
public static $EXPORT_TYPE_AGIRIS = 9;
|
||||||
public static $EXPORT_TYPE_FEC = 11;
|
public static $EXPORT_TYPE_FEC = 11;
|
||||||
|
public static $EXPORT_TYPE_OPENCONCERTO = 12;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,6 +104,7 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
|
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
|
||||||
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
||||||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
||||||
|
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
||||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -126,6 +128,7 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_EBP => 'ebp',
|
self::$EXPORT_TYPE_EBP => 'ebp',
|
||||||
self::$EXPORT_TYPE_COGILOG => 'cogilog',
|
self::$EXPORT_TYPE_COGILOG => 'cogilog',
|
||||||
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
||||||
|
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
||||||
self::$EXPORT_TYPE_FEC => 'fec',
|
self::$EXPORT_TYPE_FEC => 'fec',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -187,6 +190,10 @@ class AccountancyExport
|
|||||||
'label' => $langs->trans('Modelcsv_FEC'),
|
'label' => $langs->trans('Modelcsv_FEC'),
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||||
),
|
),
|
||||||
|
self::$EXPORT_TYPE_OPENCONCERTO => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_openconcerto'),
|
||||||
|
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
'cr'=> array (
|
'cr'=> array (
|
||||||
'1' => $langs->trans("Unix"),
|
'1' => $langs->trans("Unix"),
|
||||||
@ -248,6 +255,9 @@ class AccountancyExport
|
|||||||
case self::$EXPORT_TYPE_AGIRIS :
|
case self::$EXPORT_TYPE_AGIRIS :
|
||||||
$this->exportAgiris($TData);
|
$this->exportAgiris($TData);
|
||||||
break;
|
break;
|
||||||
|
case self::$EXPORT_TYPE_OPENCONCERTO :
|
||||||
|
$this->exportOpenConcerto($TData);
|
||||||
|
break;
|
||||||
case self::$EXPORT_TYPE_FEC :
|
case self::$EXPORT_TYPE_FEC :
|
||||||
$this->exportFEC($TData);
|
$this->exportFEC($TData);
|
||||||
break;
|
break;
|
||||||
@ -588,6 +598,39 @@ class AccountancyExport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export format : OpenConcerto
|
||||||
|
*
|
||||||
|
* @param array $objectLines data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function exportOpenConcerto($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
|
$separator = ';';
|
||||||
|
$end_line = "\n";
|
||||||
|
|
||||||
|
foreach ($objectLines as $line) {
|
||||||
|
|
||||||
|
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||||
|
|
||||||
|
print $date . $separator;
|
||||||
|
print $line->code_journal;
|
||||||
|
if (empty($line->subledger_account)) {
|
||||||
|
print length_accountg($line->numero_compte) . $separator;
|
||||||
|
} else {
|
||||||
|
print length_accounta($line->subledger_account) . $separator;
|
||||||
|
}
|
||||||
|
print $line->doc_ref . $separator;
|
||||||
|
print $line->label_operation . $separator;
|
||||||
|
print price($line->debit) . $separator;
|
||||||
|
print price($line->credit) . $separator;
|
||||||
|
|
||||||
|
print $end_line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : Configurable
|
* Export format : Configurable
|
||||||
*
|
*
|
||||||
|
|||||||
@ -499,7 +499,7 @@ class Commande extends CommonOrder
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -2532,7 +2532,6 @@ class Facture extends CommonInvoice
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@ -2540,7 +2539,7 @@ class Facture extends CommonInvoice
|
|||||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function setDraft($user, $idwarehouse = -1)
|
public function setDraft($user, $idwarehouse = -1)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@ -2549,11 +2548,11 @@ class Facture extends CommonInvoice
|
|||||||
|
|
||||||
if ($this->statut == self::STATUS_DRAFT)
|
if ($this->statut == self::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING);
|
dol_syslog(__METHOD__." already draft status", LOG_WARNING);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -2564,10 +2563,10 @@ class Facture extends CommonInvoice
|
|||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->oldcopy= clone $this;
|
$this->oldcopy= clone $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si on decremente le produit principal et ses composants a la validation de facture, on réincrement
|
// Si on decremente le produit principal et ses composants a la validation de facture, on réincrement
|
||||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
|
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
|
||||||
@ -2595,15 +2594,15 @@ class Facture extends CommonInvoice
|
|||||||
$this->brouillon = 1;
|
$this->brouillon = 1;
|
||||||
$this->statut = self::STATUS_DRAFT;
|
$this->statut = self::STATUS_DRAFT;
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('BILL_UNVALIDATE', $user);
|
$result=$this->call_trigger('BILL_UNVALIDATE', $user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->statut=$old_statut;
|
$this->statut=$old_statut;
|
||||||
$this->brouillon=0;
|
$this->brouillon=0;
|
||||||
}
|
}
|
||||||
// End call triggers
|
// End call triggers
|
||||||
} else {
|
} else {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -48,17 +48,17 @@ $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'contrac
|
|||||||
|
|
||||||
$search_name=GETPOST('search_name', 'alpha');
|
$search_name=GETPOST('search_name', 'alpha');
|
||||||
$search_email=GETPOST('search_email', 'alpha');
|
$search_email=GETPOST('search_email', 'alpha');
|
||||||
$search_town=GETPOST('search_town','alpha');
|
$search_town=GETPOST('search_town', 'alpha');
|
||||||
$search_zip=GETPOST('search_zip','alpha');
|
$search_zip=GETPOST('search_zip', 'alpha');
|
||||||
$search_state=trim(GETPOST("search_state"));
|
$search_state=trim(GETPOST("search_state", 'alpha'));
|
||||||
$search_country=GETPOST("search_country", 'int');
|
$search_country=GETPOST("search_country", 'int');
|
||||||
$search_type_thirdparty=GETPOST("search_type_thirdparty", 'int');
|
$search_type_thirdparty=GETPOST("search_type_thirdparty", 'int');
|
||||||
$search_contract=GETPOST('search_contract');
|
$search_contract=GETPOST('search_contract', 'alpha');
|
||||||
$search_ref_customer=GETPOST('search_ref_customer', 'alpha');
|
$search_ref_customer=GETPOST('search_ref_customer', 'alpha');
|
||||||
$search_ref_supplier=GETPOST('search_ref_supplier', 'alpha');
|
$search_ref_supplier=GETPOST('search_ref_supplier', 'alpha');
|
||||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||||
$search_status=GETPOST('search_status');
|
$search_status=GETPOST('search_status', 'alpha');
|
||||||
$socid=GETPOST('socid');
|
$socid=GETPOST('socid', 'int');
|
||||||
$search_user=GETPOST('search_user', 'int');
|
$search_user=GETPOST('search_user', 'int');
|
||||||
$search_sale=GETPOST('search_sale', 'int');
|
$search_sale=GETPOST('search_sale', 'int');
|
||||||
$search_product_category=GETPOST('search_product_category', 'int');
|
$search_product_category=GETPOST('search_product_category', 'int');
|
||||||
@ -709,8 +709,8 @@ while ($i < min($num, $limit))
|
|||||||
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
|
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
|
||||||
if ($listsalesrepresentatives < 0) dol_print_error($db);
|
if ($listsalesrepresentatives < 0) dol_print_error($db);
|
||||||
$nbofsalesrepresentative=count($listsalesrepresentatives);
|
$nbofsalesrepresentative=count($listsalesrepresentatives);
|
||||||
if ($nbofsalesrepresentative > 3) {
|
if ($nbofsalesrepresentative > 3) {
|
||||||
// We print only number
|
// We print only number
|
||||||
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
|
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
|
||||||
print $nbofsalesrepresentative;
|
print $nbofsalesrepresentative;
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -1227,12 +1227,12 @@ abstract class CommonObject
|
|||||||
$result=array();
|
$result=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
//cas particulier pour les expeditions
|
//cas particulier pour les expeditions
|
||||||
if($this->element=='shipping' && $this->origin_id != 0) {
|
if ($this->element=='shipping' && $this->origin_id != 0) {
|
||||||
$id=$this->origin_id;
|
$id=$this->origin_id;
|
||||||
$element='commande';
|
$element='commande';
|
||||||
} elseif($this->element=='reception' && $this->origin_id != 0) {
|
} elseif ($this->element=='reception' && $this->origin_id != 0) {
|
||||||
$id=$this->origin_id;
|
$id=$this->origin_id;
|
||||||
$element='order_supplier';
|
$element='order_supplier';
|
||||||
} else {
|
} else {
|
||||||
$id=$this->id;
|
$id=$this->id;
|
||||||
$element=$this->element;
|
$element=$this->element;
|
||||||
@ -2086,25 +2086,25 @@ abstract class CommonObject
|
|||||||
* Change the shipping method
|
* Change the shipping method
|
||||||
*
|
*
|
||||||
* @param int $shipping_method_id Id of shipping method
|
* @param int $shipping_method_id Id of shipping method
|
||||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @param User $userused Object user
|
* @param User $userused Object user
|
||||||
*
|
*
|
||||||
* @return int 1 if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
public function setShippingMethod($shipping_method_id, $notrigger = false, $userused = null)
|
public function setShippingMethod($shipping_method_id, $notrigger = false, $userused = null)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if (empty($userused)) $userused=$user;
|
if (empty($userused)) $userused=$user;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (! $this->table_element) {
|
if (! $this->table_element) {
|
||||||
dol_syslog(get_class($this)."::setShippingMethod was called on objet with property table_element not defined", LOG_ERR);
|
dol_syslog(get_class($this)."::setShippingMethod was called on objet with property table_element not defined", LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if ($shipping_method_id<0) $shipping_method_id='NULL';
|
if ($shipping_method_id<0) $shipping_method_id='NULL';
|
||||||
dol_syslog(get_class($this).'::setShippingMethod('.$shipping_method_id.')');
|
dol_syslog(get_class($this).'::setShippingMethod('.$shipping_method_id.')');
|
||||||
@ -2112,30 +2112,30 @@ abstract class CommonObject
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " SET fk_shipping_method = ".$shipping_method_id;
|
$sql.= " SET fk_shipping_method = ".$shipping_method_id;
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
dol_syslog(get_class($this).'::setShippingMethod Error ', LOG_DEBUG);
|
dol_syslog(get_class($this).'::setShippingMethod Error ', LOG_DEBUG);
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
} else {
|
} else {
|
||||||
if (!$notrigger)
|
if (!$notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$this->context=array('shippingmethodupdate'=>1);
|
$this->context=array('shippingmethodupdate'=>1);
|
||||||
$result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
|
$result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
// End call trigger
|
// End call trigger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
$this->shipping_method_id = ($shipping_method_id=='NULL')?null:$shipping_method_id;
|
$this->shipping_method_id = ($shipping_method_id=='NULL')?null:$shipping_method_id;
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2217,17 +2217,17 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
public function setBankAccount($fk_account, $notrigger = false, $userused = null)
|
public function setBankAccount($fk_account, $notrigger = false, $userused = null)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if (empty($userused)) $userused=$user;
|
if (empty($userused)) $userused=$user;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (! $this->table_element) {
|
if (! $this->table_element) {
|
||||||
dol_syslog(get_class($this)."::setBankAccount was called on objet with property table_element not defined", LOG_ERR);
|
dol_syslog(get_class($this)."::setBankAccount was called on objet with property table_element not defined", LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if ($fk_account<0) $fk_account='NULL';
|
if ($fk_account<0) $fk_account='NULL';
|
||||||
dol_syslog(get_class($this).'::setBankAccount('.$fk_account.')');
|
dol_syslog(get_class($this).'::setBankAccount('.$fk_account.')');
|
||||||
@ -2236,36 +2236,36 @@ abstract class CommonObject
|
|||||||
$sql.= " SET fk_account = ".$fk_account;
|
$sql.= " SET fk_account = ".$fk_account;
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error());
|
dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error());
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!$notrigger)
|
if (!$notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$this->context=array('bankaccountupdate'=>1);
|
$this->context=array('bankaccountupdate'=>1);
|
||||||
$result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
|
$result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
// End call trigger
|
// End call trigger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->fk_account = ($fk_account=='NULL')?null:$fk_account;
|
$this->fk_account = ($fk_account=='NULL')?null:$fk_account;
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: Move line related operations to CommonObjectLine?
|
// TODO: Move line related operations to CommonObjectLine?
|
||||||
@ -2967,7 +2967,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add objects linked in llx_element_element.
|
* Add objects linked in llx_element_element.
|
||||||
*
|
*
|
||||||
@ -2978,7 +2978,7 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
public function add_object_linked($origin = null, $origin_id = null)
|
public function add_object_linked($origin = null, $origin_id = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$origin = (! empty($origin) ? $origin : $this->origin);
|
$origin = (! empty($origin) ? $origin : $this->origin);
|
||||||
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
||||||
|
|
||||||
@ -2986,7 +2986,7 @@ abstract class CommonObject
|
|||||||
if ($origin == 'order') $origin='commande';
|
if ($origin == 'order') $origin='commande';
|
||||||
if ($origin == 'invoice') $origin='facture';
|
if ($origin == 'invoice') $origin='facture';
|
||||||
if ($origin == 'invoice_template') $origin='facturerec';
|
if ($origin == 'invoice_template') $origin='facturerec';
|
||||||
if ($origin == 'supplierorder') $origin='order_supplier';
|
if ($origin == 'supplierorder') $origin='order_supplier';
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||||
@ -3003,16 +3003,16 @@ abstract class CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
|
dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3649,10 +3649,11 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
|
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
|
||||||
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
||||||
}elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
|
}
|
||||||
{
|
elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
|
||||||
if (empty($totalToShip)) $totalToShip=0;
|
{
|
||||||
$totalToShip+=$line->qty; // defined for reception only
|
if (empty($totalToShip)) $totalToShip=0;
|
||||||
|
$totalToShip+=$line->qty; // defined for reception only
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define qty, weight, volume, weight_units, volume_units
|
// Define qty, weight, volume, weight_units, volume_units
|
||||||
@ -4271,7 +4272,7 @@ abstract class CommonObject
|
|||||||
$productstatic->id = $line->fk_product;
|
$productstatic->id = $line->fk_product;
|
||||||
$productstatic->ref = $line->ref;
|
$productstatic->ref = $line->ref;
|
||||||
$productstatic->type = $line->fk_product_type;
|
$productstatic->type = $line->fk_product_type;
|
||||||
if(empty($productstatic->ref)){
|
if (empty($productstatic->ref)) {
|
||||||
$line->fetch_product();
|
$line->fetch_product();
|
||||||
$productstatic = $line->product;
|
$productstatic = $line->product;
|
||||||
}
|
}
|
||||||
@ -4637,14 +4638,14 @@ abstract class CommonObject
|
|||||||
if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
|
if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
|
||||||
}
|
}
|
||||||
if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey=true;
|
$setsharekey=true;
|
||||||
}
|
}
|
||||||
if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey=true;
|
$setsharekey=true;
|
||||||
}
|
}
|
||||||
if ($this->element == 'bank_account' && ! empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'bank_account' && ! empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey=true;
|
$setsharekey=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($setsharekey)
|
if ($setsharekey)
|
||||||
{
|
{
|
||||||
@ -4807,7 +4808,7 @@ abstract class CommonObject
|
|||||||
/* For triggers */
|
/* For triggers */
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Call trigger based on this instance.
|
* Call trigger based on this instance.
|
||||||
* Some context information may also be provided into array property this->context.
|
* Some context information may also be provided into array property this->context.
|
||||||
@ -4818,9 +4819,9 @@ abstract class CommonObject
|
|||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @return int Result of run_triggers
|
* @return int Result of run_triggers
|
||||||
*/
|
*/
|
||||||
public function call_trigger($trigger_name, $user)
|
public function call_trigger($trigger_name, $user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
@ -4845,7 +4846,7 @@ abstract class CommonObject
|
|||||||
/* Functions for extrafields */
|
/* Functions for extrafields */
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to get extra fields of an object into $this->array_options
|
* Function to get extra fields of an object into $this->array_options
|
||||||
* This method is in most cases called by method fetch of objects but you can call it separately.
|
* This method is in most cases called by method fetch of objects but you can call it separately.
|
||||||
@ -4854,9 +4855,9 @@ abstract class CommonObject
|
|||||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
||||||
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
||||||
*/
|
*/
|
||||||
public function fetch_optionals($rowid = null, $optionsArray = null)
|
public function fetch_optionals($rowid = null, $optionsArray = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($rowid)) $rowid=$this->id;
|
if (empty($rowid)) $rowid=$this->id;
|
||||||
|
|
||||||
// To avoid SQL errors. Probably not the better solution though
|
// To avoid SQL errors. Probably not the better solution though
|
||||||
@ -5484,7 +5485,7 @@ abstract class CommonObject
|
|||||||
elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
|
elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
|
||||||
{
|
{
|
||||||
$morecss = 'maxwidth75';
|
$morecss = 'maxwidth75';
|
||||||
} elseif ($type == 'url') {
|
} elseif ($type == 'url') {
|
||||||
$morecss='minwidth400';
|
$morecss='minwidth400';
|
||||||
}
|
}
|
||||||
elseif ($type == 'boolean')
|
elseif ($type == 'boolean')
|
||||||
@ -7178,8 +7179,8 @@ abstract class CommonObject
|
|||||||
* @param array $fieldsentry Properties of field
|
* @param array $fieldsentry Properties of field
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function quote($value, $fieldsentry)
|
protected function quote($value, $fieldsentry)
|
||||||
{
|
{
|
||||||
if (is_null($value)) return 'NULL';
|
if (is_null($value)) return 'NULL';
|
||||||
elseif (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
|
elseif (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
|
||||||
else return "'".$this->db->escape($value)."'";
|
else return "'".$this->db->escape($value)."'";
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class DolGraph
|
|||||||
public function __construct($library = 'jflot')
|
public function __construct($library = 'jflot')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor;
|
||||||
|
|
||||||
// To use old feature
|
// To use old feature
|
||||||
if ($library == 'artichow')
|
if ($library == 'artichow')
|
||||||
@ -883,7 +883,6 @@ class DolGraph
|
|||||||
private function draw_jflot($file, $fileurl)
|
private function draw_jflot($file, $fileurl)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $artichow_defaultfont;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
|
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
|
||||||
|
|
||||||
|
|||||||
@ -6585,7 +6585,7 @@ function dol_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembe
|
|||||||
* or descending output and uses optionally natural case insensitive sorting (which
|
* or descending output and uses optionally natural case insensitive sorting (which
|
||||||
* can be optionally case sensitive as well).
|
* can be optionally case sensitive as well).
|
||||||
*
|
*
|
||||||
* @param array $array Array to sort (array of array('key','otherkey1','otherkey2'...))
|
* @param array $array Array to sort (array of array('key1'=>val1,'key2'=>val2,'key3'...) or array of objects)
|
||||||
* @param string $index Key in array to use for sorting criteria
|
* @param string $index Key in array to use for sorting criteria
|
||||||
* @param int $order Sort order ('asc' or 'desc')
|
* @param int $order Sort order ('asc' or 'desc')
|
||||||
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort)
|
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort)
|
||||||
@ -6604,7 +6604,17 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
|
|||||||
if ($sizearray>0)
|
if ($sizearray>0)
|
||||||
{
|
{
|
||||||
$temp = array();
|
$temp = array();
|
||||||
foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
|
foreach(array_keys($array) as $key)
|
||||||
|
{
|
||||||
|
if (is_object($array[$key]))
|
||||||
|
{
|
||||||
|
$temp[$key]=$array[$key]->$index;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$temp[$key]=$array[$key][$index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $natsort) {
|
if (! $natsort) {
|
||||||
($order=='asc') ? asort($temp) : arsort($temp);
|
($order=='asc') ? asort($temp) : arsort($temp);
|
||||||
|
|||||||
@ -243,11 +243,12 @@ class modAccounting extends DolibarrModules
|
|||||||
$this->export_icon[$r]='Accounting';
|
$this->export_icon[$r]='Accounting';
|
||||||
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
|
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
|
||||||
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
|
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
|
||||||
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
|
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.account_parent'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
|
||||||
$this->export_entities_array[$r]=array('ac.rowid'=>"Accounting",'ac.pcg_version'=>"Accounting",'aa.rowid'=>'Accounting','aa.account_number'=>"Accounting",'aa.label'=>"Accounting",'aa.accountparent'=>"Accounting",'aa.pcg_type'=>"Accounting",'aa.pcgsubtype'=>"Accounting",'aa_active'=>"Accounting");
|
$this->export_entities_array[$r]=array('ac.rowid'=>"Accounting",'ac.pcg_version'=>"Accounting",'aa.rowid'=>'Accounting','aa.account_number'=>"Accounting",'aa.label'=>"Accounting",'aa.accountparent'=>"Accounting",'aa.pcg_type'=>"Accounting",'aa.pcgsubtype'=>"Accounting",'aa_active'=>"Accounting");
|
||||||
|
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa, '.MAIN_DB_PREFIX.'accounting_system as ac';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa';
|
||||||
|
$this->export_sql_end[$r] .=' ,'.MAIN_DB_PREFIX.'accounting_system as ac';
|
||||||
$this->export_sql_end[$r] .=' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') ';
|
$this->export_sql_end[$r] .=' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') ';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -169,6 +169,7 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_permission[$r]=array(array("produit","export"));
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
$this->export_fields_array[$r]=array(
|
$this->export_fields_array[$r]=array(
|
||||||
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",
|
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",
|
||||||
|
'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode",
|
||||||
'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",
|
'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",
|
||||||
'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
|
'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
|
||||||
'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
||||||
@ -184,7 +185,8 @@ class modProduct extends DolibarrModules
|
|||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
||||||
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
|
||||||
$this->export_TypeFields_array[$r]=array(
|
$this->export_TypeFields_array[$r]=array(
|
||||||
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",
|
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
|
||||||
|
'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
|
||||||
'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",
|
'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",
|
||||||
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",
|
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",
|
||||||
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'
|
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'
|
||||||
@ -289,7 +291,8 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_permission[$r]=array(array("produit","export"));
|
$this->export_permission[$r]=array(array("produit","export"));
|
||||||
$this->export_fields_array[$r]=array(
|
$this->export_fields_array[$r]=array(
|
||||||
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",
|
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",
|
||||||
'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",
|
'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode",
|
||||||
|
'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",
|
||||||
'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode',
|
'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode',
|
||||||
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",
|
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",
|
||||||
'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
|
||||||
@ -298,7 +301,8 @@ class modProduct extends DolibarrModules
|
|||||||
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
|
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
|
||||||
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty','pa.incdec'=>'ComposedProductIncDecStock'));
|
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty','pa.incdec'=>'ComposedProductIncDecStock'));
|
||||||
$this->export_TypeFields_array[$r]=array(
|
$this->export_TypeFields_array[$r]=array(
|
||||||
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",
|
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
|
||||||
|
'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
|
||||||
'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text',
|
'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text',
|
||||||
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
|
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
|
||||||
'p.datec'=>'Date','p.tms'=>'Date'
|
'p.datec'=>'Date','p.tms'=>'Date'
|
||||||
@ -308,7 +312,8 @@ class modProduct extends DolibarrModules
|
|||||||
$this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
|
$this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
|
||||||
$this->export_entities_array[$r]=array(
|
$this->export_entities_array[$r]=array(
|
||||||
'p.rowid'=>"virtualproduct",'p.ref'=>"virtualproduct",'p.label'=>"virtualproduct",'p.description'=>"virtualproduct",'p.url'=>"virtualproduct",
|
'p.rowid'=>"virtualproduct",'p.ref'=>"virtualproduct",'p.label'=>"virtualproduct",'p.description'=>"virtualproduct",'p.url'=>"virtualproduct",
|
||||||
'p.accountancy_code_sell'=>'virtualproduct','p.accountancy_code_buy'=>'virtualproduct','p.note'=>"virtualproduct",'p.length'=>"virtualproduct",
|
'p.accountancy_code_sell'=>'virtualproduct','p.accountancy_code_sell_intra'=>'virtualproduct','p.accountancy_code_sell_export'=>'virtualproduct',
|
||||||
|
'p.accountancy_code_buy'=>'virtualproduct','p.note'=>"virtualproduct",'p.length'=>"virtualproduct",
|
||||||
'p.surface'=>"virtualproduct",'p.volume'=>"virtualproduct",'p.weight'=>"virtualproduct",'p.customcode'=>'virtualproduct',
|
'p.surface'=>"virtualproduct",'p.volume'=>"virtualproduct",'p.weight'=>"virtualproduct",'p.customcode'=>'virtualproduct',
|
||||||
'p.price_base_type'=>"virtualproduct",'p.price'=>"virtualproduct",'p.price_ttc'=>"virtualproduct",'p.tva_tx'=>"virtualproduct",
|
'p.price_base_type'=>"virtualproduct",'p.price'=>"virtualproduct",'p.price_ttc'=>"virtualproduct",'p.tva_tx'=>"virtualproduct",
|
||||||
'p.tosell'=>"virtualproduct",'p.tobuy'=>"virtualproduct",'p.datec'=>"virtualproduct",'p.tms'=>"virtualproduct"
|
'p.tosell'=>"virtualproduct",'p.tobuy'=>"virtualproduct",'p.datec'=>"virtualproduct",'p.tms'=>"virtualproduct"
|
||||||
@ -492,6 +497,8 @@ class modProduct extends DolibarrModules
|
|||||||
'p.duration' => "eg. 365d/12m/1y",
|
'p.duration' => "eg. 365d/12m/1y",
|
||||||
'p.url' => 'link to product (no https)',
|
'p.url' => 'link to product (no https)',
|
||||||
'p.accountancy_code_sell' => "",
|
'p.accountancy_code_sell' => "",
|
||||||
|
'p.accountancy_code_sell_intra' => "",
|
||||||
|
'p.accountancy_code_sell_export' => "",
|
||||||
'p.accountancy_code_buy' => "",
|
'p.accountancy_code_buy' => "",
|
||||||
'p.weight' => "",
|
'p.weight' => "",
|
||||||
'p.weight_units' => 'use a unit of measure from the dictionary. g/Kg/T etc....matches field "Short Label" for unit type "weight" in table "' . MAIN_DB_PREFIX . 'c_units',
|
'p.weight_units' => 'use a unit of measure from the dictionary. g/Kg/T etc....matches field "Short Label" for unit type "weight" in table "' . MAIN_DB_PREFIX . 'c_units',
|
||||||
|
|||||||
@ -1474,8 +1474,6 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@ -1492,11 +1490,11 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
|
|
||||||
if ($this->statut == self::STATUS_DRAFT)
|
if ($this->statut == self::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING);
|
dol_syslog(__METHOD__." already draft status", LOG_WARNING);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 6.35.0 - 2019-05-14
|
||||||
|
* [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs
|
||||||
|
|
||||||
|
## 6.34.6 - 2019-05-13
|
||||||
|
* [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant
|
||||||
|
|
||||||
|
## 6.34.5 - 2019-05-06
|
||||||
|
* [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations
|
||||||
|
|
||||||
|
## 6.34.4 - 2019-05-06
|
||||||
|
* [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types
|
||||||
|
|
||||||
## 6.34.3 - 2019-05-01
|
## 6.34.3 - 2019-05-01
|
||||||
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
|
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
|
||||||
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
|
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
6.34.3
|
6.35.0
|
||||||
|
|||||||
@ -67,6 +67,7 @@ require(dirname(__FILE__) . '/lib/BalanceTransaction.php');
|
|||||||
require(dirname(__FILE__) . '/lib/BankAccount.php');
|
require(dirname(__FILE__) . '/lib/BankAccount.php');
|
||||||
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
|
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
|
||||||
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
|
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
|
||||||
|
require(dirname(__FILE__) . '/lib/Capability.php');
|
||||||
require(dirname(__FILE__) . '/lib/Card.php');
|
require(dirname(__FILE__) . '/lib/Card.php');
|
||||||
require(dirname(__FILE__) . '/lib/Charge.php');
|
require(dirname(__FILE__) . '/lib/Charge.php');
|
||||||
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
|
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
|
||||||
|
|||||||
@ -85,6 +85,7 @@ class Account extends ApiResource
|
|||||||
return $savedNestedResources;
|
return $savedNestedResources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PATH_CAPABILITIES = '/capabilities';
|
||||||
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
|
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
|
||||||
const PATH_LOGIN_LINKS = '/login_links';
|
const PATH_LOGIN_LINKS = '/login_links';
|
||||||
const PATH_PERSONS = '/persons';
|
const PATH_PERSONS = '/persons';
|
||||||
@ -128,21 +129,6 @@ class Account extends ApiResource
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array|null $params
|
|
||||||
* @param array|string|null $options
|
|
||||||
*
|
|
||||||
* @return Collection The list of persons.
|
|
||||||
*/
|
|
||||||
public function persons($params = null, $options = null)
|
|
||||||
{
|
|
||||||
$url = $this->instanceUrl() . '/persons';
|
|
||||||
list($response, $opts) = $this->_request('get', $url, $params, $options);
|
|
||||||
$obj = Util\Util::convertToStripeObject($response, $opts);
|
|
||||||
$obj->setLastResponse($response);
|
|
||||||
return $obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array|null $clientId
|
* @param array|null $clientId
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
@ -158,6 +144,51 @@ class Account extends ApiResource
|
|||||||
return OAuth::deauthorize($params, $opts);
|
return OAuth::deauthorize($params, $opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Capabilities methods
|
||||||
|
* We can not add the capabilities() method today as the Account object already has a
|
||||||
|
* capabilities property which is a hash and not the sub-list of capabilities.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $id The ID of the account to which the capability belongs.
|
||||||
|
* @param string|null $capabilityId The ID of the capability to retrieve.
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $opts
|
||||||
|
*
|
||||||
|
* @return Capability
|
||||||
|
*/
|
||||||
|
public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null)
|
||||||
|
{
|
||||||
|
return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $id The ID of the account to which the capability belongs.
|
||||||
|
* @param string|null $capabilityId The ID of the capability to update.
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $opts
|
||||||
|
*
|
||||||
|
* @return Capability
|
||||||
|
*/
|
||||||
|
public static function updateCapability($id, $capabilityId, $params = null, $opts = null)
|
||||||
|
{
|
||||||
|
return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string|null $id The ID of the account on which to retrieve the capabilities.
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $opts
|
||||||
|
*
|
||||||
|
* @return Collection The list of capabilities.
|
||||||
|
*/
|
||||||
|
public static function allCapabilities($id, $params = null, $opts = null)
|
||||||
|
{
|
||||||
|
return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|null $id The ID of the account on which to create the external account.
|
* @param string|null $id The ID of the account on which to create the external account.
|
||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
@ -233,6 +264,21 @@ class Account extends ApiResource
|
|||||||
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
|
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|null $params
|
||||||
|
* @param array|string|null $options
|
||||||
|
*
|
||||||
|
* @return Collection The list of persons.
|
||||||
|
*/
|
||||||
|
public function persons($params = null, $options = null)
|
||||||
|
{
|
||||||
|
$url = $this->instanceUrl() . '/persons';
|
||||||
|
list($response, $opts) = $this->_request('get', $url, $params, $options);
|
||||||
|
$obj = Util\Util::convertToStripeObject($response, $opts);
|
||||||
|
$obj->setLastResponse($response);
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|null $id The ID of the account on which to create the person.
|
* @param string|null $id The ID of the account on which to create the person.
|
||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
|
|||||||
@ -13,7 +13,7 @@ trait Create
|
|||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
* @param array|string|null $options
|
* @param array|string|null $options
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The created resource.
|
* @return static The created resource.
|
||||||
*/
|
*/
|
||||||
public static function create($params = null, $options = null)
|
public static function create($params = null, $options = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,7 +13,7 @@ trait Delete
|
|||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The deleted resource.
|
* @return static The deleted resource.
|
||||||
*/
|
*/
|
||||||
public function delete($params = null, $opts = null)
|
public function delete($params = null, $opts = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,7 +15,7 @@ trait Update
|
|||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The updated resource.
|
* @return static The updated resource.
|
||||||
*/
|
*/
|
||||||
public static function update($id, $params = null, $opts = null)
|
public static function update($id, $params = null, $opts = null)
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ trait Update
|
|||||||
/**
|
/**
|
||||||
* @param array|string|null $opts
|
* @param array|string|null $opts
|
||||||
*
|
*
|
||||||
* @return \Stripe\ApiResource The saved resource.
|
* @return static The saved resource.
|
||||||
*/
|
*/
|
||||||
public function save($opts = null)
|
public function save($opts = null)
|
||||||
{
|
{
|
||||||
|
|||||||
83
htdocs/includes/stripe/lib/Capability.php
Normal file
83
htdocs/includes/stripe/lib/Capability.php
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Stripe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Capability
|
||||||
|
*
|
||||||
|
* @package Stripe
|
||||||
|
*
|
||||||
|
* @property string $id
|
||||||
|
* @property string $object
|
||||||
|
* @property string $account
|
||||||
|
* @property bool $requested
|
||||||
|
* @property int $requested_at
|
||||||
|
* @property mixed $requirements
|
||||||
|
* @property string $status
|
||||||
|
*/
|
||||||
|
class Capability extends ApiResource
|
||||||
|
{
|
||||||
|
|
||||||
|
const OBJECT_NAME = "capability";
|
||||||
|
|
||||||
|
use ApiOperations\Update;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible string representations of a capability's status.
|
||||||
|
* @link https://stripe.com/docs/api/capabilities/object#capability_object-status
|
||||||
|
*/
|
||||||
|
const STATUS_ACTIVE = 'active';
|
||||||
|
const STATUS_INACTIVE = 'inactive';
|
||||||
|
const STATUS_PENDING = 'pending';
|
||||||
|
const STATUS_UNREQUESTED = 'unrequested';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string The API URL for this Stripe account reversal.
|
||||||
|
*/
|
||||||
|
public function instanceUrl()
|
||||||
|
{
|
||||||
|
$id = $this['id'];
|
||||||
|
$account = $this['account'];
|
||||||
|
if (!$id) {
|
||||||
|
throw new Error\InvalidRequest(
|
||||||
|
"Could not determine which URL to request: " .
|
||||||
|
"class instance has invalid ID: $id",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$id = Util\Util::utf8($id);
|
||||||
|
$account = Util\Util::utf8($account);
|
||||||
|
|
||||||
|
$base = Account::classUrl();
|
||||||
|
$accountExtn = urlencode($account);
|
||||||
|
$extn = urlencode($id);
|
||||||
|
return "$base/$accountExtn/capabilities/$extn";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|string $_id
|
||||||
|
* @param array|string|null $_opts
|
||||||
|
*
|
||||||
|
* @throws \Stripe\Error\InvalidRequest
|
||||||
|
*/
|
||||||
|
public static function retrieve($_id, $_opts = null)
|
||||||
|
{
|
||||||
|
$msg = "Capabilities cannot be accessed without an account ID. " .
|
||||||
|
"Retrieve a Capability using \$account->retrieveCapability('acap_123') instead.";
|
||||||
|
throw new Error\InvalidRequest($msg, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $_id
|
||||||
|
* @param array|null $_params
|
||||||
|
* @param array|string|null $_options
|
||||||
|
*
|
||||||
|
* @throws \Stripe\Error\InvalidRequest
|
||||||
|
*/
|
||||||
|
public static function update($_id, $_params = null, $_options = null)
|
||||||
|
{
|
||||||
|
$msg = "Capabilities cannot be accessed without an account ID. " .
|
||||||
|
"Update a Capability using \$account->updateCapability('acap_123') instead.";
|
||||||
|
throw new Error\InvalidRequest($msg, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -27,132 +27,141 @@ class Event extends ApiResource
|
|||||||
* Possible string representations of event types.
|
* Possible string representations of event types.
|
||||||
* @link https://stripe.com/docs/api#event_types
|
* @link https://stripe.com/docs/api#event_types
|
||||||
*/
|
*/
|
||||||
const ACCOUNT_UPDATED = 'account.updated';
|
const ACCOUNT_UPDATED = 'account.updated';
|
||||||
const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized';
|
const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized';
|
||||||
const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized';
|
const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized';
|
||||||
const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
|
const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
|
||||||
const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
|
const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
|
||||||
const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
|
const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
|
||||||
const APPLICATION_FEE_CREATED = 'application_fee.created';
|
const APPLICATION_FEE_CREATED = 'application_fee.created';
|
||||||
const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
|
const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
|
||||||
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
|
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
|
||||||
const BALANCE_AVAILABLE = 'balance.available';
|
const BALANCE_AVAILABLE = 'balance.available';
|
||||||
const CHARGE_CAPTURED = 'charge.captured';
|
const CHARGE_CAPTURED = 'charge.captured';
|
||||||
const CHARGE_EXPIRED = 'charge.expired';
|
const CHARGE_EXPIRED = 'charge.expired';
|
||||||
const CHARGE_FAILED = 'charge.failed';
|
const CHARGE_FAILED = 'charge.failed';
|
||||||
const CHARGE_PENDING = 'charge.pending';
|
const CHARGE_PENDING = 'charge.pending';
|
||||||
const CHARGE_REFUNDED = 'charge.refunded';
|
const CHARGE_REFUNDED = 'charge.refunded';
|
||||||
const CHARGE_SUCCEEDED = 'charge.succeeded';
|
const CHARGE_SUCCEEDED = 'charge.succeeded';
|
||||||
const CHARGE_UPDATED = 'charge.updated';
|
const CHARGE_UPDATED = 'charge.updated';
|
||||||
const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
|
const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
|
||||||
const CHARGE_DISPUTE_CREATED = 'charge.dispute.created';
|
const CHARGE_DISPUTE_CREATED = 'charge.dispute.created';
|
||||||
const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated';
|
const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated';
|
||||||
const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
|
const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
|
||||||
const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
|
const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
|
||||||
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
|
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
|
||||||
const COUPON_CREATED = 'coupon.created';
|
const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
|
||||||
const COUPON_DELETED = 'coupon.deleted';
|
const COUPON_CREATED = 'coupon.created';
|
||||||
const COUPON_UPDATED = 'coupon.updated';
|
const COUPON_DELETED = 'coupon.deleted';
|
||||||
const CREDIT_NOTE_CREATED = 'credit_note.created';
|
const COUPON_UPDATED = 'coupon.updated';
|
||||||
const CREDIT_NOTE_UPDATED = 'credit_note.updated';
|
const CREDIT_NOTE_CREATED = 'credit_note.created';
|
||||||
const CREDIT_NOTE_VOIDED = 'credit_note.voided';
|
const CREDIT_NOTE_UPDATED = 'credit_note.updated';
|
||||||
const CUSTOMER_CREATED = 'customer.created';
|
const CREDIT_NOTE_VOIDED = 'credit_note.voided';
|
||||||
const CUSTOMER_DELETED = 'customer.deleted';
|
const CUSTOMER_CREATED = 'customer.created';
|
||||||
const CUSTOMER_UPDATED = 'customer.updated';
|
const CUSTOMER_DELETED = 'customer.deleted';
|
||||||
const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
|
const CUSTOMER_UPDATED = 'customer.updated';
|
||||||
const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
|
const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
|
||||||
const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
|
const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
|
||||||
const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
|
const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
|
||||||
const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
|
const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
|
||||||
const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
|
const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
|
||||||
const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
|
const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
|
||||||
const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
|
const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
|
||||||
const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
|
const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
|
||||||
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
|
const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
|
||||||
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
|
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
|
||||||
const FILE_CREATED = 'file.created';
|
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
|
||||||
const INVOICE_CREATED = 'invoice.created';
|
const FILE_CREATED = 'file.created';
|
||||||
const INVOICE_DELETED = 'invoice.deleted';
|
const INVOICE_CREATED = 'invoice.created';
|
||||||
const INVOICE_FINALIZED = 'invoice.finalized';
|
const INVOICE_DELETED = 'invoice.deleted';
|
||||||
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
|
const INVOICE_FINALIZED = 'invoice.finalized';
|
||||||
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
|
const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
|
||||||
const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
|
const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
|
||||||
const INVOICE_SENT = 'invoice.sent';
|
const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
|
||||||
const INVOICE_UPCOMING = 'invoice.upcoming';
|
const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
|
||||||
const INVOICE_UPDATED = 'invoice.updated';
|
const INVOICE_SENT = 'invoice.sent';
|
||||||
const INVOICE_VOIDED = 'invoice.voided';
|
const INVOICE_UPCOMING = 'invoice.upcoming';
|
||||||
const INVOICEITEM_CREATED = 'invoiceitem.created';
|
const INVOICE_UPDATED = 'invoice.updated';
|
||||||
const INVOICEITEM_DELETED = 'invoiceitem.deleted';
|
const INVOICE_VOIDED = 'invoice.voided';
|
||||||
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
|
const INVOICEITEM_CREATED = 'invoiceitem.created';
|
||||||
const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created';
|
const INVOICEITEM_DELETED = 'invoiceitem.deleted';
|
||||||
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
|
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
|
||||||
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
|
const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created';
|
||||||
const ISSUING_CARD_CREATED = 'issuing_card.created';
|
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
|
||||||
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
|
const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
|
||||||
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
|
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
|
||||||
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
|
const ISSUING_CARD_CREATED = 'issuing_card.created';
|
||||||
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
|
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
|
||||||
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
|
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
|
||||||
const ORDER_CREATED = 'order.created';
|
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
|
||||||
const ORDER_PAYMENT_FAILED = 'order.payment_failed';
|
const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
|
||||||
const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded';
|
const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
|
||||||
const ORDER_UPDATED = 'order.updated';
|
const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
|
||||||
const ORDER_RETURN_CREATED = 'order_return.created';
|
const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
|
||||||
const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
|
const ORDER_CREATED = 'order.created';
|
||||||
const PAYMENT_INTENT_CREATED = 'payment_intent.created';
|
const ORDER_PAYMENT_FAILED = 'order.payment_failed';
|
||||||
const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
|
const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded';
|
||||||
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
|
const ORDER_UPDATED = 'order.updated';
|
||||||
const PAYOUT_CANCELED = 'payout.canceled';
|
const ORDER_RETURN_CREATED = 'order_return.created';
|
||||||
const PAYOUT_CREATED = 'payout.created';
|
const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
|
||||||
const PAYOUT_FAILED = 'payout.failed';
|
const PAYMENT_INTENT_CREATED = 'payment_intent.created';
|
||||||
const PAYOUT_PAID = 'payout.paid';
|
const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
|
||||||
const PAYOUT_UPDATED = 'payout.updated';
|
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
|
||||||
const PERSON_CREATED = 'person.created';
|
const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
|
||||||
const PERSON_DELETED = 'person.deleted';
|
const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
|
||||||
const PERSON_UPDATED = 'person.updated';
|
const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
|
||||||
const PING = 'ping';
|
const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
|
||||||
const PLAN_CREATED = 'plan.created';
|
const PAYOUT_CANCELED = 'payout.canceled';
|
||||||
const PLAN_DELETED = 'plan.deleted';
|
const PAYOUT_CREATED = 'payout.created';
|
||||||
const PLAN_UPDATED = 'plan.updated';
|
const PAYOUT_FAILED = 'payout.failed';
|
||||||
const PRODUCT_CREATED = 'product.created';
|
const PAYOUT_PAID = 'payout.paid';
|
||||||
const PRODUCT_DELETED = 'product.deleted';
|
const PAYOUT_UPDATED = 'payout.updated';
|
||||||
const PRODUCT_UPDATED = 'product.updated';
|
const PERSON_CREATED = 'person.created';
|
||||||
const RECIPIENT_CREATED = 'recipient.created';
|
const PERSON_DELETED = 'person.deleted';
|
||||||
const RECIPIENT_DELETED = 'recipient.deleted';
|
const PERSON_UPDATED = 'person.updated';
|
||||||
const RECIPIENT_UPDATED = 'recipient.updated';
|
const PING = 'ping';
|
||||||
const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
|
const PLAN_CREATED = 'plan.created';
|
||||||
const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
|
const PLAN_DELETED = 'plan.deleted';
|
||||||
const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
|
const PLAN_UPDATED = 'plan.updated';
|
||||||
const REVIEW_CLOSED = 'review.closed';
|
const PRODUCT_CREATED = 'product.created';
|
||||||
const REVIEW_OPENED = 'review.opened';
|
const PRODUCT_DELETED = 'product.deleted';
|
||||||
const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
|
const PRODUCT_UPDATED = 'product.updated';
|
||||||
const SKU_CREATED = 'sku.created';
|
const RECIPIENT_CREATED = 'recipient.created';
|
||||||
const SKU_DELETED = 'sku.deleted';
|
const RECIPIENT_DELETED = 'recipient.deleted';
|
||||||
const SKU_UPDATED = 'sku.updated';
|
const RECIPIENT_UPDATED = 'recipient.updated';
|
||||||
const SOURCE_CANCELED = 'source.canceled';
|
const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
|
||||||
const SOURCE_CHARGEABLE = 'source.chargeable';
|
const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
|
||||||
const SOURCE_FAILED = 'source.failed';
|
const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
|
||||||
const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification';
|
const REVIEW_CLOSED = 'review.closed';
|
||||||
const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required';
|
const REVIEW_OPENED = 'review.opened';
|
||||||
const SOURCE_TRANSACTION_CREATED = 'source.transaction.created';
|
const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
|
||||||
const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated';
|
const SKU_CREATED = 'sku.created';
|
||||||
const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted';
|
const SKU_DELETED = 'sku.deleted';
|
||||||
const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled';
|
const SKU_UPDATED = 'sku.updated';
|
||||||
const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
|
const SOURCE_CANCELED = 'source.canceled';
|
||||||
const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
|
const SOURCE_CHARGEABLE = 'source.chargeable';
|
||||||
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
|
const SOURCE_FAILED = 'source.failed';
|
||||||
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
|
const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification';
|
||||||
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
|
const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required';
|
||||||
const TAX_RATE_CREATED = 'tax_rate.created';
|
const SOURCE_TRANSACTION_CREATED = 'source.transaction.created';
|
||||||
const TAX_RATE_UPDATED = 'tax_rate.updated';
|
const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated';
|
||||||
const TOPUP_CANCELED = 'topup.canceled';
|
const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted';
|
||||||
const TOPUP_CREATED = 'topup.created';
|
const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled';
|
||||||
const TOPUP_FAILED = 'topup.failed';
|
const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
|
||||||
const TOPUP_REVERSED = 'topup.reversed';
|
const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
|
||||||
const TOPUP_SUCCEEDED = 'topup.succeeded';
|
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
|
||||||
const TRANSFER_CREATED = 'transfer.created';
|
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
|
||||||
const TRANSFER_REVERSED = 'transfer.reversed';
|
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
|
||||||
const TRANSFER_UPDATED = 'transfer.updated';
|
const TAX_RATE_CREATED = 'tax_rate.created';
|
||||||
|
const TAX_RATE_UPDATED = 'tax_rate.updated';
|
||||||
|
const TOPUP_CANCELED = 'topup.canceled';
|
||||||
|
const TOPUP_CREATED = 'topup.created';
|
||||||
|
const TOPUP_FAILED = 'topup.failed';
|
||||||
|
const TOPUP_REVERSED = 'topup.reversed';
|
||||||
|
const TOPUP_SUCCEEDED = 'topup.succeeded';
|
||||||
|
const TRANSFER_CREATED = 'transfer.created';
|
||||||
|
const TRANSFER_REVERSED = 'transfer.reversed';
|
||||||
|
const TRANSFER_UPDATED = 'transfer.updated';
|
||||||
|
|
||||||
use ApiOperations\All;
|
use ApiOperations\All;
|
||||||
use ApiOperations\Retrieve;
|
use ApiOperations\Retrieve;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class Stripe
|
|||||||
// @var float Initial delay between retries, in seconds
|
// @var float Initial delay between retries, in seconds
|
||||||
private static $initialNetworkRetryDelay = 0.5;
|
private static $initialNetworkRetryDelay = 0.5;
|
||||||
|
|
||||||
const VERSION = '6.34.3';
|
const VERSION = '6.35.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string The API key used for requests.
|
* @return string The API key used for requests.
|
||||||
|
|||||||
@ -80,6 +80,7 @@ abstract class Util
|
|||||||
\Stripe\BankAccount::OBJECT_NAME => 'Stripe\\BankAccount',
|
\Stripe\BankAccount::OBJECT_NAME => 'Stripe\\BankAccount',
|
||||||
\Stripe\BitcoinReceiver::OBJECT_NAME => 'Stripe\\BitcoinReceiver',
|
\Stripe\BitcoinReceiver::OBJECT_NAME => 'Stripe\\BitcoinReceiver',
|
||||||
\Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction',
|
\Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction',
|
||||||
|
\Stripe\Capability::OBJECT_NAME => 'Stripe\\Capability',
|
||||||
\Stripe\Card::OBJECT_NAME => 'Stripe\\Card',
|
\Stripe\Card::OBJECT_NAME => 'Stripe\\Card',
|
||||||
\Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge',
|
\Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge',
|
||||||
\Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session',
|
\Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session',
|
||||||
|
|||||||
@ -61,6 +61,8 @@ CREATE TABLE llx_pos_cash_fence(
|
|||||||
-- For 10.0
|
-- For 10.0
|
||||||
|
|
||||||
DROP TABLE llx_cotisation;
|
DROP TABLE llx_cotisation;
|
||||||
|
ALTER TABLE llx_accounting_bookkeeping DROP COLUMN validated;
|
||||||
|
ALTER TABLE llx_accounting_bookkeeping_tmp DROP COLUMN validated;
|
||||||
|
|
||||||
ALTER TABLE llx_loan ADD COLUMN insurance_amount double(24,8) DEFAULT 0;
|
ALTER TABLE llx_loan ADD COLUMN insurance_amount double(24,8) DEFAULT 0;
|
||||||
|
|
||||||
|
|||||||
@ -49,8 +49,7 @@ CREATE TABLE llx_accounting_bookkeeping
|
|||||||
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
|
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
|
||||||
journal_label varchar(255), -- FEC:JournalLib
|
journal_label varchar(255), -- FEC:JournalLib
|
||||||
piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document
|
piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document
|
||||||
validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification)
|
date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification)
|
||||||
date_validated datetime, -- FEC:ValidDate
|
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
extraparams varchar(255) -- for other parameters with json format
|
extraparams varchar(255) -- for other parameters with json format
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@ -49,8 +49,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
|
|||||||
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
|
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
|
||||||
journal_label varchar(255), -- FEC:JournalLib
|
journal_label varchar(255), -- FEC:JournalLib
|
||||||
piece_num integer NOT NULL, -- FEC:EcritureNum
|
piece_num integer NOT NULL, -- FEC:EcritureNum
|
||||||
validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification)
|
date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification)
|
||||||
date_validated datetime, -- FEC:ValidDate
|
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
extraparams varchar(255) -- for other parameters with json format
|
extraparams varchar(255) -- for other parameters with json format
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@ -289,8 +289,9 @@ Modelcsv_quadratus=Export for Quadratus QuadraCompta
|
|||||||
Modelcsv_ebp=Export for EBP
|
Modelcsv_ebp=Export for EBP
|
||||||
Modelcsv_cogilog=Export for Cogilog
|
Modelcsv_cogilog=Export for Cogilog
|
||||||
Modelcsv_agiris=Export for Agiris
|
Modelcsv_agiris=Export for Agiris
|
||||||
|
Modelcsv_openconcerto=Export for OpenConcerto (Test)
|
||||||
Modelcsv_configurable=Export CSV Configurable
|
Modelcsv_configurable=Export CSV Configurable
|
||||||
Modelcsv_FEC=Export FEC (Art. L47 A) (Test)
|
Modelcsv_FEC=Export FEC (Art. L47 A)
|
||||||
ChartofaccountsId=Chart of accounts Id
|
ChartofaccountsId=Chart of accounts Id
|
||||||
|
|
||||||
## Tools - Init accounting account on product / service
|
## Tools - Init accounting account on product / service
|
||||||
|
|||||||
@ -156,11 +156,11 @@ CheckRejectedAndInvoicesReopened=Check returned and invoices reopened
|
|||||||
BankAccountModelModule=Document templates for bank accounts
|
BankAccountModelModule=Document templates for bank accounts
|
||||||
DocumentModelSepaMandate=Template of SEPA mandate. Useful for European countries in EEC only.
|
DocumentModelSepaMandate=Template of SEPA mandate. Useful for European countries in EEC only.
|
||||||
DocumentModelBan=Template to print a page with BAN information.
|
DocumentModelBan=Template to print a page with BAN information.
|
||||||
NewVariousPayment=New miscellaneous payments
|
NewVariousPayment=New miscellaneous payment
|
||||||
VariousPayment=Miscellaneous payments
|
VariousPayment=Miscellaneous payment
|
||||||
VariousPayments=Miscellaneous payments
|
VariousPayments=Miscellaneous payments
|
||||||
ShowVariousPayment=Show miscellaneous payments
|
ShowVariousPayment=Show miscellaneous payment
|
||||||
AddVariousPayment=Add miscellaneous payments
|
AddVariousPayment=Add miscellaneous payment
|
||||||
SEPAMandate=SEPA mandate
|
SEPAMandate=SEPA mandate
|
||||||
YourSEPAMandate=Your SEPA mandate
|
YourSEPAMandate=Your SEPA mandate
|
||||||
FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make direct debit order to your bank. Return it signed (scan of the signed document) or send it by mail to
|
FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make direct debit order to your bank. Return it signed (scan of the signed document) or send it by mail to
|
||||||
|
|||||||
@ -396,8 +396,9 @@ if ($action == 'dopayment')
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called when choosing Stripe mode, after clicking the 'dopayment' with the Charge API architecture.
|
// Called when choosing Stripe mode.
|
||||||
// When using the PaymentItent architecture, we dont need this, the Stripe customer is created when creating PaymentItent when showing payment page.
|
// When using the Charge API architecture, this code is called after clicking the 'dopayment' with the Charge API architecture.
|
||||||
|
// When using the PaymentIntent API architecture, the Stripe customer is already created when creating PaymentItent when showing payment page and the payment is already ok.
|
||||||
if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
||||||
{
|
{
|
||||||
$amountstripe = $amount;
|
$amountstripe = $amount;
|
||||||
@ -426,6 +427,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$errormessage = '';
|
$errormessage = '';
|
||||||
|
|
||||||
|
// When using the Charge API architecture
|
||||||
if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -611,6 +613,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When using the PaymentIntent API architecture
|
||||||
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
||||||
{
|
{
|
||||||
$service = 'StripeTest';
|
$service = 'StripeTest';
|
||||||
@ -656,6 +659,12 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
|||||||
setEventMessages($e->getMessage(), null, 'errors');
|
setEventMessages($e->getMessage(), null, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method
|
||||||
|
// Note that with other Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here.
|
||||||
|
//dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2008,7 +2017,7 @@ if (preg_match('/^dopayment/', $action))
|
|||||||
billing_details: {
|
billing_details: {
|
||||||
name: cardholderName.value
|
name: cardholderName.value
|
||||||
<?php if (GETPOST('email', 'alpha')) { ?>, email: '<?php echo GETPOST('email', 'alpha'); ?>'<?php } ?>
|
<?php if (GETPOST('email', 'alpha')) { ?>, email: '<?php echo GETPOST('email', 'alpha'); ?>'<?php } ?>
|
||||||
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, phone: '<?php echo $object->thirdparty->phone; ?>'<?php } ?>
|
<?php if (is_object($object) && is_object($object->thirdparty) && is_object($object->thirdparty->phone)) { ?>, phone: '<?php echo $object->thirdparty->phone; ?>'<?php } ?>
|
||||||
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, address: {
|
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, address: {
|
||||||
city: '<?php echo $object->thirdparty->town; ?>',
|
city: '<?php echo $object->thirdparty->town; ?>',
|
||||||
country: '<?php echo $object->thirdparty->country_code; ?>',
|
country: '<?php echo $object->thirdparty->country_code; ?>',
|
||||||
@ -2016,7 +2025,7 @@ if (preg_match('/^dopayment/', $action))
|
|||||||
postal_code: '<?php echo $object->thirdparty->zip; ?>'}<?php } ?>
|
postal_code: '<?php echo $object->thirdparty->zip; ?>'}<?php } ?>
|
||||||
} /* TODO Add all other known data like emails, ... to be SCA compliant */
|
} /* TODO Add all other known data like emails, ... to be SCA compliant */
|
||||||
},
|
},
|
||||||
save_payment_method: false
|
save_payment_method: true /* the card will be saved */
|
||||||
}
|
}
|
||||||
).then(function(result) {
|
).then(function(result) {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
|||||||
@ -1765,8 +1765,6 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@ -1799,7 +1797,7 @@ class Reception extends CommonObject
|
|||||||
$sql.= " SET fk_statut = ".self::STATUS_DRAFT;
|
$sql.= " SET fk_statut = ".self::STATUS_DRAFT;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
// If stock increment is done on closing
|
// If stock increment is done on closing
|
||||||
|
|||||||
@ -227,7 +227,6 @@ if ($action=="change")
|
|||||||
{
|
{
|
||||||
$idcustomer = GETPOST('idcustomer', 'int');
|
$idcustomer = GETPOST('idcustomer', 'int');
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
|
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS-".$place.")'";
|
$sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS-".$place.")'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -810,7 +810,41 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
try {
|
try {
|
||||||
$customerstripe=$stripe->customerStripe($object, $stripeacc, $servicestatus);
|
$customerstripe=$stripe->customerStripe($object, $stripeacc, $servicestatus);
|
||||||
if ($customerstripe->id) {
|
if ($customerstripe->id) {
|
||||||
$listofsources=$customerstripe->sources->data;
|
|
||||||
|
// When using the Charge API architecture
|
||||||
|
if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
||||||
|
{
|
||||||
|
$listofsources=$customerstripe->sources->data;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$service = 'StripeTest';
|
||||||
|
$servicestatus = 0;
|
||||||
|
if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox', 'alpha'))
|
||||||
|
{
|
||||||
|
$service = 'StripeLive';
|
||||||
|
$servicestatus = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Force to use the correct API key
|
||||||
|
global $stripearrayofkeysbyenv;
|
||||||
|
\Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$servicestatus]['secret_key']);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
|
||||||
|
$paymentmethodobjs = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "card"));
|
||||||
|
} else {
|
||||||
|
$paymentmethodobjs = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "card"), array("stripe_account" => $stripeacc));
|
||||||
|
}
|
||||||
|
|
||||||
|
$listofsources = $paymentmethodobjs->data;
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
setEventMessages($e->getMessage(), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
@ -1001,6 +1035,14 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
{
|
{
|
||||||
print '<span class="fa fa-university fa-2x fa-fw"></span>';
|
print '<span class="fa fa-university fa-2x fa-fw"></span>';
|
||||||
}
|
}
|
||||||
|
elseif ($src->object=='payment_method' && $src->type=='card')
|
||||||
|
{
|
||||||
|
print img_credit_card($src->card->brand);
|
||||||
|
}
|
||||||
|
elseif ($src->object=='payment_method' && $src->type=='sepa_debit')
|
||||||
|
{
|
||||||
|
print '<span class="fa fa-university fa-2x fa-fw"></span>';
|
||||||
|
}
|
||||||
print'</td>';
|
print'</td>';
|
||||||
print '<td valign="middle">';
|
print '<td valign="middle">';
|
||||||
if ($src->object=='card')
|
if ($src->object=='card')
|
||||||
@ -1040,6 +1082,34 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
}
|
}
|
||||||
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||||
}
|
}
|
||||||
|
elseif ($src->object=='payment_method' && $src->type=='card')
|
||||||
|
{
|
||||||
|
print $src->billing_details->name.'<br>....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.'';
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
|
if ($src->card->country)
|
||||||
|
{
|
||||||
|
$img=picto_from_langcode($src->card->country);
|
||||||
|
print $img?$img.' ':'';
|
||||||
|
print getCountry($src->card->country, 1);
|
||||||
|
}
|
||||||
|
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||||
|
}
|
||||||
|
elseif ($src->object=='payment_method' && $src->type=='sepa_debit')
|
||||||
|
{
|
||||||
|
print 'info sepa';
|
||||||
|
print '</td><td>';
|
||||||
|
if ($src->sepa_debit->country)
|
||||||
|
{
|
||||||
|
$img=picto_from_langcode($src->sepa_debit->country);
|
||||||
|
print $img?$img.' ':'';
|
||||||
|
print getCountry($src->sepa_debit->country, 1);
|
||||||
|
}
|
||||||
|
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '</td><td>';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Default
|
// Default
|
||||||
print '<td class="center" width="50">';
|
print '<td class="center" width="50">';
|
||||||
@ -1080,7 +1150,9 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
|
|
||||||
if ($nbremote == 0 && $nblocal == 0)
|
if ($nbremote == 0 && $nblocal == 0)
|
||||||
{
|
{
|
||||||
print '<tr><td class="opacitymedium" colspan="7">'.$langs->trans("None").'</td></tr>';
|
$colspan=8;
|
||||||
|
if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) $colspan++;
|
||||||
|
print '<tr><td class="opacitymedium" colspan="'.$colspan.'">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|||||||
@ -239,6 +239,10 @@ class Stripe extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Stripe payment intent. Create it with confirm=false
|
* Get the Stripe payment intent. Create it with confirm=false
|
||||||
|
* Warning. If a payment was tried and failed, a payment intent was created.
|
||||||
|
* But if we change someting on object to pay (amount or other), reusing same payment intent is not allowed.
|
||||||
|
* Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay),
|
||||||
|
* that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old that will not be used)
|
||||||
*
|
*
|
||||||
* @param double $amount Amount
|
* @param double $amount Amount
|
||||||
* @param string $currency_code Currency code
|
* @param string $currency_code Currency code
|
||||||
@ -279,7 +283,12 @@ class Stripe extends CommonObject
|
|||||||
|
|
||||||
if (is_object($object))
|
if (is_object($object))
|
||||||
{
|
{
|
||||||
$sql = "SELECT pi.ext_payment_id, pi.entity, pi.fk_facture, pi.sourcetype, pi.ext_payment_site";
|
// Warning. If a payment was tried and failed, a payment intent was created.
|
||||||
|
// But if we change someting on object to pay (amount or other), reusing same payment intent is not allowed.
|
||||||
|
// Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay),
|
||||||
|
// that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old that will not be used)
|
||||||
|
/*
|
||||||
|
$sql = "SELECT pi.ext_payment_id, pi.entity, pi.fk_facture, pi.sourcetype, pi.ext_payment_site";
|
||||||
$sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi";
|
$sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi";
|
||||||
$sql.= " WHERE pi.fk_facture = " . $object->id;
|
$sql.= " WHERE pi.fk_facture = " . $object->id;
|
||||||
$sql.= " AND pi.sourcetype = '" . $object->element . "'";
|
$sql.= " AND pi.sourcetype = '" . $object->element . "'";
|
||||||
@ -314,7 +323,7 @@ class Stripe extends CommonObject
|
|||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($paymentintent))
|
if (empty($paymentintent))
|
||||||
@ -335,11 +344,12 @@ class Stripe extends CommonObject
|
|||||||
"payment_method_types" => ["card"],
|
"payment_method_types" => ["card"],
|
||||||
"description" => $description,
|
"description" => $description,
|
||||||
"statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
|
"statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
|
||||||
|
//"save_payment_method" => true,
|
||||||
"metadata" => $metadata
|
"metadata" => $metadata
|
||||||
);
|
);
|
||||||
if (! is_null($customer)) $dataforintent["customer"]=$customer;
|
if (! is_null($customer)) $dataforintent["customer"]=$customer;
|
||||||
// save_payment_method = true,
|
|
||||||
// payment_method =
|
// payment_method =
|
||||||
|
// payment_method_types = array('card')
|
||||||
//var_dump($dataforintent);
|
//var_dump($dataforintent);
|
||||||
|
|
||||||
if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $fee>0)
|
if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $fee>0)
|
||||||
@ -368,15 +378,39 @@ class Stripe extends CommonObject
|
|||||||
// Store the payment intent
|
// Store the payment intent
|
||||||
if (is_object($object))
|
if (is_object($object))
|
||||||
{
|
{
|
||||||
$now=dol_now();
|
$paymentintentalreadyexists = 0;
|
||||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (fk_soc, date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)";
|
// Check that payment intent $paymentintent->id is not already recorded.
|
||||||
$sql .= " VALUES ('".$object->socid."','".$this->db->idate($now)."', '0', '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', " . $conf->entity . ", '" . $service . "')";
|
$sql = "SELECT pi.rowid";
|
||||||
|
$sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi";
|
||||||
|
$sql.= " WHERE pi.entity IN (".getEntity('societe').")";
|
||||||
|
$sql.= " AND pi.ext_payment_site = '" . $service . "'";
|
||||||
|
$sql.= " AND pi.ext_payment_id = '".$this->db->escape($paymentintent->id)."'";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this) . "::getPaymentIntent search if payment intent already in prelevement_facture_demande", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if ($resql) {
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
if ($obj) $paymentintentalreadyexists++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error($this->db);
|
||||||
|
|
||||||
|
// If not, we create it.
|
||||||
|
if (! $paymentintentalreadyexists)
|
||||||
{
|
{
|
||||||
$error++;
|
$now=dol_now();
|
||||||
$this->error = $this->db->lasterror();
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)";
|
||||||
dol_syslog(get_class($this) . "::PaymentIntent failed to insert paymentintent with id=".$paymentintent->id." into database.");
|
$sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', " . $conf->entity . ", '" . $service . "')";
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this) . "::PaymentIntent failed to insert paymentintent with id=".$paymentintent->id." into database.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -398,7 +432,14 @@ class Stripe extends CommonObject
|
|||||||
|
|
||||||
dol_syslog("getPaymentIntent return error=".$error);
|
dol_syslog("getPaymentIntent return error=".$error);
|
||||||
|
|
||||||
return $paymentintent;
|
if (! $error)
|
||||||
|
{
|
||||||
|
return $paymentintent;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -58,7 +58,6 @@ if($resql){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$terminaltouse = $terminal;
|
$terminaltouse = $terminal;
|
||||||
if ($terminaltouse == '1') $terminaltouse = '';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -43,7 +43,6 @@ $left = GETPOST('left', 'alpha');
|
|||||||
$top = GETPOST('top', 'alpha');
|
$top = GETPOST('top', 'alpha');
|
||||||
|
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
|
|
||||||
$newname = GETPOST('newname', 'alpha');
|
$newname = GETPOST('newname', 'alpha');
|
||||||
$mode = GETPOST('mode', 'alpha');
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|||||||
@ -36,7 +36,6 @@ require '../main.inc.php'; // Load $user and permissions
|
|||||||
$langs->loadLangs(array("bills", "cashdesk"));
|
$langs->loadLangs(array("bills", "cashdesk"));
|
||||||
|
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
|
|
||||||
$idline = GETPOST('idline', 'int');
|
$idline = GETPOST('idline', 'int');
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|||||||
@ -43,7 +43,6 @@ $id = GETPOST('id', 'int');
|
|||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$idproduct = GETPOST('idproduct', 'int');
|
$idproduct = GETPOST('idproduct', 'int');
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abort invoice creationg with a given error message
|
* Abort invoice creationg with a given error message
|
||||||
@ -90,7 +89,7 @@ if ($invoiceid > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takepostermvar"].'-'.$place.')');
|
$ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')');
|
||||||
}
|
}
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
{
|
{
|
||||||
@ -104,12 +103,12 @@ if ($ret > 0)
|
|||||||
|
|
||||||
if ($action == 'valid' && $user->rights->facture->creer)
|
if ($action == 'valid' && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takepostermvar"]}; // For backward compatibility
|
if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||||
elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takepostermvar"]}; // For backward compatibility
|
elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||||
elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takepostermvar"]}; // For backward compatibility
|
elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takepostermvar"];
|
$accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
|
||||||
$bankaccount=$conf->global->$accountname;
|
$bankaccount=$conf->global->$accountname;
|
||||||
}
|
}
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
@ -137,9 +136,9 @@ if ($action == 'valid' && $user->rights->facture->creer)
|
|||||||
$invoice->update($user);
|
$invoice->update($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takepostermvar"]} != "1")
|
if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1")
|
||||||
{
|
{
|
||||||
$invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takepostermvar"]});
|
$invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -180,13 +179,13 @@ if ($action == 'history')
|
|||||||
|
|
||||||
if (($action=="addline" || $action=="freezone") && $placeid == 0)
|
if (($action=="addline" || $action=="freezone") && $placeid == 0)
|
||||||
{
|
{
|
||||||
$invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]};
|
$invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]};
|
||||||
$invoice->date = dol_now();
|
$invoice->date = dol_now();
|
||||||
$invoice->module_source = 'takepos';
|
$invoice->module_source = 'takepos';
|
||||||
$invoice->pos_source = (string) $posnb;
|
$invoice->pos_source = $_SESSION["takeposterminal"];
|
||||||
|
|
||||||
$placeid = $invoice->create($user);
|
$placeid = $invoice->create($user);
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")' where rowid=".$placeid;
|
$sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -559,11 +558,11 @@ else { // No invoice generated yet
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]})
|
if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]})
|
||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
|
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
|
||||||
else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]});
|
else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]});
|
||||||
print '<p style="font-size:120%;" class="right">';
|
print '<p style="font-size:120%;" class="right">';
|
||||||
print $langs->trans("Customer").': '.$soc->name;
|
print $langs->trans("Customer").': '.$soc->name;
|
||||||
print '</p>';
|
print '</p>';
|
||||||
|
|||||||
@ -35,7 +35,6 @@ require '../main.inc.php'; // Load $user and permissions
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
|
|
||||||
$invoiceid = GETPOST('invoiceid', 'int');
|
$invoiceid = GETPOST('invoiceid', 'int');
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ if ($invoiceid > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'";
|
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
|
|||||||
@ -31,7 +31,6 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
$langs->loadLangs(array("main", "cashdesk"));
|
$langs->loadLangs(array("main", "cashdesk"));
|
||||||
|
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
|
|
||||||
$facid=GETPOST('facid', 'int');
|
$facid=GETPOST('facid', 'int');
|
||||||
|
|
||||||
@ -44,7 +43,7 @@ top_httphead('text/html');
|
|||||||
|
|
||||||
if ($place > 0)
|
if ($place > 0)
|
||||||
{
|
{
|
||||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'";
|
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
|
|||||||
@ -39,15 +39,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
|
|
||||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$setterminal = GETPOST('setterminal', 'int');
|
$setterminal = GETPOST('setterminal', 'int');
|
||||||
|
|
||||||
if ($setterminal>0)
|
if ($setterminal>0)
|
||||||
{
|
{
|
||||||
$_SESSION["takeposterminal"]=$setterminal;
|
$_SESSION["takeposterminal"]=$setterminal;
|
||||||
if ($setterminal==1) $_SESSION["takepostermvar"]="";
|
|
||||||
else $_SESSION["takepostermvar"]=$setterminal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter"));
|
$langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter"));
|
||||||
|
|||||||
@ -209,21 +209,14 @@ if ($resql) {
|
|||||||
/**
|
/**
|
||||||
* Send email
|
* Send email
|
||||||
*
|
*
|
||||||
* @param string $mode
|
* @param string $mode Mode (test | confirm)
|
||||||
* Mode (test | confirm)
|
* @param string $oldemail Target email
|
||||||
* @param string $oldemail
|
* @param string $message Message to send
|
||||||
* Target email
|
* @param string $total Total amount of unpayed invoices
|
||||||
* @param string $message
|
* @param string $userlang Code lang to use for email output.
|
||||||
* Message to send
|
* @param string $oldtarget Target name
|
||||||
* @param string $total
|
* @param int $duration_value duration value
|
||||||
* Total amount of unpayed invoices
|
* @return int <0 if KO, >0 if OK
|
||||||
* @param string $userlang
|
|
||||||
* Code lang to use for email output.
|
|
||||||
* @param string $oldtarget
|
|
||||||
* Target name
|
|
||||||
* @param int $duration_value
|
|
||||||
* duration value
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value)
|
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -168,21 +168,14 @@ if ($resql) {
|
|||||||
/**
|
/**
|
||||||
* Send email
|
* Send email
|
||||||
*
|
*
|
||||||
* @param string $mode
|
* @param string $mode Mode (test | confirm)
|
||||||
* Mode (test | confirm)
|
* @param string $oldemail Old email
|
||||||
* @param string $oldemail
|
* @param string $message Message to send
|
||||||
* Old email
|
* @param string $total Total amount of unpayed invoices
|
||||||
* @param string $message
|
* @param string $userlang Code lang to use for email output.
|
||||||
* Message to send
|
* @param string $oldsalerepresentative Old sale representative
|
||||||
* @param string $total
|
* @param int $duration_value Duration value
|
||||||
* Total amount of unpayed invoices
|
* @return int <0 if KO, >0 if OK
|
||||||
* @param string $userlang
|
|
||||||
* Code lang to use for email output.
|
|
||||||
* @param string $oldsalerepresentative
|
|
||||||
* Old sale representative
|
|
||||||
* @param int $duration_value
|
|
||||||
* duration value
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative, $duration_value)
|
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative, $duration_value)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -229,16 +229,12 @@ exit(0);
|
|||||||
/**
|
/**
|
||||||
* script cron usage
|
* script cron usage
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path Path
|
||||||
* path
|
* @param string $script_file Filename
|
||||||
* @param string $script_file
|
|
||||||
* filename
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function usage($path, $script_file)
|
function usage($path, $script_file)
|
||||||
{
|
{
|
||||||
global $conf;
|
|
||||||
|
|
||||||
print "Usage: " . $script_file . " securitykey userlogin|'firstadmin' [cronjobid]\n";
|
print "Usage: " . $script_file . " securitykey userlogin|'firstadmin' [cronjobid]\n";
|
||||||
print "The script return 0 when everything worked successfully.\n";
|
print "The script return 0 when everything worked successfully.\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|||||||
@ -207,19 +207,13 @@ if ($resql) {
|
|||||||
/**
|
/**
|
||||||
* Send email
|
* Send email
|
||||||
*
|
*
|
||||||
* @param string $mode
|
* @param string $mode Mode (test | confirm)
|
||||||
* Mode (test | confirm)
|
* @param string $oldemail Target email
|
||||||
* @param string $oldemail
|
* @param string $message Message to send
|
||||||
* Target email
|
* @param string $total Total amount of unpayed invoices
|
||||||
* @param string $message
|
* @param string $userlang Code lang to use for email output.
|
||||||
* Message to send
|
* @param string $oldtarget Target name
|
||||||
* @param string $total
|
* @return int <0 if KO, >0 if OK
|
||||||
* Total amount of unpayed invoices
|
|
||||||
* @param string $userlang
|
|
||||||
* Code lang to use for email output.
|
|
||||||
* @param string $oldtarget
|
|
||||||
* Target name
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
|
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -172,19 +172,13 @@ if ($resql) {
|
|||||||
/**
|
/**
|
||||||
* Send email
|
* Send email
|
||||||
*
|
*
|
||||||
* @param string $mode
|
* @param string $mode Mode (test | confirm)
|
||||||
* Mode (test | confirm)
|
* @param string $oldemail Old email
|
||||||
* @param string $oldemail
|
* @param string $message Message to send
|
||||||
* Old email
|
* @param string $total Total amount of unpayed invoices
|
||||||
* @param string $message
|
* @param string $userlang Code lang to use for email output.
|
||||||
* Message to send
|
* @param string $oldsalerepresentative Old sale representative
|
||||||
* @param string $total
|
* @return int <0 if KO, >0 if OK
|
||||||
* Total amount of unpayed invoices
|
|
||||||
* @param string $userlang
|
|
||||||
* Code lang to use for email output.
|
|
||||||
* @param string $oldsalerepresentative
|
|
||||||
* Old sale representative
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative)
|
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -272,12 +272,12 @@ if ($result >= 0) {
|
|||||||
|
|
||||||
exit($error);
|
exit($error);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to say if a value is empty or not
|
* Function to say if a value is empty or not
|
||||||
*
|
*
|
||||||
* @param string $element
|
* @param string $element Value to test
|
||||||
* Value to test
|
* @return boolean True of false
|
||||||
* @return boolean True of false
|
|
||||||
*/
|
*/
|
||||||
function dolValidElement($element)
|
function dolValidElement($element)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,12 +181,12 @@ if ($result >= 0) {
|
|||||||
|
|
||||||
exit($error);
|
exit($error);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to say if a value is empty or not
|
* Function to say if a value is empty or not
|
||||||
*
|
*
|
||||||
* @param string $element
|
* @param string $element Value to test
|
||||||
* Value to test
|
* @return boolean True of false
|
||||||
* @return boolean True of false
|
|
||||||
*/
|
*/
|
||||||
function dolValidElementType($element)
|
function dolValidElementType($element)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -86,9 +86,8 @@ exit($error);
|
|||||||
/**
|
/**
|
||||||
* Migrate file from old path to new one for product $product
|
* Migrate file from old path to new one for product $product
|
||||||
*
|
*
|
||||||
* @param Product $product
|
* @param Product $product Object product
|
||||||
* Object product
|
* @return void
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
function migrate_product_photospath($product)
|
function migrate_product_photospath($product)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -230,12 +230,12 @@ if ($result >= 0) {
|
|||||||
|
|
||||||
exit($error);
|
exit($error);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to say if a value is empty or not
|
* Function to say if a value is empty or not
|
||||||
*
|
*
|
||||||
* @param string $element
|
* @param string $element Value to test
|
||||||
* Value to test
|
* @return boolean True of false
|
||||||
* @return boolean True of false
|
|
||||||
*/
|
*/
|
||||||
function dolValidElement($element)
|
function dolValidElement($element)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -273,12 +273,12 @@ if ($result >= 0) {
|
|||||||
|
|
||||||
exit($error);
|
exit($error);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to say if a value is empty or not
|
* Function to say if a value is empty or not
|
||||||
*
|
*
|
||||||
* @param string $element
|
* @param string $element Value to test
|
||||||
* Value to test
|
* @return boolean True of false
|
||||||
* @return boolean True of false
|
|
||||||
*/
|
*/
|
||||||
function dolValidElement($element)
|
function dolValidElement($element)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user