diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 1dbe17d6a13..0e2d3b35f38 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -275,6 +275,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $refcomp=$societestatic->getNomUrl(1,'',24); $paiement = $facturestatic->getSommePaiement(); // Payment already done + $paiement+= $facturestatic->getSumDepositsUsed(); + $paiement+= $facturestatic->getSumCreditNotesUsed(); } if ($obj->family == 'social_contribution') { diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 4c7b9e62f04..42558d11635 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; -$langs->load("compta"); -$langs->load("banks"); -$langs->load("bills"); +$langs->loadLangs(array("compta","banks","bills","accountancy")); // Security check $socid = GETPOST("socid","int"); @@ -43,7 +41,8 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $search_ref = GETPOST('search_ref','int'); $search_user = GETPOST('search_user','alpha'); $search_label = GETPOST('search_label','alpha'); -$search_amount = GETPOST('search_amount','alpha'); +$search_amount_deb = GETPOST('search_amount_deb','alpha'); +$search_amount_cred = GETPOST('search_amount_cred','alpha'); $search_account = GETPOST('search_account','int'); $sortfield = GETPOST("sortfield",'alpha'); @@ -77,7 +76,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', { $search_ref=""; $search_label=""; - $search_amount=""; + $search_amount_deb=""; + $search_amount_cred=""; $search_account=''; $typeid=""; } @@ -104,7 +104,8 @@ $sql.= " WHERE v.entity = ".$conf->entity; // Search criteria if ($search_ref) $sql.=" AND v.rowid=".$search_ref; if ($search_label) $sql.=natural_search(array('v.label'), $search_label); -if ($search_amount) $sql.=natural_search("v.amount", $search_amount, 1); +if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1); +if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1); if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($filtre) { $filtre=str_replace(":","=",$filtre); @@ -158,8 +159,8 @@ if ($result) print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre("Sens",$_SERVER["PHP_SELF"],"v.sens","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -192,11 +193,11 @@ if ($result) // Accounting account if (! empty($conf->accounting->enabled)) print ' '; - // Amount - print ''; + // Debit + print ''; - // Sens - print ' '; + // Credit + print ''; print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -205,6 +206,7 @@ if ($result) print "\n"; + $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); @@ -241,7 +243,7 @@ if ($result) $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($obj->accountancy_journal); - $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + $accountstatic->accountancy_journal = $accountingjournal->code; } $accountstatic->label=$obj->blabel; @@ -259,16 +261,25 @@ if ($result) print ''.$accountingaccount->getNomUrl(0,1,1,'',1).''; } - // Amount - print "".price($obj->amount).""; + // Debit + print ""; + if ($obj->sens == 0) + { + print price($obj->amount); + $totalarray['totaldeb'] += $obj->amount; + } + print ""; + + // Credit + print ""; + if ($obj->sens == 1) + { + print price($obj->amount); + $totalarray['totalcred'] += $obj->amount; + } + print ""; - // Sens - if ($obj->sens == '1') $sens = $langs->trans("Credit"); else $sens = $langs->trans("Debit"); - print "".$sens.""; print ""; - print "\n"; - - $total = $total + $obj->amount; $i++; } @@ -277,7 +288,8 @@ if ($result) if (! empty($conf->banque->enabled)) $colspan++; print ''; print ''.$langs->trans("Total").''; - print ''.price($total).""; + print ''.price($totalarray['totaldeb']).""; + print ''.price($totalarray['totalcred']).""; print ''; print ''; print ''; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 6c6ab3d0ea0..dd03cb86df9 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro * @@ -32,15 +32,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; $langs->load("bills"); $langs->load("compta"); // Security check -$facid =GETPOST('facid','int'); -$socid =GETPOST('socid','int'); -$userid=GETPOST('userid','int'); +$facid = GETPOST('facid','int'); +$socid = GETPOST('socid','int'); +$userid = GETPOST('userid','int'); $day = GETPOST('day','int'); $month = GETPOST('month','int'); $year = GETPOST('year','int'); @@ -334,7 +334,7 @@ if ($resql) $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objp->accountancy_journal); - $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + $accountstatic->accountancy_journal = $accountingjournal->code; print $accountstatic->getNomUrl(1); } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 90ec4c7edba..ce3915cf2ee 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2045,7 +2045,7 @@ else if ($user->rights->contrat->creer) print ''; else print ''; } - if ($object->statut == 1 && $nbofservices) + if ($object->statut == 1) { if ($user->rights->contrat->creer) print ''; else print ''; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 54e4d271c6d..51061b4b6ad 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -223,7 +223,7 @@ if ($mode == "5") $sql.= " AND cd.statut = 5"; if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'"; if ($filter == "notexpired") $sql.= " AND cd.date_fin_validite >= '".$db->idate($now)."'"; if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'"; -if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'"; +if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract)."%' "; if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; $filter_dateouvertureprevue=dol_mktime(0,0,0,$opouvertureprevuemonth,$opouvertureprevueday,$opouvertureprevueyear); diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index d81d8f22ac5..a34754b8d4c 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -120,7 +120,7 @@ class Interfaces if (! $qualified) { - dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG); + //dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG); continue; } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 202a598d8ae..71912714b90 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2015 Juanjo Menent + * Copyright (C) 2017 Ferran Marcet * * 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 @@ -419,7 +420,7 @@ function dol_get_next_week($day, $week, $month, $year) { $tmparray = dol_get_first_day_week($day, $month, $year); - $time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0); + $time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0); $time+=24*60*60*7; $tmparray=dol_getdate($time,true); diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index bfe0e45e02c..b263b16e29e 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -63,7 +63,7 @@ class modECM extends DolibarrModules $this->picto='dir'; // Data directories to create when module is enabled - $this->dirs = array("/ecm/My_First_Directory","/ecm/temp"); + $this->dirs = array("/ecm/temp"); // Config pages. Put here list of php page names stored in admmin directory used to setup module $this->config_page_url = array('ecm.php'); diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 826379f57f4..eb3b5a054e5 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -10,7 +10,7 @@ CronSetup= Scheduled job management setup URLToLaunchCronJobs=URL to check and launch qualified cron jobs OrToLaunchASpecificJob=Or to check and launch a specific job KeyForCronAccess=Security key for URL to launch cron jobs -FileToLaunchCronJobs=Command line to launch cron jobs +FileToLaunchCronJobs=Command line to check and launch qualified cron jobs CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run the command line each 5 minutes CronMethodDoesNotExists=Class %s does not contains any method %s diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1000388cb56..949711b4a1b 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1172,6 +1172,9 @@ if ($action == 'edit_price' && $object->getRights()->creer) print ''; print ''; + $parameters=array('colspan' => 2); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print ''; dol_fiche_end(); diff --git a/htdocs/theme/eldy/img/object_stripe.png b/htdocs/theme/eldy/img/object_stripe.png new file mode 100644 index 00000000000..287bd24910c Binary files /dev/null and b/htdocs/theme/eldy/img/object_stripe.png differ diff --git a/htdocs/theme/md/img/object_stripe.png b/htdocs/theme/md/img/object_stripe.png new file mode 100644 index 00000000000..287bd24910c Binary files /dev/null and b/htdocs/theme/md/img/object_stripe.png differ