From b214fcb5e09867fee36d1455fd97b79e6dafb79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 May 2021 23:29:35 +0200 Subject: [PATCH 1/7] complete tooltip product --- htdocs/product/stock/card.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b8698ff7ad3..6a61c60237b 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2016 Francis Appels * Copyright (C) 2021 Noé Cendrier + * Copyright (C) 2021 Frédéric France * * 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 @@ -612,6 +613,14 @@ if ($action == 'create') { } $sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.price, p.price_ttc, p.entity,"; + $sql .= "p.tosell, p.tobuy,"; + $sql .= "p.accountancy_code_sell,"; + $sql .= "p.accountancy_code_sell_intra,"; + $sql .= "p.accountancy_code_sell_export,"; + $sql .= "p.accountancy_code_buy,"; + $sql .= "p.accountancy_code_buy_intra,"; + $sql .= "p.accountancy_code_buy_export,"; + $sql .= 'p.barcode,'; if ($separatedPMP) { $sql .= " pa.pmp as ppmp,"; } else { @@ -683,6 +692,15 @@ if ($action == 'create') { $productstatic->entity = $objp->entity; $productstatic->status_batch = $objp->tobatch; $productstatic->fk_unit = $objp->fk_unit; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->barcode = $objp->barcode; + $productstatic->accountancy_code_sell = $objp->accountancy_code_sell; + $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra; + $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export; + $productstatic->accountancy_code_buy = $objp->accountancy_code_buy; + $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra; + $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; print $productstatic->getNomUrl(1, 'stock', 16); print ''; From 0d8c75268e34bdee95d05aa5251eef28e562c600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 May 2021 23:32:14 +0200 Subject: [PATCH 2/7] Update card.php --- htdocs/product/stock/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 6a61c60237b..91284944397 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -786,6 +786,7 @@ if ($action == 'create') { } print ' '; print ' '; + print ' '; print ''; } else { dol_print_error($db); From 1e6f3d0624a7220eeb77b3ee9d74efd4a447ca05 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 20 May 2021 12:30:02 +0200 Subject: [PATCH 3/7] add inventory link into mvt stock list --- htdocs/product/stock/class/mouvementstock.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 287cc26596c..4877bb861ab 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -962,6 +962,10 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; $origin = new Reception($this->db); break; + case 'inventory': + require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; + $origin = new Inventory($this->db); + break; default: if ($origintype) { From d93cf0beb749ca764d10d7e9aecceea648f723f7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 20 May 2021 12:36:26 +0200 Subject: [PATCH 4/7] fix: change societe by company varaible name in all file --- htdocs/compta/facture/list.php | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 282aad95d89..e3d8f52265a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -85,8 +85,8 @@ $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); $search_type = GETPOST('search_type', 'int'); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); -$search_societe = GETPOST('search_societe', 'alpha'); -$search_societe_alias = GETPOST('search_societe_alias', 'alpha'); +$search_company = GETPOST('search_company', 'alpha'); +$search_company_alias = GETPOST('search_company_alias', 'alpha'); $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); $search_montant_vat = GETPOST('search_montant_vat', 'alpha'); $search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha'); @@ -304,8 +304,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_type = ''; $search_project_ref = ''; $search_project = ''; - $search_societe = ''; - $search_societe_alias = ''; + $search_company = ''; + $search_company_alias = ''; $search_montant_ht = ''; $search_montant_vat = ''; $search_montant_localtax1 = ''; @@ -363,7 +363,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } -if ($massaction == 'makepayment') { +if ($massaction == 'makepayment_confirm') { $arrayofselected = is_array($toselect) ? $toselect : array(); $loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected); @@ -574,11 +574,11 @@ if ($search_project_ref) { if ($search_project) { $sql .= natural_search('p.title', $search_project); } -if ($search_societe) { - $sql .= natural_search('s.nom', $search_societe); +if ($search_company) { + $sql .= natural_search('s.nom', $search_company); } -if ($search_societe_alias) { - $sql .= natural_search('s.name_alias', $search_societe_alias); +if ($search_company_alias) { + $sql .= natural_search('s.name_alias', $search_company_alias); } if ($search_town) { $sql .= natural_search('s.town', $search_town); @@ -782,8 +782,8 @@ if ($resql) { if ($socid) { $soc = new Societe($db); $soc->fetch($socid); - if (empty($search_societe)) { - $search_societe = $soc->name; + if (empty($search_company)) { + $search_company = $soc->name; } } @@ -854,11 +854,11 @@ if ($resql) { if ($search_type != '') { $param .= '&search_type='.urlencode($search_type); } - if ($search_societe) { - $param .= '&search_societe='.urlencode($search_societe); + if ($search_company) { + $param .= '&search_societe='.urlencode($search_company); } - if ($search_societe_alias) { - $param .= '&search_societe_alias='.urlencode($search_societe_alias); + if ($search_company_alias) { + $param .= '&search_societe_alias='.urlencode($search_company_alias); } if ($search_town) { $param .= '&search_town='.urlencode($search_town); @@ -948,7 +948,7 @@ if ($resql) { 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), - //'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this + 'makepayment'=>$langs->trans("InvoicePaymentsLimits"), ); if ($conf->prelevement->enabled && !empty($user->rights->prelevement->bons->creer)) { $langs->load("withdrawals"); @@ -1142,11 +1142,11 @@ if ($resql) { } // Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; + print ''; } // Town if (!empty($arrayfields['s.town']['checked'])) { From 7874be6e37f9e47a7cebd17ae105e8d135357d13 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 20 May 2021 12:48:18 +0200 Subject: [PATCH 5/7] bad comment remove --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index e3d8f52265a..fff12c96151 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -948,7 +948,7 @@ if ($resql) { 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), - 'makepayment'=>$langs->trans("InvoicePaymentsLimits"), + //'makepayment'=>$langs->trans("InvoicePaymentsLimits"), ); if ($conf->prelevement->enabled && !empty($user->rights->prelevement->bons->creer)) { $langs->load("withdrawals"); From d83dbd19228e749881aaabcac712d7fac9ad6ad4 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 20 May 2021 13:24:30 +0200 Subject: [PATCH 6/7] fix: on mass action confirm box tag filter must not make LEFT JOIN --- htdocs/societe/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index f79857d744f..0a3e9207a96 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -467,10 +467,10 @@ if ($search_sale && $search_sale != '-1') { $sql .= ", sc.fk_soc, sc.fk_user"; } // We'll need these fields in order to filter by categ -if ($search_categ_cus) { +if ($search_categ_cus && $search_categ_cus!=-1) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } -if ($search_categ_sup) { +if ($search_categ_sup && $search_categ_sup!=-1) { $sql .= ", cs.fk_categorie, cs.fk_soc"; } // Add fields from extrafields @@ -494,10 +494,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_ef $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)"; // We'll need this table joined to the select in order to filter by categ -if (!empty($search_categ_cus)) { +if (!empty($search_categ_cus) && $search_categ_cus!=-1) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } -if (!empty($search_categ_sup)) { +if (!empty($search_categ_sup) && $search_categ_sup!=-1) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; From 5e6d6ccf67b6a187fce1de3d3839de553dc0500f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 20 May 2021 13:45:52 +0200 Subject: [PATCH 7/7] same bug on invoie list --- htdocs/compta/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 282aad95d89..0beedbf70a9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -492,7 +492,7 @@ $sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo if (!$sall) { $sql .= ', SUM(pf.amount) as dynamount_payed, SUM(pf.multicurrency_amount) as multicurrency_dynamount_payed'; } -if ($search_categ_cus) { +if ($search_categ_cus && $search_categ_cus!=-1) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields @@ -509,7 +509,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus)) { +if (!empty($search_categ_cus) && $search_categ_cus!=-1) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } @@ -720,7 +720,7 @@ if (!$sall) { $sql .= ' country.code,'; $sql .= " p.rowid, p.ref, p.title,"; $sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender"; - if ($search_categ_cus) { + if ($search_categ_cus && $search_categ_cus!=-1) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields