diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 6c325c865a9..284b747465d 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1143,7 +1143,7 @@ if ($resql)
// Amount HT
if (! empty($arrayfields['f.total_ht']['checked']))
{
- print '
'.price($obj->total_ht)." | \n";
+ print ''.price($obj->total_ht)." | \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 ''.price($obj->total_vat)." | \n";
+ print ''.price($obj->total_vat)." | \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 ''.price($obj->total_localtax1)." | \n";
+ print ''.price($obj->total_localtax1)." | \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 ''.price($obj->total_localtax2)." | \n";
+ print ''.price($obj->total_localtax2)." | \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 ''.price($obj->total_ttc)." | \n";
+ print ''.price($obj->total_ttc)." | \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 ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').' | '; // TODO Use a denormalized field
+ print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').' | '; // 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 ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').' | '; // TODO Use a denormalized field
+ print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').' | '; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index cd92d8d02f5..6e6bab0cf57 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -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');
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index d75e658a191..638de5580e4 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -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)."'";
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index ed7caf0061d..7d51f3783c1 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -986,7 +986,7 @@ if ($resql)
// Amount HT
if (! empty($arrayfields['f.total_ht']['checked']))
{
- print ''.price($obj->total_ht)." | \n";
+ print ''.price($obj->total_ht)." | \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 ''.price($obj->total_vat)." | \n";
+ print ''.price($obj->total_vat)." | \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 ''.price($obj->total_localtax1)." | \n";
+ print ''.price($obj->total_localtax1)." | \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 ''.price($obj->total_localtax2)." | \n";
+ print ''.price($obj->total_localtax2)." | \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 ''.price($obj->total_ttc)." | \n";
+ print ''.price($obj->total_ttc)." | \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 ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').' | '; // TODO Use a denormalized field
+ print ''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').' | '; // 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 ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').' | '; // TODO Use a denormalized field
+ print ''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').' | '; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index 6a3596f6e24..0e41e11cbaa 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -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);