From f0c572717f0ef5a15338a52c17d01c449e2880a2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 21 Apr 2018 01:08:22 +0200 Subject: [PATCH 1/5] fix getcountry note: stripe account may just be call with customer not card or source --- htdocs/stripe/payment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 7e551965df7..a97d5eb4d71 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -32,6 +32,7 @@ // Load Dolibarr environment $res=@include("../main.inc.php"); // For root directory if (! $res) $res=@include("../../main.inc.php"); +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -305,7 +306,6 @@ if (empty($reshook)) { $stripeacc = $stripe->getStripeAccount($entity); $customer2 = \Stripe\Customer::retrieve($customer->id, array("stripe_account" => $stripeacc)); - //$src = $customer2->sources->retrieve("$source", array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided $src = $customer2->sources->retrieve("$source"); if ($src->type=='card') { @@ -395,7 +395,7 @@ if (empty($reshook)) } else { - $loc = dol_buildpath('/stripeconnect/payment.php?facid='.$facid.'&action=create&error='.$e->getMessage().'', 1); + $loc = DOL_URL_ROOT.'/stripeconnect/payment.php?facid='.$facid.'&action=create&error='.$e->getMessage(); $db->rollback(); header('Location: '.$loc); From f5ef0441fd1bf50851e9202566bbd9a50c8104df Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 21 Apr 2018 11:23:02 +0200 Subject: [PATCH 2/5] fix for customer rereive and charge with sources --- htdocs/stripe/payment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index a97d5eb4d71..1bf278965b8 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -304,8 +304,8 @@ if (empty($reshook)) } elseif (preg_match('/src_/i',$source)) { - $stripeacc = $stripe->getStripeAccount($entity); - $customer2 = \Stripe\Customer::retrieve($customer->id, array("stripe_account" => $stripeacc)); + + $customer2 = $customerstripe=$stripe->customerStripe($facture->thirdparty, $stripeacc, $servicestatus); $src = $customer2->sources->retrieve("$source"); if ($src->type=='card') { From d8e7c98a8dff7b816adb17c61bf68823d1309911 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 22 Apr 2018 05:56:31 +0200 Subject: [PATCH 3/5] Add nature "inventory" & hide in ventilation journal --- htdocs/core/menus/standard/eldy.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index d66f916bb78..e3a2ca4515d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1059,12 +1059,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank"; if ($objp->nature == 5 && ! empty($conf->expensereport->enabled)) $nature="expensereports"; if ($objp->nature == 1) $nature="various"; + if ($objp->nature == 8) $nature="inventory"; if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists if ($conf->global->MAIN_FEATURES_LEVEL < 2) { - if ($nature == 'various' || $nature == 'hasnew') $nature=''; + if ($nature == 'various' || $nature == 'hasnew' || $nature == 'inventory') $nature=''; } if ($nature) From 034f7d56e4d147f66c5a130909e48019d6b2e6f0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 22 Apr 2018 06:49:04 +0200 Subject: [PATCH 4/5] Invert credit debit --- htdocs/accountancy/bookkeeping/card.php | 2 +- htdocs/langs/en_US/accountancy.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 51829c004f1..f0cc48a4878 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -694,7 +694,7 @@ if ($action == 'create') } else { - print ''; + print ''; } print '   '; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 876e6b37837..83be8d8e423 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -216,7 +216,7 @@ ValidateHistory=Bind Automatically AutomaticBindingDone=Automatic binding done ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used -MvtNotCorrectlyBalanced=Movement not correctly balanced. Credit = %s. Debit = %s +MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s FicheVentilation=Binding card GeneralLedgerIsWritten=Transactions are written in the Ledger GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized. From 05f4e3c68e486308c11ceb9538ee95cb7a7fb687 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Apr 2018 11:14:01 +0200 Subject: [PATCH 5/5] update code --- htdocs/contrat/admin/contract_extrafields.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 3fb55acc2ca..a33d020d74d 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2018 Philippe Grand * * 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 @@ -31,9 +31,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("contracts"); +// Load traductions files requiredby by page +$langs->loadLangs(array("companies","admin","contracts")); $extrafields = new ExtraFields($db); $form = new Form($db);