diff --git a/ChangeLog b/ChangeLog index 63c19ea52e6..2d9dc0ee0f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -153,56 +153,63 @@ parameter. All methods addline in this case were modified to remove this paramet +***** ChangeLog for 3.4.3 compared to 3.4.2 ***** +Fix: Bad get of localtaxes into contracts add lines + ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** -Fix: field's problem into company's page (RIB) -Fix: Document cerfa doesn't contained firstname & lastname from donator +Fix: field's problem into company's page (RIB). +Fix: Document cerfa doesn't contained firstname & lastname from donator. Fix: Bad rounding on margin calculations and display. Fix: Option drop table into backup was broken. -Fix: [ bug #1105 ] Searching Boxes other search option -Fix: wrong buy price update -Fix: [ bug #1142 ] Set paiement on invoice (PGSql) -Fix: [ bug #1145 ] Agenda button list type do not display -Fix: [ bug #1148 ] Product consomation : supplier order bad status -Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists -Fix: [ bug #1174 ] Product translated description not good into PDF -Fix: [ bug #1163 ] SQL Error when searching for supplier orders -Fix: [ bug #1162 ] Translaction for morning and afternoon -Fix: [ bug #1161 ] Search on product label +Fix: [ bug #1105 ] Searching Boxes other search option. +Fix: wrong buy price update. +Fix: [ bug #1142 ] Set paiement on invoice (PGSql). +Fix: [ bug #1145 ] Agenda button list type do not display. +Fix: [ bug #1148 ] Product consomation : supplier order bad status. +Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists. +Fix: [ bug #1174 ] Product translated description not good into PDF. +Fix: [ bug #1163 ] SQL Error when searching for supplier orders. +Fix: [ bug #1162 ] Translaction for morning and afternoon. +Fix: [ bug #1161 ] Search on product label. Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode. -Fix: [ bug #1171 ] Documents lost in interventions after validating -Fix: fix unsubscribe URL into mailing when sending manually (not by script) -Fix: [ bug #1182 ] ODT company_country tag is htmlencoded -Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type -Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal +Fix: [ bug #1171 ] Documents lost in interventions after validating. +Fix: fix unsubscribe URL into mailing when sending manually (not by script). +Fix: [ bug #1182 ] ODT company_country tag is htmlencoded. +Fix: [ bug #1196 ] Product barcode search does not expect 13th digit on EAN13 type. +Fix: [ bug #1202 ] Wrong amount in deposit % invoice from proposal. +Fix: Removed analytics tags into doc page. +Fix: Call Image on this instead of pdf. +Fix: Missing parameter for photo. +Fix: Bad SQL request for turnover report. ***** ChangeLog for 3.4.1 compared to 3.4.0 ***** -Fix: Display buying price on line edit when no supplier price is defined -Fix: Retrieving of margin info when invoice created automatically from order -Fix: Reordering supplier products in list by supplier or supplier ref was crashing -Fix: [ bug #1029 ] Tulip numbering mask -Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card -Fix: [ bug #1033 ] SUPPLIER REF disappeared -Fix: update extrafield do not display immediately after update -Fix: Fix bug with canvas thirdparty -Fix: [ bug #1037 ] Consumption> Supplier invoices related -Fix: User group name do not display in card (view or edit mode) -Fix: Link "Show all supplier invoice" on supplier card not working -Fix: [ bug #1039 ] Pre-defined invoices conversion -Fix: If only service module is activated, it's impossible to delete service -Fix: [ bug #1043 ] Bad interventions ref numbering -Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted -Fix: Localtaxes balance not showing -Fix: Intervention box links to contracts id -Fix: Compatibility with multicompany module -Fix: Edit propal line was losing product supplier price id -Fix: Delete linked element to supplier invoice when deleted -Fix: [ bug #1061 ] Bad info shipped products -Fix: [ bug #1062 ] Documents lost in propals and contracts validating -Fix: Supplier price displayed on document lines and margin infos didnt take discount -Fix: sorting on qty did not work in supplier product list -Fix: there was no escaping on filter fields in supplier product list -Fix: bugs on margin reports and better margin calculation on credit notes -Qual: Add travis-ci integration +Fix: Display buying price on line edit when no supplier price is defined. +Fix: Retrieving of margin info when invoice created automatically from order. +Fix: Reordering supplier products in list by supplier or supplier ref was crashing. +Fix: [ bug #1029 ] Tulip numbering mask. +Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card. +Fix: [ bug #1033 ] SUPPLIER REF disappeared. +Fix: update extrafield do not display immediatly after update. +Fix: Fix bug with canvas thirdparty. +Fix: [ bug #1037 ] Consumption> Supplier invoices related. +Fix: User group name do not display in card (view or edit mode). +Fix: Link "Show all supplier invoice" on suplier card not working. +Fix: [ bug #1039 ] Pre-defined invoices conversion. +Fix: If only service module is activated, it's impossible to delete service. +Fix: [ bug #1043 ] Bad interventions ref numbering. +Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted. +Fix: Localtaxes balance not showing. +Fix: Intervention box links to contracts id. +Fix: Compatiblity with multicompany module. +Fix: Edit propal line was losing product supplier price id. +Fix: Delete linked element to supplier invoice when deleted. +Fix: [ bug #1061 ] Bad info shipped products. +Fix: [ bug #1062 ] Documents lost in propals and contracts validating. +Fix: Supplier price displayed on document lines and margin infos didnt take discount. +Fix: sorting on qty did not work in supplier product list. +Fix: there was no escaping on filter fields in supplier product list. +Fix: bugs on margin reports and better margin calculation on credit notes. +Qual: Add travis-ci integration. ***** ChangeLog for 3.4 compared to 3.3.* ***** For users: @@ -301,6 +308,7 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac ***** ChangeLog for 3.3.5 compared to 3.3.4 ***** +- Fix: Change to make debian package ok despite removal of ckeditor. - Fix: jcrop file to match debian rules - Fix: Add missing country UK. - Fix: Minor fix into package. diff --git a/README.md b/README.md index bad4d47ffc2..574e74da85c 100644 --- a/README.md +++ b/README.md @@ -76,61 +76,63 @@ See ChangeLog file found into package. ### Main modules/features: -- Customers, Prospects or Suppliers directory -- Products and services catalog -- Bank accounts management -- Orders management -- Commercial proposals management -- Contracts management -- Invoices management -- Payments management -- Standing orders management -- Stock management -- Shipping management +- Customers, Prospects or Suppliers directory. +- Products and services catalog. +- Bank accounts management. +- Orders management. +- Commercial proposals management. +- Contracts management. +- Invoices management. +- Payments management. +- Standing orders management. +- Stock management. +- Shipping management. - PDF or ODT generation for invoice, proposals, orders... -- Agenda with ical,vcal export for third tools integration -- EDM (Electronic Document Management) -- Foundations members management -- Employee's holidays management -- Mass Emailing -- Realize surveys -- Point of Sale +- Agenda with ical,vcal export for third tools integration. +- EDM (Electronic Document Management). +- Foundations members management. +- Employee's holidays management. +- Mass Emailing. +- Realize surveys. +- Point of Sale. ### Other modules: -- Bookmarks management -- Donations management -- Reporting -- Data export/import -- LDAP connectivity -- Third parties or products categories -- ClickToDial integration -- RSS integration +- Bookmarks management. +- Donations management. +- Reporting. +- Data export/import. +- Third parties or products categories. +- LDAP connectivity. +- ClickToDial integration. +- RSS integration. +- Can be extended with a lot of other external modules available onto DoliStore.com. ### Miscellaneous: - Multi-user, with several permissions levels for each feature. -- Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions). - Very user friendly and easy to use. -- Optional WYSIWYG forms, optional Ajax forms. -- Several skins. -- Code is highly customizable (a lot of use of modules and submodules). -- Works with Mysql 4.1 or higher, or PostgreSql 8.14 or higher. -- Works with PHP 5.0 or higher. -- An easy to understand and maintain code (PHP with no heavy frameworks). -- A trigger architecture to allow you to make Dolibarr business events run PHP code to update your own information system. -- "NPR VAT Rate" (French particularity for managing VAT in DOM-TOM called "Non Perçue Récupérable"). - +- Highly customizable: Enable only modules you need, user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one). +- Works with PHP 5.2.1, MySql 4.1 or PostgreSQL 8.1. +- Compatible with all Cloud solutions that match MySql, PHP or PostgreSQL prerequisites. +- An easy to understand, maintain and code interfaces with your own system information (PHP with no heavy frameworks, trigger and hook architecture). +- Support countries specific features: + Spanish Tax RE and ISPF. + French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM). + Canadian double taxes (federal/province) and other countries using cumulative VAT. + Tunisian tax stamp. + Compatible with European directives (2006/112/CE ... 2010/45/UE) (http://europa.eu/legislation_summaries/taxation/l31057_en.htm) + ... ## WHAT DOLIBARR CAN'T DO YET (TODO LIST) This is features that Dolibarr does not support completely yet: -- No double party accountancy (only bank management). +- No double party accountancy (only bank and treasury management). - Dolibarr manage one currency at once (mono-currency). -- Dolibarr manage one master company/foundation (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas). -- Dolibarr does not contains Payroll module. +- Dolibarr manage one master activity (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas). - Tasks on module project can't have dependencies between each other. +- Dolibarr does not contains Payroll module. - Dolibarr does not include any Webmail. - Dolibarr can't do coffee (not yet). diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7c3b1f6c479..03d40dbb085 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -158,7 +158,7 @@ foreach ($modulesdir as $dir) if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; // We discard modules according to property disabled - if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false; + if (! empty($objMod->hidden)) $modulequalified=false; // Define array $categ with categ with at least one qualified module if ($modulequalified) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 4ab19b7f915..9f4be55eb40 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -528,13 +528,13 @@ class Categorie } /** - * Return list of contents of a category + * Return list of id of elements having this category * * @param string $field Field name for select in table. Full field name will be fk_field. * @param string $classname PHP Class of object to store entity * @param string $category_table Table name for select in table. Full table name will be PREFIX_categorie_table. * @param string $object_table Table name for select in table. Full table name will be PREFIX_table. - * @return void + * @return mixed -1 if KO, array of instance of object if OK */ function get_type($field,$classname,$category_table='',$object_table='') { diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 6316436f69a..7aa9aa0b964 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -365,6 +365,8 @@ if($object->type == 2) $var=true; foreach ($socs as $key => $soc) { + if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself + $i++; $var=!$var; print "\t\n"; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index bb4b434742d..083d05ae3ef 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -250,9 +250,12 @@ if ($id > 0) // Country print ''.$langs->trans("Country").''; - $img=picto_from_langcode($object->country_code); - if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$object->country; + if (! empty($object->country_code)) + { + $img=picto_from_langcode($object->country_code); + if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); + else print ($img?$img.' ':'').$object->country; + } print ''; // EMail diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index a7b51fb5fb0..45d242bd4e5 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -52,7 +52,9 @@ $startyear=$year-1; $endyear=$year; $langs->load('orders'); +$langs->load('companies'); $langs->load('other'); +$langs->load('suppliers'); /* diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 66644cde848..b5ff84546fd 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -27,8 +27,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - * \class Deplacement - * \brief Class to manage trips and working credit notes + * Class to manage trips and working credit notes */ class Deplacement extends CommonObject { @@ -65,6 +64,9 @@ class Deplacement extends CommonObject { $this->db = $db; + $this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed'); + $this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed'); + return 1; } @@ -327,7 +329,6 @@ class Deplacement extends CommonObject } if ($mode == 4) { - //if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 95ca831c37c..e24ca5dd56b 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2013 Antoine Iauch + * Copyright (C) 2013 Laurent Destailleur * * 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 @@ -173,23 +174,21 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl // SQL request $catotal=0; -if ($modecompta == 'CREANCES-DETTES') { +if ($modecompta == 'CREANCES-DETTES') +{ $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,"; $sql.= " sum(l.total_ht) as amount, sum(l.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - $sql.= " JOIN ".MAIN_DB_PREFIX."facturedet as l"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON l.fk_facture = f.rowid"; - if ($selected_cat === -2) { - $sql.=" LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; - } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = " . $selected_cat; - if ($subcat) { - $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as l, ".MAIN_DB_PREFIX."product as p"; + if ($selected_cat === -2) // Without any category + { + $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; + } + else if ($selected_cat) // Into a specific category + { + $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp"; } - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_categorie = c.rowid"; - } $sql.= " WHERE l.fk_product = p.rowid"; + $sql.= " AND l.fk_facture = f.rowid"; $sql.= " AND f.fk_statut in (1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql.= " AND f.type IN (0,1,2)"; @@ -199,16 +198,21 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) { - $sql.=" AND cp.fk_product is null"; - } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " AND cp.fk_product = p.rowid"; - } + if ($selected_cat === -2) // Without any category + { + $sql.=" AND cp.fk_product is null"; + } + else if ($selected_cat) { // Into a specific category + $sql.= " AND (c.rowid = ".$selected_cat; + if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= ")"; + $sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid"; + } $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY p.rowid "; - $sql.= "ORDER BY p.ref "; + $sql.= " GROUP BY p.rowid"; + $sql.= " ORDER BY p.ref"; + dol_syslog("cabyprodserv sql=".$sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -384,7 +388,10 @@ if ($modecompta == 'CREANCES-DETTES') { print ''; } else { // $modecompta != 'CREANCES-DETTES' - print '
'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '
'; + // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an + // invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ? + // Because there is no way to know this, this report is not relevant. + print '
'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '
'; } llxFooter(); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index f154b2a69f6..97333f1758c 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Antoine Iauch @@ -180,17 +180,14 @@ $catotal=0; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name,"; $sql.= " sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= " JOIN ".MAIN_DB_PREFIX."facture as f"; - if ($selected_cat === -2) { + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + if ($selected_cat === -2) // Without any category + { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = ".$selected_cat; - if ($subcat) { - $sql.=" OR c.fk_parent = " . $selected_cat; - } - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_categorie = c.rowid"; + else if ($selected_cat) // Into a specific category + { + $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } $sql.= " WHERE f.fk_statut in (1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -202,28 +199,50 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - if ($selected_cat === -2) { + if ($selected_cat === -2) // Without any category + { $sql.=" AND cs.fk_societe is null"; } - if ($selected_cat && $selected_cat !== -2) { - $sql.= " AND cs.fk_societe = s.rowid"; + else if ($selected_cat) { // Into a specific category + $sql.= " AND (c.rowid = ".$selected_cat; + if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= ")"; + $sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_societe = s.rowid"; } - } else { +} else { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) */ $sql = "SELECT s.rowid as socid, s.nom as name, sum(pf.amount) as amount_ttc"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql .= " WHERE p.rowid = pf.fk_paiement"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if ($selected_cat === -2) // Without any category + { + $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; + } + else if ($selected_cat) // Into a specific category + { + $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; + } + $sql.= " WHERE p.rowid = pf.fk_paiement"; $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND f.fk_soc = s.rowid"; if ($date_start && $date_end) { $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } + if ($selected_cat === -2) // Without any category + { + $sql.=" AND cs.fk_societe is null"; + } + else if ($selected_cat) { // Into a specific category + $sql.= " AND (c.rowid = ".$selected_cat; + if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; + $sql.= ")"; + $sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_societe = s.rowid"; + } } $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; @@ -231,6 +250,7 @@ $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; //echo $sql; +dol_syslog("casoc sql=".$sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -251,7 +271,7 @@ if ($result) { // On ajoute les paiements anciennes version, non lies par paiement_facture if ($modecompta != 'CREANCES-DETTES') { - $sql = "SELECT '0' as socid, 'Autres' as name, sum(DISTINCT p.amount) as amount_ttc"; + $sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; @@ -483,4 +503,4 @@ print ''; llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index f045fb30cc3..06b408d4fa2 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -3,8 +3,8 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -448,8 +448,8 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $desc=$product_desc; } - $localtax1_tx=get_localtax($tva_tx,1,$object->societe); - $localtax2_tx=get_localtax($tva_tx,2,$object->societe); + $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty); + $localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty); // ajout prix achat $fk_fournprice = $_POST['fournprice']; diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 2389a681000..e2ad29b8562 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -213,30 +213,42 @@ if ($type == 'directory') $textifempty = $langs->trans('NoFileFound'); } else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); - + $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); } } -if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) + +if ($section) { - if ($section) - { - $param.=($param?'?':'').(preg_replace('/^&/','',$param)); + $useajax=1; + if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; + if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - $useglobalvars=1; - $form = new Form($db); - $formquestion=array('urlfile'=>array('type'=>'hidden','value'=>'','name'=>'urlfile')); - print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",'deletefile'); + $param.=($param?'?':'').(preg_replace('/^&/','',$param)); - // Enable jquery handlers on new generated HTML objects - print ''."\n"; - } + if ($useajax || $action == 'delete') + { + $urlfile=''; + if ($action == 'delete') $urlfile=GETPOST('urlfile'); + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + $useglobalvars=1; + $form = new Form($db); + $formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile')); + print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0)); + } + + if ($useajax) + { + // Enable jquery handlers on new generated HTML objects + print ''."\n"; + } } // Close db if mode is not noajax diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 2ed38d94e4a..64dd4c8b9fa 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -403,7 +403,7 @@ class Conf $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024); // Define list of limited modules - if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. + if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. // Timeouts if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8c1c4ac7987..f2a3ea58754 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2525,6 +2525,19 @@ class Form if (is_array($formquestion) && ! empty($formquestion)) { + // First add hidden fields and value + foreach ($formquestion as $key => $input) + { + if (is_array($input) && ! empty($input)) + { + if ($input['type'] == 'hidden') + { + $more.=''."\n"; + } + } + } + + // Now add questions $more.=''."\n"; $more.=''."\n"; foreach ($formquestion as $key => $input) @@ -2584,10 +2597,6 @@ class Form $more.=$input['value']; $more.=''."\n"; } - else if ($input['type'] == 'hidden') - { - $more.=''; - } } } $more.='
'.(! empty($formquestion['text'])?$formquestion['text']:'').'
'."\n"; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 0559c7b56da..9c0968436d3 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -813,7 +813,12 @@ class FormFile else $filepath=$file['name']; */ - print ''.img_delete().''; + $useajax=1; + if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; + if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; + + print ''.img_delete().''; } else print ' '; print ""; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0ade2ab1b2b..1437d5d9974 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -557,19 +557,18 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany")); print_fiche_titre($title,$buttoncreate,''); - print "\n".''."\n"; - - - $param="socid=".$object->id; - if ($search_status != '') $param.='&search_status='.$search_status; - if ($search_name != '') $param.='&search_name='.urlencode($search_name); - print ''; print ''; print ''; print ''; - $colspan=8; + print "\n".'
'."\n"; + + $param="socid=".$object->id; + if ($search_status != '') $param.='&search_status='.$search_status; + if ($search_name != '') $param.='&search_name='.urlencode($search_name); + + $colspan=9; print ''; print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder); @@ -579,21 +578,20 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email","",$param,'',$sortfield,$sortorder); if (! empty($conf->skype->enabled)) { - $colspan++; - print ''; + $colspan++; + print ''; } print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder); + // Copy to clipboard print ""; - if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) - { - $colspan++; - print ''; - } - if ($user->rights->societe->contact->creer) + // Add to agenda + if (! empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create)) { $colspan++; print ''; } + // Edit + print ''; print ""; @@ -603,7 +601,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; print ''; - print ''; + print ''; print ''; @@ -612,21 +610,26 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; if (! empty($conf->skype->enabled)) { - $colspan++; - print ''; + $colspan++; + print ''; } - print ''; + // Copy to clipboard print ""; + + // Add to agenda if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $colspan++; print ''; } - + // Edit print ''; @@ -689,9 +692,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; } + // Status print ''; - // copy in clipboard + // Copy to clipboard $coords = ''; if (!empty($object->name)) $coords .= addslashes($object->name)."
"; @@ -722,10 +726,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if (!empty($object->country)) $coords .= "
".addslashes($object->country); } + print ''; + // Add to agenda if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ''; } - - + + // Edit if ($user->rights->societe->contact->creer) { print ''; } - + else print ''; print "\n"; $i++; @@ -762,6 +768,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') } print "\n
'.$langs->trans("Skype").''.$langs->trans("Skype").'    
       '; + + // Status + print ''; print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print '  '; print ''; print ''.$contactstatic->getLibStatut(5).''; print img_picto($langs->trans("Address"), 'object_address.png'); print ''; @@ -739,8 +745,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print img_object($langs->trans("Event"),"action"); print ''; @@ -748,7 +754,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print img_edit(); print ' 
\n"; + print ''."\n"; + print "
\n"; ?>