From 4c2866fc57fbd4533af4d6505a7fb57040b0b1b0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 25 May 2011 13:34:12 +0000 Subject: [PATCH] Works on paypal module Fix: add transaction id and default bank account --- htdocs/compta/paiement.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index c1137d75e19..5dff8710940 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -41,6 +41,8 @@ $confirm = GETPOST('confirm'); $facid = GETPOST('facid'); $socname = GETPOST('socname'); +$accountid = GETPOST('accountid'); +$paymentnum = GETPOST('num_paiement'); $sortfield = GETPOST('sortfield'); $sortorder = GETPOST('sortorder'); @@ -244,6 +246,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $formquestion[$i++]=array('type' => 'hidden','name' => 'socid', 'value' => $facture->socid); $formquestion[$i++]=array('type' => 'hidden','name' => 'type', 'value' => $facture->type); } + + // Invoice with Paypal transaction + if ($conf->paypal->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int)) + { + if (! empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid=$conf->global->PAYPAL_BANK_ACCOUNT; + $paymentnum=$facture->ref_int; + } if ($conf->use_javascript_ajax) { @@ -332,7 +341,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if ($facture->type != 2) print ''.$langs->trans('AccountToCredit').''; if ($facture->type == 2) print ''.$langs->trans('AccountToDebit').''; print ''; - $html->select_comptes(GETPOST('accountid'),'accountid',0,'',2); + $html->select_comptes($accountid,'accountid',0,'',2); print ''; } else @@ -345,7 +354,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print ''; - print ''; + print ''; // Check transmitter print ''.$langs->trans('CheckTransmitter');