Merge pull request #9507 from frederic34/stripetransac
clean code indentation completely broken
This commit is contained in:
commit
8ceee52d97
@ -1,14 +1,15 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018 ThibaultFOUCART <support@ptibogxiv.net>
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018 ThibaultFOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -47,9 +48,9 @@ $confirm = GETPOST('confirm');
|
||||
|
||||
$facid = GETPOST('facid','int');
|
||||
$socname = GETPOST('socname');
|
||||
$source = GETPOST('source_id');
|
||||
$source = GETPOST('source_id');
|
||||
$accountid = GETPOST('accountid');
|
||||
$paymentnum = GETPOST('num_paiement');
|
||||
$paymentnum = GETPOST('num_paiement');
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
@ -218,15 +219,12 @@ if (empty($reshook))
|
||||
/*
|
||||
* Action add_paiement
|
||||
*/
|
||||
if ($action == 'add_paiement')
|
||||
{
|
||||
if ($error)
|
||||
{
|
||||
$action = 'create';
|
||||
if (!$source)
|
||||
{
|
||||
setEventMessages($langs->transnoentities('NoSource'), null, 'errors');
|
||||
}
|
||||
if ($action == 'add_paiement') {
|
||||
if ($error) {
|
||||
$action = 'create';
|
||||
if (!$source) {
|
||||
setEventMessages($langs->transnoentities('NoSource'), null, 'errors');
|
||||
}
|
||||
$error++;
|
||||
}
|
||||
// Le reste propre a cette action s'affiche en bas de page.
|
||||
@ -301,7 +299,7 @@ if (empty($reshook))
|
||||
}
|
||||
elseif (preg_match('/src_/i',$source))
|
||||
{
|
||||
|
||||
|
||||
$customer2 = $customerstripe=$stripe->customerStripe($facture->thirdparty, $stripeacc, $servicestatus);
|
||||
$src = $customer2->sources->retrieve("$source");
|
||||
if ($src->type=='card')
|
||||
@ -406,16 +404,14 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha'))
|
||||
{
|
||||
if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha')) {
|
||||
$service = 'StripeLive';
|
||||
$servicestatus = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
|
||||
}
|
||||
|
||||
@ -568,7 +564,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans('Invoice').'</span></td><td>'.$facture->getNomUrl(4)."</td></tr>\n";
|
||||
}*/
|
||||
|
||||
// Third party
|
||||
// Third party
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans('Company').'</span></td><td>'.$facture->thirdparty->getNomUrl(4)."</td></tr>\n";
|
||||
|
||||
// Bank account
|
||||
@ -583,22 +579,22 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
|
||||
// Cheque number
|
||||
// print '<tr><td>'.$langs->trans('Numero');
|
||||
// print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
// print '</td>';
|
||||
// print '<td><input name="num_paiement" type="text" value="'.$paymentnum.'"></td></tr>';
|
||||
//print '<tr><td>'.$langs->trans('Numero');
|
||||
//print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
//print '</td>';
|
||||
//print '<td><input name="num_paiement" type="text" value="'.$paymentnum.'"></td></tr>';
|
||||
|
||||
// Check transmitter
|
||||
// print '<tr><td class="'.(GETPOST('paiementcode')=='CHQ'?'fieldrequired ':'').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');
|
||||
// print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||
// print '</td>';
|
||||
// print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur').'"></td></tr>';
|
||||
//print '<tr><td class="'.(GETPOST('paiementcode')=='CHQ'?'fieldrequired ':'').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');
|
||||
//print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||
//print '</td>';
|
||||
//print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur').'"></td></tr>';
|
||||
|
||||
// Bank name
|
||||
// print '<tr><td>'.$langs->trans('Bank');
|
||||
// print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||
// print '</td>';
|
||||
// print '<td><input name="chqbank" size="30" type="text" value="'.GETPOST('chqbank').'"></td></tr>';
|
||||
//print '<tr><td>'.$langs->trans('Bank');
|
||||
//print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||
//print '</td>';
|
||||
//print '<td><input name="chqbank" size="30" type="text" value="'.GETPOST('chqbank').'"></td></tr>';
|
||||
|
||||
// Comments
|
||||
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
||||
@ -607,145 +603,155 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$customerstripe=$stripe->customerStripe($facture->thirdparty, $stripeacc, $servicestatus);
|
||||
$customerstripe=$stripe->customerStripe($facture->thirdparty, $stripeacc, $servicestatus);
|
||||
|
||||
print '<br>';
|
||||
print_barre_liste($langs->trans('StripeSourceList').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
|
||||
print '<br>';
|
||||
print_barre_liste($langs->trans('StripeSourceList').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
|
||||
|
||||
print '<table class="liste" width="100%">'."\n";
|
||||
// Titles with sort buttons
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="left"></td>';
|
||||
print '<td align="left">'.$langs->trans('Type').'</td>';
|
||||
print '<td align="left">'.$langs->trans('Informations').'</td>';
|
||||
print '<td align="left"></td>';
|
||||
print "<td></td></tr>\n";
|
||||
foreach ($customerstripe->sources->data as $src) {
|
||||
print '<tr>';
|
||||
print '<table class="liste" width="100%">'."\n";
|
||||
// Titles with sort buttons
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="left"></td>';
|
||||
print '<td align="left">'.$langs->trans('Type').'</td>';
|
||||
print '<td align="left">'.$langs->trans('Informations').'</td>';
|
||||
print '<td align="left"></td>';
|
||||
print "<td></td></tr>\n";
|
||||
foreach ($customerstripe->sources->data as $src) {
|
||||
print '<tr>';
|
||||
|
||||
print '<td align="center" width="20" ';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';}
|
||||
print'><input type="radio" id="source_id" class="flat" name="source_id" value="'.$src->id.'"';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) {
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print '><input type="radio" id="source_id" class="flat" name="source_id" value="'.$src->id.'"';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) {
|
||||
print ' disabled';
|
||||
} elseif (($customerstripe->default_source==$src->id && $action != 'add_paiement') or ($source==$src->id && $action == 'add_paiement')) {
|
||||
print ' checked';
|
||||
}
|
||||
print '></td>';
|
||||
|
||||
print '<td ';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';}
|
||||
print '<td ';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
|
||||
print' >';
|
||||
if ($src->object=='card')
|
||||
{
|
||||
print img_credit_card($src->brand);
|
||||
}
|
||||
elseif ($src->object=='source' && $src->type=='card')
|
||||
{
|
||||
print img_credit_card($src->card->brand);
|
||||
}
|
||||
elseif ($src->object=='source' && $src->type=='sepa_debit')
|
||||
{
|
||||
print '<span class="fa fa-university fa-2x fa-fw"></span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td ';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';}
|
||||
print' >';
|
||||
if ($src->object=='card'){
|
||||
print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.'';
|
||||
print '</td><td>';
|
||||
if ($src->country)
|
||||
{
|
||||
$img=picto_from_langcode($src->country);
|
||||
print $img?$img.' ':'';
|
||||
print getCountry($src->country,1);
|
||||
}
|
||||
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
}
|
||||
elseif ($src->object=='source' && $src->type=='card'){
|
||||
print $src->owner->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=='source' && $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>';
|
||||
}
|
||||
print '</td>';
|
||||
print' >';
|
||||
if ($src->object=='card') {
|
||||
print img_credit_card($src->brand);
|
||||
} elseif ($src->object=='source' && $src->type=='card') {
|
||||
print img_credit_card($src->card->brand);
|
||||
} elseif ($src->object=='source' && $src->type=='sepa_debit') {
|
||||
print '<span class="fa fa-university fa-2x fa-fw"></span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td ';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print' >';
|
||||
if ($src->object=='card') {
|
||||
print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.'';
|
||||
print '</td><td>';
|
||||
if ($src->country) {
|
||||
$img = picto_from_langcode($src->country);
|
||||
print $img?$img.' ':'';
|
||||
print getCountry($src->country,1);
|
||||
} else {
|
||||
print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
}
|
||||
} elseif ($src->object=='source' && $src->type=='card') {
|
||||
print $src->owner->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=='source' && $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>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
// Default
|
||||
print '<td align="center" width="50" ';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';}
|
||||
print'>';
|
||||
if (($action == 'add_paiement' && $src->id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print'>';
|
||||
if (($customerstripe->default_source==$src->id)) {
|
||||
print "<SPAN class=' fa fa-star fa-2x'></SPAN>";
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// TODO more dolibarize with new stripe function and stripeconnect
|
||||
//if ($stripe->getStripeCustomerAccount($facture->socid)) {
|
||||
//$account=\Stripe\Account::retrieve("".$stripe->getStripeCustomerAccount($facture->socid)."");
|
||||
//}
|
||||
print '</tr>';
|
||||
}
|
||||
// TODO more dolibarize with new stripe function and stripeconnect
|
||||
//if ($stripe->getStripeCustomerAccount($facture->socid)) {
|
||||
// $account=\Stripe\Account::retrieve("".$stripe->getStripeCustomerAccount($facture->socid)."");
|
||||
//}
|
||||
|
||||
if (($account->type=='custom' or $account->type=='express') && $entity==1) {
|
||||
print '<tr class="oddeven">';
|
||||
if (($account->type=='custom' or $account->type=='express') && $entity==1) {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td align="center" width="20" ';
|
||||
if ($action == 'add_paiement' && $stripe->getStripeCustomerAccount($facture->socid)!=$source) { print'class="opacitymedium"';}
|
||||
print'><input type="radio" id="source_id" class="flat" name="source_id" value="'.$conf->global->STRIPE_EXTERNAL_ACCOUNT.'"';
|
||||
if ((empty($input) && $action != 'add_paiement') or ($source==$conf->global->STRIPE_EXTERNAL_ACCOUNT && $action == 'add_paiement')) {
|
||||
print ' checked';
|
||||
} elseif ($action == 'add_paiement' && $conf->global->STRIPE_EXTERNAL_ACCOUNT!=$source) {
|
||||
print ' disabled';
|
||||
}
|
||||
print '></td><td ';
|
||||
if ($action == 'add_paiement' && $stripe->getStripeCustomerAccount($facture->socid)!=$source) { print'class="opacitymedium"';}
|
||||
print '><span class="fa fa-cc-stripe fa-3x fa-fw"></span></td>';
|
||||
print '<td align="center" width="20" ';
|
||||
if ($action == 'add_paiement' && $stripe->getStripeCustomerAccount($facture->socid)!=$source) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print'><input type="radio" id="source_id" class="flat" name="source_id" value="'.$conf->global->STRIPE_EXTERNAL_ACCOUNT.'"';
|
||||
if ((empty($input) && $action != 'add_paiement') or ($source==$conf->global->STRIPE_EXTERNAL_ACCOUNT && $action == 'add_paiement')) {
|
||||
print ' checked';
|
||||
} elseif ($action == 'add_paiement' && $conf->global->STRIPE_EXTERNAL_ACCOUNT!=$source) {
|
||||
print ' disabled';
|
||||
}
|
||||
print '></td><td ';
|
||||
if ($action == 'add_paiement' && $stripe->getStripeCustomerAccount($facture->socid)!=$source) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print '><span class="fa fa-cc-stripe fa-3x fa-fw"></span></td>';
|
||||
|
||||
print '<td ';
|
||||
if ($action == 'add_paiement' && $stripe->getStripeCustomerAccount($facture->socid)!=$source) { print'class="opacitymedium"';}
|
||||
print'>'.$langs->trans('sold');
|
||||
print'</td><td ';
|
||||
if ($action == 'add_paiement' && $src->id!=$source) { print'class="opacitymedium"';}
|
||||
print'>';
|
||||
print '<td ';
|
||||
if ($action == 'add_paiement' && $stripe->getStripeCustomerAccount($facture->socid)!=$source) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print'>'.$langs->trans('sold');
|
||||
print'</td><td ';
|
||||
if ($action == 'add_paiement' && $src->id!=$source) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print'>';
|
||||
|
||||
print '</td>';
|
||||
// Default
|
||||
print '<td align="center" width="50" ';
|
||||
if ($action == 'add_paiement' && $src->id!=$source) { print'class="opacitymedium"';}
|
||||
print'>';
|
||||
// if (($customer->default_source!=$src->id)) {
|
||||
// print img_picto($langs->trans("Disabled"),'off');
|
||||
// } else {
|
||||
// print img_picto($langs->trans("Default"),'on');
|
||||
// }
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if (empty($input)&&!$stripe->getStripeCustomerAccount($facture->socid))
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</td>';
|
||||
// Default
|
||||
print '<td align="center" width="50" ';
|
||||
if ($action == 'add_paiement' && $src->id!=$source) {
|
||||
print'class="opacitymedium"';
|
||||
}
|
||||
print'>';
|
||||
//if (($customer->default_source!=$src->id)) {
|
||||
// print img_picto($langs->trans("Disabled"),'off');
|
||||
//} else {
|
||||
// print img_picto($langs->trans("Default"),'on');
|
||||
//}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if (empty($input)&&!$stripe->getStripeCustomerAccount($facture->socid)) {
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</table>";
|
||||
|
||||
|
||||
/*
|
||||
@ -756,14 +762,14 @@ print '</tr>';
|
||||
$sql.= ' f.datef as df, f.fk_soc as socid';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||
|
||||
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) {
|
||||
if (!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) {
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON (f.fk_soc = s.rowid)';
|
||||
}
|
||||
|
||||
$sql.= ' WHERE f.entity = '.$conf->entity;
|
||||
$sql.= ' AND (f.fk_soc = '.$facture->socid;
|
||||
|
||||
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) {
|
||||
if (!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) {
|
||||
$sql.= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.$facture->thirdparty->parent.')';
|
||||
}
|
||||
|
||||
@ -1023,10 +1029,11 @@ print '</tr>';
|
||||
$preselectedchoice=$addwarning?'no':'yes';
|
||||
|
||||
print '<br>';
|
||||
if (!empty($totalpayment)) $text=$langs->trans('ConfirmCustomerPayment',$totalpayment,$langs->trans("Currency".$conf->currency));
|
||||
if (!empty($multicurrency_totalpayment))
|
||||
{
|
||||
$text.='<br>'.$langs->trans('ConfirmCustomerPayment',$multicurrency_totalpayment,$langs->trans("paymentInInvoiceCurrency"));
|
||||
if (!empty($totalpayment)) {
|
||||
$text = $langs->trans('ConfirmCustomerPayment', $totalpayment, $langs->trans("Currency".$conf->currency));
|
||||
}
|
||||
if (!empty($multicurrency_totalpayment)) {
|
||||
$text.='<br>'.$langs->trans('ConfirmCustomerPayment', $multicurrency_totalpayment, $langs->trans("paymentInInvoiceCurrency"));
|
||||
}
|
||||
if (GETPOST('closepaidinvoices'))
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 PtibogXIV <support@ptibogxiv.net>
|
||||
/* Copyright (C) 2018 PtibogXIV <support@ptibogxiv.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -25,7 +26,9 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe'));
|
||||
@ -77,25 +80,26 @@ $stripeaccount = $stripe->getStripeAccount($service);
|
||||
|
||||
if (! $rowid) {
|
||||
|
||||
print '<FORM method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
if ($optioncss != '')
|
||||
print '<INPUT type="hidden" name="optioncss" value="' . $optioncss . '">';
|
||||
print '<INPUT type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<INPUT type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<INPUT type="hidden" name="action" value="list">';
|
||||
print '<INPUT type="hidden" name="sortfield" value="' . $sortfield . '">';
|
||||
print '<INPUT type="hidden" name="sortorder" value="' . $sortorder . '">';
|
||||
print '<INPUT type="hidden" name="page" value="' . $page . '">';
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
|
||||
print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
|
||||
print '<input type="hidden" name="page" value="' . $page . '">';
|
||||
|
||||
$title=$langs->trans("StripeTransactionList");
|
||||
$title.=($stripeaccount?' (Stripe connection with Stripe OAuth Connect account '.$stripeaccount.')':' (Stripe connection with keys from Stripe module setup)');
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit);
|
||||
|
||||
print '<DIV class="div-table-responsive">';
|
||||
print '<TABLE class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
|
||||
|
||||
print '<TR class="liste_titre">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||
//print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||
//print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||
@ -105,9 +109,9 @@ if (! $rowid) {
|
||||
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'align="right"');
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
if ($stripeaccount)
|
||||
{
|
||||
@ -155,14 +159,14 @@ if (! $rowid) {
|
||||
$societestatic->email = $obj->email;
|
||||
$societestatic->societe_id = $obj->fk_soc;
|
||||
|
||||
print '<TR class="oddeven">';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
print "<TD><A href='" . DOL_URL_ROOT . "/stripe/transaction.php?rowid=" . $txn->source . "'>" . $txn->source . "</A></TD>\n";
|
||||
print "<td><a href='" . DOL_URL_ROOT . "/stripe/transaction.php?rowid=" . $txn->source . "'>" . $txn->source . "</A></td>\n";
|
||||
// Stripe customer
|
||||
//print "<TD>".$charge->customer."</TD>\n";
|
||||
//print "<td>".$charge->customer."</td>\n";
|
||||
// Link
|
||||
/*print "<TD>";
|
||||
/*print "<td>";
|
||||
if ($societestatic->id > 0)
|
||||
{
|
||||
print $societestatic->getNomUrl(1);
|
||||
@ -171,8 +175,9 @@ if (! $rowid) {
|
||||
{
|
||||
print $memberstatic->getNomUrl(1);
|
||||
}
|
||||
print "</TD>\n";*/
|
||||
print "</td>\n";*/
|
||||
// Origine
|
||||
|
||||
//print "<TD>";
|
||||
////if ($charge->metadata->dol_type=="order"){
|
||||
// $object = new Commande($db);
|
||||
@ -185,27 +190,29 @@ if (! $rowid) {
|
||||
//}
|
||||
//print "</TD>\n";
|
||||
// Date payment
|
||||
print '<TD align="center">' . dol_print_date($txn->created, '%d/%m/%Y %H:%M') . "</TD>\n";
|
||||
print '<td align="center">' . dol_print_date($txn->created, '%d/%m/%Y %H:%M') . "</td>\n";
|
||||
// Type
|
||||
print '<TD>' . $txn->type . '</TD>';
|
||||
print '<td>' . $txn->type . '</td>';
|
||||
// Amount
|
||||
print "<TD align=\"right\">" . price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</TD>";
|
||||
print "<TD align=\"right\">" . price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</TD>";
|
||||
print "<td align=\"right\">" . price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</td>";
|
||||
print "<td align=\"right\">" . price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</td>";
|
||||
// Status
|
||||
print "<TD align='right'>";
|
||||
if ($txn->status=='available')
|
||||
{print img_picto($langs->trans("".$txn->status.""),'statut4');}
|
||||
print "<td align='right'>";
|
||||
if ($txn->status=='available')
|
||||
{
|
||||
print img_picto($langs->trans("".$txn->status.""),'statut4');}
|
||||
elseif ($txn->status=='pending')
|
||||
{print img_picto($langs->trans("".$txn->status.""),'statut7');}
|
||||
elseif ($txn->status=='failed')
|
||||
{print img_picto($langs->trans("".$txn->status.""),'statut8');}
|
||||
print '</TD>';
|
||||
print "</TR>\n";
|
||||
{
|
||||
print img_picto($langs->trans("".$txn->status.""),'statut8');}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</TABLE>";
|
||||
print '</DIV>';
|
||||
print '</FORM>';
|
||||
} else {}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user