From 21d9b00fcebb899058dfeb32bbada22437b0938e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 23:17:46 +0100 Subject: [PATCH 1/5] Fix missing amount in table of prelevement --- htdocs/stripe/class/stripe.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index f5656387192..762b73db43b 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -325,7 +325,7 @@ class Stripe extends CommonObject */ public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 0) { - global $conf; + global $conf, $user; dol_syslog("getPaymentIntent", LOG_INFO, 1); @@ -486,8 +486,8 @@ class Stripe extends CommonObject if (!$paymentintentalreadyexists) { $now = dol_now(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; - $sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', ".$conf->entity.", '".$service."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site, amount)"; + $sql .= " VALUES ('".$this->db->idate($now)."', ".$user->id.", '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', ".$conf->entity.", '".$service."', ".$amount.")"; $resql = $this->db->query($sql); if (!$resql) { From 1973f2c9b9832b5c5899a27d1366f940af4d29e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 10:07:34 +0100 Subject: [PATCH 2/5] Fix look and feel v11 --- htdocs/societe/project.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 1ff2c24956e..c6029544c90 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -118,14 +118,15 @@ if ($socid) dol_fiche_end(); + $params = ''; - $addbutton = ''.$langs->trans("AddProject").''; + $newcardbutton .= dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage), '', 1, $params); print '
'; // Projects list - $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1, $addbutton); + $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1, $newcardbutton); } // End of page From 33b7fc11f0ac1ee75512b87e4c212acbe56ed558 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 10:41:31 +0100 Subject: [PATCH 3/5] Fix status of emailing target --- htdocs/comm/mailing/cibles.php | 3 ++- htdocs/comm/mailing/class/mailing.class.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 3dcfdf9e451..41e49ed09b3 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -673,7 +673,8 @@ if ($object->fetch($id) >= 0) // Date sent print ' '; - print ''.$langs->trans("MailingStatusNotSent"); + print ''; + print $object::libStatutDest($obj->statut, 2, ''); print ''; } else diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 32637096910..553c5e79c15 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -662,10 +662,12 @@ class Mailing extends CommonObject $labelStatusShort = array(); $labelStatus[-1] = $langs->trans('MailingStatusError'); + $labelStatus[0] = $langs->trans('MailingStatusNotSent'); $labelStatus[1] = $langs->trans('MailingStatusSent'); $labelStatus[2] = $langs->trans('MailingStatusRead'); $labelStatus[3] = $langs->trans('MailingStatusNotContact'); $labelStatusShort[-1] = $langs->trans('MailingStatusError'); + $labelStatusShort[0] = $langs->trans('MailingStatusNotSent'); $labelStatusShort[1] = $langs->trans('MailingStatusSent'); $labelStatusShort[2] = $langs->trans('MailingStatusRead'); $labelStatusShort[3] = $langs->trans('MailingStatusNotContact'); From 78d4978d31adae3b57c830c34d9f62691d928dc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 11:26:11 +0100 Subject: [PATCH 4/5] FIX #13100 --- htdocs/core/class/html.form.class.php | 31 ++++++++++++++++---------- htdocs/product/class/product.class.php | 3 +++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7188be03507..73e9ae0709b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2110,7 +2110,7 @@ class Form } } - $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; + $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; if (count($warehouseStatusArray)) { $selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock @@ -2737,13 +2737,15 @@ class Form $out = ''; $outarray = array(); + $maxlengtharticle = (empty($conf->global->PRODUCT_MAX_LENGTH_COMBO) ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO); + $langs->load('stocks'); // Units if ($conf->global->PRODUCT_USE_UNITS) { $langs->load('other'); } - $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, p.fk_product_type,"; + $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, p.fk_product_type,"; $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,"; $sql .= " pfp.supplier_reputation"; @@ -2751,7 +2753,7 @@ class Form if ($conf->global->PRODUCT_USE_UNITS) { $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; } - if (!empty($conf->barcode->enabled)) $sql .= " ,pfp.barcode"; + if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; if ($socid) $sql .= " AND pfp.fk_soc = ".$socid; @@ -2814,6 +2816,7 @@ class Form $outref = $objp->ref; $outval = ''; + $outbarcode = $objp->barcode; $outqty = 1; $outdiscount = 0; $outtype = $objp->fk_product_type; @@ -2864,12 +2867,22 @@ class Form if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $label, 1); $optlabel = $objp->ref; - if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { $optlabel .= ' ('.$objp->ref_fourn.')'; + } + if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) { + $optlabel .= ' ('.$outbarcode.')'; + } + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); $outvallabel = $objRef; - if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { $outvallabel .= ' ('.$objRefFourn.')'; + } + if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) { + $outvallabel .= ' ('.$outbarcode.')'; + } + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); // Units $optlabel .= $outvalUnits; @@ -2931,12 +2944,6 @@ class Form $optlabel .= " - ".dol_trunc($objp->name, 8); $outvallabel .= " - ".dol_trunc($objp->name, 8); } - if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) - { - //$optlabel .= " - ".$objp->barcode; - $optlabel .= " - ".$objp->barcode; - $outvallabel .= " - ".$objp->barcode; - } if ($objp->supplier_reputation) { //TODO dictionary @@ -3024,7 +3031,7 @@ class Form $langs->load('stocks'); - $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, pfp.fk_soc,"; + $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5eb8ab904cc..746f3ce20dd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4305,6 +4305,9 @@ class Product extends CommonObject if (!empty($this->label)) { $label .= '
'.$langs->trans('ProductLabel').': '.$this->label; } + if (!empty($conf->barcode->enabled)) { + $label .= '
'.$langs->trans('BarCode').': '.$this->barcode; + } if ($this->type == Product::TYPE_PRODUCT) { From e511deb8e7eea5c4fc69542fb00163a34c68c9ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 11:39:08 +0100 Subject: [PATCH 5/5] FIX #13096 --- htdocs/adherents/subscription.php | 2 +- htdocs/compta/paiement/class/paiement.class.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 30ecafcf3e4..04acfb93bb4 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -229,7 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! // Payment informations $accountid = $_POST["accountid"]; $operation = $_POST["operation"]; // Payment mode - $num_chq = $_POST["num_chq"]; + $num_chq = GETPOST("num_chq", "alphanohtml"); $emetteur_nom = $_POST["chqemetteur"]; $emetteur_banque = $_POST["chqbank"]; $option = $_POST["paymentsave"]; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e4a4a275029..87a8d5547ee 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -604,11 +604,12 @@ class Paiement extends CommonObject * @param string $emetteur_nom Name of transmitter * @param string $emetteur_banque Name of bank * @param int $notrigger No trigger + * @param string $num_chq Numero of cheque * @return int <0 if KO, bank_line_id if OK */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) { - global $conf,$langs,$user; + global $conf, $langs, $user; $error=0; $bank_line_id=0; @@ -628,7 +629,7 @@ class Paiement extends CommonObject include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - dol_syslog("$user->id,$mode,$label,$this->fk_account,$emetteur_nom,$emetteur_banque"); + dol_syslog("$user->id, $mode, $label, $this->fk_account, $emetteur_nom, $emetteur_banque"); $acc = new Account($this->db); $result=$acc->fetch($this->fk_account); @@ -647,7 +648,7 @@ class Paiement extends CommonObject $this->paiementid, // Payment mode id or code ("CHQ or VIR for example") $label, $totalamount, // Sign must be positive when we receive money (customer payment), negative when you give money (supplier invoice or credit note) - $this->num_paiement, + $this->num_payment, '', $user, $emetteur_nom,