From f64092a1e84896b91d54c56cd7d9b49936bca74f Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Thu, 1 Aug 2019 11:00:49 +0200 Subject: [PATCH 01/26] FIX order or proposals billed if both workflow conf activated --- .../interface_20_modWorkflow_WorkflowManager.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 2c7ee724d2f..583701f7bc9 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -121,7 +121,8 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_VALIDATE') { dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); - + $ret = null; + // First classify billed the order to allow the proposal classify process if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { @@ -142,7 +143,6 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } } - return $ret; } // Second classify billed the proposal. @@ -165,8 +165,9 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } } - return $ret; } + + return $ret; } // classify billed order & billed propososal From cd0d5c41f5d02952ba556f9487d03f3281024636 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Aug 2019 16:37:40 +0200 Subject: [PATCH 02/26] Update interface_20_modWorkflow_WorkflowManager.class.php --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 583701f7bc9..8c849f5fa40 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -121,7 +121,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_VALIDATE') { dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id ); - $ret = null; + $ret = 0; // First classify billed the order to allow the proposal classify process if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) From 7a2e08a6812bec0ecfde8355ea999558f8dbf92e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 2 Aug 2019 11:41:40 +0200 Subject: [PATCH 03/26] Fix author in message / ticket API --- htdocs/ticket/class/api_tickets.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 060ddc36ff3..c23ec3da151 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -160,15 +160,15 @@ class Tickets extends DolibarrApi $num = count($this->ticket->cache_msgs_ticket); $i = 0; while ($i < $num) { - if ($this->ticket->cache_msgs_ticket[$i]['fk_user_action'] > 0) { + if ($this->ticket->cache_msgs_ticket[$i]['fk_user_author'] > 0) { $user_action = new User($this->db); - $user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_action']); + $user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_author']); } // Now define messages $messages[] = array( 'id' => $this->ticket->cache_msgs_ticket[$i]['id'], - 'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_action'], + 'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'], 'fk_user_action_socid' => $user_action->socid, 'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname), 'message' => $this->ticket->cache_msgs_ticket[$i]['message'], @@ -195,6 +195,7 @@ class Tickets extends DolibarrApi // Now define messages $history[] = array( 'id' => $this->ticket->cache_logs_ticket[$i]['id'], + 'fk_user_author' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'], 'fk_user_action' => $this->ticket->cache_logs_ticket[$i]['fk_user_create'], 'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname), 'message' => $this->ticket->cache_logs_ticket[$i]['message'], From 74e3a423fdea0c85d1e1e6ee9bc8bceff710df67 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 2 Aug 2019 12:35:00 +0200 Subject: [PATCH 04/26] Fix document list for products in API --- htdocs/api/class/api_documents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index f4a7084b336..48d6bf5b903 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -368,7 +368,7 @@ class Documents extends DolibarrApi throw new RestException(404, 'Product not found'); } - $upload_dir = $conf->product->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'product'); + $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); } elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') { From 3a0c1954d6358c5e1909871ba146b68559d01c51 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 2 Aug 2019 13:23:15 +0200 Subject: [PATCH 05/26] Fix application_fee_amount need fix in v10 too --- htdocs/stripe/class/stripe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index c731637fce6..69c422c8c7c 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -403,7 +403,7 @@ class Stripe extends CommonObject if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { - $dataforintent["application_fee"] = $stripefee; + $dataforintent["application_fee_amount"] = $stripefee; } if ($usethirdpartyemailforreceiptemail && is_object($object) && $object->thirdparty->email) { @@ -730,7 +730,7 @@ class Stripe extends CommonObject ); if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { - $paymentarray["application_fee"] = $stripefee; + $paymentarray["application_fee_amount"] = $stripefee; } if ($societe->email && $usethirdpartyemailforreceiptemail) { From 2d34a0c4c164d3caa5c9f5c3a5355d064a051f8b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 2 Aug 2019 14:48:45 +0200 Subject: [PATCH 06/26] Fix table in admin stripe.php --- htdocs/stripe/admin/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index c2b2143f277..02039f3edc2 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -254,7 +254,7 @@ if (empty($conf->stripeconnect->enabled)) print price($conf->global->STRIPE_APPLICATION_FEE_PERCENT); print '% + '; print price($conf->global->STRIPE_APPLICATION_FEE); - print ' '.$langs->getCurrencySymbol($conf->currency).' '.$langs->trans("minimum").' '.price($conf->global->STRIPE_APPLICATION_FEE_MINIMAL).' '.$langs->getCurrencySymbol($conf->currency).' '; + print ' '.$langs->getCurrencySymbol($conf->currency).' '.$langs->trans("minimum").' '.price($conf->global->STRIPE_APPLICATION_FEE_MINIMAL).' '.$langs->getCurrencySymbol($conf->currency); print ''; } From 13eef54392e8a5f415c4c2eef0bdb8e3b0350ca4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Aug 2019 12:31:13 +0200 Subject: [PATCH 07/26] Fix round for application fee in stripe --- htdocs/stripe/class/stripe.class.php | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index c731637fce6..28ba74fa91b 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -319,14 +319,14 @@ class Stripe extends CommonObject if (! in_array($currency_code, $arrayzerounitcurrency)) $stripeamount = $amount * 100; else $stripeamount = $amount; - $fee = round($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE); + $fee = $amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE; if ($fee >= $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL > $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { - $fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL); + $fee = $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL; } elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { - $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL); + $fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL; } - if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = $fee * 100; - else $stripefee = $fee; + if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100); + else $stripefee = round($fee); $paymentintent = null; @@ -708,15 +708,14 @@ class Stripe extends CommonObject $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description")); } } else { - $fee = round($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE); - if ($fee >= $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL > $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { - $fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL); - } - elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { - $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL); - } - if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = $fee * 100; - else $stripefee = $fee; + $fee = $amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE; + if ($fee >= $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL > $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { + $fee = $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL; + } elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) { + $fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL; + } + if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100); + else $stripefee = round($fee); $paymentarray = array( "amount" => "$stripeamount", From d30ce126e0838cb7f174cb88dd2be842f83e08f3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Aug 2019 13:00:52 +0200 Subject: [PATCH 08/26] Fix update stripe api for more compliance to API --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 5638a10d332..17ca74b7955 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -55,4 +55,4 @@ else \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); \Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version -\Stripe\Stripe::setApiVersion("2019-03-14"); // force version API +\Stripe\Stripe::setApiVersion("2019-05-16"); // force version API From 07cc21a113187c85887bdfe9844be9d370697067 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Aug 2019 20:35:53 +0200 Subject: [PATCH 09/26] Fix display payment intent in stripe's charge list --- htdocs/stripe/charge.php | 47 +++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index e8823119e30..80c633b0254 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -121,6 +121,31 @@ if (!$rowid) //print $list; foreach ($list->data as $charge) { + if ($charge->refunded=='1'){ + $status = img_picto($langs->trans("refunded"), 'statut6'); + } elseif ($charge->paid=='1'){ + $status = img_picto($langs->trans("".$charge->status.""), 'statut4'); + } else { + $label="Message: ".$charge->failure_message."
"; + $label.="Réseau: ".$charge->outcome->network_status."
"; + $label.="Statut: ".$langs->trans("".$charge->outcome->seller_message.""); + $status = $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1); + } + + if ($charge->payment_method_details->type=='card') + { + $type = $langs->trans("card"); + } + elseif ($charge->source->type=='card'){ + $type = $langs->trans("card"); + } elseif ($charge->payment_method_details->type=='three_d_secure'){ + $type = $langs->trans("card3DS"); + } + + if (! empty($charge->payment_intent)) { + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + } + // The metadata FULLTAG is defined by the online payment page $FULLTAG=$charge->metadata->FULLTAG; @@ -205,31 +230,13 @@ if (!$rowid) print ''.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."\n"; // Type print ''; - if ($charge->source->object=='card') - { - print $langs->trans("card"); - } - elseif ($charge->source->type=='card'){ - print $langs->trans("card"); - } elseif ($charge->source->type=='three_d_secure'){ - print $langs->trans("card3DS"); - } + print $type; print ''; // Amount print ''.price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency)).""; // Status print ''; - if ($charge->refunded=='1'){ - print img_picto($langs->trans("refunded"), 'statut6'); - } elseif ($charge->paid=='1'){ - - print img_picto($langs->trans("".$charge->status.""), 'statut4'); - } else { - $label="Message: ".$charge->failure_message."
"; - $label.="Réseau: ".$charge->outcome->network_status."
"; - $label.="Statut: ".$langs->trans("".$charge->outcome->seller_message.""); - print $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1); - } + print $status; print "\n"; print "\n"; From 5339bb71ac2df1cfae61ab90acdce8c340179209 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Aug 2019 20:53:18 +0200 Subject: [PATCH 10/26] FIX Fatal situation if payment removed on expense report. Action set_unpaid was not available. --- htdocs/expensereport/card.php | 40 +++++++++++++++++-- .../class/expensereport.class.php | 4 +- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 21e716d7ac1..22410ee4085 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -967,6 +967,34 @@ if (empty($reshook)) } } + if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid) + { + $object = new ExpenseReport($db); + $object->fetch($id); + + $result = $object->set_unpaid($user); + + if ($result > 0) + { + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records + + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + } + } + if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid) { $object = new ExpenseReport($db); @@ -2349,8 +2377,8 @@ if ($action != 'create' && $action != 'edit') } - // If status is Appoved - // -------------------- + // If status is Approved + // --------------------- if ($user->rights->expensereport->approve && $object->fk_statut == 5) { @@ -2394,9 +2422,15 @@ if ($action != 'create' && $action != 'edit') print ''; } + if ($user->rights->expensereport->to_paid && $object->paid && $object->fk_statut == ExpenseReport::STATUS_CLOSED) + { + // Set unpaid + print ''; + } + // Clone if ($user->rights->expensereport->creer) { - print ''; + print ''; } /* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */ diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 3f5029c4ef6..9bbf6617369 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1366,12 +1366,12 @@ class ExpenseReport extends CommonObject { $error = 0; - if ($this->fk_c_deplacement_statuts != 5) + if ($this->paid) { $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql.= " SET fk_statut = 5"; + $sql.= " SET paid = 0"; $sql.= ' WHERE rowid = '.$this->id; dol_syslog(get_class($this)."::set_unpaid sql=".$sql, LOG_DEBUG); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index fae0f88fcc5..02bddd4b923 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -94,6 +94,7 @@ PaymentHigherThanReminderToPay=Payment higher than reminder to pay HelpPaymentHigherThanReminderToPay=Attention, the payment amount of one or more bills is higher than the rest to pay.
Edit your entry, otherwise confirm and think about creating a credit note of the excess received for each overpaid invoices. HelpPaymentHigherThanReminderToPaySupplier=Attention, the payment amount of one or more bills is higher than the rest to pay.
Edit your entry, otherwise confirm and think about creating a credit note of the excess paid for each overpaid invoice. ClassifyPaid=Classify 'Paid' +ClassifyUnPaid=Classify 'Unpaid' ClassifyPaidPartially=Classify 'Paid partially' ClassifyCanceled=Classify 'Abandoned' ClassifyClosed=Classify 'Closed' diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 4b088f8dea2..cbdcd3aefaf 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -95,6 +95,7 @@ HelpPaymentHigherThanReminderToPay=Attention, le montant de paiement pour une ou HelpPaymentHigherThanReminderToPaySupplier=Attention, le montant de paiement pour une ou plusieurs factures est supérieur au reste à payer.
Corrigez votre saisie, sinon, confirmez et pensez à créer un avoir pour l'excédent pour chaque facture surpayée. ClassifyPaid=Classer 'Payée' ClassifyPaidPartially=Classer 'Payée partiellement' +ClassifyUnPaid=Classer 'Non payée' ClassifyCanceled=Classer 'Abandonnée' ClassifyClosed=Classer 'Fermée' ClassifyUnBilled=Classer 'Non facturée' From 4ed1ff5b9bc9231ef2945494974da3ee3f8367df Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Aug 2019 21:17:12 +0200 Subject: [PATCH 11/26] Fix display only stripe sources for customer --- htdocs/societe/paymentmodes.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index fdd4f54b6c8..4a34a2b360f 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -822,7 +822,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '
'; // List of Stripe payment modes - if (! (empty($conf->stripe->enabled))) + if (! (empty($conf->stripe->enabled)) && $object->client) { $morehtmlright=''; if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) @@ -1184,11 +1184,10 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } print ""; print ""; + print '
'; } - // List of bank accounts - print '
'; $morehtmlright= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create'); From 4633af3f5d84f175dd528d8c452138631172971d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Aug 2019 21:19:47 +0200 Subject: [PATCH 12/26] Update charge.php --- htdocs/stripe/charge.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 80c633b0254..a524a62f6a3 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -130,16 +130,15 @@ if (!$rowid) $label.="Réseau: ".$charge->outcome->network_status."
"; $label.="Statut: ".$langs->trans("".$charge->outcome->seller_message.""); $status = $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1); - } + } if ($charge->payment_method_details->type=='card') { $type = $langs->trans("card"); - } - elseif ($charge->source->type=='card'){ - $type = $langs->trans("card"); + } elseif ($charge->source->type=='card'){ + $type = $langs->trans("card"); } elseif ($charge->payment_method_details->type=='three_d_secure'){ - $type = $langs->trans("card3DS"); + $type = $langs->trans("card3DS"); } if (! empty($charge->payment_intent)) { From 0ede65448232e0cc652745344fa6fb2c53c0c0c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Aug 2019 13:15:49 +0200 Subject: [PATCH 13/26] Prepare 10.0.1 --- ChangeLog | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/ChangeLog b/ChangeLog index babd1f4db32..c78ad8674eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,112 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 10.0.1 compared to 10.0.0 ***** +FIX: #10930 +FIX: #10984 FIX: reposition on "Build backup" button +FIX: #11400 +FIX: #11412 +FIX: #11460 FIX: #11492 FIX: #11576 FIX: #11590 +FIX: #11463 +FIX: #11466 +FIX: #11498 +FIX: #11505 +FIX: #11506 +FIX: #11507 +FIX: #11509 +FIX: #11537 +FIX: #11543 +FIX: #11553 +FIX: #11584 +FIX: accounting mode must be taken from global conf, because there's no way to choose a mode with interface +FIX: Add message from public interface +FIX: add missing hook calls +FIX: Add warning when setup is strange +FIX: ajax call for line positioning when CSRFCHECK_WITH_TOKEN is on +FIX: API return 404 sometimes even if API exists +FIX: Attachment was lost when we validate an expense report +FIX: avoid conflict with "$classname" in card.php +FIX: Bad sql request +FIX: better compatibility with multicompany transverse mode +FIX: Better PHP compatibility +FIX: Block to link with tickets +FIX: Can't submit a ticket from public interface +FIX: categories import: prevent mismatch between category type and object type +FIX: Closing ticket from public interface +FIX: Column 'paid' missing in expense report +FIX: compatibility mysql 8. rank is reserved +FIX: Computed field were not calculated into lists. +FIX: Content of email for subscription +FIX: correct error in files with multiple spaces +FIX: CVE-2019-11199 +FIX: delete of links between objects +FIX: div not balanced +FIX: do not return formatted prices in json string +FIX: duplicate on the check (TODO field $onetrtd not used ?) +FIX: element name in update_price +FIX: empty product_use_units in product configuration +FIX: expedition card: infinite loop for printObjectLine hook if return > 0 +FIX: extrafield loading bug due to assumption that an object is a third party while it may be a contact if MAIN_USE_COMPANY_NAME_OF_CONTACT is set. +FIX: Fatal error on dol_htmloutput_mesg with corrupted array +FIX: Fatal situation if payment removed on expense report. Action +FIX: FEC Format - Missing date_creation in general ledger when you add a new transaction +FIX: FEC Format - Save translation of the journal label in database & nowrap on amount +FIX: floating point precision errors in the triggers of the workflow module +FIX: for #11232 +FIX: format of field with type timestamp +FIX: fournrprice log for insert +FIX: help text +FIX: import filter error +FIX: __INFOS__ tag not exists +FIX: issue #9300: install error with PostgreSQL using custom table prefix +FIX: issue #9300: install error with PostgreSQL when using custom table prefix +FIX: Language key +FIX: Limit of uploaded files (max_post_size was not used) +FIX: list of balance of leaves +FIX: minor spelling issues +FIX: missing "dropdown-icon" replacement +FIX: Missing field "Conciliated" into bank transaction export +FIX: missing filter by current contact +FIX: missing token +FIX: Missing where on entity +FIX: move sql request in INNER JOIN +FIX: name was able to be in field but went back to new line +FIX: Nowrap on amount +FIX: Online payment +FIX: on shipment delete confirm dialog, a new checkbox allows the user to choose if they want their stock re-incremented after the deletion. +FIX: option EXPORT_LABEL_FOR_SELECT to restore compatibility in export +FIX: Option THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION +FIX: outdated phpdoc +FIX: Permission for BOM menu +FIX: permission to delete a draft purchase order +FIX: phpcs +FIX: Position was lost when we edit the line of template invoice +FIX: product_use_units was set to 0 each time a conf in block other was set +FIX: propal createFrom hook: undefined parameter attached +FIX: Responsive of public interface of ticket +FIX: search by phone pro +FIX: Setup of TakePos was not possible after a clean install +FIX: Show list of events on tickets +FIX: socpeople assigned list in action com list +FIX: SQL problem on donation & nowrap on amount +FIX: stock increase on shipment deletion if STOCK_CALCULATE_ON_SHIPMENT_NEW: is set +FIX: stripe webhook ID constant set +FIX: summary of time spent in preview tab of projects +FIX: the feature to bill time spent was not enabled. +FIX: The new feature to attach document on lines was not correclty +FIX: The proposed new supplier code does not work +FIX: this function can not be private +FIX: tk9877 - PDF rouget requires product.lib.php (otherwise measuring_units_string() is not defined) +FIX: Update the file index table when we validate/rename a ref. +FIX: use rounding to compare the amounts +FIX: We must save code instead of value in database for template invoice modelpdf +FIX: we need to be able to add freeline with qty between 0 & 1 in supplierorder line +FIX: We should remove property comments only for project and task api. +FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized +FIX: when STOCK_CALCULATE_ON_SHIPMENT_NEW: is set, deleting a "closed" shipment now increases stock as expected +FIX: wrong path sociales/index.php doesnt exist anymore + ***** ChangeLog for 10.0.0 compared to 9.0.0 ***** For Users: NEW: Module "Ticket" is available as a stable module. From baa2e870d0e9b8f112e8298115cf6fdc7b9b631e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 5 Aug 2019 11:01:58 +0200 Subject: [PATCH 14/26] Update admin.lang found in admin/company.php --- htdocs/langs/en_US/admin.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a1d042a07a1..de1e5f52fcd 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -395,6 +395,7 @@ ButtonHideUnauthorized=Hide buttons for non-admin users for unauthorized actions OldVATRates=Old VAT rate NewVATRates=New VAT rate PriceBaseTypeToChange=Modify on prices with base reference value defined on +PriceFormatInCurrentLanguage=Price Format In Current Language MassConvert=Launch mass convert String=String TextLong=Long text @@ -1857,4 +1858,4 @@ MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or use application from a text browser like lynx or links. ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. EXPORTS_SHARE_MODELS=Export models are share with everybody -ExportSetup=Setup of module Export \ No newline at end of file +ExportSetup=Setup of module Export From 41c07b9b4364dc5c6a261dcbd65cb00a68ee1d45 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 5 Aug 2019 13:10:26 +0200 Subject: [PATCH 15/26] fix bad test in delivery card --- htdocs/livraison/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 2e1c9cb47c1..028ce581358 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -570,7 +570,7 @@ else } // Other attributes - if ($action = 'create_delivery') { + if ($action == 'create_delivery') { // copy from expedition $expeditionExtrafields = new Extrafields($db); $expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element); From 1d4fc32c20f0beb8d5eb21965ae413e9fc616674 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 5 Aug 2019 13:13:56 +0200 Subject: [PATCH 16/26] fix second bad test --- htdocs/livraison/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 028ce581358..13a6196d3a3 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -675,7 +675,7 @@ else $mode = ($object->statut == 0) ? 'edit' : 'view'; $line = new LivraisonLigne($db); $line->fetch_optionals($object->lines[$i]->id); - if ($action = 'create_delivery') { + if ($action == 'create_delivery') { $srcLine = new ExpeditionLigne($db); $expeditionLineExtrafields = new Extrafields($db); $expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element); From fde526f59df4343c991b40800b8406ed656e7028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 5 Aug 2019 14:58:50 +0200 Subject: [PATCH 17/26] Update pdf_einstein.modules.php --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index def09507b92..778b6525d21 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1221,7 +1221,7 @@ class pdf_einstein extends ModelePDFCommandes * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param string $titlekey Translation key to show as title of document - * @return void + * @return int Return topshift value */ function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="PdfOrderTitle") { From 7f23b77cbec9639f263d2ff8ad8a3b68e6885817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 5 Aug 2019 15:00:06 +0200 Subject: [PATCH 18/26] Update pdf_proforma.modules.php --- htdocs/core/modules/commande/doc/pdf_proforma.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index ebbe72f94c9..7a2c1f724c0 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -65,12 +65,12 @@ class pdf_proforma extends pdf_einstein * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param string $titlekey Translation key to show as title of document - * @return void + * @return int Return topshift value */ function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="InvoiceProForma") { global $conf,$langs,$hookmanager; - parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey); + return parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey); } } From 05ac4eec52c8fe5c585dbc8171ee891e45742e9e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 6 Aug 2019 00:16:18 +0200 Subject: [PATCH 19/26] Update charge.php --- htdocs/stripe/charge.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index a524a62f6a3..9d4bf71c040 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -133,13 +133,13 @@ if (!$rowid) } if ($charge->payment_method_details->type=='card') - { + { $type = $langs->trans("card"); - } elseif ($charge->source->type=='card'){ + } elseif ($charge->source->type=='card'){ $type = $langs->trans("card"); - } elseif ($charge->payment_method_details->type=='three_d_secure'){ + } elseif ($charge->payment_method_details->type=='three_d_secure'){ $type = $langs->trans("card3DS"); - } + } if (! empty($charge->payment_intent)) { $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); From 69985339d86b1668704ce64c16f51699ca25717f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 6 Aug 2019 11:47:34 +0200 Subject: [PATCH 20/26] Update price_parser.class.php --- .../product/dynamic_price/class/price_parser.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 3249671d173..1dd98c6610e 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -259,9 +259,14 @@ class PriceParser return -1; } - //Get the supplier min + //Get the supplier min price $productFournisseur = new ProductFournisseur($this->db); - $supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0); + $res = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0); + if ($res<1) { + $this->error_parser = array(25, null); + return -1; + } + $supplier_min_price = $productFournisseur->fourn_unitprice; //Accessible values by expressions $extra_values = array_merge($extra_values, array( From ee8d99351df76ef2e12a11a379b12c9ba69a64d3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 6 Aug 2019 16:28:18 +0200 Subject: [PATCH 21/26] Update facture.php --- htdocs/product/stats/facture.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index d60c4d835a5..a11bfe14865 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -234,7 +234,9 @@ if ($id > 0 || ! empty($ref)) while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); - + + if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty); + $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; From 0fc92b92a25da11770e8649805ae4b9226acbada Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 6 Aug 2019 16:47:54 +0200 Subject: [PATCH 22/26] Update facture.php --- htdocs/product/stats/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index a11bfe14865..8eab980f1dc 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -235,7 +235,7 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); - if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty); + if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty); $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; From 322ec32ff53a442a82838ce521429df74f2a1fb2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 7 Aug 2019 20:16:53 +0200 Subject: [PATCH 23/26] FIX duration when creating service --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 847c6325b50..ca3cec982df 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1028,7 +1028,7 @@ else if ($type == 1) { print ''.$langs->trans("Duration").''; - print ''; + print ''; print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOST('duration_value', 'alpha'), 0, 1); print ''; } From 0b831ccdf73f7bd6bc8a5d1a59c270d4f0270fb1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Aug 2019 09:33:14 +0200 Subject: [PATCH 24/26] FIX better help message with multicompany --- htdocs/product/admin/product.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 67bca85cfe0..fff393ffc2a 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -556,7 +556,14 @@ if (! empty($conf->fournisseur->enabled)) $rowspan++; print ''; -print ''.$langs->trans("PricingRule").''; +if (empty($conf->multicompany->enabled)) +{ + print ''.$langs->trans("PricingRule").''; +} +else +{ + print ''.$form->textwithpicto($langs->trans("PricingRule"), $langs->trans("SamePriceAlsoForSharedCompanies"), 1).''; +} print ''; $current_rule = 'PRODUCT_PRICE_UNIQ'; if (!empty($conf->global->PRODUIT_MULTIPRICES)) $current_rule='PRODUIT_MULTIPRICES'; @@ -564,10 +571,6 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) $current_rule='PRODUI if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES'; if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'; print $form->selectarray("princingrule", $select_pricing_rules, $current_rule); -if ( empty($conf->multicompany->enabled)) -{ - print $langs->trans("SamePriceAlsoForSharedCompanies"); -} print ''; print ''; print ''; From 8f2786cf7b9fa87820d385a693a7dfa7bf2ed0ab Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Fri, 9 Aug 2019 10:02:41 +0100 Subject: [PATCH 25/26] fix:this is not accessible in static context --- htdocs/debugbar/class/TraceableDB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index 4edc39a74af..d4bfd291602 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -143,7 +143,7 @@ class TraceableDB extends DoliDB */ public static function convertSQLFromMysql($line, $type = 'ddl') { - return $this->db->convertSQLFromMysql($line); + return self::$db->convertSQLFromMysql($line); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 2dee289fc6eda76e05cc185583f02b1578b4ed35 Mon Sep 17 00:00:00 2001 From: Je2fb <46494485+Je2fb@users.noreply.github.com> Date: Wed, 7 Aug 2019 17:16:34 +0200 Subject: [PATCH 26/26] Update price_parser.class.php Calculation with supplier_min_price work Conflicts: htdocs/product/dynamic_price/class/price_parser.class.php --- htdocs/product/dynamic_price/class/price_parser.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index ef968f5e960..9b929f84946 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -262,9 +262,11 @@ class PriceParser return -1; } - //Get the supplier min - $productFournisseur = new ProductFournisseur($this->db); - $supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0); + //Get the supplier min + $productFournisseur = new ProductFournisseur($this->db); + if ($productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0) > 0) { + $supplier_min_price = $productFournisseur->fourn_unitprice; + } //Accessible values by expressions $extra_values = array_merge($extra_values, array(