From 2c411310bc0464311a3a0c1eab7a01feedbdc264 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 25 Apr 2019 08:29:43 +0200 Subject: [PATCH 1/5] FIX Menu Accountancy (Simple) not accessible without module Accountancy (Double entries) --- htdocs/core/menus/standard/eldy.lib.php | 74 ++++++++++++------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 02727acf36c..dcee245f257 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1302,42 +1302,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } } - // Accountancy (simple) - if (! empty($conf->comptabilite->enabled)) - { - $langs->load("compta"); - - // Bilan, resultats - $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); - - if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { - $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - /* On verra ca avec module compabilite expert - $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); - */ - $newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); - - /* - $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); - if (! empty($conf->propal->enabled)) { - $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); - } - */ - $newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); - - // Journaux - $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); - $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); - } - //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); - } - // Configuration $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { @@ -1369,8 +1333,44 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 120); $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 130); } - } + } + // Accountancy (simple) + if (! empty($conf->comptabilite->enabled)) + { + $langs->load("compta"); + + // Bilan, resultats + $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); + + if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { + $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + /* On verra ca avec module compabilite expert + $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); + */ + $newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); + + /* + $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); + if (! empty($conf->propal->enabled)) { + $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); + } + */ + $newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + + // Journaux + $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); + $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); + } + //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); + } + // Assets if (! empty($conf->asset->enabled)) { From cb658dda8cc007ceac78c721812d95ad444a7670 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 25 Apr 2019 12:04:26 +0200 Subject: [PATCH 2/5] Fix morphy type adherent --- htdocs/adherents/type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 9a241c027ab..089d817ac94 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -431,7 +431,7 @@ if ($rowid > 0) print ''; // Morphy - print ''.$langs->trans("Nature").''.$object->getmorphylib().''; + print ''.$langs->trans("Nature").''.$object->getmorphylib($object->morphy).''; print ''; print ''.$langs->trans("SubscriptionRequired").''; From 2968921f877a7eb6fb2c64b6f1f1b288b017191b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 25 Apr 2019 13:12:33 +0200 Subject: [PATCH 3/5] Fix display type in subscription --- htdocs/adherents/subscription.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 39466e8ae8a..9961471fdd6 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -5,6 +5,7 @@ * Copyright (C) 2012-2017 Regis Houssin * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Thibault FOUCART * * 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 @@ -668,7 +669,7 @@ if ($rowid > 0) { $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,"; $sql.= " c.rowid as crowid, c.subscription,"; - $sql.= " c.datec,"; + $sql.= " c.datec, c.fk_type as cfk_type,"; $sql.= " c.dateadh as dateh,"; $sql.= " c.datef,"; $sql.= " c.fk_bank,"; @@ -693,6 +694,7 @@ if ($rowid > 0) print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder); print ''.$langs->trans("DateCreation").''; + print ''.$langs->trans("Type").''; print ''.$langs->trans("DateStart").''; print ''.$langs->trans("DateEnd").''; print ''.$langs->trans("Amount").''; @@ -711,9 +713,15 @@ if ($rowid > 0) $subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->id=$objp->crowid; + $adht = new AdherentType($db); + $adht->fetch($objp->cfk_type); + print ''; print ''.$subscriptionstatic->getNomUrl(1).''; print ''.dol_print_date($db->jdate($objp->datec), 'dayhour')."\n"; + print ''; + if ( ! empty($objp->cfk_type) ) print $adht->getNomUrl(1); + print ''; print ''.dol_print_date($db->jdate($objp->dateh), 'day')."\n"; print ''.dol_print_date($db->jdate($objp->datef), 'day')."\n"; print ''.price($objp->subscription).''; From e80436469f9034882a4351a0b8a00ddc4629af4c Mon Sep 17 00:00:00 2001 From: Lionel VESSILLER Date: Thu, 25 Apr 2019 16:05:12 +0200 Subject: [PATCH 4/5] Fix default payment condition and method --- htdocs/fourn/commande/orderstoinvoice.php | 25 +++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 4b9511ce0df..093e0fd331b 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -298,11 +298,23 @@ if ($action == 'create' && !$error) { if ($socid) $res = $soc->fetch($socid); if ($res) { - $cond_reglement_id = $soc->cond_reglement_id; - $mode_reglement_id = $soc->mode_reglement_id; + $cond_reglement_id = $soc->cond_reglement_supplier_id; + $mode_reglement_id = $soc->mode_reglement_supplier_id; } $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? - 1 : ''; + $objectsrc = new CommandeFournisseur($db); + $listoforders = array(); + foreach ($selected as $sel) { + $result = $objectsrc->fetch($sel); + if ($result > 0) { + $listoforders[] = $objectsrc->ref; + } + + if (empty($cond_reglement_id)) $cond_reglement_id = $objectsrc->cond_reglement_id; + if (empty($mode_reglement_id)) $mode_reglement_id = $objectsrc->mode_reglement_id; + } + print '
'; print ''; print ''; @@ -350,15 +362,6 @@ if ($action == 'create' && !$error) { print ''; } - $objectsrc = new CommandeFournisseur($db); - $listoforders = array (); - foreach ($selected as $sel) { - $result = $objectsrc->fetch($sel); - if ($result > 0) { - $listoforders[] = $objectsrc->ref; - } - } - // Other attributes $parameters = array ( 'objectsrc' => $objectsrc, From 4353925d95e21b8782b47af192cb8af3264d86b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Apr 2019 19:02:16 +0200 Subject: [PATCH 5/5] Update subscription.php --- htdocs/adherents/subscription.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 9961471fdd6..cf85e7b2acf 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -705,6 +705,7 @@ if ($rowid > 0) print "\n"; $accountstatic=new Account($db); + $adht = new AdherentType($db); while ($i < $num) { @@ -713,14 +714,19 @@ if ($rowid > 0) $subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->id=$objp->crowid; - $adht = new AdherentType($db); - $adht->fetch($objp->cfk_type); + if ($objp->cfk_type > 0) + { + $adht->fetch($objp->cfk_type); + } print ''; print ''.$subscriptionstatic->getNomUrl(1).''; print ''.dol_print_date($db->jdate($objp->datec), 'dayhour')."\n"; print ''; - if ( ! empty($objp->cfk_type) ) print $adht->getNomUrl(1); + if ($objp->cfk_type > 0) + { + print $adht->getNomUrl(1); + } print ''; print ''.dol_print_date($db->jdate($objp->dateh), 'day')."\n"; print ''.dol_print_date($db->jdate($objp->datef), 'day')."\n";