Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2019-07-04 12:27:00 +02:00
commit 2fee41f712
23 changed files with 113 additions and 32 deletions

View File

@ -1903,6 +1903,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
}
else{
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
}
print '</td>';
}
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
@ -1965,7 +1968,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
}
else
{
if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position';
$fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'';
if ($fieldlist[$field]=='sortorder')
{
$fieldlist[$field]='position';
}
$classtd=''; $class='';
if ($fieldlist[$field]=='code') $classtd='width100';
@ -1982,7 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
}
if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
$langs->load("bills");
$transkey="PaymentCondition".strtoupper($obj->code);
$transkey="PaymentConditionShort".strtoupper($obj->code);
}
if ($transkey && $langs->trans($transkey) != $transkey)
{
@ -1992,8 +2001,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
}
if (! $transfound)
{
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag($fieldValue).'" name="'.$fieldlist[$field].'">';
}
else{
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
}
print '</td>';
}
}

View File

@ -8,6 +8,7 @@
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -252,7 +253,10 @@ if ($action == 'add')
{
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
}
else $object->label = $cactioncomm->libelle;
else {
$cactioncomm->fetch($object->type_code);
$object->label = $cactioncomm->label;
}
}
}
$object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;

View File

@ -261,7 +261,7 @@ if ($search_month_date_when > 0)
if ($search_year_date_when > 0 && empty($search_day_date_when))
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when, $search_month_date_when, false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when, $search_month_date_when, false))."'";
elseif ($search_year_date_when > 0 && ! empty($search_day_date_when))
$sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
else
$sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'";
}

View File

@ -1143,7 +1143,7 @@ if ($resql)
// Amount HT
if (! empty($arrayfields['f.total_ht']['checked']))
{
print '<td class="right">'.price($obj->total_ht)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_ht)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
$totalarray['totalht'] += $obj->total_ht;
@ -1151,7 +1151,7 @@ if ($resql)
// Amount VAT
if (! empty($arrayfields['f.total_vat']['checked']))
{
print '<td class="right">'.price($obj->total_vat)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_vat)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
$totalarray['totalvat'] += $obj->total_vat;
@ -1159,7 +1159,7 @@ if ($resql)
// Amount LocalTax1
if (! empty($arrayfields['f.total_localtax1']['checked']))
{
print '<td class="right">'.price($obj->total_localtax1)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_localtax1)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
$totalarray['totallocaltax1'] += $obj->total_localtax1;
@ -1167,7 +1167,7 @@ if ($resql)
// Amount LocalTax2
if (! empty($arrayfields['f.total_localtax2']['checked']))
{
print '<td class="right">'.price($obj->total_localtax2)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_localtax2)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
$totalarray['totallocaltax2'] += $obj->total_localtax2;
@ -1175,7 +1175,7 @@ if ($resql)
// Amount TTC
if (! empty($arrayfields['f.total_ttc']['checked']))
{
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_ttc)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
@ -1183,7 +1183,7 @@ if ($resql)
if (! empty($arrayfields['dynamount_payed']['checked']))
{
print '<td class="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowrap">'.(! empty($totalpay)?price($totalpay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
$totalarray['totalam'] += $totalpay;
@ -1191,7 +1191,7 @@ if ($resql)
if (! empty($arrayfields['rtp']['checked']))
{
print '<td class="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowrap">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;

View File

@ -220,6 +220,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
</script>';
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow.='<input type="hidden" name="page_y" value="">';
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';

View File

@ -217,6 +217,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
</script>';
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow.='<input type="hidden" name="page_y" value="">';
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';

View File

@ -216,6 +216,7 @@ class box_graph_orders_permonth extends ModeleBoxes
</script>';
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow.='<input type="hidden" name="page_y" value="">';
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';

View File

@ -215,6 +215,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
</script>';
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow.='<input type="hidden" name="page_y" value="">';
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';

View File

@ -332,6 +332,7 @@ class box_graph_product_distribution extends ModeleBoxes
</script>';
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow.='<input type="hidden" name="page_y" value="">';
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,showinvoicenb,showpropalnb,showordernb">';

View File

@ -219,6 +219,7 @@ class box_graph_propales_permonth extends ModeleBoxes
</script>';
$stringtoshow.='<div class="center hideobject divboxfilter" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow.='<input type="hidden" name="page_y" value="">';
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';

View File

@ -34,6 +34,15 @@ if ($resql) // This can fail when class is used on old database (during migra
case 'boolean':
$typeFilter="Boolean";
break;
case 'select':
if (! empty($conf->global->EXPORT_LABEL_FOR_SELECT))
{
$tmpparam=unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...)
if ($tmpparam['options'] && is_array($tmpparam['options'])) {
$typeFilter="Select:".$obj->param;
}
}
break;
case 'sellist':
$tmp='';
$tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null

View File

@ -261,6 +261,9 @@ class ExportCsv extends ModeleExports
}
$this->col=0;
$reg=array();
foreach($array_selected_sorted as $code => $value)
{
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);

View File

@ -345,6 +345,8 @@ class ExportExcel extends ModeleExports
// Define first row
$this->col=0;
$reg=array();
foreach($array_selected_sorted as $code => $value)
{
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);

View File

@ -304,6 +304,8 @@ class ExportExcel2007new extends ModeleExports
// Define first row
$this->col=0;
$reg=array();
foreach($array_selected_sorted as $code => $value)
{
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);

View File

@ -8,6 +8,36 @@ use \DebugBar\DataCollector\RequestDataCollector;
class DolRequestDataCollector extends RequestDataCollector
{
/**
* Collects the data from the collectors
*
* @return array
*/
public function collect()
{
$vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER');
$data = array();
foreach ($vars as $var) {
if (isset($GLOBALS[$var])) {
$arrayofvalues = $GLOBALS[$var];
if ($var == '_COOKIE')
{
foreach($arrayofvalues as $key => $val)
{
if (preg_match('/^DOLSESSID_/', $key)) $arrayofvalues[$key]='*****hidden*****';
}
//var_dump($arrayofvalues);
}
$data["$" . $var] = $this->getDataFormatter()->formatVar($arrayofvalues);
}
}
return $data;
}
/**
* Return widget settings
*
@ -20,7 +50,7 @@ class DolRequestDataCollector extends RequestDataCollector
$langs->load("other");
return array(
$langs->transnoentities('Request') => array(
$langs->transnoentities('Variables') => array(
"icon" => "tags",
"widget" => "PhpDebugBar.Widgets.VariableListWidget",
"map" => "request",

View File

@ -154,7 +154,7 @@ if ($action == 'add')
if (! $error)
{
$object->socid = GETPOST("socid", 'int');
$object->socid = GETPOST("socid", 'int');
$object->firstname = GETPOST("firstname", 'alpha');
$object->lastname = GETPOST("lastname", 'alpha');
$object->societe = GETPOST("societe", 'alpha');
@ -164,7 +164,7 @@ if ($action == 'add')
$object->town = GETPOST("town", 'alpha');
$object->country_id = GETPOST('country_id', 'int');
$object->email = GETPOST('email', 'alpha');
$object->date = $donation_date;
$object->date = $donation_date;
$object->note_private = GETPOST("note_private", 'none');
$object->note_public = GETPOST("note_public", 'none');
$object->public = GETPOST("public", 'alpha');

View File

@ -392,11 +392,11 @@ class Don extends CommonObject
$sql.= ", phone";
$sql.= ", phone_mobile";
$sql.= ") VALUES (";
$sql.= " '".$this->db->idate($now)."'";
$sql.= "'".$this->db->idate($now)."'";
$sql.= ", ".$conf->entity;
$sql.= ", ".price2num($this->amount);
$sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null");
$sql.= ", '".$this->db->escape($this->socid)."'";
$sql.= ", ".($this->socid > 0 ? $this->socid : "null");
$sql.= ", '".$this->db->escape($this->firstname)."'";
$sql.= ", '".$this->db->escape($this->lastname)."'";
$sql.= ", '".$this->db->escape($this->societe)."'";

View File

@ -242,7 +242,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
// We ask to move a qty
if (GETPOST($qty) != 0) {
if (! (GETPOST($ent, 'int') > 0)) {
dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.');
$text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline);
setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors');
$error ++;
@ -279,7 +279,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
// We ask to move a qty
if (GETPOST($qty) > 0) {
if (! (GETPOST($ent, 'int') > 0)) {
dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.');
$text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline) . '-' . ($reg[1] + 1);
setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors');
$error ++;

View File

@ -986,7 +986,7 @@ if ($resql)
// Amount HT
if (! empty($arrayfields['f.total_ht']['checked']))
{
print '<td class="right">'.price($obj->total_ht)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_ht)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
$totalarray['totalht'] += $obj->total_ht;
@ -994,7 +994,7 @@ if ($resql)
// Amount VAT
if (! empty($arrayfields['f.total_vat']['checked']))
{
print '<td class="right">'.price($obj->total_vat)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_vat)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
$totalarray['totalvat'] += $obj->total_vat;
@ -1002,7 +1002,7 @@ if ($resql)
// Amount LocalTax1
if (! empty($arrayfields['f.total_localtax1']['checked']))
{
print '<td class="right">'.price($obj->total_localtax1)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_localtax1)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
$totalarray['totallocaltax1'] += $obj->total_localtax1;
@ -1010,7 +1010,7 @@ if ($resql)
// Amount LocalTax2
if (! empty($arrayfields['f.total_localtax2']['checked']))
{
print '<td class="right">'.price($obj->total_localtax2)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_localtax2)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
$totalarray['totallocaltax2'] += $obj->total_localtax2;
@ -1018,7 +1018,7 @@ if ($resql)
// Amount TTC
if (! empty($arrayfields['f.total_ttc']['checked']))
{
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
print '<td class="right nowrap">'.price($obj->total_ttc)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
@ -1026,7 +1026,7 @@ if ($resql)
if (! empty($arrayfields['dynamount_payed']['checked']))
{
print '<td class="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowrap">'.(! empty($totalpay)?price($totalpay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
$totalarray['totalam'] += $totalpay;
@ -1034,7 +1034,7 @@ if ($resql)
if (! empty($arrayfields['rtp']['checked']))
{
print '<td class="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowrap">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;

View File

@ -353,6 +353,7 @@ if (! defined('NOTOKENRENEWAL'))
//var_dump(GETPOST('token').' '.$_SESSION['token'].' - '.$_SESSION['newtoken'].' '.$_SERVER['SCRIPT_FILENAME']);
// Check token
//var_dump((! defined('NOCSRFCHECK')).' '.empty($dolibarr_nocsrfcheck).' '.(! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)).' '.$_SERVER['REQUEST_METHOD'].' '.(! GETPOSTISSET('token')));
if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN))
|| defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set
{

View File

@ -245,12 +245,12 @@ if ($action == 'set')
if (! $res > 0) $error++;
}
if ($action == 'other')
{
$value = GETPOST('activate_units', 'alpha');
$res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
}
//if ($action == 'other')
//{
// $value = GETPOST('activate_units', 'alpha');
// $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity);
// if (! $res > 0) $error++;
//}
if ($action)
{

View File

@ -605,6 +605,7 @@ foreach ($listofreferent as $key => $value)
if ($key == 'invoice')
{
if (! empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice, do not include into total
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $element->type == Facture::TYPE_DEPOSIT) $qualifiedfortotal=false; // If hidden option to use deposits as payment (deprecated, not recommended to use this), deposits are not included
}
if ($key == 'propal')
{

View File

@ -637,6 +637,16 @@ if (empty($reshook))
elseif ($action == 'deletecard' && $source)
{
try {
if (preg_match('/pm_/', $source))
{
$payment_method = \Stripe\PaymentMethod::retrieve($source, ["stripe_account" => $stripeacc]);
if ($payment_method)
{
$payment_method->detach();
}
}
else
{
$cu=$stripe->customerStripe($object, $stripeacc, $servicestatus);
$card=$cu->sources->retrieve("$source");
if ($card)
@ -645,6 +655,7 @@ if (empty($reshook))
if (method_exists($card, 'detach')) $card->detach();
else $card->delete();
}
}
$url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
header('Location: '.$url);