diff --git a/ChangeLog b/ChangeLog
index 977ac4123ea..26c693fa486 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,7 +69,20 @@ For users:
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
New experimental module:
-- New: Module Accounting Expert to manage accountancy
+- New: Module Accounting Expert to manage accountancy
+ Special Thanks to developpers :
+ Olivier Geffroy
+ Alexandre Spangaro
+ Ari Elbaz
+ Florian Henry
+ Juanjo Menent
+
+ And to the contributors :
+ Jeff Info 2000 euros
+ Nord Anim 120 euros
+ Hydroflex 120 euros
+ Asysteo 120 euros
+ Fournisseur médical 120 euros
For translators:
- Update language files.
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 43dc38ea4bb..9ebdea5fefc 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -47,31 +47,33 @@ $accounting = new AccountingAccount($db);
// Action
if ($action == 'add')
{
- $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
-
- dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
- $result = $db->query($sql);
- $obj = $db->fetch_object($result);
-
- $accounting->fk_pcg_version = $obj->pcg_version;
- $accounting->pcg_type = GETPOST('pcg_type');
- $accounting->pcg_subtype = GETPOST('pcg_subtype');
- $accounting->account_number = GETPOST('account_number', 'int');
- $accounting->account_parent = GETPOST('account_parent', 'int');
- $accounting->label = GETPOST('label', 'alpha');
- $accounting->active = 1;
-
- $res = $accounting->create($user);
-
- if ($res == 0) {
- } else {
- if ($res == - 3) {
- $_error = 1;
- $action = "create";
- }
- if ($res == - 4) {
- $_error = 2;
- $action = "create";
+ if (! GETPOST('cancel', 'alpha')) {
+ $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
+
+ dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
+ $result = $db->query($sql);
+ $obj = $db->fetch_object($result);
+
+ $accounting->fk_pcg_version = $obj->pcg_version;
+ $accounting->pcg_type = GETPOST('pcg_type');
+ $accounting->pcg_subtype = GETPOST('pcg_subtype');
+ $accounting->account_number = GETPOST('account_number', 'int');
+ $accounting->account_parent = GETPOST('account_parent', 'int');
+ $accounting->label = GETPOST('label', 'alpha');
+ $accounting->active = 1;
+
+ $res = $accounting->create($user);
+
+ if ($res == 0) {
+ } else {
+ if ($res == - 3) {
+ $_error = 1;
+ $action = "create";
+ }
+ if ($res == - 4) {
+ $_error = 2;
+ $action = "create";
+ }
}
}
Header("Location: account.php");
diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php
index 448ce32cb18..c8b8c8a7d97 100644
--- a/htdocs/accountancy/admin/export.php
+++ b/htdocs/accountancy/admin/export.php
@@ -86,7 +86,8 @@ llxHeader();
$form = new Form($db);
-print_fiche_titre($langs->trans('ConfigAccountingExpert'));
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
$head = admin_accounting_prepare_head(null);
diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php
index 4354cd90cc3..b350aa8e590 100644
--- a/htdocs/accountancy/admin/importaccounts.php
+++ b/htdocs/accountancy/admin/importaccounts.php
@@ -61,7 +61,7 @@ if ($_POST["action"] == 'import') {
$accounting = new AccountingAccount($db);
- $monLabel = GETPOST('intitule' . $maLigneCochee);
+ $monLabel = GETPOST('label' . $maLigneCochee);
$monParentAccount = GETPOST('AccountParent' . $maLigneCochee);
$monType = GETPOST('pcgType' . $maLigneCochee);
$monSubType = GETPOST('pcgSubType' . $maLigneCochee);
@@ -146,7 +146,7 @@ if ($result) {
print '';
print '
';
- print ' ';
+ print ' ';
print ' ';
// Colonne choix du compte
@@ -164,7 +164,7 @@ if ($result) {
// Colonne choix ligne a ventiler
- $checked = ('intitule' == 'O') ? ' checked=checked' : '';
+ $checked = ('label' == 'O') ? ' checked=checked' : '';
print '';
print ' ';
diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index 9abd2899af4..66f5efef04d 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -146,7 +146,8 @@ llxHeader();
$form = new Form($db);
-print_fiche_titre($langs->trans('ConfigAccountingExpert'));
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
$head = admin_accounting_prepare_head($accounting);
diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journaux.php
index 49938781ace..77b7d15e1c3 100644
--- a/htdocs/accountancy/admin/journaux.php
+++ b/htdocs/accountancy/admin/journaux.php
@@ -80,7 +80,8 @@ llxHeader();
$form = new Form($db);
-print_fiche_titre($langs->trans('ConfigAccountingExpert'));
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
$head = admin_accounting_prepare_head(null);
@@ -102,7 +103,7 @@ foreach ( $list as $key ) {
// Param
$label = $langs->trans($key);
- print ' ' . $label . ' ';
+ print '' . $label . ' ';
// Value
print '';
@@ -117,44 +118,49 @@ print ' ';
diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php
index dd9f18e82a4..120d08db09c 100644
--- a/htdocs/accountancy/bookkeeping/balancebymonth.php
+++ b/htdocs/accountancy/bookkeeping/balancebymonth.php
@@ -76,7 +76,7 @@ $y = $year_current;
$var = true;
print '';
-print '' . $langs->trans("Intitule") . ' ' . $langs->trans("JanuaryMin") . ' ' . $langs->trans("FebruaryMin") . ' ' . $langs->trans("MarchMin") . ' ' . $langs->trans("AprilMin") . ' ' . $langs->trans("MayMin") . ' ' . $langs->trans("JuneMin") . ' ' . $langs->trans("JulyMin") . ' ' . $langs->trans("AugustMin") . ' ' . $langs->trans("SeptemberMin") . ' ' . $langs->trans("OctoberMin") . ' ' . $langs->trans("NovemberMin") . ' ' . $langs->trans("DecemberMin") . ' Total ';
+print '' . $langs->trans("Label") . ' ' . $langs->trans("JanuaryMin") . ' ' . $langs->trans("FebruaryMin") . ' ' . $langs->trans("MarchMin") . ' ' . $langs->trans("AprilMin") . ' ' . $langs->trans("MayMin") . ' ' . $langs->trans("JuneMin") . ' ' . $langs->trans("JulyMin") . ' ' . $langs->trans("AugustMin") . ' ' . $langs->trans("SeptemberMin") . ' ' . $langs->trans("OctoberMin") . ' ' . $langs->trans("NovemberMin") . ' ' . $langs->trans("DecemberMin") . ' Total ';
$sql = "SELECT bk.numero_compte AS 'compte',";
$sql .= " ROUND(SUM(IF(MONTH(bk.doc_date)=1,bk.montant,0)),2) AS 'Janvier',";
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index c782797b9cb..9e109c7feeb 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -26,7 +26,7 @@
require '../../main.inc.php';
// Class
-require_once DOL_DOCUMENT_ROOT.'accountancy/class/bookkeeping.class.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
// Langs
$langs->load("accounting");
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 12cf9559d8d..de3bbf5c1db 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -91,9 +91,9 @@ else if ($action == 'export_csv') {
else {
- llxHeader('', $langs->trans("Accounting") . ' - ' . $langs->trans("Bookkeeping"));
+ llxHeader('', $langs->trans("Bookkeeping"));
- /*
+/*
* List
*/
diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php
index 070f9a8071a..7ce2134d0d2 100644
--- a/htdocs/accountancy/class/accountancysystem.class.php
+++ b/htdocs/accountancy/class/accountancysystem.class.php
@@ -57,8 +57,8 @@ class AccountancySystem
$now = dol_now();
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system";
- $sql .= " (date_creation, fk_user_author, numero,intitule)";
- $sql .= " VALUES (" . $this->db->idate($now) . "," . $user->id . ",'" . $this->numero . "','" . $this->intitule . "')";
+ $sql .= " (date_creation, fk_user_author, numero, label)";
+ $sql .= " VALUES (" . $this->db->idate($now) . "," . $user->id . ",'" . $this->numero . "','" . $this->label . "')";
dol_syslog(get_class($this) . "::create sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php
index 6e0d16c6d6b..82c3ec3ca10 100644
--- a/htdocs/accountancy/class/accountingaccount.class.php
+++ b/htdocs/accountancy/class/accountingaccount.class.php
@@ -126,8 +126,8 @@ class AccountingAccount
if (isset($this->active))
$this->active = trim($this->active);
- // Check parameters
- // Put here code to add control on parameters values
+ // Check parameters
+ // Put here code to add control on parameters values
// Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accountingaccount(";
diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php
index 7385219780b..33bb33a2353 100644
--- a/htdocs/accountancy/class/html.formventilation.class.php
+++ b/htdocs/accountancy/class/html.formventilation.class.php
@@ -166,7 +166,9 @@ class FormVentilation extends Form
$out = '';
$sql = "SELECT DISTINCT pcg_type ";
- $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount ";
+ $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa";
+ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
+ $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
$sql .= " ORDER BY pcg_type";
dol_syslog(get_class($this) . "::select_pcgtype sql=" . $sql, LOG_DEBUG);
@@ -220,7 +222,9 @@ class FormVentilation extends Form
$out = '';
$sql = "SELECT DISTINCT pcg_subtype ";
- $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount ";
+ $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa";
+ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
+ $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
$sql .= " ORDER BY pcg_subtype";
dol_syslog(get_class($this) . "::select_pcgsubtype sql=" . $sql, LOG_DEBUG);
diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php
index 08dc4b05bd9..91a0eb5df8b 100644
--- a/htdocs/accountancy/customer/card.php
+++ b/htdocs/accountancy/customer/card.php
@@ -47,16 +47,23 @@ if (! $user->rights->accounting->access)
* Actions
*/
-if ($action == 'ventil' && $user->rights->accounting->access) {
- $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
- $sql .= " SET fk_code_ventilation = " . $codeventil;
- $sql .= " WHERE rowid = " . $id;
+if ($action == 'ventil' && $user->rights->accounting->access)
+{
+ if (! GETPOST('cancel', 'alpha'))
+ {
+ $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
+ $sql .= " SET fk_code_ventilation = " . $codeventil;
+ $sql .= " WHERE rowid = " . $id;
- dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
- $resql = $db->query($sql);
- if (! $resql) {
- setEventMessage($db->lasterror(), 'errors');
- }
+ dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
+ $resql = $db->query($sql);
+ if (! $resql) {
+ setEventMessage($db->lasterror(), 'errors');
+ }
+ } else {
+ header("Location: ./lines.php");
+ exit();
+ }
}
llxHeader("", "", "FicheVentilation");
@@ -101,7 +108,8 @@ if (! empty($id)) {
print ' ';
print ' ';
- print_fiche_titre($langs->trans("Ventilation"));
+ $linkback=''.$langs->trans("Back").' ';
+ print_fiche_titre($langs->trans('AccountingVentilationCustomer'),$linkback,'setup');
print '';
+
+ print ' ';
+ print ' ';
} else {
print "Error";
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index a9723b72497..2df4d675b20 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -28,6 +28,7 @@ require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
// Langs
$langs->load("compta");
@@ -118,7 +119,7 @@ $var = true;
print '';
print '' . $langs->trans("Account") . ' ';
-print '' . $langs->trans("Intitule") . ' ';
+print '' . $langs->trans("Label") . ' ';
print '' . $langs->trans("JanuaryMin") . ' ';
print '' . $langs->trans("FebruaryMin") . ' ';
print '' . $langs->trans("MarchMin") . ' ';
@@ -169,7 +170,7 @@ if ($resql) {
while ( $i < $num ) {
$row = $db->fetch_row($resql);
- print '' . $row[0] . ' ';
+ print '' . length_accountg($row[0]) . ' ';
print '' . $row[1] . ' ';
print '' . price($row[2]) . ' ';
print '' . price($row[3]) . ' ';
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index b67069cdf69..02602262e2c 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -27,9 +27,9 @@
require '../../main.inc.php';
// Class
-require_once DOL_DOCUMENT_ROOT.'compta/facture/class/facture.class.php';
-require_once DOL_DOCUMENT_ROOT.'product/class/product.class.php';
-require_once DOL_DOCUMENT_ROOT.'accountancy/class/html.formventilation.class.php';
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
// Langs
$langs->load("compta");
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 4a57482a2d7..f2d5a586b37 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -264,7 +264,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->fk_docdet = $val["fk_bank"];
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
$bookkeeping->numero_compte = $k;
- $bookkeeping->label_compte = $compte->intitule;
+ $bookkeeping->label_compte = $compte->label;
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php
index f278a458ab5..33b1e4359c1 100644
--- a/htdocs/accountancy/journal/cashjournal.php
+++ b/htdocs/accountancy/journal/cashjournal.php
@@ -244,7 +244,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->fk_docdet = $val["fk_bank"];
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
$bookkeeping->numero_compte = $k;
- $bookkeeping->label_compte = $compte->intitule;
+ $bookkeeping->label_compte = $compte->label;
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index 3136be313e6..cd6ef6bcb53 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -27,6 +27,7 @@ require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
// Langs
$langs->load("compta");
@@ -93,7 +94,7 @@ llxHeader('', $langs->trans("SuppliersVentilation"));
$textprevyear = "" . img_previous() . " ";
$textnextyear = " " . img_next() . " ";
-print_fiche_titre($langs->trans("VentilationComptableSupplier") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
+print_fiche_titre($langs->trans("AccountingVentilationSupplier") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
print '' . $langs->trans("DescVentilSupplier") . ' ';
print '';
@@ -103,21 +104,21 @@ $y = $year_current;
$var = true;
print '';
-print '' . $langs->trans("Account") . ' ';
-print '' . $langs->trans("Intitule") . ' ';
-print '' . $langs->trans("JanuaryMin") . ' ';
-print '' . $langs->trans("FebruaryMin") . ' ';
-print '' . $langs->trans("MarchMin") . ' ';
-print '' . $langs->trans("AprilMin") . ' ';
-print '' . $langs->trans("MayMin") . ' ';
-print '' . $langs->trans("JuneMin") . ' ';
-print '' . $langs->trans("JulyMin") . ' ';
-print '' . $langs->trans("AugustMin") . ' ';
-print '' . $langs->trans("SeptemberMin") . ' ';
-print '' . $langs->trans("OctoberMin") . ' ';
-print '' . $langs->trans("NovemberMin") . ' ';
-print '' . $langs->trans("DecemberMin") . ' ';
-print '' . $langs->trans("Total") . ' ';
+print '' . $langs->trans("Account") . ' ';
+print '' . $langs->trans("Label") . ' ';
+print '' . $langs->trans("JanuaryMin") . ' ';
+print '' . $langs->trans("FebruaryMin") . ' ';
+print '' . $langs->trans("MarchMin") . ' ';
+print '' . $langs->trans("AprilMin") . ' ';
+print '' . $langs->trans("MayMin") . ' ';
+print '' . $langs->trans("JuneMin") . ' ';
+print '' . $langs->trans("JulyMin") . ' ';
+print '' . $langs->trans("AugustMin") . ' ';
+print '' . $langs->trans("SeptemberMin") . ' ';
+print '' . $langs->trans("OctoberMin") . ' ';
+print '' . $langs->trans("NovemberMin") . ' ';
+print '' . $langs->trans("DecemberMin") . ' ';
+print '' . $langs->trans("Total") . ' ';
$sql = "SELECT IF(aa.account_number IS NULL, 'Non pointe', aa.account_number) AS 'code comptable',";
$sql .= " IF(aa.label IS NULL, 'Non pointe', aa.label) AS 'Intitulé',";
@@ -157,7 +158,7 @@ if ($resql) {
$row = $db->fetch_row($resql);
- print '' . $row[0] . ' ';
+ print '' . length_accountg($row[0]) . ' ';
print '' . $row[1] . ' ';
print '' . price($row[2]) . ' ';
print '' . price($row[3]) . ' ';
@@ -183,20 +184,20 @@ print "
\n";
print " \n";
print '';
-print '' . $langs->trans("Total") . ' ';
-print '' . $langs->trans("JanuaryMin") . ' ';
-print '' . $langs->trans("FebruaryMin") . ' ';
-print '' . $langs->trans("MarchMin") . ' ';
-print '' . $langs->trans("AprilMin") . ' ';
-print '' . $langs->trans("MayMin") . ' ';
-print '' . $langs->trans("JuneMin") . ' ';
-print '' . $langs->trans("JulyMin") . ' ';
-print '' . $langs->trans("AugustMin") . ' ';
-print '' . $langs->trans("SeptemberMin") . ' ';
-print '' . $langs->trans("OctoberMin") . ' ';
-print '' . $langs->trans("NovemberMin") . ' ';
-print '' . $langs->trans("DecemberMin") . ' ';
-print '' . $langs->trans("Total") . ' ';
+print '' . $langs->trans("Total") . ' ';
+print '' . $langs->trans("JanuaryMin") . ' ';
+print '' . $langs->trans("FebruaryMin") . ' ';
+print '' . $langs->trans("MarchMin") . ' ';
+print '' . $langs->trans("AprilMin") . ' ';
+print '' . $langs->trans("MayMin") . ' ';
+print '' . $langs->trans("JuneMin") . ' ';
+print '' . $langs->trans("JulyMin") . ' ';
+print '' . $langs->trans("AugustMin") . ' ';
+print '' . $langs->trans("SeptemberMin") . ' ';
+print '' . $langs->trans("OctoberMin") . ' ';
+print '' . $langs->trans("NovemberMin") . ' ';
+print '' . $langs->trans("DecemberMin") . ' ';
+print '' . $langs->trans("Total") . ' ';
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS 'Total',";
$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=1,ffd.total_ht,0)),2) AS 'Janvier',";
@@ -232,19 +233,19 @@ if ($resql) {
$row = $db->fetch_row($resql);
print '' . $row[0] . ' ';
- print '' . $row[1] . ' ';
- print '' . price($row[2]) . ' ';
- print '' . price($row[3]) . ' ';
- print '' . price($row[4]) . ' ';
- print '' . price($row[5]) . ' ';
- print '' . price($row[6]) . ' ';
- print '' . price($row[7]) . ' ';
- print '' . price($row[8]) . ' ';
- print '' . price($row[9]) . ' ';
- print '' . price($row[10]) . ' ';
- print '' . price($row[11]) . ' ';
- print '' . price($row[12]) . ' ';
- print '' . price($row[13]) . ' ';
+ print '' . $row[1] . ' ';
+ print '' . price($row[2]) . ' ';
+ print '' . price($row[3]) . ' ';
+ print '' . price($row[4]) . ' ';
+ print '' . price($row[5]) . ' ';
+ print '' . price($row[6]) . ' ';
+ print '' . price($row[7]) . ' ';
+ print '' . price($row[8]) . ' ';
+ print '' . price($row[9]) . ' ';
+ print '' . price($row[10]) . ' ';
+ print '' . price($row[11]) . ' ';
+ print '' . price($row[12]) . ' ';
+ print '' . price($row[13]) . ' ';
print ' ';
$i ++;
diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php
index 043efc92059..bbedab346d1 100644
--- a/htdocs/admin/index.php
+++ b/htdocs/admin/index.php
@@ -25,7 +25,6 @@ require '../main.inc.php';
$langs->load("admin");
$langs->load("companies");
-$langs->load("accountancy");
if (!$user->admin) accessforbidden();
diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php
new file mode 100644
index 00000000000..453db8e4203
--- /dev/null
+++ b/htdocs/admin/salaries.php
@@ -0,0 +1,118 @@
+
+ *
+ * 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 .
+ *
+ */
+
+/**
+ * \file htdocs/admin/salaries.php
+ * \ingroup Salaries
+ * \brief Setup page to configure salaries module
+ */
+
+require '../main.inc.php';
+
+// Class
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+
+$langs->load("admin");
+$langs->load("salaries");
+
+// Security check
+if (!$user->admin)
+ accessforbidden();
+
+$action = GETPOST('action', 'alpha');
+
+// Other parameters COMPTA_* & ACCOUNTING_*
+$list = array (
+ 'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',
+ 'SALARIES_ACCOUNTING_ACCOUNT_CHARGE'
+);
+
+/*
+ * Actions
+ */
+
+if ($action == 'update')
+{
+ $error = 0;
+
+ foreach ($list as $constname) {
+ $constvalue = GETPOST($constname, 'alpha');
+
+ if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
+ $error++;
+ }
+ }
+
+ if (! $error)
+ {
+ setEventMessage($langs->trans("SetupSaved"));
+ }
+ else
+ {
+ setEventMessage($langs->trans("Error"),'errors');
+ }
+}
+
+/*
+ * View
+ */
+
+llxHeader();
+
+$form = new Form($db);
+
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print_fiche_titre($langs->trans('ConfigSalaries'),$linkback,'setup');
+
+print '