Commit 74c7a561bb8e468abd23ef196b6988a551663307
Exists in
3.5
and in
1 other branch
Merge pull request #95 from aspangaro/3.5
Update 3.5
Showing
10 changed files
with
169 additions
and
189 deletions
Show diff stats
accountingex/admin/about.php
... | ... | @@ -19,9 +19,9 @@ |
19 | 19 | */ |
20 | 20 | |
21 | 21 | /** |
22 | - * \file accountingex/admin/about.php | |
23 | - * \ingroup Accounting Expert | |
24 | - * \brief Page administration du module | |
22 | + * \file accountingex/admin/about.php | |
23 | + * \ingroup Accounting Expert | |
24 | + * \brief Setup page to configure accounting expert module | |
25 | 25 | */ |
26 | 26 | |
27 | 27 | // Dolibarr environment |
... | ... | @@ -48,7 +48,7 @@ if ($user->societe_id > 0) |
48 | 48 | if (! $user->rights->accountingex->admin) |
49 | 49 | accessforbidden(); |
50 | 50 | |
51 | - /* | |
51 | +/* | |
52 | 52 | * View |
53 | 53 | */ |
54 | 54 | |
... | ... | @@ -68,7 +68,7 @@ print '</tr>'; |
68 | 68 | // Alexandre Spangaro |
69 | 69 | print '<tr><td><img src="../img/fidurex.jpg" width="250"></td>'; |
70 | 70 | print '<td><b>Alexandre Spangaro</b> - Comptable'; |
71 | -print '<br>Cabinet Fidurex - 29 Boulevard de la Rochelle - 55000 Bar le Duc<br>Tél : 03.29.79.04.42 - @ : aspangaro AT fidurex DOT fr'; | |
71 | +print '<br>Cabinet Fidurex - Expertise comptable, commissariat aux comptes, audit, social.<br>' . $langs->trans("Email") . ' : aspangaro@fidurex.fr <br>' . $langs->trans("Phone") . ' : +33 3 29 79 04 42'; | |
72 | 72 | print '<br><br><a target="_blank" href="http://twiter.com/alexspangaro"><img src="../img/tweet.png" width="20"></a>'; |
73 | 73 | print '</td></tr>'; |
74 | 74 | |
... | ... | @@ -77,16 +77,19 @@ print '<tr><td>&nbsp;</td></tr>'; |
77 | 77 | // Ari Elbaz - Accedinfo |
78 | 78 | print '<tr align="left"><td><img src="../img/accedinfo.jpg" width="250"></td>'; |
79 | 79 | print '<td><b>Ari Elbaz</b>'; |
80 | -print '<br>Accedinfo.com<br>67000 Strasbourg<br>Tél : 03.88.33.77.47<br><br>'; | |
81 | -print '<a title="Accedinfo.com Facebook" target="_blank" href="http://www.facebook.com/accedinfosav"><img src="../img/fb.png" width="20"></a> '; | |
80 | +print '<br>Accedinfo.com<br>67000 Strasbourg<br>' . $langs->trans("Phone") . ' : +33 3 88 33 77 47'; | |
81 | +print '<br><a target="_blank" href="http://accedinfo.com">http://www.accedinfo.com/</a>'; | |
82 | +print '<br><br><a title="Accedinfo.com Facebook" target="_blank" href="http://www.facebook.com/accedinfosav"><img src="../img/fb.png" width="20"></a> '; | |
82 | 83 | print '<a target="_blank" href="http://twiter.com/elarifr"><img src="../img/tweet.png" width="20"></a> '; |
83 | 84 | print '<a target="_blank" href="https://plus.google.com/109875408706351786851"><img src="../img/google+.png" width="20"></a>'; |
84 | 85 | print '</td></tr>'; |
85 | 86 | |
87 | +print '<tr><td> </td></tr>'; | |
88 | + | |
86 | 89 | // Florian HENRY - Open-concept.pro |
87 | -print '<tr><td><img src="http://demo.open-concept.pro/prestashop/img/logo.jpg"></td>'; | |
90 | +print '<tr><td><img src="http://demo.open-concept.pro/prestashop/img/logo.jpg" width="250"></td>'; | |
88 | 91 | print '<td><b>Florian Henry</b> - Intégrateur/développeur Solution Open-Source'; |
89 | -print '<br>Florian HENRY - Open-Concept.pro <BR> florian.henry@open-concept.pro <BR> +33 6 03 76 48 07'; | |
92 | +print '<br>Florian HENRY - Open-Concept.pro <BR>' . $langs->trans("Email") . ' : florian.henry@open-concept.pro <BR>' . $langs->trans("Phone") . ' : +33 6 03 76 48 07'; | |
90 | 93 | print '<br><a target="_blank" href="http://www.open-concept.pro">http://www.open-concept.pro</a>'; |
91 | 94 | print '<br><br><a target="_blank" href="http://twitter.com/_open_concept_"><img src="../img/tweet.png" width="20"></a>'; |
92 | 95 | print '</td></tr>'; | ... | ... |
accountingex/admin/account.php
... | ... | @@ -17,9 +17,9 @@ |
17 | 17 | */ |
18 | 18 | |
19 | 19 | /** |
20 | - * \file accountingex/admin/account.php | |
21 | - * \ingroup Accounting Expert | |
22 | - * \brief List accounting account | |
20 | + * \file accountingex/admin/account.php | |
21 | + * \ingroup Accounting Expert | |
22 | + * \brief List accounting account | |
23 | 23 | */ |
24 | 24 | |
25 | 25 | // Dolibarr environment |
... | ... | @@ -78,7 +78,7 @@ $accounting = new AccountingAccount($db); |
78 | 78 | if ($action == 'disable') { |
79 | 79 | $accounting = $accounting->fetch($id); |
80 | 80 | if (! empty($accounting->id)) { |
81 | - $result = $accounting->account_desactivate($user); | |
81 | + $result = $accounting->account_desactivate($id); | |
82 | 82 | } |
83 | 83 | |
84 | 84 | $action = 'update'; |
... | ... | @@ -90,7 +90,7 @@ if ($action == 'disable') { |
90 | 90 | $accounting = $accounting->fetch($id); |
91 | 91 | |
92 | 92 | if (! empty($accounting->id)) { |
93 | - $result = $accounting->account_activate($user); | |
93 | + $result = $accounting->account_activate($id); | |
94 | 94 | } |
95 | 95 | $action = 'update'; |
96 | 96 | if ($result < 0) { | ... | ... |
accountingex/admin/export.php
1 | 1 | <?php |
2 | -/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> | |
3 | - * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> | |
2 | +/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> | |
3 | + * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> | |
4 | 4 | * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> |
5 | + * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> | |
5 | 6 | * |
6 | 7 | * This program is free software; you can redistribute it and/or modify |
7 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | @@ -15,13 +16,12 @@ |
15 | 16 | * |
16 | 17 | * You should have received a copy of the GNU General Public License |
17 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | - * | |
19 | 19 | */ |
20 | 20 | |
21 | 21 | /** |
22 | - * \file htdocs/accountingex/admin/export.php | |
23 | - * \ingroup Accounting Expert | |
24 | - * \brief Setup page to configure accounting expert module | |
22 | + * \file htdocs/accountingex/admin/export.php | |
23 | + * \ingroup Accounting Expert | |
24 | + * \brief Setup page to configure accounting expert module | |
25 | 25 | */ |
26 | 26 | |
27 | 27 | // Dolibarr environment |
... | ... | @@ -54,7 +54,6 @@ $action = GETPOST('action', 'alpha'); |
54 | 54 | |
55 | 55 | // Other parameters ACCOUNTINGEX_* |
56 | 56 | $list = array ( |
57 | - 'ACCOUNTINGEX_MODELCSV', | |
58 | 57 | 'ACCOUNTINGEX_SEPARATORCSV' |
59 | 58 | ); |
60 | 59 | |
... | ... | @@ -66,7 +65,7 @@ if ($action == 'update') { |
66 | 65 | |
67 | 66 | $modelcsv = GETPOST('modelcsv', 'int'); |
68 | 67 | |
69 | - if (in_array($modelcsv, $modelcsv)) { | |
68 | + if (! empty($modelcsv)) { | |
70 | 69 | |
71 | 70 | if (! dolibarr_set_const($db, 'ACCOUNTINGEX_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { |
72 | 71 | $error ++; |
... | ... | @@ -91,7 +90,7 @@ if ($action == 'update') { |
91 | 90 | } |
92 | 91 | |
93 | 92 | /* |
94 | - * Affichage page | |
93 | + * View | |
95 | 94 | */ |
96 | 95 | |
97 | 96 | llxHeader(); | ... | ... |
accountingex/admin/index.php
1 | 1 | <?php |
2 | -/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> | |
2 | +/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> | |
3 | 3 | * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> |
4 | 4 | * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> |
5 | - * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> | |
5 | + * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> | |
6 | + * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> | |
6 | 7 | * |
7 | 8 | * This program is free software; you can redistribute it and/or modify |
8 | 9 | * it under the terms of the GNU General Public License as published by |
... | ... | @@ -20,9 +21,9 @@ |
20 | 21 | */ |
21 | 22 | |
22 | 23 | /** |
23 | - * \file htdocs/accountingex/admin/index.php | |
24 | - * \ingroup Accounting Expert | |
25 | - * \brief Setup page to configure accounting expert module | |
24 | + * \file htdocs/accountingex/admin/index.php | |
25 | + * \ingroup Accounting Expert | |
26 | + * \brief Setup page to configure accounting expert module | |
26 | 27 | */ |
27 | 28 | |
28 | 29 | // Dolibarr environment |
... | ... | @@ -53,40 +54,74 @@ if (! $user->rights->accountingex->admin) |
53 | 54 | |
54 | 55 | $action = GETPOST('action', 'alpha'); |
55 | 56 | |
57 | +// Other parameters COMPTA_* & ACCOUNTINGEX_* | |
58 | +$list = array ( | |
59 | + 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION', | |
60 | + 'ACCOUNTINGEX_LENGTH_GACCOUNT', | |
61 | + 'ACCOUNTINGEX_LENGTH_AACCOUNT', | |
62 | + 'COMPTA_ACCOUNT_CUSTOMER', | |
63 | + 'COMPTA_ACCOUNT_SUPPLIER', | |
64 | + 'COMPTA_PRODUCT_BUY_ACCOUNT', | |
65 | + 'COMPTA_PRODUCT_SOLD_ACCOUNT', | |
66 | + 'COMPTA_SERVICE_BUY_ACCOUNT', | |
67 | + 'COMPTA_SERVICE_SOLD_ACCOUNT', | |
68 | + 'ACCOUNTINGEX_ACCOUNT_SUSPENSE', | |
69 | + 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH' | |
70 | +); | |
71 | + | |
56 | 72 | /* |
57 | 73 | * Actions |
58 | 74 | */ |
75 | + | |
76 | +$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES'; | |
59 | 77 | |
60 | -$compta_mode = defined('COMPTA_MODE') ? COMPTA_MODE : 'RECETTES-DEPENSES'; | |
78 | +if ($action == 'update') | |
79 | +{ | |
80 | + $error = 0; | |
61 | 81 | |
62 | -if ($action == 'setcomptamode') { | |
63 | - $compta_mode = GETPOST('compta_mode', 'alpha'); | |
64 | - | |
65 | - $res = dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode, 'chaine', 0, '', $conf->entity); | |
66 | - | |
67 | - if (! $res > 0) | |
68 | - $error ++; | |
69 | - | |
70 | - if (! $error) { | |
71 | - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); | |
72 | - } else { | |
73 | - setEventMessage($langs->trans("Error"), 'mesgs'); | |
74 | - } | |
75 | -} | |
82 | + $compta_modes = array( | |
83 | + 'RECETTES-DEPENSES', | |
84 | + 'CREANCES-DETTES' | |
85 | + ); | |
76 | 86 | |
77 | -if ($action == 'setchart') { | |
78 | - $chartofaccounts = GETPOST('chartofaccounts', 'alpha'); | |
87 | + $compta_mode = GETPOST('compta_mode','alpha'); | |
79 | 88 | |
80 | - $res = dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'string', 0, '', $conf->entity); | |
89 | + if (in_array($compta_mode,$compta_modes)) { | |
90 | + | |
91 | + if (!dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode, 'chaine', 0, '', $conf->entity)) { | |
92 | + $error++; | |
93 | + } | |
94 | + } else { | |
95 | + $error++; | |
96 | + } | |
81 | 97 | |
82 | - if (! $res > 0) | |
83 | - $error ++; | |
98 | + $chartofaccounts = GETPOST('chartofaccounts', 'int'); | |
84 | 99 | |
85 | - if (! $error) { | |
86 | - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); | |
100 | + if (! empty($chartofaccounts)) { | |
101 | + | |
102 | + if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { | |
103 | + $error ++; | |
104 | + } | |
87 | 105 | } else { |
88 | - setEventMessage($langs->trans("Error"), 'mesgs'); | |
106 | + $error ++; | |
89 | 107 | } |
108 | + | |
109 | + foreach ($list as $constname) { | |
110 | + $constvalue = GETPOST($constname, 'alpha'); | |
111 | + | |
112 | + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { | |
113 | + $error++; | |
114 | + } | |
115 | + } | |
116 | + | |
117 | + if (! $error) | |
118 | + { | |
119 | + setEventMessage($langs->trans("SetupSaved")); | |
120 | + } | |
121 | + else | |
122 | + { | |
123 | + setEventMessage($langs->trans("Error"),'errors'); | |
124 | + } | |
90 | 125 | } |
91 | 126 | |
92 | 127 | if ($action == 'setlistsorttodo') { |
... | ... | @@ -114,25 +149,8 @@ if ($action == 'setlistsortdone') { |
114 | 149 | } |
115 | 150 | } |
116 | 151 | |
117 | -if ($action == 'update' || $action == 'add') { | |
118 | - $constname = GETPOST('constname', 'alpha'); | |
119 | - $constvalue = GETPOST('constvalue', 'alpha'); | |
120 | - $consttype = GETPOST('consttype', 'alpha'); | |
121 | - $constnote = GETPOST('constnote', 'alpha'); | |
122 | - | |
123 | - $res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity); | |
124 | - | |
125 | - if (! $res > 0) | |
126 | - $error ++; | |
127 | - | |
128 | - if (! $error) { | |
129 | - setEventMessage($langs->trans("SetupSaved"), 'mesgs'); | |
130 | - } else { | |
131 | - setEventMessage($langs->trans("Error"), 'mesgs'); | |
132 | - } | |
133 | -} | |
134 | 152 | /* |
135 | - * Affichage page | |
153 | + * View | |
136 | 154 | */ |
137 | 155 | |
138 | 156 | llxHeader(); |
... | ... | @@ -145,57 +163,54 @@ $head = admin_account_prepare_head($accounting); |
145 | 163 | |
146 | 164 | dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron'); |
147 | 165 | |
166 | +print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; | |
167 | +print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; | |
168 | +print '<input type="hidden" name="action" value="update">'; | |
169 | + | |
148 | 170 | print '<table class="noborder" width="100%">'; |
149 | 171 | |
150 | 172 | // Cas du parametre COMPTA_MODE |
151 | -print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">'; | |
152 | -print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; | |
153 | -print '<input type="hidden" name="action" value="setcomptamode">'; | |
173 | + | |
154 | 174 | print '<tr class="liste_titre">'; |
155 | -print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>'; | |
156 | -print '<td align="right"><input class="button" type="submit" value="' . $langs->trans('Modify') . '"></td>'; | |
175 | +print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description').'</td>'; | |
157 | 176 | print "</tr>\n"; |
158 | -print '<tr ' . $bc[false] . '><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"' . ($compta_mode != 'CREANCES-DETTES' ? ' checked' : '') . '> ' . $langs->trans('OptionModeTrue') . '</td>'; | |
159 | -print '<td colspan="2">' . nl2br($langs->trans('OptionModeTrueDesc')); | |
177 | +print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>'; | |
178 | +print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc')); | |
160 | 179 | // Write info on way to count VAT |
161 | -if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { | |
162 | - print "<br>\n"; | |
163 | - print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); | |
164 | -} else { | |
165 | - print "<br>\n"; | |
166 | - print nl2br($langs->trans('OptionModeTrueInfoExpert')); | |
167 | -} | |
180 | +//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) | |
181 | +//{ | |
182 | +// // print "<br>\n"; | |
183 | +// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); | |
184 | +//} | |
185 | +//else | |
186 | +//{ | |
187 | +// // print "<br>\n"; | |
188 | +// // print nl2br($langs->trans('OptionModeTrueInfoExpert')); | |
189 | +//} | |
168 | 190 | print "</td></tr>\n"; |
169 | -print '<tr ' . $bc[true] . '><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"' . ($compta_mode == 'CREANCES-DETTES' ? ' checked' : '') . '> ' . $langs->trans('OptionModeVirtual') . '</td>'; | |
170 | -print '<td colspan="2">' . nl2br($langs->trans('OptionModeVirtualDesc')) . "</td></tr>\n"; | |
191 | +print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>'; | |
192 | +print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n"; | |
171 | 193 | print '</form>'; |
172 | 194 | |
173 | 195 | print "</table>\n"; |
174 | 196 | |
197 | +print "<br>\n"; | |
198 | + | |
175 | 199 | /* |
176 | 200 | * Define Chart of accounts |
177 | - * | |
178 | 201 | */ |
179 | -print '<br>'; | |
180 | - | |
181 | -print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; | |
182 | -print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />'; | |
183 | - | |
184 | 202 | print '<table class="noborder" width="100%">'; |
185 | 203 | $var = True; |
186 | 204 | |
187 | 205 | print '<tr class="liste_titre">'; |
188 | -print '<td>'; | |
189 | -print '<input type="hidden" name="action" value="setchart">'; | |
206 | +print '<td colspan="3">'; | |
190 | 207 | print $langs->trans("Chartofaccounts") . '</td>'; |
191 | -print '<td align="right"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>'; | |
192 | 208 | print "</tr>\n"; |
193 | 209 | $var = ! $var; |
194 | 210 | print '<tr ' . $bc[$var] . '>'; |
195 | 211 | print "<td>" . $langs->trans("Selectchartofaccounts") . "</td>"; |
196 | 212 | print "<td>"; |
197 | 213 | print '<select class="flat" name="chartofaccounts" id="chartofaccounts">'; |
198 | -// print '<option value="0">'.$langs->trans("DoNotSuggestChart").'</option>'; | |
199 | 214 | |
200 | 215 | $sql = "SELECT rowid, pcg_version, fk_pays, label, active"; |
201 | 216 | $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system"; |
... | ... | @@ -224,70 +239,33 @@ if ($resql) { |
224 | 239 | print "</select>"; |
225 | 240 | print "</td></tr>"; |
226 | 241 | print "</table>"; |
227 | -print "</form>"; | |
228 | 242 | |
229 | 243 | print "<br>\n"; |
230 | 244 | |
231 | 245 | /* |
232 | - * Params | |
233 | - * | |
246 | + * Others params | |
234 | 247 | */ |
235 | -$list = array ( | |
236 | - 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION', | |
237 | - 'ACCOUNTINGEX_LENGTH_GACCOUNT', | |
238 | - 'ACCOUNTINGEX_LENGTH_AACCOUNT', | |
239 | - 'COMPTA_ACCOUNT_CUSTOMER', | |
240 | - 'COMPTA_ACCOUNT_SUPPLIER', | |
241 | - 'COMPTA_PRODUCT_BUY_ACCOUNT', | |
242 | - 'COMPTA_PRODUCT_SOLD_ACCOUNT', | |
243 | - 'COMPTA_SERVICE_BUY_ACCOUNT', | |
244 | - 'COMPTA_SERVICE_SOLD_ACCOUNT', | |
245 | - 'ACCOUNTINGEX_ACCOUNT_SUSPENSE', | |
246 | - 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH' | |
247 | -); | |
248 | +print '<table class="noborder" width="100%">'; | |
249 | +print '<tr class="liste_titre">'; | |
250 | +print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>'; | |
251 | +print "</tr>\n"; | |
248 | 252 | |
249 | -$num = count($list); | |
250 | -if ($num) { | |
251 | - print '<table class="noborder" width="100%">'; | |
252 | - print '<tr class="liste_titre">'; | |
253 | - print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>'; | |
254 | - print "</tr>\n"; | |
255 | -} | |
253 | +foreach ($list as $key) | |
254 | +{ | |
255 | + $var=!$var; | |
256 | + | |
257 | + print '<tr '.$bc[$var].' class="value">'; | |
256 | 258 | |
257 | -foreach ( $list as $key ) { | |
258 | - $var = ! $var; | |
259 | - | |
260 | - print '<form action="index.php" method="POST">'; | |
261 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; | |
262 | - | |
263 | - print '<input type="hidden" name="action" value="update">'; | |
264 | - print '<input type="hidden" name="consttype" value="string">'; | |
265 | - print '<input type="hidden" name="constname" value="' . $key . '">'; | |
266 | - | |
267 | - print '<tr ' . $bc[$var] . ' class="value">'; | |
268 | - | |
269 | 259 | // Param |
270 | - $label = $langs->trans($key); | |
271 | - print '<td>' . $label; | |
272 | - // print ' ('.$key.')'; | |
273 | - print "</td>\n"; | |
274 | - | |
260 | + $label = $langs->trans($key); | |
261 | + print '<td><label for="'.$key.'">'.$label.'</label></td>'; | |
262 | + | |
275 | 263 | // Value |
276 | 264 | print '<td>'; |
277 | - print '<input type="text" size="20" name="constvalue" value="' . $conf->global->$key . '">'; | |
278 | - print '</td><td>'; | |
279 | - print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"> '; | |
280 | - print "</td></tr>\n"; | |
281 | - print '</form>'; | |
282 | - | |
283 | - $i ++; | |
265 | + print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">'; | |
266 | + print '</td></tr>'; | |
284 | 267 | } |
285 | 268 | |
286 | -print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; | |
287 | -print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; | |
288 | -print '<input type="hidden" name="action" value="updateoptions">'; | |
289 | - | |
290 | -$var = ! $var; | |
291 | 269 | print "<tr " . $bc[$var] . ">"; |
292 | 270 | print '<td width="80%">' . $langs->trans("ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO") . '</td>'; |
293 | 271 | if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO)) { |
... | ... | @@ -314,11 +292,10 @@ if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE)) { |
314 | 292 | } |
315 | 293 | print '</tr>'; |
316 | 294 | |
317 | -if ($num) { | |
318 | - print "</table>\n"; | |
319 | -} | |
320 | - | |
321 | 295 | print '</form>'; |
296 | +print "</table>\n"; | |
297 | + | |
298 | +print '<br /><br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; | |
322 | 299 | |
323 | 300 | llxFooter(); |
324 | 301 | $db->close(); |
325 | 302 | \ No newline at end of file | ... | ... |
accountingex/admin/journaux.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> |
3 | 3 | * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> |
4 | 4 | * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> |
5 | + * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> | |
5 | 6 | * |
6 | 7 | * This program is free software; you can redistribute it and/or modify |
7 | 8 | * it under the terms of the GNU General Public License as published by | ... | ... |
accountingex/class/accountingaccount.class.php
... | ... | @@ -359,7 +359,7 @@ class AccountingAccount { |
359 | 359 | * @param User $user update |
360 | 360 | * @return int if KO, >0 if OK |
361 | 361 | */ |
362 | - function account_desactivate($user) { | |
362 | + function account_desactivate($id) { | |
363 | 363 | global $langs; |
364 | 364 | |
365 | 365 | $result = $this->checkUsage(); |
... | ... | @@ -369,7 +369,7 @@ class AccountingAccount { |
369 | 369 | |
370 | 370 | $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; |
371 | 371 | $sql .= "SET active = '0'"; |
372 | - $sql .= " WHERE rowid = " . $this->id; | |
372 | + $sql .= " WHERE rowid = ".$this->db->escape($id); | |
373 | 373 | |
374 | 374 | dol_syslog(get_class($this) . "::desactivate sql=" . $sql, LOG_DEBUG); |
375 | 375 | $result = $this->db->query($sql); |
... | ... | @@ -393,14 +393,14 @@ class AccountingAccount { |
393 | 393 | * @param User $user update |
394 | 394 | * @return int if KO, >0 if OK |
395 | 395 | */ |
396 | - function account_activate($user) { | |
396 | + function account_activate($id) { | |
397 | 397 | global $langs; |
398 | 398 | |
399 | 399 | $this->db->begin(); |
400 | 400 | |
401 | 401 | $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; |
402 | 402 | $sql .= "SET active = '1'"; |
403 | - $sql .= " WHERE rowid = " . $this->id; | |
403 | + $sql .= " WHERE rowid = ".$this->db->escape($id); | |
404 | 404 | |
405 | 405 | dol_syslog(get_class($this) . "::activate sql=" . $sql, LOG_DEBUG); |
406 | 406 | $result = $this->db->query($sql); | ... | ... |
accountingex/customer/lignes.php
... | ... | @@ -21,8 +21,8 @@ |
21 | 21 | |
22 | 22 | /** |
23 | 23 | * \file accountingex/customer/lignes.php |
24 | - * \ingroup Accounting Expert | |
25 | - * \brief Page de detail des lignes de ventilation d'une facture client | |
24 | + * \ingroup Accounting Expert | |
25 | + * \brief Page of detail of the lines of ventilation of invoices customers | |
26 | 26 | */ |
27 | 27 | |
28 | 28 | // Dolibarr environment |
... | ... | @@ -36,7 +36,7 @@ if (! $res && file_exists("../../../main.inc.php")) |
36 | 36 | if (! $res) |
37 | 37 | die("Include of main fails"); |
38 | 38 | |
39 | - // Class | |
39 | +// Class | |
40 | 40 | dol_include_once("/accountingex/class/html.formventilation.class.php"); |
41 | 41 | dol_include_once("/compta/facture/class/facture.class.php"); |
42 | 42 | dol_include_once("/product/class/product.class.php"); |
... | ... | @@ -87,12 +87,12 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) |
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | -llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched")); | |
91 | - | |
92 | 90 | /* |
93 | - * Lignes de factures | |
94 | - * | |
91 | + * View | |
95 | 92 | */ |
93 | + | |
94 | +llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched")); | |
95 | + | |
96 | 96 | $page = GETPOST("page"); |
97 | 97 | if ($page < 0) |
98 | 98 | $page = 0; |
... | ... | @@ -150,14 +150,14 @@ if ($result) { |
150 | 150 | // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... |
151 | 151 | print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lignes); |
152 | 152 | |
153 | - print '<td align="left"><br><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></br><br></td>'; | |
153 | + print '<td align="left"><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></td>'; | |
154 | 154 | |
155 | 155 | print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
156 | 156 | print '<table class="noborder" width="100%">'; |
157 | 157 | |
158 | - print '<div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '</div>'; | |
158 | + print '<br><br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount"); | |
159 | 159 | print $formventilation->select_account($account_parent, 'account_parent', 1); |
160 | - print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>'; | |
160 | + print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>'; | |
161 | 161 | |
162 | 162 | print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>'; |
163 | 163 | print '<td>' . $langs->trans("Ref") . '</td>'; | ... | ... |
accountingex/journal/purchasesjournal.php
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * \file accountingex/journal/purchasesjournal.php |
26 | - * \ingroup Accounting Expert | |
26 | + * \ingroup Accounting Expert | |
27 | 27 | * \brief Page with purchases journal |
28 | 28 | */ |
29 | 29 | |
... | ... | @@ -38,7 +38,7 @@ if (! $res && file_exists("../../../main.inc.php")) |
38 | 38 | if (! $res) |
39 | 39 | die("Include of main fails"); |
40 | 40 | |
41 | - // Class | |
41 | +// Class | |
42 | 42 | dol_include_once("/core/lib/report.lib.php"); |
43 | 43 | dol_include_once("/core/lib/date.lib.php"); |
44 | 44 | dol_include_once("/accountingex/core/lib/account.lib.php"); |
... | ... | @@ -185,9 +185,9 @@ if ($action == 'writebookkeeping') { |
185 | 185 | $bookkeeping->label_compte = $tabcompany[$key]['name']; |
186 | 186 | $bookkeeping->numero_compte = $conf->global->COMPTA_ACCOUNT_SUPPLIER; |
187 | 187 | $bookkeeping->montant = $mt; |
188 | - $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; | |
189 | - $bookkeeping->debit = ($mt >= 0) ? $mt : 0; | |
190 | - $bookkeeping->credit = ($mt < 0) ? $mt : 0; | |
188 | + $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; | |
189 | + $bookkeeping->debit = ($mt <= 0) ? $mt : 0; | |
190 | + $bookkeeping->credit = ($mt > 0) ? $mt : 0; | |
191 | 191 | $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL; |
192 | 192 | |
193 | 193 | $bookkeeping->create(); |
... | ... | @@ -210,9 +210,9 @@ if ($action == 'writebookkeeping') { |
210 | 210 | $bookkeeping->label_compte = dol_trunc($val["description"], 128); |
211 | 211 | $bookkeeping->numero_compte = $k; |
212 | 212 | $bookkeeping->montant = $mt; |
213 | - $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; | |
214 | - $bookkeeping->debit = ($mt < 0) ? $mt : 0; | |
215 | - $bookkeeping->credit = ($mt >= 0) ? $mt : 0; | |
213 | + $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; | |
214 | + $bookkeeping->debit = ($mt > 0) ? $mt : 0; | |
215 | + $bookkeeping->credit = ($mt <= 0) ? $mt : 0; | |
216 | 216 | $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL; |
217 | 217 | |
218 | 218 | $bookkeeping->create(); |
... | ... | @@ -237,9 +237,9 @@ if ($action == 'writebookkeeping') { |
237 | 237 | $bookkeeping->label_compte = $langs->trans("VAT"); |
238 | 238 | $bookkeeping->numero_compte = $k; |
239 | 239 | $bookkeeping->montant = $mt; |
240 | - $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; | |
241 | - $bookkeeping->debit = ($mt < 0) ? $mt : 0; | |
242 | - $bookkeeping->credit = ($mt >= 0) ? $mt : 0; | |
240 | + $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; | |
241 | + $bookkeeping->debit = ($mt > 0) ? $mt : 0; | |
242 | + $bookkeeping->credit = ($mt <= 0) ? $mt : 0; | |
243 | 243 | $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL; |
244 | 244 | |
245 | 245 | $bookkeeping->create(); | ... | ... |
accountingex/langs/fr_FR/accountingex.lang
... | ... | @@ -157,4 +157,4 @@ ValidateHistory=Valider Automatiquement |
157 | 157 | |
158 | 158 | ErrorAccountancyCodeIsAlreadyUse=Erreur, vous ne pouvez pas supprimer ce compte comptable car il est utilisé |
159 | 159 | |
160 | -FicheVentilation=Fiche ventilation | |
161 | 160 | \ No newline at end of file |
161 | +FicheVentilation=Fiche ventilation | ... | ... |
accountingex/supplier/lignes.php
... | ... | @@ -21,9 +21,9 @@ |
21 | 21 | */ |
22 | 22 | |
23 | 23 | /** |
24 | - * \file accountingex/supplier/lignes.php | |
25 | - * \ingroup Accounting Expert | |
26 | - * \brief Page de detail des lignes de ventilation d'une facture | |
24 | + * \file accountingex/supplier/lignes.php | |
25 | + * \ingroup Accounting Expert | |
26 | + * \brief Page of detail of the lines of ventilation of invoices suppliers | |
27 | 27 | */ |
28 | 28 | |
29 | 29 | // Dolibarr environment |
... | ... | @@ -37,7 +37,7 @@ if (! $res && file_exists("../../../main.inc.php")) |
37 | 37 | if (! $res) |
38 | 38 | die("Include of main fails"); |
39 | 39 | |
40 | - // Class | |
40 | +// Class | |
41 | 41 | dol_include_once("/accountingex/class/html.formventilation.class.php"); |
42 | 42 | dol_include_once("/fourn/class/fournisseur.facture.class.php"); |
43 | 43 | dol_include_once("/product/class/product.class.php"); |
... | ... | @@ -86,12 +86,12 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) |
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | -llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched")); | |
90 | - | |
91 | 89 | /* |
92 | - * Lignes de factures | |
93 | - * | |
90 | + * View | |
94 | 91 | */ |
92 | + | |
93 | +llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched")); | |
94 | + | |
95 | 95 | $page = $_GET["page"]; |
96 | 96 | if ($page < 0) |
97 | 97 | $page = 0; |
... | ... | @@ -149,14 +149,14 @@ if ($result) { |
149 | 149 | // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... |
150 | 150 | print_barre_liste($langs->trans("InvoiceLinesDone"), $page, "lignes.php", "", $sortfield, $sortorder, '', $num_lignes); |
151 | 151 | |
152 | - print '<td align="left"><br><b>' . $langs->trans("DescVentilDoneSupplier") . '</b></br></td>'; | |
152 | + print '<td align="left"><b>' . $langs->trans("DescVentilDoneSupplier") . '</b></td>'; | |
153 | 153 | |
154 | 154 | print '<form method="GET" action="lignes.php">'; |
155 | 155 | print '<table class="noborder" width="100%">'; |
156 | 156 | |
157 | - print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("ChangeAccount") . '" /></div>'; | |
158 | - | |
157 | + print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount"); | |
159 | 158 | print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1); |
159 | + print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '" /></div>'; | |
160 | 160 | |
161 | 161 | print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>'; |
162 | 162 | print '<td>' . $langs->trans("Ref") . '</td>'; |
... | ... | @@ -229,4 +229,4 @@ if ($result) { |
229 | 229 | print "</table></form>"; |
230 | 230 | |
231 | 231 | $db->close(); |
232 | 232 | -llxFooter(); |
233 | +llxFooter(); | |
233 | 234 | \ No newline at end of file | ... | ... |