diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index 6c9dd0da851..42a95d8002b 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -29,6 +29,10 @@ CustomerDetails=Customer details NewTransaction=New transaction OrderIsCreated=Order created InvoiceIsCreated=Invoice created +PaypalCreateOrderEnabled=Enable the ability to create customer orders +PaypalCreateInvoiceEnabled=Enable the ability to create customer invoices +DefaultProductShippingCosts=Select the product to be used for adding shipping costs. +DefaultPaypalAccount=Select the bank account to be used as a Paypal account, this will deduct the Paypal fee when adding a payment. # Paypal transaction fields PAYERID=Payer ID diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang index 6d4bd8d2db6..6a73994a273 100644 --- a/htdocs/langs/fr_FR/paypal.lang +++ b/htdocs/langs/fr_FR/paypal.lang @@ -29,6 +29,10 @@ CustomerDetails=Détail du client NewTransaction=Nouveau paiement OrderIsCreated=Commande créée InvoiceIsCreated=Facture créée +PaypalCreateOrderEnabled=Activer la possibilité de créer des commandes clients. +PaypalCreateInvoiceEnabled=Activer la possibilité de créer des factures clients. +DefaultProductShippingCosts=Sélectionnez le produit qui sera utilisé pour l'ajout des frais de port. +DefaultPaypalAccount=Sélectionner le compte bancaire qui sera utilisé comme compte Paypal, ceci permettra de déduire les frais Paypal lors de l'ajout d'un paiement. # Paypal transaction fields PAYERID=ID du payeur diff --git a/htdocs/paypal/admin/import.php b/htdocs/paypal/admin/import.php index d1dc27d7fe4..fda11b0fb64 100755 --- a/htdocs/paypal/admin/import.php +++ b/htdocs/paypal/admin/import.php @@ -33,8 +33,9 @@ if (!$user->admin) $langs->load("paypal"); $langs->load("admin"); -$action=GETPOST('action'); -$idprod=GETPOST('idprod'); +$action = GETPOST('action'); +$idprod = GETPOST('idprod'); +$accountid = GETPOST('accountid'); /* @@ -81,6 +82,19 @@ if ($action == 'setproductshippingcosts') } } +if ($action == 'setpaypalaccount') +{ + if (dolibarr_set_const($db, 'PAYPAL_BANK_ACCOUNT', $accountid, 'chaine', 0, '', $conf->entity) > 0) + { + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + /* * View */ @@ -135,19 +149,91 @@ print '