diff --git a/.tx/config b/.tx/config index fcd276390ee..a89b56c1013 100644 --- a/.tx/config +++ b/.tx/config @@ -2,6 +2,12 @@ host = https://www.transifex.com lang_map = uz: uz_UZ +[dolibarr.accountancy] +file_filter = htdocs/langs//accountancy.lang +source_file = htdocs/langs/en_US/accountancy.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.admin] file_filter = htdocs/langs//admin.lang source_file = htdocs/langs/en_US/admin.lang diff --git a/ChangeLog b/ChangeLog index 2c0a5353f60..cf0f0b2f922 100644 --- a/ChangeLog +++ b/ChangeLog @@ -143,6 +143,7 @@ For users: - Fix: Extrafield feature select from table should try to translate multiple column when not needed - Fix: cents for indian ruppes are calle paisa and paise. - Fix: Invoices payments may be older than invoices. +- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: diff --git a/build/debian/control b/build/debian/control index f4f9e12aa58..fc0cee30319 100755 --- a/build/debian/control +++ b/build/debian/control @@ -68,4 +68,4 @@ Description: Web based software to manage a company or foundation PDF exports, And a lot more modules... . - You can also add third parties external modules or develop yours. + You can also add external modules from third parties or develop yours. diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index c8b8c8a7d97..ca7e5f84e07 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García + * Copyright (C) 2014 Juanjo Menent * * 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,9 +131,6 @@ print "
\n"; * Params * */ -$list = array ( - 'ACCOUNTING_SEPARATORCSV' -); $num = count($list); if ($num) { diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 66f5efef04d..02cb262b209 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -3,7 +3,8 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) - * Copyright (C) 2014 Marcos García + * Copyright (C) 2014 Marcos García + * Copyright (C) 2014 Juanjo Menent * * 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 diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journaux.php index 77b7d15e1c3..f7507cda234 100644 --- a/htdocs/accountancy/admin/journaux.php +++ b/htdocs/accountancy/admin/journaux.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García + * Copyright (C) 2014 Juanjo Menent * * 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 diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 82c3ec3ca10..e6ada14a7db 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/accountancy/class/Accountingaccount.class.php + * \file htdocs/accountancy/class/accountingaccount.class.php * \ingroup Accounting Expert * \brief Fichier de la classe des comptes comptable */ @@ -29,8 +29,11 @@ class AccountingAccount { var $db; + var $error; + var $id; var $rowid; + var $datec; // Creation date var $fk_pcg_version; var $pcg_type; @@ -62,8 +65,10 @@ class AccountingAccount */ function fetch($rowid = null, $account_number = null) { - if ($rowid || $account_number) { - $sql = "SELECT * FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE "; + if ($rowid || $account_number) + { + $sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, labe, fk_user_author, fk_user_modifn active"; + $sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE"; if ($rowid) { $sql .= " rowid = '" . $rowid . "'"; } elseif ($account_number) { @@ -72,28 +77,40 @@ class AccountingAccount dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); - if ($result) { + if ($result) + { $obj = $this->db->fetch_object($result); - } else { - return null; + + if ($obj) + { + $this->id = $obj->rowid; + $this->rowid = $obj->rowid; + $this->datec = $obj->datec; + $this->tms = $obj->tms; + $this->fk_pcg_version = $obj->fk_pcg_version; + $this->pcg_type = $obj->pcg_type; + $this->pcg_subtype = $obj->pcg_subtype; + $this->account_number = $obj->account_number; + $this->account_parent = $obj->account_parent; + $this->label = $obj->label; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_modif = $obj->fk_user_modif; + $this->active = $obj->active; + + return $this->id; + } + else + { + return 0; + } + } + else + { + dol_print_error($this->db); } } - $this->id = $obj->rowid; - $this->rowid = $obj->rowid; - $this->datec = $obj->datec; - $this->tms = $obj->tms; - $this->fk_pcg_version = $obj->fk_pcg_version; - $this->pcg_type = $obj->pcg_type; - $this->pcg_subtype = $obj->pcg_subtype; - $this->account_number = $obj->account_number; - $this->account_parent = $obj->account_parent; - $this->label = $obj->label; - $this->fk_user_author = $obj->fk_user_author; - $this->fk_user_modif = $obj->fk_user_modif; - $this->active = $obj->active; - - return $obj->rowid; + return -1; } /** diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 2df4d675b20..9ae070c25e0 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,7 +1,8 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -40,7 +41,7 @@ $langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->read) accessforbidden(); // Filter diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index aff9f7aa3a7..9215d5a9d98 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -2,7 +2,8 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) - * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -43,7 +44,7 @@ $account_parent = GETPOST('account_parent'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->dispatch) accessforbidden(); $formventilation = new FormVentilation($db); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 02602262e2c..fefed420621 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -44,7 +45,7 @@ $mesCasesCochees = GETPOST('mesCasesCochees', 'array'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->dispatch) accessforbidden(); $formventilation = new FormVentilation($db); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index e0c2ceb8e36..c9d21f5d9be 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -28,7 +28,7 @@ */ require '../../main.inc.php'; - + // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -88,12 +88,12 @@ $sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,"; $sql .= " fd.rowid as fdid, fd.description, fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,"; $sql .= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur, s.fournisseur,"; $sql .= " s.code_compta_fournisseur, p.accountancy_code_buy , ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; -$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det fd"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = fd.fk_product"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount aa ON aa.rowid = fd.fk_code_ventilation"; -$sql .= " JOIN " . MAIN_DB_PREFIX . "facture_fourn f ON f.rowid = fd.fk_facture_fourn"; -$sql .= " JOIN " . MAIN_DB_PREFIX . "societe s ON s.rowid = f.fk_soc"; +$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as fd"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation"; +$sql .= " JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = fd.fk_facture_fourn"; +$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql .= " WHERE f.fk_statut > 0 "; if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = " . $conf->entity; @@ -113,13 +113,13 @@ if ($result) { // les variables $cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER)) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"); $cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)) ? $conf->global->COMPTA_VAT_ACCOUNT : $langs->trans("CodeNotDef"); - + $tabfac = array (); $tabht = array (); $tabtva = array (); $tabttc = array (); $tabcompany = array (); - + $i = 0; while ( $i < $num ) { $obj = $db->fetch_object($result); @@ -133,7 +133,7 @@ if ($result) { $compta_prod = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT)) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"); } $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva); - + $tabfac[$obj->rowid]["date"] = $obj->df; $tabfac[$obj->rowid]["ref"] = $obj->ref; $tabfac[$obj->rowid]["type"] = $obj->type; @@ -145,9 +145,9 @@ if ($result) { $tabcompany[$obj->rowid] = array ( 'id' => $obj->socid, 'name' => $obj->name, - 'code_fournisseur' => $obj->code_compta_fournisseur + 'code_fournisseur' => $obj->code_compta_fournisseur ); - + $i ++; } } else { @@ -160,11 +160,11 @@ if ($result) { // Bookkeeping Write if ($action == 'writebookkeeping') { $now = dol_now(); - + foreach ( $tabfac as $key => $val ) { foreach ( $tabttc[$key] as $k => $mt ) { // get compte id and label - + $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_ref = $val["ref"]; @@ -180,10 +180,10 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; - + $bookkeeping->create(); } - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { @@ -205,18 +205,18 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; - + $bookkeeping->create(); } } } - + // VAT // var_dump($tabtva); foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { // get compte id and label - + $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_ref = $val["ref"]; @@ -232,7 +232,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; - + $bookkeeping->create(); } } @@ -243,21 +243,21 @@ if ($action == 'writebookkeeping') { if ($action == 'export_csv') { $sep = $conf->global->ACCOUNTING_SEPARATORCSV; - + header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename=journal_achats.csv'); - + if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert { foreach ( $tabfac as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + if ($mt) { print $date . $sep; print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; @@ -270,7 +270,7 @@ if ($action == 'export_csv') { print "\n"; } } - + // VAT // var_dump($tabtva); foreach ( $tabtva[$key] as $k => $mt ) { @@ -289,7 +289,7 @@ if ($action == 'export_csv') { print $date . $sep; print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; - + foreach ( $tabttc[$key] as $k => $mt ) { print length_accounta(html_entity_decode($k)) . $sep; print ($mt < 0 ? 'D' : 'C') . $sep; @@ -303,11 +303,11 @@ if ($action == 'export_csv') { { foreach ( $tabfac as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), 'day'); - + $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { @@ -333,7 +333,7 @@ if ($action == 'export_csv') { print "\n"; } } - + // Third party print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; @@ -347,11 +347,11 @@ if ($action == 'export_csv') { } } } else { - + llxHeader('', '', ''); - + $form = new Form($db); - + $nom = $langs->trans("PurchasesJournal"); $nomlink = ''; $periodlink = ''; @@ -364,11 +364,11 @@ if ($action == 'export_csv') { $description .= $langs->trans("DepositsAreIncluded"); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); - + print ''; - + print ''; - + print ' '; - + /* * Show result array */ print '

'; - + $i = 0; print ""; print ""; @@ -397,21 +397,21 @@ if ($action == 'export_csv') { print ""; print ""; print "\n"; - + $var = true; $r = ''; - + $invoicestatic = new FactureFournisseur($db); $companystatic = new Fournisseur($db); - + foreach ( $tabfac as $key => $val ) { $invoicestatic->id = $key; $invoicestatic->ref = $val["ref"]; $invoicestatic->type = $val["type"]; $invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32)); - + $date = dol_print_date($db->jdate($val["date"]), 'day'); - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { @@ -441,16 +441,16 @@ if ($action == 'export_csv') { } } print ""; - + // Third party // print ""; print ""; print ""; - + foreach ( $tabttc[$key] as $k => $mt ) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; - + print ""; } print ""; - + $var = ! $var; } - + print "
" . $langs->trans("Account") . "" . $langs->trans("Type") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
".$conf->global->COMPTA_JOURNAL_BUY."" . $date . "" . $invoicestatic->getNomUrl(1) . "" . length_accounta($k); print "" . $langs->trans("ThirdParty"); print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')'; @@ -459,12 +459,12 @@ if ($action == 'export_csv') { print '' . ($mt >= 0 ? price($mt) : '') . "
"; - + // End of page llxFooter(); } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 587a0d387a4..79444fbca60 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -90,11 +90,11 @@ $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tot $sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,"; $sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte, "; $sql .= " ct.accountancy_code_sell as account_tva"; -$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet fd"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = fd.fk_product"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount aa ON aa.rowid = fd.fk_code_ventilation"; -$sql .= " JOIN " . MAIN_DB_PREFIX . "facture f ON f.rowid = fd.fk_facture"; -$sql .= " JOIN " . MAIN_DB_PREFIX . "societe s ON s.rowid = f.fk_soc"; +$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation"; +$sql .= " JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; +$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'"; $sql .= " WHERE fd.fk_code_ventilation > 0 "; if (! empty($conf->multicompany->enabled)) { diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 3ff70b4e670..b0078839b55 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent s * * 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 @@ -45,7 +46,7 @@ $codeventil = GETPOST('codeventil'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->dispatch) accessforbidden(); if ($action == 'ventil' && $user->rights->accounting->access) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index cd6ef6bcb53..7d633c575f1 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -39,7 +40,7 @@ $langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->read) accessforbidden(); // Filter diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 41ab92aa765..8b2a870220d 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -4,7 +4,8 @@ * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) - * Copyright (C) 2013-2014 Florian Henry a + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -44,7 +45,7 @@ $langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->dispatch) accessforbidden(); $formventilation = new FormVentilation($db); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 7cb53a99a83..4bdf28672c1 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent s * * 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 @@ -45,7 +46,7 @@ $mesCasesCochees = GETPOST('mesCasesCochees', 'array'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) +if (! $user->rights->accounting->ventilation->dispatch) accessforbidden(); $formventilation = new FormVentilation($db); diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 9bd164a9b32..79ba8597672 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -130,7 +130,7 @@ abstract class ActionsAdherentCardCommon } else { - $this->errors=$nuser->error; + $this->errors[]=$nuser->error; $this->db->rollback(); } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index eade23f7a3a..5b3dc089880 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -276,7 +276,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ $db->begin(); // Create subscription - $crowid=$object->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend, $option); + $crowid=$object->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend); if ($crowid <= 0) { $error++; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index a866ecd9a70..215f2eae069 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -324,8 +324,8 @@ if ($conf->use_javascript_ajax) '   '.$titre.''. ''. ''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. - ''.img_edit_add('default',0,'class="menuNew" id="new'.$menu['rowid'].'"').' '. - ''.img_delete('default',0,'class="menuDel" id="del'.$menu['rowid'].'"').' '. + ''.img_edit_add('default').' '. + ''.img_delete('default').' '. ''.img_picto("Monter","1uparrow").''.img_picto("Descendre","1downarrow").''. '' ); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 2247df9493e..6094bb7e4f1 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -55,7 +55,7 @@ if ($action == "set") if (! $res > 0) $error++; $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int'); - $account = new Account($db, $id); + $account = new Account($db); if($account->fetch($id)>0) { diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index fc9d0489e9a..85139b56ba9 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -50,7 +50,7 @@ print "
\n"; $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); -$triggers = $interfaces->getTriggersList(0,'priority'); +$triggers = $interfaces->getTriggersList(); print ' diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 2da54e77712..712f60f25cd 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -65,7 +65,7 @@ llxHeader('',$langs->trans("Categories"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'setup'); -$head = categoriesadmin_prepare_head(null); +$head = categoriesadmin_prepare_head(); dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category'); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 9ff2ce11871..a21f7a53699 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -396,7 +396,7 @@ else if ($id || $ref) llxHeader("","",$langs->trans("Member")); - $head=member_prepare_head($member, $user); + $head=member_prepare_head($member); $titre=$langs->trans("Member"); $picto='user'; dol_fiche_head($head, 'category', $titre,0,$picto); @@ -471,7 +471,7 @@ else if ($id || $ref) llxHeader("","",$langs->trans("Contact")); - $head=contact_prepare_head($object, $user); + $head=contact_prepare_head($object); $titre=$langs->trans("ContactsAddresses"); $picto='contact'; dol_fiche_head($head, 'category', $titre,0,$picto); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 426faf46297..d8619e696af 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent @@ -87,20 +87,37 @@ $hookmanager->initHooks(array('actioncard')); * Actions */ -if (GETPOST('addassignedtouser')) +// Remove user to assigned list +if (! empty($_POST['removedassigned'])) +{ + $idtoremove=$_POST['removedassigned']; + if (! empty($_SESSION['assignedtouser'])) $tmpassigneduserids=dol_json_decode($_SESSION['assignedtouser'],1); + else $tmpassigneduserids=array(); + unset($tmpassigneduserids[$idtoremove]); + //var_dump($_POST['removedassigned']);exit; + $_SESSION['assignedtouser']=dol_json_encode($tmpassigneduserids); + $donotclearsession=1; + if ($action == 'add') $action = 'create'; + if ($action == 'update') $action = 'edit'; +} + +// Add user to assigned list +if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser')) { // Add a new user if (GETPOST('affectedto') > 0) { $assignedtouser=array(); - if (!empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); + if (! empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); $assignedtouser[GETPOST('affectedto')]=array('transparency'=>GETPOST('transparency'),'mandatory'=>1); $_SESSION['assignedtouser']=dol_json_encode($assignedtouser); } $donotclearsession=1; - $action='create'; + if ($action == 'add') $action = 'create'; + if ($action == 'update') $action = 'edit'; } -// Add action + +// Add event if ($action == 'add') { $error=0; @@ -131,22 +148,22 @@ if ($action == 'add') // Check parameters if (! $datef && $percentage == 100) { - $error++; + $error++; $donotclearsession=1; $action = 'create'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); } if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label')) { - $error++; + $error++; $donotclearsession=1; $action = 'create'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")), 'errors'); } // Initialisation objet cactioncomm - if (! GETPOST('actioncode')) + if (! GETPOST('actioncode') > 0) { - $error++; + $error++; $donotclearsession=1; $action = 'create'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); } @@ -161,7 +178,6 @@ if ($action == 'add') $object->priority = GETPOST("priority")?GETPOST("priority"):0; $object->fulldayevent = (! empty($fulldayevent)?1:0); $object->location = GETPOST("location"); - $object->transparency = (GETPOST("transparency")=='on'?1:0); $object->label = trim(GETPOST('label')); $object->fk_element = GETPOST("fk_element"); $object->elementtype = GETPOST("elementtype"); @@ -186,18 +202,35 @@ if ($action == 'add') $object->percentage = $percentage; $object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; - $usertodo=new User($db); - if ($_POST["affectedto"] > 0) + $listofuserid=dol_json_decode($_SESSION['assignedtouser']); + $i=0; + foreach($listofuserid as $key => $value) { - $usertodo->fetch($_POST["affectedto"]); + if ($i == 0) // First entry + { + $usertodo=new User($db); + if ($key > 0) + { + $usertodo->fetch($key); + } + $object->usertodo = $usertodo; + $object->transparency = (GETPOST("transparency")=='on'?1:0); + } + + $object->userassigned[$key]=array('id'=>$key, 'transparency'=>(GETPOST("transparency")=='on'?1:0)); + + $i++; } - $object->usertodo = $usertodo; - $userdone=new User($db); - if ($_POST["doneby"] > 0) + + if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) { - $userdone->fetch($_POST["doneby"]); + $userdone=new User($db); + if ($_POST["doneby"] > 0) + { + $userdone->fetch($_POST["doneby"]); + } + $object->userdone = $userdone; } - $object->userdone = $userdone; $object->note = trim($_POST["note"]); if (isset($_POST["contactid"])) $object->contact = $contact; @@ -214,16 +247,22 @@ if ($action == 'add') if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $object->use_phenix=1; // Check parameters + if (empty($object->usertodo)) + { + $error++; $donotclearsession=1; + $action = 'create'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionAffectedTo")), 'errors'); + } if ($object->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent)))) { - $error++; + $error++; $donotclearsession=1; $action = 'create'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); } if (! GETPOST('apyear') && ! GETPOST('adyear')) { - $error++; + $error++; $donotclearsession=1; $action = 'create'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); } @@ -265,42 +304,14 @@ if ($action == 'add') $langs->load("errors"); $error=$langs->trans($object->error); setEventMessage($error,'errors'); - $action = 'create'; + $action = 'create'; $donotclearsession=1; } } else { $db->rollback(); - $langs->load("errors"); - - if (! empty($object->error)) setEventMessage($langs->trans($object->error), 'errors'); - if (count($object->errors)) setEventMessage($object->errors, 'errors'); - - $action = 'create'; - } - } -} - -/* - * Action suppression de l'action - */ -if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') -{ - $object->fetch($id); - - if ($user->rights->agenda->myactions->delete - || $user->rights->agenda->allactions->delete) - { - $result=$object->delete(); - - if ($result >= 0) - { - header("Location: index.php"); - exit; - } - else - { - setEventMessage($object->error,'errors'); + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'create'; $donotclearsession=1; } } } @@ -348,25 +359,59 @@ if ($action == 'update') if (! $datef && $percentage == 100) { - $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); + $error++; $donotclearsession=1; + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); $action = 'edit'; } // Users - $usertodo=new User($db); - if ($_POST["affectedto"]) + $listofuserid=dol_json_decode($_SESSION['assignedtouser']); + $i=0; + foreach($listofuserid as $key => $value) { - $usertodo->fetch($_POST["affectedto"]); - } - $object->usertodo = $usertodo; - $object->transparency=(GETPOST("transparency")=='on'?1:0); + if ($i == 0) // First entry + { + $usertodo=new User($db); + if ($key > 0) + { + $usertodo->fetch($key); + } + $object->usertodo = $usertodo; + $object->transparency=(GETPOST("transparency")=='on'?1:0); + } - $userdone=new User($db); - if ($_POST["doneby"]) - { - $userdone->fetch($_POST["doneby"]); + $object->userassigned[$key]=array('id'=>$key, 'transparency'=>(GETPOST("transparency")=='on'?1:0)); + + $i++; + } + + if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) + { + $userdone=new User($db); + if ($_POST["doneby"]) + { + $userdone->fetch($_POST["doneby"]); + } + $object->userdone = $userdone; + } + + // Check parameters + if (! GETPOST('actioncode') > 0) + { + $error++; $donotclearsession=1; + $action = 'edit'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + } + else + { + $result=$cactioncomm->fetch(GETPOST('actioncode')); + } + if (empty($object->usertodo)) + { + $error++; $donotclearsession=1; + $action = 'edit'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionAffectedTo")), 'errors'); } - $object->userdone = $userdone; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -383,17 +428,13 @@ if ($action == 'update') } else { + setEventMessages($object->error,$object->errors,'errors'); $db->rollback(); } } } - if ($result < 0) - { - setEventMessage($object->error,'errors'); - setEventMessage($object->errors,'errors'); - } - else + if (! $error) { if (! empty($backtopage)) { @@ -403,6 +444,30 @@ if ($action == 'update') } } +/* + * delete event + */ +if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') +{ + $object->fetch($id); + + if ($user->rights->agenda->myactions->delete + || $user->rights->agenda->allactions->delete) + { + $result=$object->delete(); + + if ($result >= 0) + { + header("Location: index.php"); + exit; + } + else + { + setEventMessages($object->error,$object->errors,'errors'); + } + } +} + /* * Action move update, used when user move an event in calendar by drag'n drop */ @@ -576,15 +641,14 @@ if ($action == 'create') print ''; // Assigned to - $var=false; print ''; print '
'.$langs->trans("Location").'
'.$langs->trans("ActionAffectedTo").''; if (empty($donotclearsession)) { $assignedtouser=GETPOST("affectedtouser")?GETPOST("affectedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id); $_SESSION['assignedtouser']=dol_json_encode(array($assignedtouser=>array('transparency'=>1,'mandatory'=>1))); } - //print $form->select_dolusers_forevent('affectedto',1); - print $form->select_dolusers(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1); + print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'affectedto',1); + //print $form->select_dolusers(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1); print '
'; @@ -599,7 +663,7 @@ if ($action == 'create') print ''; // Realised by - if ($conf->global->AGENDA_ENABLE_DONEBY) + if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) { print ''.$langs->trans("ActionDoneBy").''; print $form->select_dolusers(GETPOST("doneby")?GETPOST("doneby"):(! empty($object->userdone->id) && $percent==100?$object->userdone->id:0),'doneby',1); @@ -704,11 +768,6 @@ if ($action == 'create') // View or edit if ($id > 0) { - if ($error) - { - dol_htmloutput_errors($error); - } - $result=$object->fetch($id); $object->fetch_optionals($id,$extralabels); @@ -833,7 +892,14 @@ if ($id > 0) // Assigned to print ''.$langs->trans("ActionAffectedTo").''; - print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'affectedto',1); + $listofuserid=array(); + if (empty($donotclearsession)) + { + if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); + $_SESSION['assignedtouser']=dol_json_encode($listofuserid); + } + print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'affectedto',1); + //print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'affectedto',1); print ''; print '

'; @@ -844,7 +910,7 @@ if ($id > 0) print ''; // Realised by - if ($conf->global->AGENDA_ENABLE_DONEBY) + if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) { print '"; print ''; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index e511a163c79..81596540489 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -102,7 +102,7 @@ if ($_POST["action"] == 'add') if (! $error) { - $id = $account->create($user->id); + $id = $account->create($user); if ($id > 0) { $_GET["id"]=$id; // Force chargement page en mode visu @@ -306,7 +306,7 @@ if ($action == 'create') $doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); $doleditor->Create(); print ''; - + print '
'.$langs->trans("ActionDoneBy").''; print $form->select_dolusers($object->userdone->id> 0?$object->userdone->id:-1,'doneby',1); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8bf2a1036bf..adc3e8d5aee 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -57,12 +57,14 @@ class ActionComm extends CommonObject var $punctual = 1; // Milestone var $percentage; // Percentage var $location; // Location + var $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) var $priority; // Small int (0 By default) var $note; // Description - var $usertodo; // Object user that must do action - var $userdone; // Object user that did action + var $userassigned; // Array of user ids + var $usertodo; // Object user of owner + var $userdone; // Object user that did action (deprecated) var $societe; // Company linked to action (optional) var $contact; // Contact linked to action (optional) @@ -89,10 +91,10 @@ class ActionComm extends CommonObject { $this->db = $db; - $this->author = new stdClass(); - $this->usermod = new stdClass(); - $this->usertodo = new stdClass(); - $this->userdone = new stdClass(); + //$this->author = new stdClass(); + //$this->usermod = new stdClass(); + //$this->usertodo = new stdClass(); + //$this->userdone = new stdClass(); $this->societe = new stdClass(); $this->contact = new stdClass(); } @@ -258,9 +260,10 @@ class ActionComm extends CommonObject * Load object from database * * @param int $id Id of action to get + * @param string $ref Ref of action to get * @return int <0 if KO, >0 if OK */ - function fetch($id) + function fetch($id, $ref='') { global $langs; @@ -286,7 +289,9 @@ class ActionComm extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; - $sql.= " WHERE a.id=".$id." AND a.fk_action=c.id"; + $sql.= " WHERE a.fk_action=c.id"; + if ($ref) $sql.= " AND a.id=".$ref; // No field ref, we use id + else $sql.= " AND a.id=".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index c3f28a36ed6..5ad90cd24de 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -327,11 +327,11 @@ if ($id > 0) print ''; if ($action == 'editconditions') { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'cond_reglement_id',-1,1); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id',1); } else { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'none'); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'none'); } print "
'; print '
'; @@ -510,7 +510,7 @@ else $account->fetch(GETPOST('id','int')); print_fiche_titre($langs->trans("EditFinancialAccount")); - + if ($conf->use_javascript_ajax) { print "\n".''; + $out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); + $out.=''; $assignedtouser=array(); if (!empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); if (count($assignedtouser)) $out.='
'; + $i=0; foreach($assignedtouser as $key => $value) { $userstatic->fetch($key); $out.=$userstatic->getNomUrl(1); + if ($i == 0) $out.=' ('.$langs->trans("Owner").')'; + $out.=' '; //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); $out.='
'; + $i++; } //$out.=''; @@ -3043,7 +3050,7 @@ class Form * @param int $page Page * @param string $selected Id condition pre-selectionne * @param string $htmlname Name of select html field - * @param int $addempty Ajoute entree vide + * @param int $addempty Add empty entry * @return void */ function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 68d0f4e7639..dc87e64950d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1940,29 +1940,31 @@ function img_pdf($titlealt = 'default', $size = 3) * Show logo + * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $other Add more attributes on img * @return string Return tag img */ -function img_edit_add($titlealt = 'default') +function img_edit_add($titlealt = 'default', $other = '') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Add'); - return img_picto($titlealt, 'edit_add.png'); + return img_picto($titlealt, 'edit_add.png', $other); } /** * Show logo - * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $other Add more attributes on img * @return string Return tag img */ -function img_edit_remove($titlealt = 'default') +function img_edit_remove($titlealt = 'default', $other='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Remove'); - return img_picto($titlealt, 'edit_remove.png'); + return img_picto($titlealt, 'edit_remove.png', $other); } /** @@ -2265,9 +2267,9 @@ function img_search($titlealt = 'default', $other = '') global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Search'); - + $img = img_picto($titlealt, 'search.png', $other, false, 1); - + $input = ''; @@ -2286,9 +2288,9 @@ function img_searchclear($titlealt = 'default', $other = '') global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Search'); - + $img = img_picto($titlealt, 'searchclear.png', $other, false, 1); - + $input = ''; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 19611dd9404..05abcd625e8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1221,7 +1221,7 @@ function dol_print_reduction($reduction,$langs) $string = ''; if ($reduction == 100) { - $string = $langs->trans("Offered"); + $string = $langs->transnoentities("Offered"); } else { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 060524181d8..8455bcaf550 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -39,22 +39,22 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Home - Sytem info insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?leftmenu=admintools', 'SystemTools', 0, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 208__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/system/modules.php?leftmenu=admintools', 'Modules', 2, 'admin', '', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 207__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/triggers.php?leftmenu=admintools', 'Triggers', 2, 'admin', '', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 202__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/system/modules.php?leftmenu=admintools', 'Modules', 2, 'admin', '', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 203__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/triggers.php?leftmenu=admintools', 'Triggers', 2, 'admin', '', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 204__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/browser.php?leftmenu=admintools', 'InfoBrowser', 1, 'admin', '', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 204__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/os.php?leftmenu=admintools', 'InfoOS', 1, 'admin', '', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 205__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/web.php?leftmenu=admintools', 'InfoWebServer', 1, 'admin', '', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 206__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/phpinfo.php?leftmenu=admintools', 'InfoPHP', 1, 'admin', '', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 205__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/os.php?leftmenu=admintools', 'InfoOS', 1, 'admin', '', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 206__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/web.php?leftmenu=admintools', 'InfoWebServer', 1, 'admin', '', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 207__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/phpinfo.php?leftmenu=admintools', 'InfoPHP', 1, 'admin', '', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 210__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/database.php?leftmenu=admintools', 'InfoDatabase', 1, 'admin', '', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 301__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_export.php?leftmenu=admintools', 'Backup', 1, 'admin', '', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 302__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_import.php?leftmenu=admintools', 'Restore', 1, 'admin', '', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 305__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/update.php?leftmenu=admintools', 'MenuUpgrade', 1, 'admin', '', '', 2, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools" && function_exists("eaccelerator_info")', __HANDLER__, 'left', 304__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/eaccelerator.php?leftmenu=admintools', 'EAccelerator', 1, 'admin', '', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 306__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/listevents.php?leftmenu=admintools', 'Audit', 1, 'admin', '', '', 2, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools" && function_exists("eaccelerator_info")', __HANDLER__, 'left', 306__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/eaccelerator.php?leftmenu=admintools', 'EAccelerator', 1, 'admin', '', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 307__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/listevents.php?leftmenu=admintools', 'Audit', 1, 'admin', '', '', 2, 10, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 308__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/listsessions.php?leftmenu=admintools', 'Sessions', 1, 'admin', '', '', 2, 11, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 303__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 307__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 203__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__); -- Home - Menu users and groups insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index fb55ce74052..4a49740ebb1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -526,11 +526,11 @@ elseif ($action == 'update_line' && $user->rights->fournisseur->facture->creer) } - $localtax1tx= get_localtax($_POST['tauxtva'], 1, $mysoc,$object->thirdparty); - $localtax2tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty); + $localtax1_tx= get_localtax($_POST['tauxtva'], 1, $mysoc,$object->thirdparty); + $localtax2_tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty); $remise_percent=GETPOST('remise_percent'); - $result=$object->updateline(GETPOST('lineid'), $label, $pu, GETPOST('tauxtva'), $localtax1tx, $localtax2tx, GETPOST('qty'), GETPOST('idprod'), $price_base_type, 0, $type, $remise_percent); + $result=$object->updateline(GETPOST('lineid'), $label, $pu, GETPOST('tauxtva'), $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('idprod'), $price_base_type, 0, $type, $remise_percent); if ($result >= 0) { unset($_POST['label']); @@ -626,13 +626,13 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer) $tvatx=get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); $npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); - $localtax1tx= get_localtax($tvatx, 1, $mysoc,$object->thirdparty); - $localtax2tx= get_localtax($tvatx, 2, $mysoc,$object->thirdparty); + $localtax1_tx= get_localtax($tvatx, 1, $mysoc,$object->thirdparty); + $localtax2_tx= get_localtax($tvatx, 2, $mysoc,$object->thirdparty); $type = $productsupplier->type; // TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first) - $result=$object->addline($desc, $productsupplier->fourn_pu, $tvatx, $localtax1tx, $localtax2tx, $qty, $idprod, $remise_percent, '', '', 0, $npr); + $result=$object->addline($desc, $productsupplier->fourn_pu, $tvatx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, '', '', 0, $npr); } if ($idprod == -2 || $idprod == 0) { diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 635154768bb..24cb1a6203d 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -18,6 +18,16 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer; + +ALTER TABLE llx_propal ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_commande ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_facture ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_product ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_fichinter ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_modif integer after fk_user_author; +ALTER TABLE llx_bank_account ADD COLUMN fk_user_modif integer after fk_user_author; ALTER TABLE llx_fichinter ADD COLUMN ref_ext varchar(255); diff --git a/htdocs/install/mysql/tables/llx_bank_account.sql b/htdocs/install/mysql/tables/llx_bank_account.sql index 63a0e23762d..bb2da7841b8 100644 --- a/htdocs/install/mysql/tables/llx_bank_account.sql +++ b/htdocs/install/mysql/tables/llx_bank_account.sql @@ -30,6 +30,8 @@ create table llx_bank_account ref varchar(12) NOT NULL, label varchar(30) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_user_author integer, + fk_user_modif integer, bank varchar(60), code_banque varchar(8), code_guichet varchar(6), diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 3cf3fdac226..90e8fd7af71 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -36,9 +36,10 @@ create table llx_commande date_valid datetime, -- date de validation date_cloture datetime, -- date de cloture date_commande date, -- date de la commande - fk_user_author integer, -- createur de la commande - fk_user_valid integer, -- valideur de la commande - fk_user_cloture integer, -- auteur cloture + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating + fk_user_cloture integer, -- user closing source smallint, fk_statut smallint default 0, amount_ht real default 0, diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql index d8076c1c06c..2ecf9e10442 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql @@ -30,16 +30,17 @@ create table llx_commande_fournisseur ref_supplier varchar(30), fk_soc integer NOT NULL, - fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande + fk_projet integer DEFAULT 0, -- project id tms timestamp, date_creation datetime, -- date de creation date_valid datetime, -- date de validation date_approve datetime, -- date de approve date_commande date, -- date de la commande - fk_user_author integer, -- createur de la commande - fk_user_valid integer, -- valideur de la commande - fk_user_approve integer, -- auteur approve + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating + fk_user_approve integer, -- user approving source smallint NOT NULL, fk_statut smallint default 0, amount_ht real default 0, diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 2522ee7a73e..433bef887f1 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -56,8 +56,9 @@ create table llx_facture fk_statut smallint DEFAULT 0 NOT NULL, - fk_user_author integer, -- createur de la facture - fk_user_valid integer, -- valideur de la facture + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating fk_facture_source integer, -- facture origine si facture avoir fk_projet integer DEFAULT NULL, -- projet auquel est associee la facture diff --git a/htdocs/install/mysql/tables/llx_facture_fourn.sql b/htdocs/install/mysql/tables/llx_facture_fourn.sql index 2bb85f8400e..3a71c2455aa 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn.sql @@ -52,8 +52,9 @@ create table llx_facture_fourn fk_statut smallint DEFAULT 0 NOT NULL, - fk_user_author integer, -- createur de la facture - fk_user_valid integer, -- valideur de la facture + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating fk_facture_source integer, -- facture origine si facture avoir fk_projet integer, -- projet auquel est associee la facture diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql index 242710a0993..58f953c7196 100644 --- a/htdocs/install/mysql/tables/llx_fichinter.sql +++ b/htdocs/install/mysql/tables/llx_fichinter.sql @@ -29,9 +29,10 @@ create table llx_fichinter tms timestamp, datec datetime, -- date de creation date_valid datetime, -- date de validation - datei date, -- date de livraison du bon d'intervention - fk_user_author integer, -- createur de la fiche - fk_user_valid integer, -- valideur de la fiche + datei date, -- date de livraison du bon d'intervention + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- valideur de la fiche fk_statut smallint DEFAULT 0, duree real, -- duree totale de l'intervention description text, diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 0ab9a24785c..e9703fc90cf 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -48,8 +48,9 @@ create table llx_product recuperableonly integer NOT NULL DEFAULT '0', -- French NPR VAT localtax1_tx double(6,3) DEFAULT 0, -- Spanish local VAT 1 localtax2_tx double(6,3) DEFAULT 0, -- Spanish local VAT 2 - fk_user_author integer DEFAULT NULL, - tosell tinyint DEFAULT 1, -- Product you sell + fk_user_author integer DEFAULT NULL, -- user making creation + fk_user_modif integer, -- user making last change + tosell tinyint DEFAULT 1, -- Product you sell tobuy tinyint DEFAULT 1, -- Product you buy tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch or eat-by management fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module) diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql index c9ab3ecd138..90996073021 100644 --- a/htdocs/install/mysql/tables/llx_propal.sql +++ b/htdocs/install/mysql/tables/llx_propal.sql @@ -38,9 +38,10 @@ create table llx_propal fin_validite datetime, -- date de fin de validite date_valid datetime, -- date de validation date_cloture datetime, -- date de cloture - fk_user_author integer, -- createur de la propale - fk_user_valid integer, -- valideur de la propale - fk_user_cloture integer, -- cloture de la propale signee ou non signee + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating + fk_user_cloture integer, -- user closing (signed or not) fk_statut smallint DEFAULT 0 NOT NULL, price real DEFAULT 0, -- (obsolete) remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 0c1ad62eab2..3d9681774d8 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -66,26 +66,26 @@ Lineofinvoice=Line of invoice VentilatedinAccount=Ventilated successfully in the accounting account NotVentilatedinAccount=Not ventilated in the accounting account -ACCOUNTINGEX_SEPARATORCSV=Separator CSV +ACCOUNTING_SEPARATORCSV=Separator CSV -ACCOUNTINGEX_LIMIT_LIST_VENTILATION=Number of elements to be ventilated shown by page (maximum recommended : 50) -ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO=Begin the sorting of the pages of ventilation "Has to ventilate" by the most recent elements -ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE=Begin the sorting of the pages of ventilation "Ventilated" by the most recent elements +ACCOUNTING_LIMIT_LIST_VENTILATION=Number of elements to be ventilated shown by page (maximum recommended : 50) +ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the pages of ventilation "Has to ventilate" by the most recent elements +ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin the sorting of the pages of ventilation "Ventilated" by the most recent elements AccountLength=Length of the accounting accounts shown in Dolibarr AccountLengthDesc=Function allowing to feign a length of accounting account by replacing spaces by the zero figure. This function touches only the display, it does not modify the accounting accounts registered in Dolibarr. For the export, this function is necessary to be compatible with certain software. -ACCOUNTINGEX_LENGTH_GACCOUNT=Length of the general accounts -ACCOUNTINGEX_LENGTH_AACCOUNT=Length of the third party accounts +ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts +ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts -ACCOUNTINGEX_SELL_JOURNAL=Sell journal -ACCOUNTINGEX_PURCHASE_JOURNAL=Purchase journal -ACCOUNTINGEX_BANK_JOURNAL=Bank journal -ACCOUNTINGEX_CASH_JOURNAL=Cash journal -ACCOUNTINGEX_MISCELLANEOUS_JOURNAL=Miscellaneous journal -ACCOUNTINGEX_SOCIAL_JOURNAL=Social journal +ACCOUNTING_SELL_JOURNAL=Sell journal +ACCOUNTING_PURCHASE_JOURNAL=Purchase journal +ACCOUNTING_BANK_JOURNAL=Bank journal +ACCOUNTING_CASH_JOURNAL=Cash journal +ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal +ACCOUNTING_SOCIAL_JOURNAL=Social journal -ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH=Account of transfer -ACCOUNTINGEX_ACCOUNT_SUSPENSE=Account of wait +ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer +ACCOUNTING_ACCOUNT_SUSPENSE=Account of wait COMPTA_PRODUCT_BUY_ACCOUNT=Accounting account by default for bought products (if not defined in the product sheet) COMPTA_PRODUCT_SOLD_ACCOUNT=Accounting account by default for the sold products (if not defined in the product sheet) diff --git a/htdocs/langs/es_ES/accountancy.lang b/htdocs/langs/es_ES/accountancy.lang index 624e2c02291..4298ceddbc6 100644 --- a/htdocs/langs/es_ES/accountancy.lang +++ b/htdocs/langs/es_ES/accountancy.lang @@ -1,149 +1,150 @@ -# Dolibarr language file - es_ES - Experto de la contabilidad +# Dolibarr language file - en_US - Accounting Expert CHARSET=UTF-8 Accounting=Contabilidad Globalparameters=Configuración global -Chartofaccounts=Cuentas +Chartofaccounts=Plan contable Fiscalyear=Años fiscales -Menuaccount=Contabilidad Cuentas +Menuaccount=Cuentas contables Menuthirdpartyaccount=Cuentas de terceros -MenuTools=Instrumentos -Configuration=Configuración -Export=Exportación +MenuTools=Utilidades ConfigAccountingExpert=Configuración del módulo contable Journaux=Diarios -JournalFinancial=Diarios +JournalFinancial=Diarios financieros Exports=Exportaciones -Modelcsv=Plantilla de Exportación -Selectmodelcsv=Seleccione una plantilla de exportación +Modelcsv=Modelo de exportación +Selectmodelcsv=Seleccione un modelo de exportación Modelcsv_normal=Exportación clásica Modelcsv_CEGID=Exportar a Cegid Expert BackToChartofaccounts=Volver al plan contable Back=Volver -Definechartofaccounts=Definir la contabilidad +Definechartofaccounts=Definir plan contable Selectchartofaccounts=Seleccione un plan contable -Validate=validar +Validate=Validar Addanaccount=Añadir una cuenta contable -ImportAccount=Importar cuentas -AccountAccounting=Cuenta -Ventilation=Contabilización +AccountAccounting=Cuenta contable +Ventilation=Contabilizar ToDispatch=A realizar Dispatched=Realizadas CustomersVentilation=Contabilización ventas SuppliersVentilation=Contabilización compras -TradeMargin=margen de beneficio -Reports=relaciones -ByCustomerInvoice=Por las facturas de los clientes -ByMonth=por mes +TradeMargin=Margen de beneficio +Reports=Informes +ByCustomerInvoice=Por facturas a clientes +ByMonth=Por mes NewAccount=Nueva cuenta contable -Update=Actualización -List=lista -Create=crear -UpdateAccount=Editar una cuenta -UpdateMvts=Modificación de un movimiento +Update=Actualizar +List=Listado +Create=Crear +UpdateAccount=Modificar una cuenta contable +UpdateMvts=Modificar un movimiento WriteBookKeeping=Registrar los asientos en el libro mayor -Bookkeeping=libro mayor -AccountBalanceByMonth=Saldo Mensual +Bookkeeping=Libro Mayor +AccountBalanceByMonth=Saldo mensual -AccountingVentilation=desglose de Contabilidad -AccountingVentilationSupplier=Proveedor de cuentas de ventilación -AccountingVentilationCustomer=Cliente de cuentas de ventilación -Line=línea +AccountingVentilation=Contabilización +AccountingVentilationSupplier=Contabilización compras +AccountingVentilationCustomer=Contabilización ventas +Line=Línea -Ventilate=contabilizar -VentilationAuto=contabilización automática +CAHTF=Total (base imponible) compras a proveedor +InvoiceLines=Líneas de factura para contabilizar +InvoiceLinesDone=Líneas de facturas contabilizadas +IntoAccount=En la cuenta + +Ventilate=Contabilizar +VentilationAuto=Contabilización automática Processing=Tratamiento EndProcessing=Final del tratamiento -AnyLineVentilate=No hay línea para contabilizar -SelectedLines=Las líneas seleccionadas +AnyLineVentilate=No hay líneas para contabilizar +SelectedLines=Líneas seleccionadas Lineofinvoice=Línea de la factura VentilatedinAccount=Contabilizada con éxito en la cuenta contable NotVentilatedinAccount=Cuenta sin contabilización en la contabilidad -ACCOUNTING_SEPARATORCSV=separador CSV +ACCOUNTINGEX_SEPARATORCSV=separador CSV -ACCOUNTING_LIMIT_LIST_VENTILATION=(El máximo recomendado: 50) Número de elementos que se muestran por página para contabilizar -ACCOUNTING_LIST_SORT_VENTILATION_TODO=Páginas de inicio de clasificación de ventilación "desglose" de las pruebas más recientes -ACCOUNTING_LIST_SORT_VENTILATION_DONE=Páginas de inicio de clasificación de ventilación "ventilada" por la evidencia más reciente +ACCOUNTINGEX_LIMIT_LIST_VENTILATION=Número de elementos a contabilizar que se muestran por página (máximo recomendado: 50) +ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO=Ordenar las páginas de contabilización "A contabilizar" por los elementos más recientes +ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE=Ordenar las páginas de contabilización "Contabilizadas" por los elementos más recientes -AccountLength=Cuentas contables longitud mostrada en Dolibarr -AccountLengthDesc=Función para simular una longitud de cuenta contable sustituyendo espacios con el número cero. Esta función sólo afecta a la pantalla, no cambia las cuentas contables registrados en Dolibarr. Para la exportación, esta función se requiere para ser compatible con algunos programas. -ACCOUNTING_LENGTH_GACCOUNT=Longitud de las cuentas generales -ACCOUNTING_LENGTH_AACCOUNT=Duración de subcuentas +AccountLength=Longitud de las cuentas contables mostradas en Dolibarr +AccountLengthDesc=Función para simular una longitud de cuenta contable sustituyendo los espacios por cero. Esta función sólo afecta a la pantalla, no cambia las cuentas contables registradas en Dolibarr. Esta función es necesaria para la exportación, para ser compatible con algunos programas. +ACCOUNTINGEX_LENGTH_GACCOUNT=Longitud de las cuentas generales +ACCOUNTINGEX_LENGTH_AACCOUNT=Longitud de las subcuentas -ACCOUNTING_SELL_JOURNAL=Diario de Ventas -ACCOUNTING_PURCHASE_JOURNAL=Diario de Compras -ACCOUNTING_BANK_JOURNAL=Diario del Banco -ACCOUNTING_CASH_JOURNAL=Diario de Caso -ACCOUNTING_MISCELLANEOUS_JOURNAL=Diario de Operaciones diversas -ACCOUNTING_SOCIAL_JOURNAL=Diario Social +ACCOUNTINGEX_SELL_JOURNAL=Diario de ventas +ACCOUNTINGEX_PURCHASE_JOURNAL=Diario de compras +ACCOUNTINGEX_BANK_JOURNAL=Diario bancario +ACCOUNTINGEX_CASH_JOURNAL=Diario de caja +ACCOUNTINGEX_MISCELLANEOUS_JOURNAL=Diario de operaciones diversas +ACCOUNTINGEX_SOCIAL_JOURNAL=Diario social -ACCOUNTING_ACCOUNT_TRANSFER_CASH=Cuenta de caja -ACCOUNTING_ACCOUNT_SUSPENSE=Cuenta partidas pendientes de aplicación +ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH=Cuenta de caja +ACCOUNTINGEX_ACCOUNT_SUSPENSE=Cuenta operaciones pendientes de asignar -COMPTA_PRODUCT_BUY_ACCOUNT=Cuenta predeterminada de contabilidad para los productos comprados (si no se define en el producto) -COMPTA_PRODUCT_SOLD_ACCOUNT=Cuenta predeterminada de contabilidad para los productos vendidos (si no se define en el producto) -COMPTA_SERVICE_BUY_ACCOUNT=Cuenta predeterminada de contabilidad para los servicios adquiridos (si no está definido en la hoja de servicio) -COMPTA_SERVICE_SOLD_ACCOUNT=Cuenta predeterminada de contabilidad para servicios vendidos (si no se define en la ficha de servicio) +COMPTA_PRODUCT_BUY_ACCOUNT=Cuenta contable predeterminada para los productos comprados (si no se define en el producto) +COMPTA_PRODUCT_SOLD_ACCOUNT=Cuenta contable predeterminada para los productos vendidos (si no se define en el producto) +COMPTA_SERVICE_BUY_ACCOUNT=Cuenta contable predeterminada para los servicios comprados (si no se define en el servicio) +COMPTA_SERVICE_SOLD_ACCOUNT=Cuenta contable predeterminada para los servicios vendidos (si no se define en el servico) Doctype=Tipo de documento -Docdate=fecha -Docref=referencia -Numerocompte=cuenta -Code_tiers=tercero +Docdate=Fecha +Docref=Referencia +Numerocompte=Cuenta +Code_tiers=Tercero Labelcompte=Descripción -Debit=débito -Credit=crédito -Amount=cantidad -Sens=sentido -Codejournal=diario +Debit=Debe +Credit=Crédito +Amount=Cantidad +Sens=Sentido +Codejournal=Diario -DelBookKeeping=Eliminar el libro mayor +DelBookKeeping=Eliminar los registros del Diario Mayor SellsJournal=Diario de ventas PurchasesJournal=Diario de compras DescSellsJournal=Diario de ventas DescPurchasesJournal=Diario de compras -BankJournal=Diario de banco -DescBankJournal=Descripción del diario del Banco -CashJournal=Libro de Caja -DescCashJournal=Descripción Libro de Caja +BankJournal=Diario bancario +DescBankJournal=El diario bancario incluye todos los tipos pagos que no sean de efectivo +CashJournal=Diario de caja +DescCashJournal=El diario de caja incluye el tipo de pago efectivo -CashPayment=Reglas caja +CashPayment=Pago en efectivo -SupplierInvoicePayment=Pago factura de proveedor -CustomerInvoicePayment=Pago Factura a cliente +SupplierInvoicePayment=Pago de factura de proveedor +CustomerInvoicePayment=Cobro de factura a cliente -ThirdPartyAccount=Cuenta tercero +ThirdPartyAccount=Cuenta de tercero -NewAccountingMvt=Nueva movimiento -NumMvts=Número de movimiento -ListeMvts=Apuntes del movimiento -ErrorDebitCredit=Débito y Crédito no pueden terner valor al mismo tiempo +NewAccountingMvt=Nuevo movimiento +NumMvts=Número del movimiento +ListeMvts=Listado del movimiento +ErrorDebitCredit=Debe y Haber no pueden contener un valor al mismo tiempo -ReportThirdParty=Lista cuentas de terceros -DescThirdPartyReport=Consult here the list of the thirdparty customers and the suppliers and their accounting accounts +ReportThirdParty=Listado cuentas de terceros +DescThirdPartyReport=Consulte aquí el listado de clientes y proveedores y sus códigos contables -ListAccounts=Lista de cuentas +ListAccounts=Listado de cuentas contables Pcgversion=Versión del plan -Pcgtype=Tipo de cuenta -Pcgsubtype=tipo de subcuenta -Accountparent=Cuenta padre -Active=Activa +Pcgtype=Tipo del plan +Pcgsubtype=Subcuenta +Accountparent=Padre de la cuenta +Active=Estado NewFiscalYear=Nuevo año fiscal -NewMovCompta=Nuevo registro contable -DescVentilCustomer=Consulte aquí la contabilidad anual de sus facturas a clientes +DescVentilCustomer=Consulte aquí la contabilización anual de sus facturas a clientes TotalVente=Total ventas (base imponible) TotalMarge=Total margen ventas DescVentilDoneCustomer=Consulte aquí las líneas de facturas a clientes y sus cuentas contables -DescVentilTodoCustomer=Contabilize sus líneas de facturas a clientes +DescVentilTodoCustomer=Contabilice sus líneas de facturas a clientes con una cuenta contable ChangeAccount=Cambie la cuenta para las líneas seleccionadas a la cuenta: Vide=- DescVentilSupplier=Consulte aquí la contabilidad anual de sus facturas de proveedores @@ -155,14 +156,3 @@ ValidateHistory=Validar automáticamente ErrorAccountancyCodeIsAlreadyUse=Error, no puede eliminar esta cuenta ya que está siendo usada FicheVentilation=Ficha contable - -Accountancy_code_buy=Código compras -Accountancy_code_buy_suggest=Código compras sugerido -Accountancy_code_sell=Código ventas -Accountancy_code_sell_suggest=Código ventas sugerido -CreateMvts=Crear movimiento -customer_invoice=Factura a cliente - -accountingaccount=Cuenta contable -label=Descripción -Import=Importar \ No newline at end of file diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 6d136f38157..7e07827309a 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -45,6 +45,8 @@ ErrorModuleRequireDolibarrVersion=Error, este módulo requiere una versión %s o ErrorDecimalLargerThanAreForbidden=Error, las precisiones superiores a %s no están soportadas. DictionarySetup=Diccionarios Dictionary=Diccionarios +Chartofaccounts=Plan contable +Fiscalyear=Años fiscales ErrorReservedTypeSystemSystemAuto=El uso del tipo 'system' y 'systemauto' está reservado. Puede utilizar 'user' como valor para añadir su propio registro ErrorCodeCantContainZero=El código no puede contener el valor 0 DisableJavascript=Deshabilitar Javascript y funciones Ajax (Recomendado para personas ciegas o navegadores de texto) diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index 2bc22e55b67..b3aa4a58375 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -2,11 +2,11 @@ IdAgenda=ID de evento Actions=Eventos ActionsArea=Área de eventos (acciones y tareas) -Agenda= Agenda -Agendas= Agendas -Calendar= Calendario -Calendars= Calendarios -LocalAgenda=Calendario local +Agenda=Agenda +Agendas=Agendas +Calendar=Calendario +Calendars=Calendarios +LocalAgenda=Calendario interno AffectedTo=Asignada a DoneBy=Realizado por Event=Evento @@ -22,7 +22,7 @@ MenuToDoActions=Eventos incompletos MenuDoneActions=Eventos terminados MenuToDoMyActions=Mis eventos incompletos MenuDoneMyActions=Mis eventos terminados -ListOfEvents=Listado de eventos Dolibarr +ListOfEvents=Listado de eventos (calendario interno) ActionsAskedBy=Eventos registrados por ActionsToDoBy=Eventos asignados a ActionsDoneBy=Eventos realizados por @@ -88,3 +88,4 @@ ExtSiteUrlAgenda=Url de acceso al archivo .ical ExtSiteNoLabel=Sin descripción WorkingTimeRange=Rango temporal WorkingDaysRange=Rango diario +AddEvent=Crear evento diff --git a/htdocs/langs/es_ES/dict.lang b/htdocs/langs/es_ES/dict.lang index 7b440d71211..42c6d967657 100644 --- a/htdocs/langs/es_ES/dict.lang +++ b/htdocs/langs/es_ES/dict.lang @@ -253,7 +253,6 @@ CivilityMR=Señor CivilityMLE=Señorita CivilityMTRE=Don CivilityDR=Doctor - ##### Currencies ##### Currencyeuros=Euros CurrencyAUD=Dólares Aus. @@ -290,10 +289,10 @@ CurrencyXOF=Francos CFA BCEAO CurrencySingXOF=Franco CFA BCEAO CurrencyXPF=Francos CFP CurrencySingXPF=Franco CFP - CurrencyCentSingEUR=céntimo +CurrencyCentINR=paisa +CurrencyCentSingINR=paise CurrencyThousandthSingTND=milésimo - #### Input reasons ##### DemandReasonTypeSRC_INTE=Internet DemandReasonTypeSRC_CAMP_MAIL=Campaña correo @@ -306,7 +305,6 @@ DemandReasonTypeSRC_WOM=Boca a boca DemandReasonTypeSRC_PARTNER=Socio DemandReasonTypeSRC_EMPLOYEE=Empleado DemandReasonTypeSRC_SPONSORING=Patrocinador - #### Paper formats #### PaperFormatEU4A0=Formato 4A0 PaperFormatEU2A0=Formato 2A0 diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 7764545ed0a..d92caea7ab2 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -645,6 +645,7 @@ OptionalFieldsSetup=Configuración de los atributos opcionales URLPhoto=Url de la foto/logo SetLinkToThirdParty=Vincular a otro tercero CreateDraft=Crear borrador +SetToDraft=Volver a borrador ClickToEdit=Clic para editar ObjectDeleted=Objeto %s eliminado ByCountry=Par país diff --git a/htdocs/langs/es_ES/salaries.lang b/htdocs/langs/es_ES/salaries.lang index bc4079feb21..c8e3707d5df 100644 --- a/htdocs/langs/es_ES/salaries.lang +++ b/htdocs/langs/es_ES/salaries.lang @@ -1,4 +1,6 @@ # Dolibarr language file - Source file is en_US - users +SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Código contable pago de salarios +SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Código contable cargas financieras Salary=Salario Salaries=Salarios Employee=Empleado @@ -6,3 +8,5 @@ NewSalaryPayment=Nuevo pago SalaryPayment=Pago de salario SalariesPayments=Pagos de salarios ShowSalaryPayment=Ver pago +THM=Precio medio por hora +TJM=Precio medio por día diff --git a/htdocs/langs/es_ES/users.lang b/htdocs/langs/es_ES/users.lang index 37851adb724..65b6d8ed0a0 100644 --- a/htdocs/langs/es_ES/users.lang +++ b/htdocs/langs/es_ES/users.lang @@ -119,3 +119,4 @@ HierarchicView=Vista jerárquica UseTypeFieldToChange=Modificar el campo Tipo para cambiar OpenIDURL=Dirección OpenID LoginUsingOpenID=Usar OpenID para iniciar sesión +WeeklyHours=Horas semanales diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 950b9b4e82b..01d5516a480 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -261,7 +261,7 @@ else // Country print ''.$langs->trans('Country').''; - if (! empty($object->country_code)) + if (! empty($object->country_code)) { $img=picto_from_langcode($object->country_code); print ($img?$img.' ':''); @@ -339,14 +339,14 @@ else print "id."\">".$langs->trans("Modify").""; else print "".$langs->trans("Modify").""; - + if ($user->rights->stock->supprimer) print "id."\">".$langs->trans("Delete").""; else print "".$langs->trans("Delete").""; } } - + print ""; @@ -375,7 +375,7 @@ else $sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type, p.pmp as ppmp, p.price, p.price_ttc,"; $sql.= " ps.pmp, ps.reel as value"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE ps.fk_product = p.rowid"; $sql.= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) $sql.= " AND ps.fk_entrepot = ".$object->id; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index fb3882c3bad..3bf672f29a3 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -186,12 +186,12 @@ class Entrepot extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."stock_mouvement"; $sql.= " WHERE fk_entrepot = " . $this->id; - dol_syslog("Entrepot::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql1=$this->db->query($sql); $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock"; $sql.= " WHERE fk_entrepot = " . $this->id; - dol_syslog("Entrepot::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql2=$this->db->query($sql); if ($resql1 && $resql2) @@ -202,8 +202,8 @@ class Entrepot extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql1=$this->db->query($sql); - // Update denormalized fields because we change content of produt_stock - $sql = "UPDATE ".MAIN_DB_PREFIX."product p SET p.stock= (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)"; + // Update denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql + $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET stock = (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)"; dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql2=$this->db->query($sql); @@ -217,7 +217,7 @@ class Entrepot extends CommonObject { $this->db->rollback(); $this->error=$this->db->lasterror(); - return -1; + return -2; } } else @@ -540,7 +540,7 @@ class Entrepot extends CommonObject $this->description = 'WAREHOUSE SPECIMEN '.dol_print_date($now,'dayhourlog'); $this->statut=1; $this->specimen=1; - + $this->lieu='Location test'; $this->address='21 jump street'; $this->zip='99999'; diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index d0f3e589f25..8412ed6ab1b 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -541,6 +541,8 @@ function createInvoice($authentication,$invoice) $newline->total_ht=$line['total_net']; $newline->total_tva=$line['total_vat']; $newline->total_ttc=$line['total']; + $newline->date_start=dol_stringtotime($line['date_start']); + $newline->date_end=dol_stringtotime($line['date_end']); $newline->fk_product=$line['product_id']; $newobject->lines[]=$newline; } diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index d8dda85f2fc..a8a554ca25d 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -123,14 +123,21 @@ class AllTests require_once dirname(__FILE__).'/DiscountTest.php'; $suite->addTestSuite('DiscountTest'); + require_once dirname(__FILE__).'/ContratTest.php'; + $suite->addTestSuite('ContratTest'); + + require_once dirname(__FILE__).'/FichinterTest.php'; + $suite->addTestSuite('FichinterTest'); + + require_once dirname(__FILE__).'/PropalTest.php'; + $suite->addTestSuite('PropalTest'); + require_once dirname(__FILE__).'/CommandeTest.php'; $suite->addTestSuite('CommandeTest'); require_once dirname(__FILE__).'/CommandeFournisseurTest.php'; $suite->addTestSuite('CommandeFournisseurTest'); - require_once dirname(__FILE__).'/ContratTest.php'; - $suite->addTestSuite('ContratTest'); require_once dirname(__FILE__).'/FactureTest.php'; $suite->addTestSuite('FactureTest'); require_once dirname(__FILE__).'/FactureRecTest.php'; @@ -139,8 +146,7 @@ class AllTests $suite->addTestSuite('FactureTestRounding'); require_once dirname(__FILE__).'/FactureFournisseurTest.php'; $suite->addTestSuite('FactureFournisseurTest'); - require_once dirname(__FILE__).'/PropalTest.php'; - $suite->addTestSuite('PropalTest'); + require_once dirname(__FILE__).'/UserTest.php'; $suite->addTestSuite('UserTest'); require_once dirname(__FILE__).'/UserGroupTest.php'; diff --git a/test/phpunit/FichInterTest.php b/test/phpunit/FichInterTest.php new file mode 100644 index 00000000000..96366af85a9 --- /dev/null +++ b/test/phpunit/FichInterTest.php @@ -0,0 +1,244 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/FichinterTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/fichinter/class/fichinter.class.php'; + +if (empty($user->id)) +{ + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class FichinterTest extends PHPUnit_Framework_TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return ContratTest + */ + function __construct() + { + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + } + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testFichinterCreate + * + * @return int + */ + public function testFichinterCreate() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Fichinter($this->savdb); + $localobject->initAsSpecimen(); + $result=$localobject->create($user); + + print __METHOD__." result=".$result."\n"; + $this->assertLessThan($result, 0); + + return $result; + } + + /** + * testFichinterFetch + * + * @param int $id Id of intervention + * @return int + * + * @depends testFichinterCreate + * The depends says test is run only if previous is ok + */ + public function testFichinterFetch($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Fichinter($this->savdb); + $result=$localobject->fetch($id); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + + return $localobject; + } + + /** + * testFichinterValid + * + * @param Fichinter $localobject Intervention + * @return int + * + * @depends testFichinterFetch + * The depends says test is run only if previous is ok + */ + public function testFichinterValid($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=$localobject->setValid($user); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + + $this->assertLessThan($result, 0); + return $localobject; + } + + /** + * testFichinterValid + * + * @param Object $localobject Object intervention + * @return int + * + * @depends testFichinterValid + * The depends says test is run only if previous is ok + */ + public function testFichinterOther($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + /*$result=$localobject->setstatus(0); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + */ + + $localobject->info($localobject->id); + print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; + $this->assertNotEquals($localobject->date_creation, ''); + + return $localobject->id; + } + + /** + * testFichinterDelete + * + * @param int $id Id of intervention + * @return int + * + * @depends testFichinterOther + * The depends says test is run only if previous is ok + */ + public function testFichinterDelete($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Fichinter($this->savdb); + $result=$localobject->fetch($id); + $result=$localobject->delete($user); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; + } + +}