From 1663a7a6faea4018c94a21d738ee5f05a4153b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9onard?= Date: Sun, 23 Mar 2014 14:46:09 +0100 Subject: [PATCH 1/9] Fix thousands separator in french (Belgium) language file --- htdocs/langs/fr_BE/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_BE/main.lang b/htdocs/langs/fr_BE/main.lang index cc4d012cd2e..430736a6bca 100644 --- a/htdocs/langs/fr_BE/main.lang +++ b/htdocs/langs/fr_BE/main.lang @@ -1,6 +1,6 @@ # Dolibarr language file - fr_BE - main SeparatorDecimal=, -SeparatorThousand=None +SeparatorThousand= FormatDateShort=%d/%m/%Y FormatDateShortInput=%d/%m/%Y FormatDateShortJava=dd/MM/yyyy From d9cb1da4d5de3403d85b639e9c04c39a9e3d6d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Mon, 24 Mar 2014 15:22:35 +0100 Subject: [PATCH 2/9] Project: make tasks accept a time --- htdocs/core/lib/project.lib.php | 8 ++++---- htdocs/projet/tasks.php | 13 +++++++------ htdocs/projet/tasks/task.php | 12 ++++++------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 751ebbdfc5f..4a73db2dc40 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -330,12 +330,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Date start print ''; - print dol_print_date($lines[$i]->date_start,'day'); + print dol_print_date($lines[$i]->date_start,'dayhour'); print ''; // Date end print ''; - print dol_print_date($lines[$i]->date_end,'day'); + print dol_print_date($lines[$i]->date_end,'dayhour'); print ''; // Planned Workload (in working hours) @@ -480,12 +480,12 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr // Date start print ''; - print dol_print_date($lines[$i]->date_start,'day'); + print dol_print_date($lines[$i]->date_start,'dayhour'); print ''; // Date end print ''; - print dol_print_date($lines[$i]->date_end,'day'); + print dol_print_date($lines[$i]->date_end,'dayhour'); print ''; // Planned Workload diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 794a1198c35..f0a35c14767 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -85,8 +85,8 @@ if ($action == 'createtask' && $user->rights->projet->creer) { $error=0; - $date_start = dol_mktime(0,0,0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']); - $date_end = dol_mktime(0,0,0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']); + $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyeassskr'],'user'); + $date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); if (empty($_POST["cancel"])) { @@ -234,12 +234,12 @@ if ($id > 0 || ! empty($ref)) // Date start print ''.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'day'); + print dol_print_date($object->date_start,'dayhour'); print ''; // Date end print ''.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'day'); + print dol_print_date($object->date_end,'dayhour'); print ''; // Other options @@ -304,12 +304,13 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie // Date start print ''.$langs->trans("DateStart").''; - print $form->select_date(($date_start?$date_start:''),'dateo',0,0,0,'',1,1); + var_dump($date_start); + print $form->select_date(($date_start?$date_start:''),'dateo',1,1,0,'',1,1); print ''; // Date end print ''.$langs->trans("DateEnd").''; - print $form->select_date(($date_end?$date_end:-1),'datee',0,0,0,'',1,1); + print $form->select_date(($date_end?$date_end:-1),'datee',1,1,0,'',1,1); print ''; // planned workload diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 5e2f20729cc..566813b4e85 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -87,8 +87,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $object->description = $_POST['description']; $object->fk_task_parent = $task_parent; $object->planned_workload = $planned_workload; - $object->date_start = dol_mktime(0,0,0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']); - $object->date_end = dol_mktime(0,0,0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']); + $object->date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user'); + $object->date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); $object->progress = $_POST['progress']; // Fill array 'array_options' with data from add form @@ -326,12 +326,12 @@ if ($id > 0 || ! empty($ref)) // Date start print ''.$langs->trans("DateStart").''; - print $form->select_date($object->date_start,'dateo'); + print $form->select_date($object->date_start,'dateo',1,1); print ''; // Date end print ''.$langs->trans("DateEnd").''; - print $form->select_date($object->date_end?$object->date_end:-1,'datee'); + print $form->select_date($object->date_end?$object->date_end:-1,'datee',1,1); print ''; // Planned workload @@ -415,12 +415,12 @@ if ($id > 0 || ! empty($ref)) // Date start print ''.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'day'); + print dol_print_date($object->date_start,'dayhour'); print ''; // Date end print ''.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'day'); + print dol_print_date($object->date_end,'dayhour'); print ''; // Planned workload From 7d0853d9e57e1ea72b3cb63688da772d68e0f2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Tue, 25 Mar 2014 11:36:22 +0100 Subject: [PATCH 3/9] Removed debug code --- htdocs/projet/tasks.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index f0a35c14767..c8cff281985 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -304,7 +304,6 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie // Date start print ''.$langs->trans("DateStart").''; - var_dump($date_start); print $form->select_date(($date_start?$date_start:''),'dateo',1,1,0,'',1,1); print ''; From 680ce297c5ce6ccdc8a5d5192cddf96e311e62dd Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 25 Mar 2014 15:41:20 +0100 Subject: [PATCH 4/9] Update mouvement.php sometime $year not filled then made "bug" the search propose to fill with current year in this case --- htdocs/product/stock/mouvement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index ee3f0b65639..9c6e9d80594 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -537,8 +537,8 @@ if ($resql) $productidselected=$key; $productlabelselected=$val; } - $datebefore=dol_get_first_day($year, $month?$month:1, true); - $dateafter=dol_get_last_day($year, $month?$month:12, true); + $datebefore=dol_get_first_day($year?$year:strftime("%Y",time()), $month?$month:1, true); + $dateafter=dol_get_last_day($year?$year:strftime("%Y",time()), $month?$month:12, true); $balancebefore=$movement->calculateBalanceForProductBefore($productidselected, $datebefore); $balanceafter=$movement->calculateBalanceForProductBefore($productidselected, $dateafter); From a3a6b6dff64c49a312c778c945b63e6866f640d3 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 26 Mar 2014 10:57:07 +0100 Subject: [PATCH 5/9] Update box_ficheinter.php External user show only is own intervention --- htdocs/core/boxes/box_ficheinter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 81cba912dff..cc7464ec3e9 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -72,8 +72,10 @@ class box_ficheinter extends ModeleBoxes $sql.= ", ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " WHERE f.fk_soc = s.rowid "; $sql.= " AND f.entity = ".$conf->entity; - if (! $user->rights->societe->client->voir) + if (! $user->rights->societe->client->voir && !$user->societe_id) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " ORDER BY f.tms DESC"; $sql.= $db->plimit($max, 0); From 5c837583c3faa516860a68dd0fcfcb5561fed6f8 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 26 Mar 2014 16:58:43 +0100 Subject: [PATCH 6/9] Fix installation script link to Task 1074 (missing new field) --- htdocs/install/mysql/tables/llx_stock_mouvement.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/tables/llx_stock_mouvement.sql b/htdocs/install/mysql/tables/llx_stock_mouvement.sql index ed87b77def6..c3546ca3635 100644 --- a/htdocs/install/mysql/tables/llx_stock_mouvement.sql +++ b/htdocs/install/mysql/tables/llx_stock_mouvement.sql @@ -29,4 +29,6 @@ create table llx_stock_mouvement type_mouvement smallint, fk_user_author integer, label varchar(128) + fk_origin integer, + origintype varchar(32) )ENGINE=innodb; From fcb588f424a22b59342f70c8011035c3e8e50711 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 26 Mar 2014 17:18:02 +0100 Subject: [PATCH 7/9] -Fix error when shipping a batch enabled product without stock -Fix typo --- .../class/expeditionbatch.class.php | 2 +- htdocs/expedition/fiche.php | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index cf57929ca0f..e361548309d 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -17,7 +17,7 @@ */ /** - * \file expedtion/class/productbatch.class.php + * \file expedition/class/productbatch.class.php * \ingroup productbatch * \brief This file implements CRUD method for managing product's shipment * with batch record diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index bfc444faf56..7ed44102a4c 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -856,7 +856,7 @@ if ($action == 'create') if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! $product->hasbatch()) { + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_array($product->stock_warehouse[GETPOST('entrepot_id','int')] ))) { // Quantity to send print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) @@ -897,27 +897,27 @@ if ($action == 'create') print "\n"; // Show subproducts of product - if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) - { - $product->get_sousproduits_arbo(); - $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); - if(count($prods_arbo) > 0) - { - foreach($prods_arbo as $key => $value) - { - //print $value[0]; - $img=''; - if ($value['stock'] < $value['stock_alert']) - { - $img=img_warning($langs->trans("StockTooLow")); - } - print "      -> - ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   - ".$value['stock']." ".$img.""; - } - } - } + if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) + { + $product->get_sousproduits_arbo(); + $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); + if(count($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) + { + //print $value[0]; + $img=''; + if ($value['stock'] < $value['stock_alert']) + { + $img=img_warning($langs->trans("StockTooLow")); + } + print "      -> + ".$value['fullpath']." + (".$value['nb'].") ".$value['nb_total']."   + ".$value['stock']." ".$img.""; + } + } + } } else { print ''; $subj=0; From 638e90eb67daf18deeb8ef68ce0bfe62d5369bed Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 28 Mar 2014 18:22:44 +0100 Subject: [PATCH 8/9] Fix: Margin tabs bad data show --- ChangeLog | 1 + htdocs/margin/agentMargins.php | 10 +++++++--- htdocs/margin/customerMargins.php | 18 ++++++++++++------ htdocs/margin/productMargins.php | 18 +++++++++++++----- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index e221e29f097..0a2c5118d95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -116,6 +116,7 @@ Fix: [ bug #1280 ] service with not end of date was tagged as expired. Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference Fix: [ bug #1306 ] Fatal error when adding an external calendar New: Added es_CL language +Fix: Margin tabs bad data show ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index b7c5b8d4701..cc8f4d067eb 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 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 @@ -130,11 +131,14 @@ if ($agentid > 0) { else $sql .= " AND sc.fk_user = ".$agentid; } -if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; -if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; +if (!empty($startdate)) + $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; +if (!empty($enddate)) + $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname"; +if($agentid) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname"; +else $sql.= " GROUP BY u.rowid, u.login, u.lastname, u.firstname"; $sql.= " ORDER BY ".$sortfield." ".$sortorder; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index e9a0bbfe102..e5226040794 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 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 @@ -172,13 +173,18 @@ $sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut > 0"; $sql.= " AND s.entity = ".$conf->entity; $sql.= " AND d.fk_facture = f.rowid"; -if ($client) $sql.= " AND f.fk_soc = ".$socid; -if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; -if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; +if ($client) + $sql.= " AND f.fk_soc = ".$socid; +if (!empty($startdate)) + $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; +if (!empty($enddate)) + $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; -if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; -$sql.= " ORDER BY ".$sortfield." ".$sortorder; +if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) + $sql .= " AND d.buy_price_ht <> 0"; +if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client"; +$sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index c4ba7b54c20..3152b8387b6 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 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 @@ -178,12 +179,19 @@ $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND d.fk_product = p.rowid"; $sql.= " AND f.fk_statut > 0"; $sql.= " AND d.fk_facture = f.rowid"; -if ($id > 0) $sql.= " AND d.fk_product =".$id; -if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; -if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; +if ($id > 0) + $sql.= " AND d.fk_product =".$id; +if (!empty($startdate)) + $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; +if (!empty($enddate)) + $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; -if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) + $sql .= " AND d.buy_price_ht <> 0"; +if ($id > 0) + $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +else + $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref"; $sql.= " ORDER BY ".$sortfield." ".$sortorder; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); From a1fb21114b7c7158e05d4d53338f373b6181f228 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 28 Mar 2014 18:31:43 +0100 Subject: [PATCH 9/9] New: Add some hooks for financial reports --- ChangeLog | 1 + htdocs/compta/localtax/clients.php | 18 ++++++++++++++++-- htdocs/compta/localtax/index.php | 12 +++++++++++- htdocs/compta/resultat/clientfourn.php | 11 +++++++++++ htdocs/compta/resultat/index.php | 9 +++++++-- htdocs/compta/tva/clients.php | 15 +++++++++++++++ htdocs/compta/tva/index.php | 10 ++++++++++ htdocs/compta/tva/quadri_detail.php | 12 +++++++++++- 8 files changed, 82 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a2c5118d95..88fdeafe29b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -65,6 +65,7 @@ For developers: action buttons into an element. - New: Normalize code for barcode generation to match other modules. - New: Uniformize code for contacts forms. +- New: Add some hooks for financial reports. WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 72b02194bc1..097a89c3918 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 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 @@ -153,6 +154,17 @@ print "".$vatcust.""; print "\n"; $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell'); + +$action = "tvaclient"; +$object = &$coll_list; +$parameters["mode"] = $modetax; +$parameters["start"] = $date_start; +$parameters["end"] = $date_end; +$parameters["direction"] = 'sell'; +// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('externalbalance')); +$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (is_array($coll_list)) { $var=true; @@ -160,7 +172,7 @@ if (is_array($coll_list)) $i = 1; foreach($coll_list as $coll) { - if(($min == 0 or ($min > 0 && $coll->amount > $min)) && $coll->localtax2>0) + if(($min == 0 or ($min > 0 && $coll->amount > $min)) && $coll->localtax2!=0) { $var=!$var; $intra = str_replace($find,$replace,$coll->tva_intra); @@ -222,6 +234,8 @@ print "\n"; $company_static=new Societe($db); $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); +$parameters["direction"] = 'buy'; +$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (is_array($coll_list)) { $var=true; @@ -229,7 +243,7 @@ if (is_array($coll_list)) $i = 1; foreach($coll_list as $coll) { - if(($min == 0 or ($min > 0 && $coll->amount > $min)) && $coll->localtax2>0) + if(($min == 0 or ($min > 0 && $coll->amount > $min)) && $coll->localtax2!=0) { $var=!$var; $intra = str_replace($find,$replace,$coll->tva_intra); diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index aaa36a7edd7..25f0e95fd5c 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 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 @@ -134,6 +135,15 @@ for ($m = 1 ; $m < 13 ; $m++ ) { $coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m); $coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m); + + $action = "tva"; + $object = array(&$coll_listsell, &$coll_listbuy); + $parameters["mode"] = $modetax; + $parameters["year"] = $y; + $parameters["month"] = $m; + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + $hookmanager->initHooks(array('externalbalance')); + $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (! is_array($coll_listbuy) && $coll_listbuy == -1) { @@ -181,7 +191,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) print ''.$langs->trans("SubTotal").':'; print ''.price($subtotalcoll).''; print ''.price($subtotalpaye).''; - print ''.price($subtotalpaye).''; + print ''.price($subtotal).''; print ' '; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index d28f457fb2b..15722966004 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002-2006 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 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 @@ -729,6 +730,16 @@ if ($mysoc->tva_assuj != 'franchise') // Assujeti print ''; } +$action = "balanceclient"; +$object = array(&$total_ht, &$total_ttc); +$parameters["mode"] = $modecompta; +$parameters["date_start"] = $date_start; +$parameters["date_end"] = $date_end; +$parameters["bc"] = $bc; +// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('externalbalance')); +$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +print $hookmanager->resPrint; if ($mysoc->tva_assuj != 'franchise') // Assujeti { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index e4ead871b42..a56551f234b 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 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 @@ -461,8 +462,12 @@ if ($result) { } else { dol_print_error($db); } - - +$action = "balance"; +$object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc); +$parameters["mode"] = $modecompta; +// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('externalbalance')); +$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks /* * Show result array diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index fbde1584541..84857a35130 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006 Yannick Warnier + * Copyright (C) 2014 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 @@ -185,6 +186,17 @@ print "".$vatcust.""; print "\n"; $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell'); + +$action = "tvaclient"; +$object = &$coll_list; +$parameters["mode"] = $modetax; +$parameters["start"] = $date_start; +$parameters["end"] = $date_end; +$parameters["direction"] = 'sell'; +// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('externalbalance')); +$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (is_array($coll_list)) { $var=true; @@ -263,6 +275,9 @@ print "\n"; $company_static=new Societe($db); $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); + +$parameters["direction"] = 'buy'; +$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (is_array($coll_list)) { $var=true; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 4bab6f143d1..91094e7b52d 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2014 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 @@ -153,6 +154,15 @@ for ($m = 1 ; $m < 13 ; $m++ ) { $coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m); $coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m); + + $action = "tva"; + $object = array(&$coll_listsell, &$coll_listbuy); + $parameters["mode"] = $modetax; + $parameters["year"] = $y; + $parameters["month"] = $m; + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + $hookmanager->initHooks(array('externalbalance')); + $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (! is_array($coll_listbuy) && $coll_listbuy == -1) { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index cc084655bf0..b39befd8ad6 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier + * Copyright (C) 2014 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 @@ -318,7 +319,16 @@ else print ''.$langs->trans("AmountHTVATRealReceived").''; print ''.$vatcust.''; print ''; - + + $action = "tvadetail"; + $parameters["mode"] = $modetax; + $parameters["start"] = $date_start; + $parameters["end"] = $date_end; + $object = array(&$x_coll, &$x_paye, &$x_both); + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + $hookmanager->initHooks(array('externalbalance')); + $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + foreach(array_keys($x_coll) as $rate) { $subtot_coll_total_ht = 0;