Merge remote-tracking branch 'Upstream/develop' into develop

This commit is contained in:
aspangaro 2014-09-20 06:42:31 +02:00
commit 1592968709
63 changed files with 842 additions and 436 deletions

View File

@ -2,6 +2,12 @@
host = https://www.transifex.com host = https://www.transifex.com
lang_map = uz: uz_UZ lang_map = uz: uz_UZ
[dolibarr.accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang
source_file = htdocs/langs/en_US/accountancy.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.admin] [dolibarr.admin]
file_filter = htdocs/langs/<lang>/admin.lang file_filter = htdocs/langs/<lang>/admin.lang
source_file = htdocs/langs/en_US/admin.lang source_file = htdocs/langs/en_US/admin.lang

View File

@ -143,6 +143,7 @@ For users:
- Fix: Extrafield feature select from table should try to translate multiple column when not needed - 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: cents for indian ruppes are calle paisa and paise.
- Fix: Invoices payments may be older than invoices. - 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.* ***** ***** ChangeLog for 3.6 compared to 3.5.* *****
For users: For users:

View File

@ -68,4 +68,4 @@ Description: Web based software to manage a company or foundation
PDF exports, PDF exports,
And a lot more modules... 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.

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -130,9 +131,6 @@ print "<br>\n";
* Params * Params
* *
*/ */
$list = array (
'ACCOUNTING_SEPARATORCSV'
);
$num = count($list); $num = count($list);
if ($num) { if ($num) {

View File

@ -4,6 +4,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/accountancy/class/Accountingaccount.class.php * \file htdocs/accountancy/class/accountingaccount.class.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Fichier de la classe des comptes comptable * \brief Fichier de la classe des comptes comptable
*/ */
@ -29,8 +29,11 @@
class AccountingAccount class AccountingAccount
{ {
var $db; var $db;
var $error;
var $id; var $id;
var $rowid; var $rowid;
var $datec; // Creation date var $datec; // Creation date
var $fk_pcg_version; var $fk_pcg_version;
var $pcg_type; var $pcg_type;
@ -62,8 +65,10 @@ class AccountingAccount
*/ */
function fetch($rowid = null, $account_number = null) function fetch($rowid = null, $account_number = null)
{ {
if ($rowid || $account_number) { if ($rowid || $account_number)
$sql = "SELECT * FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE "; {
$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) { if ($rowid) {
$sql .= " rowid = '" . $rowid . "'"; $sql .= " rowid = '" . $rowid . "'";
} elseif ($account_number) { } elseif ($account_number) {
@ -72,28 +77,40 @@ class AccountingAccount
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) { if ($result)
{
$obj = $this->db->fetch_object($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; return -1;
$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;
} }
/** /**

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -40,7 +41,7 @@ $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->read)
accessforbidden(); accessforbidden();
// Filter // Filter

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -43,7 +44,7 @@ $account_parent = GETPOST('account_parent');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -44,7 +45,7 @@ $mesCasesCochees = GETPOST('mesCasesCochees', 'array');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);

View File

@ -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 .= " 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.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 .= " 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 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as 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 . "c_tva as 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 . "product as p ON p.rowid = fd.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as 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 . "facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe s ON s.rowid = f.fk_soc"; $sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " WHERE f.fk_statut > 0 "; $sql .= " WHERE f.fk_statut > 0 ";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = " . $conf->entity; $sql .= " AND f.entity = " . $conf->entity;

View File

@ -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 .= " 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 .= " 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 .= " ct.accountancy_code_sell as account_tva";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet fd"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = fd.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as 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 . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe s ON s.rowid = f.fk_soc"; $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 .= " 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 "; $sql .= " WHERE fd.fk_code_ventilation > 0 ";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {

View File

@ -4,6 +4,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent s<jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -45,7 +46,7 @@ $codeventil = GETPOST('codeventil');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden(); accessforbidden();
if ($action == 'ventil' && $user->rights->accounting->access) { if ($action == 'ventil' && $user->rights->accounting->access) {

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -39,7 +40,7 @@ $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->read)
accessforbidden(); accessforbidden();
// Filter // Filter

View File

@ -4,7 +4,8 @@
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>a * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -44,7 +45,7 @@ $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -45,7 +46,7 @@ $mesCasesCochees = GETPOST('mesCasesCochees', 'array');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->access) if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);

View File

@ -130,7 +130,7 @@ abstract class ActionsAdherentCardCommon
} }
else else
{ {
$this->errors=$nuser->error; $this->errors[]=$nuser->error;
$this->db->rollback(); $this->db->rollback();
} }

View File

@ -276,7 +276,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
$db->begin(); $db->begin();
// Create subscription // 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) if ($crowid <= 0)
{ {
$error++; $error++;

View File

@ -324,8 +324,8 @@ if ($conf->use_javascript_ajax)
'<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'. '<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
'</td><td align="right">'. '</td><td align="right">'.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '. '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default',0,'class="menuNew" id="new'.$menu['rowid'].'"').'</a> '. '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default',0,'class="menuDel" id="del'.$menu['rowid'].'"').'</a> '. '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'. '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'.
'</td></tr></table>' '</td></tr></table>'
); );

View File

@ -55,7 +55,7 @@ if ($action == "set")
if (! $res > 0) $error++; if (! $res > 0) $error++;
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int'); $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int');
$account = new Account($db, $id); $account = new Account($db);
if($account->fetch($id)>0) if($account->fetch($id)>0)
{ {

View File

@ -50,7 +50,7 @@ print "<br>\n";
$template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
$interfaces = new Interfaces($db); $interfaces = new Interfaces($db);
$triggers = $interfaces->getTriggersList(0,'priority'); $triggers = $interfaces->getTriggersList();
print '<table class="noborder"> print '<table class="noborder">
<tr class="liste_titre"> <tr class="liste_titre">

View File

@ -65,7 +65,7 @@ llxHeader('',$langs->trans("Categories"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'setup'); 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'); dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category');

View File

@ -396,7 +396,7 @@ else if ($id || $ref)
llxHeader("","",$langs->trans("Member")); llxHeader("","",$langs->trans("Member"));
$head=member_prepare_head($member, $user); $head=member_prepare_head($member);
$titre=$langs->trans("Member"); $titre=$langs->trans("Member");
$picto='user'; $picto='user';
dol_fiche_head($head, 'category', $titre,0,$picto); dol_fiche_head($head, 'category', $titre,0,$picto);
@ -471,7 +471,7 @@ else if ($id || $ref)
llxHeader("","",$langs->trans("Contact")); llxHeader("","",$langs->trans("Contact"));
$head=contact_prepare_head($object, $user); $head=contact_prepare_head($object);
$titre=$langs->trans("ContactsAddresses"); $titre=$langs->trans("ContactsAddresses");
$picto='contact'; $picto='contact';
dol_fiche_head($head, 'category', $titre,0,$picto); dol_fiche_head($head, 'category', $titre,0,$picto);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -87,20 +87,37 @@ $hookmanager->initHooks(array('actioncard'));
* Actions * 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 // Add a new user
if (GETPOST('affectedto') > 0) if (GETPOST('affectedto') > 0)
{ {
$assignedtouser=array(); $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); $assignedtouser[GETPOST('affectedto')]=array('transparency'=>GETPOST('transparency'),'mandatory'=>1);
$_SESSION['assignedtouser']=dol_json_encode($assignedtouser); $_SESSION['assignedtouser']=dol_json_encode($assignedtouser);
} }
$donotclearsession=1; $donotclearsession=1;
$action='create'; if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit';
} }
// Add action
// Add event
if ($action == 'add') if ($action == 'add')
{ {
$error=0; $error=0;
@ -131,22 +148,22 @@ if ($action == 'add')
// Check parameters // Check parameters
if (! $datef && $percentage == 100) if (! $datef && $percentage == 100)
{ {
$error++; $error++; $donotclearsession=1;
$action = 'create'; $action = 'create';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors');
} }
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label')) if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label'))
{ {
$error++; $error++; $donotclearsession=1;
$action = 'create'; $action = 'create';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")), 'errors');
} }
// Initialisation objet cactioncomm // Initialisation objet cactioncomm
if (! GETPOST('actioncode')) if (! GETPOST('actioncode') > 0)
{ {
$error++; $error++; $donotclearsession=1;
$action = 'create'; $action = 'create';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
} }
@ -161,7 +178,6 @@ if ($action == 'add')
$object->priority = GETPOST("priority")?GETPOST("priority"):0; $object->priority = GETPOST("priority")?GETPOST("priority"):0;
$object->fulldayevent = (! empty($fulldayevent)?1:0); $object->fulldayevent = (! empty($fulldayevent)?1:0);
$object->location = GETPOST("location"); $object->location = GETPOST("location");
$object->transparency = (GETPOST("transparency")=='on'?1:0);
$object->label = trim(GETPOST('label')); $object->label = trim(GETPOST('label'));
$object->fk_element = GETPOST("fk_element"); $object->fk_element = GETPOST("fk_element");
$object->elementtype = GETPOST("elementtype"); $object->elementtype = GETPOST("elementtype");
@ -186,18 +202,35 @@ if ($action == 'add')
$object->percentage = $percentage; $object->percentage = $percentage;
$object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; $object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$usertodo=new User($db); $listofuserid=dol_json_decode($_SESSION['assignedtouser']);
if ($_POST["affectedto"] > 0) $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 (! empty($conf->global->AGENDA_ENABLE_DONEBY))
if ($_POST["doneby"] > 0)
{ {
$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"]); $object->note = trim($_POST["note"]);
if (isset($_POST["contactid"])) $object->contact = $contact; 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; if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $object->use_phenix=1;
// Check parameters // 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)))) if ($object->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent))))
{ {
$error++; $error++; $donotclearsession=1;
$action = 'create'; $action = 'create';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors');
} }
if (! GETPOST('apyear') && ! GETPOST('adyear')) if (! GETPOST('apyear') && ! GETPOST('adyear'))
{ {
$error++; $error++; $donotclearsession=1;
$action = 'create'; $action = 'create';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
} }
@ -265,42 +304,14 @@ if ($action == 'add')
$langs->load("errors"); $langs->load("errors");
$error=$langs->trans($object->error); $error=$langs->trans($object->error);
setEventMessage($error,'errors'); setEventMessage($error,'errors');
$action = 'create'; $action = 'create'; $donotclearsession=1;
} }
} }
else else
{ {
$db->rollback(); $db->rollback();
$langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors');
$action = 'create'; $donotclearsession=1;
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');
} }
} }
} }
@ -348,25 +359,59 @@ if ($action == 'update')
if (! $datef && $percentage == 100) 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'; $action = 'edit';
} }
// Users // Users
$usertodo=new User($db); $listofuserid=dol_json_decode($_SESSION['assignedtouser']);
if ($_POST["affectedto"]) $i=0;
foreach($listofuserid as $key => $value)
{ {
$usertodo->fetch($_POST["affectedto"]); if ($i == 0) // First entry
} {
$object->usertodo = $usertodo; $usertodo=new User($db);
$object->transparency=(GETPOST("transparency")=='on'?1:0); if ($key > 0)
{
$usertodo->fetch($key);
}
$object->usertodo = $usertodo;
$object->transparency=(GETPOST("transparency")=='on'?1:0);
}
$userdone=new User($db); $object->userassigned[$key]=array('id'=>$key, 'transparency'=>(GETPOST("transparency")=='on'?1:0));
if ($_POST["doneby"])
{ $i++;
$userdone->fetch($_POST["doneby"]); }
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 // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -383,17 +428,13 @@ if ($action == 'update')
} }
else else
{ {
setEventMessages($object->error,$object->errors,'errors');
$db->rollback(); $db->rollback();
} }
} }
} }
if ($result < 0) if (! $error)
{
setEventMessage($object->error,'errors');
setEventMessage($object->errors,'errors');
}
else
{ {
if (! empty($backtopage)) 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 * Action move update, used when user move an event in calendar by drag'n drop
*/ */
@ -576,15 +641,14 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>';
// Assigned to // Assigned to
$var=false;
print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
if (empty($donotclearsession)) if (empty($donotclearsession))
{ {
$assignedtouser=GETPOST("affectedtouser")?GETPOST("affectedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id); $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))); $_SESSION['assignedtouser']=dol_json_encode(array($assignedtouser=>array('transparency'=>1,'mandatory'=>1)));
} }
//print $form->select_dolusers_forevent('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 $form->select_dolusers(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
@ -599,7 +663,7 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
if ($conf->global->AGENDA_ENABLE_DONEBY) if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
{ {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>';
print $form->select_dolusers(GETPOST("doneby")?GETPOST("doneby"):(! empty($object->userdone->id) && $percent==100?$object->userdone->id:0),'doneby',1); 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 // View or edit
if ($id > 0) if ($id > 0)
{ {
if ($error)
{
dol_htmloutput_errors($error);
}
$result=$object->fetch($id); $result=$object->fetch($id);
$object->fetch_optionals($id,$extralabels); $object->fetch_optionals($id,$extralabels);
@ -833,7 +892,14 @@ if ($id > 0)
// Assigned to // Assigned to
print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
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 '</td></tr>'; print '</td></tr>';
print '</table><br><br><table class="border" width="100%">'; print '</table><br><br><table class="border" width="100%">';
@ -844,7 +910,7 @@ if ($id > 0)
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
if ($conf->global->AGENDA_ENABLE_DONEBY) if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
{ {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
print $form->select_dolusers($object->userdone->id> 0?$object->userdone->id:-1,'doneby',1); print $form->select_dolusers($object->userdone->id> 0?$object->userdone->id:-1,'doneby',1);

View File

@ -57,12 +57,14 @@ class ActionComm extends CommonObject
var $punctual = 1; // Milestone var $punctual = 1; // Milestone
var $percentage; // Percentage var $percentage; // Percentage
var $location; // Location 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 $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 $priority; // Small int (0 By default)
var $note; // Description var $note; // Description
var $usertodo; // Object user that must do action var $userassigned; // Array of user ids
var $userdone; // Object user that did action var $usertodo; // Object user of owner
var $userdone; // Object user that did action (deprecated)
var $societe; // Company linked to action (optional) var $societe; // Company linked to action (optional)
var $contact; // Contact linked to action (optional) var $contact; // Contact linked to action (optional)
@ -89,10 +91,10 @@ class ActionComm extends CommonObject
{ {
$this->db = $db; $this->db = $db;
$this->author = new stdClass(); //$this->author = new stdClass();
$this->usermod = new stdClass(); //$this->usermod = new stdClass();
$this->usertodo = new stdClass(); //$this->usertodo = new stdClass();
$this->userdone = new stdClass(); //$this->userdone = new stdClass();
$this->societe = new stdClass(); $this->societe = new stdClass();
$this->contact = new stdClass(); $this->contact = new stdClass();
} }
@ -258,9 +260,10 @@ class ActionComm extends CommonObject
* Load object from database * Load object from database
* *
* @param int $id Id of action to get * @param int $id Id of action to get
* @param string $ref Ref of action to get
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id) function fetch($id, $ref='')
{ {
global $langs; 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.= " 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."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.= " 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); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -327,11 +327,11 @@ if ($id > 0)
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($action == 'editconditions') 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 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 "</td>"; print "</td>";
print '</tr>'; print '</tr>';

View File

@ -102,7 +102,7 @@ if ($_POST["action"] == 'add')
if (! $error) if (! $error)
{ {
$id = $account->create($user->id); $id = $account->create($user);
if ($id > 0) if ($id > 0)
{ {
$_GET["id"]=$id; // Force chargement page en mode visu $_GET["id"]=$id; // Force chargement page en mode visu

View File

@ -338,9 +338,10 @@ class Account extends CommonObject
/** /**
* Create bank account into database * Create bank account into database
* *
* @param User $user Object user making creation
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function create() function create($user='')
{ {
global $langs,$conf; global $langs,$conf;
@ -665,10 +666,9 @@ class Account extends CommonObject
return 1; return 1;
} }
else else
{ {
return 0; return 0;
} }
$this->db->free($result);
} }
else else
{ {

View File

@ -263,11 +263,13 @@ if ($resql)
{ {
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
print '<span id="datevalue_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->dv),"day")."</span>"; print '<span id="datevalue_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->dv),"day")."</span>";
print ' <span>&nbsp; '; print ' &nbsp';
print '<span>';
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$acct->id.'&amp;rowid='.$objp->rowid.'">'; print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$acct->id.'&amp;rowid='.$objp->rowid.'">';
print img_edit_remove() . "</a> "; print img_edit_remove() . "</a> ";
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvnext&amp;account='.$acct->id.'&amp;rowid='.$objp->rowid.'">'; print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvnext&amp;account='.$acct->id.'&amp;rowid='.$objp->rowid.'">';
print img_edit_add() ."</a></span>"; print img_edit_add() ."</a>";
print '</span>';
print '</td>'; print '</td>';
} }
else else

View File

@ -222,13 +222,16 @@ class Deplacement extends CommonObject
* Load an object from database * Load an object from database
* *
* @param int $id Id of record to load * @param int $id Id of record to load
* @param string $ref Ref of record
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id) function fetch($id, $ref='')
{ {
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams"; $sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
$sql.= " WHERE rowid = ".$id; $sql.= " WHERE entity IN (".getEntity('deplacement').")";
if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'";
else $sql.= " AND id = ".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -88,7 +88,7 @@ if ($object->id)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$head=trip_prepare_head($object, $user); $head=trip_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip'); dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');

View File

@ -171,11 +171,12 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fact
} }
// Delete line // Delete line
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer) { else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$result = $object->deleteline($_GET ['lineid'], $user); $result = $object->deleteline(GETPOST('lineid'));
if ($result > 0) { if ($result > 0) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -203,14 +204,16 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
} }
// Delete link of credit note to invoice // Delete link of credit note to invoice
else if ($action == 'unlinkdiscount' && $user->rights->facture->creer) { else if ($action == 'unlinkdiscount' && $user->rights->facture->creer)
{
$discount = new DiscountAbsolute($db); $discount = new DiscountAbsolute($db);
$result = $discount->fetch($_GET ["discountid"]); $result = $discount->fetch(GETPOST("discountid"));
$discount->unlink_invoice(); $discount->unlink_invoice();
} }
// Validation // Validation
else if ($action == 'valid' && $user->rights->facture->creer) { else if ($action == 'valid' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
// On verifie signe facture // On verifie signe facture
@ -229,7 +232,8 @@ else if ($action == 'valid' && $user->rights->facture->creer) {
} }
} }
else if ($action == 'set_thirdparty' && $user->rights->facture->creer) { else if ($action == 'set_thirdparty' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->setValueFrom('fk_soc', $socid); $object->setValueFrom('fk_soc', $socid);
@ -237,12 +241,14 @@ else if ($action == 'set_thirdparty' && $user->rights->facture->creer) {
exit(); exit();
} }
else if ($action == 'classin' && $user->rights->facture->creer) { else if ($action == 'classin' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->setProject($_POST['projectid']); $object->setProject($_POST['projectid']);
} }
else if ($action == 'setmode' && $user->rights->facture->creer) { else if ($action == 'setmode' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
if ($result < 0) if ($result < 0)
@ -268,7 +274,8 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
if ($result < 0) dol_print_error($db, $object->error); if ($result < 0) dol_print_error($db, $object->error);
} }
else if ($action == 'setconditions' && $user->rights->facture->creer) { else if ($action == 'setconditions' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->cond_reglement_code = 0; // To clean property $object->cond_reglement_code = 0; // To clean property
$object->cond_reglement_id = 0; // To clean property $object->cond_reglement_id = 0; // To clean property
@ -283,7 +290,8 @@ else if ($action == 'setconditions' && $user->rights->facture->creer) {
if ($result < 0) dol_print_error($db, $object->error); if ($result < 0) dol_print_error($db, $object->error);
} }
else if ($action == 'setpaymentterm' && $user->rights->facture->creer) { else if ($action == 'setpaymentterm' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']); $object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
if ($object->date_lim_reglement < $object->date) { if ($object->date_lim_reglement < $object->date) {
@ -295,7 +303,8 @@ else if ($action == 'setpaymentterm' && $user->rights->facture->creer) {
dol_print_error($db, $object->error); dol_print_error($db, $object->error);
} }
else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) { else if ($action == 'setrevenuestamp' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->revenuestamp = GETPOST('revenuestamp'); $object->revenuestamp = GETPOST('revenuestamp');
$result = $object->update($user); $result = $object->update($user);
@ -305,16 +314,19 @@ else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) {
} }
// bank account // bank account
else if ($action == 'setbankaccount' && $user->rights->facture->creer) { else if ($action == 'setbankaccount' && $user->rights->facture->creer)
{
$result=$object->setBankAccount(GETPOST('fk_account', 'int')); $result=$object->setBankAccount(GETPOST('fk_account', 'int'));
} }
else if ($action == 'setremisepercent' && $user->rights->facture->creer) { else if ($action == 'setremisepercent' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$result = $object->set_remise($user, $_POST['remise_percent']); $result = $object->set_remise($user, $_POST['remise_percent']);
} }
else if ($action == "setabsolutediscount" && $user->rights->facture->creer) { else if ($action == "setabsolutediscount" && $user->rights->facture->creer)
{
// POST[remise_id] ou POST[remise_id_for_payment] // POST[remise_id] ou POST[remise_id_for_payment]
if (! empty($_POST["remise_id"])) { if (! empty($_POST["remise_id"])) {
$ret = $object->fetch($id); $ret = $object->fetch($id);
@ -339,7 +351,8 @@ else if ($action == "setabsolutediscount" && $user->rights->facture->creer) {
} }
} }
else if ($action == 'set_ref_client' && $user->rights->facture->creer) { else if ($action == 'set_ref_client' && $user->rights->facture->creer)
{
$object->fetch($id); $object->fetch($id);
$object->set_ref_client($_POST['ref_client']); $object->set_ref_client($_POST['ref_client']);
} }
@ -359,7 +372,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
{ {
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY'; $idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
$idprof = 'idprof' . $i; $idprof = 'idprof' . $i;
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) { if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
{
if (! $error) if (! $error)
$langs->load("errors"); $langs->load("errors");
$error ++; $error ++;
@ -376,7 +390,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
} }
// Check for warehouse // Check for warehouse
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == - 1) { if (! $idwarehouse || $idwarehouse == - 1) {
$error ++; $error ++;
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
@ -412,7 +427,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
} }
// Go back to draft status (unvalidate) // Go back to draft status (unvalidate)
else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)) { else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
{
$idwarehouse = GETPOST('idwarehouse'); $idwarehouse = GETPOST('idwarehouse');
$object->fetch($id); $object->fetch($id);
@ -426,7 +442,8 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
} }
// Check parameters // Check parameters
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == - 1) { if (! $idwarehouse || $idwarehouse == - 1) {
$error ++; $error ++;
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
@ -460,7 +477,8 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
$ventilExportCompta = $object->getVentilExportCompta(); $ventilExportCompta = $object->getVentilExportCompta();
// On verifie si aucun paiement n'a ete effectue // On verifie si aucun paiement n'a ete effectue
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) { if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
{
$result=$object->set_draft($user, $idwarehouse); $result=$object->set_draft($user, $idwarehouse);
if ($result<0) setEventMessage($object->error,'errors'); if ($result<0) setEventMessage($object->error,'errors');
@ -484,12 +502,14 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
} }
// Classify "paid" // Classify "paid"
else if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->facture->paiement) { else if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->facture->paiement)
{
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->set_paid($user);
if ($result<0) setEventMessage($object->error,'errors'); if ($result<0) setEventMessage($object->error,'errors');
} // Classif "paid partialy" } // Classif "paid partialy"
else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement) { else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement)
{
$object->fetch($id); $object->fetch($id);
$close_code = $_POST["close_code"]; $close_code = $_POST["close_code"];
$close_note = $_POST["close_note"]; $close_note = $_POST["close_note"];

View File

@ -3164,7 +3164,7 @@ class Facture extends CommonInvoice
$sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,';
$sql.= ' p.description as product_desc'; $sql.= ' p.description as product_desc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid';
$sql.= ' WHERE l.fk_facture = '.$this->id; $sql.= ' WHERE l.fk_facture = '.$this->id;
$sql.= ' ORDER BY l.rang ASC, l.rowid'; $sql.= ' ORDER BY l.rang ASC, l.rowid';

View File

@ -104,11 +104,11 @@ $sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_t
$sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,";
$sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,"; $sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,";
$sql.= " ct.accountancy_code_buy as account_tva, ct.recuperableonly"; $sql.= " ct.accountancy_code_buy as account_tva, ct.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det fd"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as fd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva as ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly 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."product as p ON p.rowid = fd.fk_product";
$sql.= " JOIN ".MAIN_DB_PREFIX."facture_fourn f ON f.rowid = fd.fk_facture_fourn"; $sql.= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc" ; $sql.= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc" ;
$sql.= " WHERE f.fk_statut > 0 AND f.entity = ".$conf->entity; $sql.= " WHERE f.fk_statut > 0 AND f.entity = ".$conf->entity;
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)";
else $sql.= " AND f.type IN (0,1,2,3)"; else $sql.= " AND f.type IN (0,1,2,3)";

View File

@ -105,10 +105,10 @@ $sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc, fd
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,";
$sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,"; $sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,";
$sql.= " ct.accountancy_code_sell as account_tva, ct.recuperableonly"; $sql.= " ct.accountancy_code_sell as account_tva, ct.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd"; $sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
$sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture"; $sql.= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc"; $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 fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'";
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_statut > 0"; $sql.= " AND f.fk_statut > 0";

View File

@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load("bills"); $langs->load("bills");
$langs->load("companies"); $langs->load("companies");
$id=GETPOST('id');
/* /*
* View * View
@ -39,8 +41,8 @@ $langs->load("companies");
llxHeader(); llxHeader();
$paiement = new Paiement($db); $paiement = new Paiement($db);
$paiement->fetch($_GET["id"], $user); $paiement->fetch($id);
$paiement->info($_GET["id"]); $paiement->info($id);
$head = payment_prepare_head($paiement); $head = payment_prepare_head($paiement);

View File

@ -1276,6 +1276,7 @@ class Form
/** /**
* Return select list of users. Selected users are stored into session. * Return select list of users. Selected users are stored into session.
* *
* @param string $action Value for $action
* @param string $htmlname Field name in form * @param string $htmlname Field name in form
* @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @param array $exclude Array list of users id to exclude * @param array $exclude Array list of users id to exclude
@ -1289,7 +1290,7 @@ class Form
* @return string HTML select string * @return string HTML select string
* @see select_dolgroups * @see select_dolgroups
*/ */
function select_dolusers_forevent($htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='') function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='')
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -1297,18 +1298,24 @@ class Form
// Method with no ajax // Method with no ajax
//$out.='<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; //$out.='<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); $out.='<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
$out.='<input type="submit" class="button" name="addassignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; $out.='<script type="text/javascript" language="javascript">jQuery(document).ready(function () { jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });})</script>';
$out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
$out.='<input type="submit" class="button" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
$assignedtouser=array(); $assignedtouser=array();
if (!empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); if (!empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true);
if (count($assignedtouser)) $out.='<br>'; if (count($assignedtouser)) $out.='<br>';
$i=0;
foreach($assignedtouser as $key => $value) foreach($assignedtouser as $key => $value)
{ {
$userstatic->fetch($key); $userstatic->fetch($key);
$out.=$userstatic->getNomUrl(1); $out.=$userstatic->getNomUrl(1);
if ($i == 0) $out.=' ('.$langs->trans("Owner").')';
$out.=' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">';
//$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional"));
//$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy"));
$out.='<br>'; $out.='<br>';
$i++;
} }
//$out.='</form>'; //$out.='</form>';
@ -3043,7 +3050,7 @@ class Form
* @param int $page Page * @param int $page Page
* @param string $selected Id condition pre-selectionne * @param string $selected Id condition pre-selectionne
* @param string $htmlname Name of select html field * @param string $htmlname Name of select html field
* @param int $addempty Ajoute entree vide * @param int $addempty Add empty entry
* @return void * @return void
*/ */
function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)

View File

@ -1940,29 +1940,31 @@ function img_pdf($titlealt = 'default', $size = 3)
* Show logo + * 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 $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 * @return string Return tag img
*/ */
function img_edit_add($titlealt = 'default') function img_edit_add($titlealt = 'default', $other = '')
{ {
global $conf, $langs; global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Add'); if ($titlealt == 'default') $titlealt = $langs->trans('Add');
return img_picto($titlealt, 'edit_add.png'); return img_picto($titlealt, 'edit_add.png', $other);
} }
/** /**
* Show logo - * 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 $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 * @return string Return tag img
*/ */
function img_edit_remove($titlealt = 'default') function img_edit_remove($titlealt = 'default', $other='')
{ {
global $conf, $langs; global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Remove'); if ($titlealt == 'default') $titlealt = $langs->trans('Remove');
return img_picto($titlealt, 'edit_remove.png'); return img_picto($titlealt, 'edit_remove.png', $other);
} }
/** /**

View File

@ -1221,7 +1221,7 @@ function dol_print_reduction($reduction,$langs)
$string = ''; $string = '';
if ($reduction == 100) if ($reduction == 100)
{ {
$string = $langs->trans("Offered"); $string = $langs->transnoentities("Offered");
} }
else else
{ {

View File

@ -39,22 +39,22 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Home - Sytem info -- 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 ('', '$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', 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', 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', 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', 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/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/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/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', 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', 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', 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', 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"', __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" && 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', 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"', __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', 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', 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', 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', 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', 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', 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 -- 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 ('', '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__); 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__);

View File

@ -526,11 +526,11 @@ elseif ($action == 'update_line' && $user->rights->fournisseur->facture->creer)
} }
$localtax1tx= get_localtax($_POST['tauxtva'], 1, $mysoc,$object->thirdparty); $localtax1_tx= get_localtax($_POST['tauxtva'], 1, $mysoc,$object->thirdparty);
$localtax2tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty); $localtax2_tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty);
$remise_percent=GETPOST('remise_percent'); $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) if ($result >= 0)
{ {
unset($_POST['label']); 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']); $tvatx=get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']);
$npr = get_default_npr($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); $localtax1_tx= get_localtax($tvatx, 1, $mysoc,$object->thirdparty);
$localtax2tx= get_localtax($tvatx, 2, $mysoc,$object->thirdparty); $localtax2_tx= get_localtax($tvatx, 2, $mysoc,$object->thirdparty);
$type = $productsupplier->type; $type = $productsupplier->type;
// TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first) // 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) if ($idprod == -2 || $idprod == 0)
{ {

View File

@ -18,6 +18,16 @@
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- 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); -- -- 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); ALTER TABLE llx_fichinter ADD COLUMN ref_ext varchar(255);

View File

@ -30,6 +30,8 @@ create table llx_bank_account
ref varchar(12) NOT NULL, ref varchar(12) NOT NULL,
label varchar(30) NOT NULL, label varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_user_author integer,
fk_user_modif integer,
bank varchar(60), bank varchar(60),
code_banque varchar(8), code_banque varchar(8),
code_guichet varchar(6), code_guichet varchar(6),

View File

@ -36,9 +36,10 @@ create table llx_commande
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
date_cloture datetime, -- date de cloture date_cloture datetime, -- date de cloture
date_commande date, -- date de la commande date_commande date, -- date de la commande
fk_user_author integer, -- createur de la commande fk_user_author integer, -- user making creation
fk_user_valid integer, -- valideur de la commande fk_user_modif integer, -- user making last change
fk_user_cloture integer, -- auteur cloture fk_user_valid integer, -- user validating
fk_user_cloture integer, -- user closing
source smallint, source smallint,
fk_statut smallint default 0, fk_statut smallint default 0,
amount_ht real default 0, amount_ht real default 0,

View File

@ -30,16 +30,17 @@ create table llx_commande_fournisseur
ref_supplier varchar(30), ref_supplier varchar(30),
fk_soc integer NOT NULL, 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, tms timestamp,
date_creation datetime, -- date de creation date_creation datetime, -- date de creation
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
date_approve datetime, -- date de approve date_approve datetime, -- date de approve
date_commande date, -- date de la commande date_commande date, -- date de la commande
fk_user_author integer, -- createur de la commande fk_user_author integer, -- user making creation
fk_user_valid integer, -- valideur de la commande fk_user_modif integer, -- user making last change
fk_user_approve integer, -- auteur approve fk_user_valid integer, -- user validating
fk_user_approve integer, -- user approving
source smallint NOT NULL, source smallint NOT NULL,
fk_statut smallint default 0, fk_statut smallint default 0,
amount_ht real default 0, amount_ht real default 0,

View File

@ -56,8 +56,9 @@ create table llx_facture
fk_statut smallint DEFAULT 0 NOT NULL, fk_statut smallint DEFAULT 0 NOT NULL,
fk_user_author integer, -- createur de la facture fk_user_author integer, -- user making creation
fk_user_valid integer, -- valideur de la facture fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating
fk_facture_source integer, -- facture origine si facture avoir fk_facture_source integer, -- facture origine si facture avoir
fk_projet integer DEFAULT NULL, -- projet auquel est associee la facture fk_projet integer DEFAULT NULL, -- projet auquel est associee la facture

View File

@ -52,8 +52,9 @@ create table llx_facture_fourn
fk_statut smallint DEFAULT 0 NOT NULL, fk_statut smallint DEFAULT 0 NOT NULL,
fk_user_author integer, -- createur de la facture fk_user_author integer, -- user making creation
fk_user_valid integer, -- valideur de la facture fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating
fk_facture_source integer, -- facture origine si facture avoir fk_facture_source integer, -- facture origine si facture avoir
fk_projet integer, -- projet auquel est associee la facture fk_projet integer, -- projet auquel est associee la facture

View File

@ -29,9 +29,10 @@ create table llx_fichinter
tms timestamp, tms timestamp,
datec datetime, -- date de creation datec datetime, -- date de creation
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
datei date, -- date de livraison du bon d'intervention datei date, -- date de livraison du bon d'intervention
fk_user_author integer, -- createur de la fiche fk_user_author integer, -- user making creation
fk_user_valid integer, -- valideur de la fiche fk_user_modif integer, -- user making last change
fk_user_valid integer, -- valideur de la fiche
fk_statut smallint DEFAULT 0, fk_statut smallint DEFAULT 0,
duree real, -- duree totale de l'intervention duree real, -- duree totale de l'intervention
description text, description text,

View File

@ -48,8 +48,9 @@ create table llx_product
recuperableonly integer NOT NULL DEFAULT '0', -- French NPR VAT recuperableonly integer NOT NULL DEFAULT '0', -- French NPR VAT
localtax1_tx double(6,3) DEFAULT 0, -- Spanish local VAT 1 localtax1_tx double(6,3) DEFAULT 0, -- Spanish local VAT 1
localtax2_tx double(6,3) DEFAULT 0, -- Spanish local VAT 2 localtax2_tx double(6,3) DEFAULT 0, -- Spanish local VAT 2
fk_user_author integer DEFAULT NULL, fk_user_author integer DEFAULT NULL, -- user making creation
tosell tinyint DEFAULT 1, -- Product you sell fk_user_modif integer, -- user making last change
tosell tinyint DEFAULT 1, -- Product you sell
tobuy tinyint DEFAULT 1, -- Product you buy 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 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) fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module)

View File

@ -38,9 +38,10 @@ create table llx_propal
fin_validite datetime, -- date de fin de validite fin_validite datetime, -- date de fin de validite
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
date_cloture datetime, -- date de cloture date_cloture datetime, -- date de cloture
fk_user_author integer, -- createur de la propale fk_user_author integer, -- user making creation
fk_user_valid integer, -- valideur de la propale fk_user_modif integer, -- user making last change
fk_user_cloture integer, -- cloture de la propale signee ou non signee fk_user_valid integer, -- user validating
fk_user_cloture integer, -- user closing (signed or not)
fk_statut smallint DEFAULT 0 NOT NULL, fk_statut smallint DEFAULT 0 NOT NULL,
price real DEFAULT 0, -- (obsolete) price real DEFAULT 0, -- (obsolete)
remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete) remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete)

View File

@ -66,26 +66,26 @@ Lineofinvoice=Line of invoice
VentilatedinAccount=Ventilated successfully in the accounting account VentilatedinAccount=Ventilated successfully in the accounting account
NotVentilatedinAccount=Not ventilated 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) ACCOUNTING_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 ACCOUNTING_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_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 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. 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 ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts
ACCOUNTINGEX_LENGTH_AACCOUNT=Length of the third party accounts ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts
ACCOUNTINGEX_SELL_JOURNAL=Sell journal ACCOUNTING_SELL_JOURNAL=Sell journal
ACCOUNTINGEX_PURCHASE_JOURNAL=Purchase journal ACCOUNTING_PURCHASE_JOURNAL=Purchase journal
ACCOUNTINGEX_BANK_JOURNAL=Bank journal ACCOUNTING_BANK_JOURNAL=Bank journal
ACCOUNTINGEX_CASH_JOURNAL=Cash journal ACCOUNTING_CASH_JOURNAL=Cash journal
ACCOUNTINGEX_MISCELLANEOUS_JOURNAL=Miscellaneous journal ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal
ACCOUNTINGEX_SOCIAL_JOURNAL=Social journal ACCOUNTING_SOCIAL_JOURNAL=Social journal
ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH=Account of transfer ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer
ACCOUNTINGEX_ACCOUNT_SUSPENSE=Account of wait 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_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) COMPTA_PRODUCT_SOLD_ACCOUNT=Accounting account by default for the sold products (if not defined in the product sheet)

View File

@ -1,149 +1,150 @@
# Dolibarr language file - es_ES - Experto de la contabilidad # Dolibarr language file - en_US - Accounting Expert
CHARSET=UTF-8 CHARSET=UTF-8
Accounting=Contabilidad Accounting=Contabilidad
Globalparameters=Configuración global Globalparameters=Configuración global
Chartofaccounts=Cuentas Chartofaccounts=Plan contable
Fiscalyear=Años fiscales Fiscalyear=Años fiscales
Menuaccount=Contabilidad Cuentas Menuaccount=Cuentas contables
Menuthirdpartyaccount=Cuentas de terceros Menuthirdpartyaccount=Cuentas de terceros
MenuTools=Instrumentos MenuTools=Utilidades
Configuration=Configuración
Export=Exportación
ConfigAccountingExpert=Configuración del módulo contable ConfigAccountingExpert=Configuración del módulo contable
Journaux=Diarios Journaux=Diarios
JournalFinancial=Diarios JournalFinancial=Diarios financieros
Exports=Exportaciones Exports=Exportaciones
Modelcsv=Plantilla de Exportación Modelcsv=Modelo de exportación
Selectmodelcsv=Seleccione una plantilla de exportación Selectmodelcsv=Seleccione un modelo de exportación
Modelcsv_normal=Exportación clásica Modelcsv_normal=Exportación clásica
Modelcsv_CEGID=Exportar a Cegid Expert Modelcsv_CEGID=Exportar a Cegid Expert
BackToChartofaccounts=Volver al plan contable BackToChartofaccounts=Volver al plan contable
Back=Volver Back=Volver
Definechartofaccounts=Definir la contabilidad Definechartofaccounts=Definir plan contable
Selectchartofaccounts=Seleccione un plan contable Selectchartofaccounts=Seleccione un plan contable
Validate=validar Validate=Validar
Addanaccount=Añadir una cuenta contable Addanaccount=Añadir una cuenta contable
ImportAccount=Importar cuentas AccountAccounting=Cuenta contable
AccountAccounting=Cuenta Ventilation=Contabilizar
Ventilation=Contabilización
ToDispatch=A realizar ToDispatch=A realizar
Dispatched=Realizadas Dispatched=Realizadas
CustomersVentilation=Contabilización ventas CustomersVentilation=Contabilización ventas
SuppliersVentilation=Contabilización compras SuppliersVentilation=Contabilización compras
TradeMargin=margen de beneficio TradeMargin=Margen de beneficio
Reports=relaciones Reports=Informes
ByCustomerInvoice=Por las facturas de los clientes ByCustomerInvoice=Por facturas a clientes
ByMonth=por mes ByMonth=Por mes
NewAccount=Nueva cuenta contable NewAccount=Nueva cuenta contable
Update=Actualización Update=Actualizar
List=lista List=Listado
Create=crear Create=Crear
UpdateAccount=Editar una cuenta UpdateAccount=Modificar una cuenta contable
UpdateMvts=Modificación de un movimiento UpdateMvts=Modificar un movimiento
WriteBookKeeping=Registrar los asientos en el libro mayor WriteBookKeeping=Registrar los asientos en el libro mayor
Bookkeeping=libro mayor Bookkeeping=Libro Mayor
AccountBalanceByMonth=Saldo Mensual AccountBalanceByMonth=Saldo mensual
AccountingVentilation=desglose de Contabilidad AccountingVentilation=Contabilización
AccountingVentilationSupplier=Proveedor de cuentas de ventilación AccountingVentilationSupplier=Contabilización compras
AccountingVentilationCustomer=Cliente de cuentas de ventilación AccountingVentilationCustomer=Contabilización ventas
Line=línea Line=Línea
Ventilate=contabilizar CAHTF=Total (base imponible) compras a proveedor
VentilationAuto=contabilización automática 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 Processing=Tratamiento
EndProcessing=Final del tratamiento EndProcessing=Final del tratamiento
AnyLineVentilate=No hay línea para contabilizar AnyLineVentilate=No hay líneas para contabilizar
SelectedLines=Las líneas seleccionadas SelectedLines=Líneas seleccionadas
Lineofinvoice=Línea de la factura Lineofinvoice=Línea de la factura
VentilatedinAccount=Contabilizada con éxito en la cuenta contable VentilatedinAccount=Contabilizada con éxito en la cuenta contable
NotVentilatedinAccount=Cuenta sin contabilización en la contabilidad 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 ACCOUNTINGEX_LIMIT_LIST_VENTILATION=Número de elementos a contabilizar que se muestran por página (máximo recomendado: 50)
ACCOUNTING_LIST_SORT_VENTILATION_TODO=Páginas de inicio de clasificación de ventilación "desglose" de las pruebas más recientes ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO=Ordenar las páginas de contabilización "A contabilizar" por los elementos 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_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 AccountLength=Longitud de las cuentas contables mostradas 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. 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.
ACCOUNTING_LENGTH_GACCOUNT=Longitud de las cuentas generales ACCOUNTINGEX_LENGTH_GACCOUNT=Longitud de las cuentas generales
ACCOUNTING_LENGTH_AACCOUNT=Duración de subcuentas ACCOUNTINGEX_LENGTH_AACCOUNT=Longitud de las subcuentas
ACCOUNTING_SELL_JOURNAL=Diario de Ventas ACCOUNTINGEX_SELL_JOURNAL=Diario de ventas
ACCOUNTING_PURCHASE_JOURNAL=Diario de Compras ACCOUNTINGEX_PURCHASE_JOURNAL=Diario de compras
ACCOUNTING_BANK_JOURNAL=Diario del Banco ACCOUNTINGEX_BANK_JOURNAL=Diario bancario
ACCOUNTING_CASH_JOURNAL=Diario de Caso ACCOUNTINGEX_CASH_JOURNAL=Diario de caja
ACCOUNTING_MISCELLANEOUS_JOURNAL=Diario de Operaciones diversas ACCOUNTINGEX_MISCELLANEOUS_JOURNAL=Diario de operaciones diversas
ACCOUNTING_SOCIAL_JOURNAL=Diario Social ACCOUNTINGEX_SOCIAL_JOURNAL=Diario social
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Cuenta de caja ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH=Cuenta de caja
ACCOUNTING_ACCOUNT_SUSPENSE=Cuenta partidas pendientes de aplicación 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_BUY_ACCOUNT=Cuenta contable predeterminada 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_PRODUCT_SOLD_ACCOUNT=Cuenta contable predeterminada 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_BUY_ACCOUNT=Cuenta contable predeterminada para los servicios comprados (si no se define en el servicio)
COMPTA_SERVICE_SOLD_ACCOUNT=Cuenta predeterminada de contabilidad para servicios vendidos (si no se define en la ficha de servicio) COMPTA_SERVICE_SOLD_ACCOUNT=Cuenta contable predeterminada para los servicios vendidos (si no se define en el servico)
Doctype=Tipo de documento Doctype=Tipo de documento
Docdate=fecha Docdate=Fecha
Docref=referencia Docref=Referencia
Numerocompte=cuenta Numerocompte=Cuenta
Code_tiers=tercero Code_tiers=Tercero
Labelcompte=Descripción Labelcompte=Descripción
Debit=débito Debit=Debe
Credit=crédito Credit=Crédito
Amount=cantidad Amount=Cantidad
Sens=sentido Sens=Sentido
Codejournal=diario Codejournal=Diario
DelBookKeeping=Eliminar el libro mayor DelBookKeeping=Eliminar los registros del Diario Mayor
SellsJournal=Diario de ventas SellsJournal=Diario de ventas
PurchasesJournal=Diario de compras PurchasesJournal=Diario de compras
DescSellsJournal=Diario de ventas DescSellsJournal=Diario de ventas
DescPurchasesJournal=Diario de compras DescPurchasesJournal=Diario de compras
BankJournal=Diario de banco BankJournal=Diario bancario
DescBankJournal=Descripción del diario del Banco DescBankJournal=El diario bancario incluye todos los tipos pagos que no sean de efectivo
CashJournal=Libro de Caja CashJournal=Diario de caja
DescCashJournal=Descripción Libro 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 SupplierInvoicePayment=Pago de factura de proveedor
CustomerInvoicePayment=Pago Factura a cliente CustomerInvoicePayment=Cobro de factura a cliente
ThirdPartyAccount=Cuenta tercero ThirdPartyAccount=Cuenta de tercero
NewAccountingMvt=Nueva movimiento NewAccountingMvt=Nuevo movimiento
NumMvts=Número de movimiento NumMvts=Número del movimiento
ListeMvts=Apuntes del movimiento ListeMvts=Listado del movimiento
ErrorDebitCredit=Débito y Crédito no pueden terner valor al mismo tiempo ErrorDebitCredit=Debe y Haber no pueden contener un valor al mismo tiempo
ReportThirdParty=Lista cuentas de terceros ReportThirdParty=Listado cuentas de terceros
DescThirdPartyReport=Consult here the list of the thirdparty customers and the suppliers and their accounting accounts 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 Pcgversion=Versión del plan
Pcgtype=Tipo de cuenta Pcgtype=Tipo del plan
Pcgsubtype=tipo de subcuenta Pcgsubtype=Subcuenta
Accountparent=Cuenta padre Accountparent=Padre de la cuenta
Active=Activa Active=Estado
NewFiscalYear=Nuevo año fiscal 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) TotalVente=Total ventas (base imponible)
TotalMarge=Total margen ventas TotalMarge=Total margen ventas
DescVentilDoneCustomer=Consulte aquí las líneas de facturas a clientes y sus cuentas contables 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: ChangeAccount=Cambie la cuenta para las líneas seleccionadas a la cuenta:
Vide=- Vide=-
DescVentilSupplier=Consulte aquí la contabilidad anual de sus facturas de proveedores 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 ErrorAccountancyCodeIsAlreadyUse=Error, no puede eliminar esta cuenta ya que está siendo usada
FicheVentilation=Ficha contable 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

View File

@ -45,6 +45,8 @@ ErrorModuleRequireDolibarrVersion=Error, este módulo requiere una versión %s o
ErrorDecimalLargerThanAreForbidden=Error, las precisiones superiores a <b>%s</b> no están soportadas. ErrorDecimalLargerThanAreForbidden=Error, las precisiones superiores a <b>%s</b> no están soportadas.
DictionarySetup=Diccionarios DictionarySetup=Diccionarios
Dictionary=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 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 ErrorCodeCantContainZero=El código no puede contener el valor 0
DisableJavascript=Deshabilitar Javascript y funciones Ajax (Recomendado para personas ciegas o navegadores de texto) DisableJavascript=Deshabilitar Javascript y funciones Ajax (Recomendado para personas ciegas o navegadores de texto)

View File

@ -2,11 +2,11 @@
IdAgenda=ID de evento IdAgenda=ID de evento
Actions=Eventos Actions=Eventos
ActionsArea=Área de eventos (acciones y tareas) ActionsArea=Área de eventos (acciones y tareas)
Agenda= Agenda Agenda=Agenda
Agendas= Agendas Agendas=Agendas
Calendar= Calendario Calendar=Calendario
Calendars= Calendarios Calendars=Calendarios
LocalAgenda=Calendario local LocalAgenda=Calendario interno
AffectedTo=Asignada a AffectedTo=Asignada a
DoneBy=Realizado por DoneBy=Realizado por
Event=Evento Event=Evento
@ -22,7 +22,7 @@ MenuToDoActions=Eventos incompletos
MenuDoneActions=Eventos terminados MenuDoneActions=Eventos terminados
MenuToDoMyActions=Mis eventos incompletos MenuToDoMyActions=Mis eventos incompletos
MenuDoneMyActions=Mis eventos terminados MenuDoneMyActions=Mis eventos terminados
ListOfEvents=Listado de eventos Dolibarr ListOfEvents=Listado de eventos (calendario interno)
ActionsAskedBy=Eventos registrados por ActionsAskedBy=Eventos registrados por
ActionsToDoBy=Eventos asignados a ActionsToDoBy=Eventos asignados a
ActionsDoneBy=Eventos realizados por ActionsDoneBy=Eventos realizados por
@ -88,3 +88,4 @@ ExtSiteUrlAgenda=Url de acceso al archivo .ical
ExtSiteNoLabel=Sin descripción ExtSiteNoLabel=Sin descripción
WorkingTimeRange=Rango temporal WorkingTimeRange=Rango temporal
WorkingDaysRange=Rango diario WorkingDaysRange=Rango diario
AddEvent=Crear evento

View File

@ -253,7 +253,6 @@ CivilityMR=Señor
CivilityMLE=Señorita CivilityMLE=Señorita
CivilityMTRE=Don CivilityMTRE=Don
CivilityDR=Doctor CivilityDR=Doctor
##### Currencies ##### ##### Currencies #####
Currencyeuros=Euros Currencyeuros=Euros
CurrencyAUD=Dólares Aus. CurrencyAUD=Dólares Aus.
@ -290,10 +289,10 @@ CurrencyXOF=Francos CFA BCEAO
CurrencySingXOF=Franco CFA BCEAO CurrencySingXOF=Franco CFA BCEAO
CurrencyXPF=Francos CFP CurrencyXPF=Francos CFP
CurrencySingXPF=Franco CFP CurrencySingXPF=Franco CFP
CurrencyCentSingEUR=céntimo CurrencyCentSingEUR=céntimo
CurrencyCentINR=paisa
CurrencyCentSingINR=paise
CurrencyThousandthSingTND=milésimo CurrencyThousandthSingTND=milésimo
#### Input reasons ##### #### Input reasons #####
DemandReasonTypeSRC_INTE=Internet DemandReasonTypeSRC_INTE=Internet
DemandReasonTypeSRC_CAMP_MAIL=Campaña correo DemandReasonTypeSRC_CAMP_MAIL=Campaña correo
@ -306,7 +305,6 @@ DemandReasonTypeSRC_WOM=Boca a boca
DemandReasonTypeSRC_PARTNER=Socio DemandReasonTypeSRC_PARTNER=Socio
DemandReasonTypeSRC_EMPLOYEE=Empleado DemandReasonTypeSRC_EMPLOYEE=Empleado
DemandReasonTypeSRC_SPONSORING=Patrocinador DemandReasonTypeSRC_SPONSORING=Patrocinador
#### Paper formats #### #### Paper formats ####
PaperFormatEU4A0=Formato 4A0 PaperFormatEU4A0=Formato 4A0
PaperFormatEU2A0=Formato 2A0 PaperFormatEU2A0=Formato 2A0

View File

@ -645,6 +645,7 @@ OptionalFieldsSetup=Configuración de los atributos opcionales
URLPhoto=Url de la foto/logo URLPhoto=Url de la foto/logo
SetLinkToThirdParty=Vincular a otro tercero SetLinkToThirdParty=Vincular a otro tercero
CreateDraft=Crear borrador CreateDraft=Crear borrador
SetToDraft=Volver a borrador
ClickToEdit=Clic para editar ClickToEdit=Clic para editar
ObjectDeleted=Objeto %s eliminado ObjectDeleted=Objeto %s eliminado
ByCountry=Par país ByCountry=Par país

View File

@ -1,4 +1,6 @@
# Dolibarr language file - Source file is en_US - users # 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 Salary=Salario
Salaries=Salarios Salaries=Salarios
Employee=Empleado Employee=Empleado
@ -6,3 +8,5 @@ NewSalaryPayment=Nuevo pago
SalaryPayment=Pago de salario SalaryPayment=Pago de salario
SalariesPayments=Pagos de salarios SalariesPayments=Pagos de salarios
ShowSalaryPayment=Ver pago ShowSalaryPayment=Ver pago
THM=Precio medio por hora
TJM=Precio medio por día

View File

@ -119,3 +119,4 @@ HierarchicView=Vista jerárquica
UseTypeFieldToChange=Modificar el campo Tipo para cambiar UseTypeFieldToChange=Modificar el campo Tipo para cambiar
OpenIDURL=Dirección OpenID OpenIDURL=Dirección OpenID
LoginUsingOpenID=Usar OpenID para iniciar sesión LoginUsingOpenID=Usar OpenID para iniciar sesión
WeeklyHours=Horas semanales

View File

@ -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 = "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.= " 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.= " 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.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse)
$sql.= " AND ps.fk_entrepot = ".$object->id; $sql.= " AND ps.fk_entrepot = ".$object->id;

View File

@ -186,12 +186,12 @@ class Entrepot extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."stock_mouvement"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."stock_mouvement";
$sql.= " WHERE fk_entrepot = " . $this->id; $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); $resql1=$this->db->query($sql);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock";
$sql.= " WHERE fk_entrepot = " . $this->id; $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); $resql2=$this->db->query($sql);
if ($resql1 && $resql2) if ($resql1 && $resql2)
@ -202,8 +202,8 @@ class Entrepot extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG); dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql1=$this->db->query($sql); $resql1=$this->db->query($sql);
// Update denormalized fields because we change content of produt_stock // 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 p SET p.stock= (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)"; $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); dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql2=$this->db->query($sql); $resql2=$this->db->query($sql);
@ -217,7 +217,7 @@ class Entrepot extends CommonObject
{ {
$this->db->rollback(); $this->db->rollback();
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
return -1; return -2;
} }
} }
else else

View File

@ -541,6 +541,8 @@ function createInvoice($authentication,$invoice)
$newline->total_ht=$line['total_net']; $newline->total_ht=$line['total_net'];
$newline->total_tva=$line['total_vat']; $newline->total_tva=$line['total_vat'];
$newline->total_ttc=$line['total']; $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']; $newline->fk_product=$line['product_id'];
$newobject->lines[]=$newline; $newobject->lines[]=$newline;
} }

View File

@ -123,14 +123,21 @@ class AllTests
require_once dirname(__FILE__).'/DiscountTest.php'; require_once dirname(__FILE__).'/DiscountTest.php';
$suite->addTestSuite('DiscountTest'); $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'; require_once dirname(__FILE__).'/CommandeTest.php';
$suite->addTestSuite('CommandeTest'); $suite->addTestSuite('CommandeTest');
require_once dirname(__FILE__).'/CommandeFournisseurTest.php'; require_once dirname(__FILE__).'/CommandeFournisseurTest.php';
$suite->addTestSuite('CommandeFournisseurTest'); $suite->addTestSuite('CommandeFournisseurTest');
require_once dirname(__FILE__).'/ContratTest.php';
$suite->addTestSuite('ContratTest');
require_once dirname(__FILE__).'/FactureTest.php'; require_once dirname(__FILE__).'/FactureTest.php';
$suite->addTestSuite('FactureTest'); $suite->addTestSuite('FactureTest');
require_once dirname(__FILE__).'/FactureRecTest.php'; require_once dirname(__FILE__).'/FactureRecTest.php';
@ -139,8 +146,7 @@ class AllTests
$suite->addTestSuite('FactureTestRounding'); $suite->addTestSuite('FactureTestRounding');
require_once dirname(__FILE__).'/FactureFournisseurTest.php'; require_once dirname(__FILE__).'/FactureFournisseurTest.php';
$suite->addTestSuite('FactureFournisseurTest'); $suite->addTestSuite('FactureFournisseurTest');
require_once dirname(__FILE__).'/PropalTest.php';
$suite->addTestSuite('PropalTest');
require_once dirname(__FILE__).'/UserTest.php'; require_once dirname(__FILE__).'/UserTest.php';
$suite->addTestSuite('UserTest'); $suite->addTestSuite('UserTest');
require_once dirname(__FILE__).'/UserGroupTest.php'; require_once dirname(__FILE__).'/UserGroupTest.php';

View File

@ -0,0 +1,244 @@
<?php
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
* 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;
}
}