diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index deca82df81a..06d0deb8ba3 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -1114,22 +1114,21 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$i++;
}
}
- } else dol_print_error($db);
+ } else {
+ dol_print_error($db);
+ }
}
// Show remote sources (not already shown as local source)
- if (is_array($listofsources) && count($listofsources))
- {
- foreach ($listofsources as $src)
- {
+ if (is_array($listofsources) && count($listofsources)) {
+ foreach ($listofsources as $src) {
if (!empty($arrayofstripecard[$src->id])) continue; // Already in previous list
$nbremote++;
print '
';
// Local ID
- if (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD))
- {
+ if (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) {
print '| ';
print ' | ';
}
@@ -1142,8 +1141,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (!empty($stripeacc)) $connect = $stripeacc.'/';
//$url='https://dashboard.stripe.com/'.$connect.'test/sources/'.$src->id;
$url = 'https://dashboard.stripe.com/'.$connect.'test/search?query='.$src->id;
- if ($servicestatus)
- {
+ if ($servicestatus) {
//$url='https://dashboard.stripe.com/'.$connect.'sources/'.$src->id;
$url = 'https://dashboard.stripe.com/'.$connect.'search?query='.$src->id;
}
@@ -1151,73 +1149,58 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print '';
// Img of credit card
print '';
- if ($src->object == 'card')
- {
+ if ($src->object == 'card') {
print img_credit_card($src->brand);
- } elseif ($src->object == 'source' && $src->type == 'card')
- {
+ } elseif ($src->object == 'source' && $src->type == 'card') {
print img_credit_card($src->card->brand);
- } elseif ($src->object == 'source' && $src->type == 'sepa_debit')
- {
+ } elseif ($src->object == 'source' && $src->type == 'sepa_debit') {
print '';
- } elseif ($src->object == 'payment_method' && $src->type == 'card')
- {
+ } elseif ($src->object == 'payment_method' && $src->type == 'card') {
print img_credit_card($src->card->brand);
- } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit')
- {
+ } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') {
print '';
}
print' | ';
// Information
print '';
- if ($src->object == 'card')
- {
+ if ($src->object == 'card') {
print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.'';
print ' | ';
- if ($src->country)
- {
+ if ($src->country) {
$img = picto_from_langcode($src->country);
print $img ? $img.' ' : '';
print getCountry($src->country, 1);
} else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'';
- } elseif ($src->object == 'source' && $src->type == 'card')
- {
+ } elseif ($src->object == 'source' && $src->type == 'card') {
print ''.$src->owner->name.' ....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.'';
print ' | ';
- if ($src->card->country)
- {
+ if ($src->card->country) {
$img = picto_from_langcode($src->card->country);
print $img ? $img.' ' : '';
print getCountry($src->card->country, 1);
} else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'';
- } elseif ($src->object == 'source' && $src->type == 'sepa_debit')
- {
+ } elseif ($src->object == 'source' && $src->type == 'sepa_debit') {
print 'SEPA debit';
print ' | ';
- if ($src->sepa_debit->country)
- {
+ 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().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'';
- } elseif ($src->object == 'payment_method' && $src->type == 'card')
- {
+ } elseif ($src->object == 'payment_method' && $src->type == 'card') {
print ''.$src->billing_details->name.' ....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.'';
print ' | ';
- if ($src->card->country)
- {
+ if ($src->card->country) {
$img = picto_from_langcode($src->card->country);
print $img ? $img.' ' : '';
print getCountry($src->card->country, 1);
} else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'';
- } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit')
- {
+ } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') {
print 'SEPA debit';
print ' | ';
- if ($src->sepa_debit->country)
- {
+ if ($src->sepa_debit->country) {
$img = picto_from_langcode($src->sepa_debit->country);
print $img ? $img.' ' : '';
print getCountry($src->sepa_debit->country, 1);
@@ -1229,8 +1212,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
// Default
print ' | ';
if ((empty($customerstripe->invoice_settings) && $customerstripe->default_source != $src->id) ||
- (!empty($customerstripe->invoice_settings) && $customerstripe->invoice_settings->default_payment_method != $src->id))
- {
+ (!empty($customerstripe->invoice_settings) && $customerstripe->invoice_settings->default_payment_method != $src->id)) {
print '';
print img_picto($langs->trans("Default"), 'off');
print '';
@@ -1252,8 +1234,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print $hookmanager->resPrint;
// Action column
print ' | ';
- if ($user->rights->societe->creer)
- {
+ if ($user->rights->societe->creer) {
print '';
print img_picto($langs->trans("Delete"), 'delete');
print '';
@@ -1264,10 +1245,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
}
}
- if ($nbremote == 0 && $nblocal == 0)
- {
- $colspan = 8;
- if (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) $colspan++;
+ if ($nbremote == 0 && $nblocal == 0) {
+ $colspan = (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD) ? 10 : 9);
print ' |