Commit afdf7485277dde9e75ba3dbe9126afed03f8bb43

Authored by aspangaro
1 parent 592440c3
Exists in 3.6

Correct lot of bugs

accountingex/admin/export.php
... ... @@ -121,7 +121,7 @@ print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'
121 121 print '<input type="hidden" name="action" value="update">';
122 122  
123 123 print '<table class="noborder" width="100%">';
124   -$var = True;
  124 +$var = true;
125 125  
126 126 print '<tr class="liste_titre">';
127 127 print '<td colspan="2">' . $langs->trans("Modelcsv") . '</td>';
... ... @@ -142,7 +142,7 @@ else
142 142 print '<td>';
143 143 $listmodelcsv=array(
144 144 '1'=>$langs->trans("Modelcsv_normal"),
145   - '2'=>$langs->trans("Modelcsv_CEGID"),
  145 + '2'=>$langs->trans("Modelcsv_CEGID")
146 146 );
147 147 print $form->selectarray("modelcsv",$listmodelcsv,$conf->global->ACCOUNTINGEX_MODELCSV,0);
148 148 print '</td>';
... ...
accountingex/admin/thirdpartyaccount.php
... ... @@ -122,7 +122,7 @@ report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $e
122 122 'action' => ''
123 123 ));
124 124  
125   -print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
  125 +print '<input type="button" class="button" style="float: right;" value="'.$langs->trans("Export").'" onclick="launch_export();" />';
126 126  
127 127 print '
128 128 <script type="text/javascript">
... ... @@ -170,7 +170,7 @@ if ($resql) {
170 170 $num = $db->num_rows($resql);
171 171 $i = 0;
172 172  
173   - // export csv
  173 + // Export
174 174 if (GETPOST('action') == 'export_csv') {
175 175  
176 176 header('Content-Type: text/csv');
... ...
accountingex/bookkeeping/list.php
... ... @@ -84,7 +84,7 @@ if ($action == &#39;delbookkeeping&#39;) {
84 84 setEventMessage($object->errors, 'errors');
85 85 }
86 86 }
87   -} // export csv
  87 +} // Export
88 88 else if ($action == 'export_csv') {
89 89  
90 90 header('Content-Type: text/csv');
... ... @@ -169,7 +169,7 @@ else {
169 169 print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
170 170 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
171 171 print '<input type="hidden" name="action" value="export_csv">';
172   - print '<input type="submit" class="button" style="float: right;" value="Export CSV" />';
  172 + print '<input type="submit" class="button" style="float: right;" value="'.$langs->trans("Export").'" />';
173 173 print '</form>';
174 174  
175 175 print '<table class="noborder" width="100%">';
... ... @@ -180,10 +180,10 @@ else {
180 180 print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder);
181 181 print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "bk.code_tiers", "", "", "", $sortfield, $sortorder);
182 182 print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", "", "", $sortfield, $sortorder);
183   - print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", align="center"', $sortfield, $sortorder);
184   - print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", align="center"', $sortfield, $sortorder);
185   - print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", align="center"', $sortfield, $sortorder);
186   - print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", align="center"', $sortfield, $sortorder);
  183 + print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", 'align="center"', $sortfield, $sortorder);
  184 + print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", 'align="center"', $sortfield, $sortorder);
  185 + print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder);
  186 + print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder);
187 187 print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder);
188 188 print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
189 189 print "</tr>\n";
... ... @@ -200,7 +200,7 @@ else {
200 200 print '<td>&nbsp;</td>';
201 201 print '<td>&nbsp;</td>';
202 202 print '<td>&nbsp;</td>';
203   - print '<td><input type="text" name="search_journal" size="3" value="' . $GETPOST("search_journal") . '"></td>';
  203 + print '<td><input type="text" name="search_journal" size="3" value="' . $search_journal . '"></td>';
204 204 print '<td align="right" colspan="2" class="liste_titre">';
205 205 print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
206 206 print '&nbsp;';
... ...
accountingex/core/modules/modAccountingExpert.class.php
... ... @@ -45,7 +45,7 @@ class modAccountingExpert extends DolibarrModules {
45 45 $this->description = "Advanced manage of accounting";
46 46  
47 47 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
48   - $this->version = '3.6.x beta 20150201';
  48 + $this->version = '3.6.x beta 20150205';
49 49 $this->revision = '3.0.0';
50 50  
51 51 $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
... ... @@ -75,7 +75,7 @@ class modAccountingExpert extends DolibarrModules {
75 75 ); // Minimum version of PHP required by module
76 76 $this->need_dolibarr_version = array (
77 77 3,
78   - 6
  78 + 5
79 79 ); // Minimum version of Dolibarr required by module
80 80 $this->langfiles = array (
81 81 "accountingex@accountingex"
... ...
accountingex/journal/bankjournal.php
... ... @@ -4,7 +4,7 @@
4 4 * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
5 5 * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
6 6 * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
7   - * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
  7 + * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
8 8 * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
9 9 * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
10 10 *
... ... @@ -128,7 +128,7 @@ $result = $db-&gt;query($sql);
128 128 if ($result) {
129 129  
130 130 $num = $db->num_rows($result);
131   - // les variables
  131 + // Variables
132 132 $cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
133 133 $cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER) ? $conf->global->COMPTA_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
134 134 $cpttva = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
... ... @@ -213,7 +213,7 @@ if ($result) {
213 213 $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
214 214  
215 215 $sqlmid = 'SELECT cchgsoc.accountancy_code';
216   - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
  216 + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales as cchgsoc ";
217 217 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
218 218 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
219 219 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
... ... @@ -266,7 +266,7 @@ if ($result) {
266 266 if ($action == 'writeBookKeeping') {
267 267 $error = 0;
268 268 foreach ( $tabpay as $key => $val ) {
269   - // bank
  269 + // Bank
270 270 foreach ( $tabbq[$key] as $k => $mt ) {
271 271 $bookkeeping = new BookKeeping($db);
272 272 $bookkeeping->doc_date = $val["date"];
... ... @@ -286,7 +286,7 @@ if ($action == &#39;writeBookKeeping&#39;) {
286 286 if ($tabtype[$key] == 'payment') {
287 287  
288 288 $sqlmid = 'SELECT fac.facnumber';
289   - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
  289 + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture as fac ";
290 290 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
291 291 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
292 292 $sqlmid .= " WHERE pay.fk_bank=" . $key;
... ... @@ -299,7 +299,7 @@ if ($action == &#39;writeBookKeeping&#39;) {
299 299 } else if ($tabtype[$key] == 'payment_supplier') {
300 300  
301 301 $sqlmid = 'SELECT facf.facnumber';
302   - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
  302 + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as facf ";
303 303 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
304 304 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
305 305 $sqlmid .= " WHERE payf.fk_bank=" . $key;
... ... @@ -339,7 +339,7 @@ if ($action == &#39;writeBookKeeping&#39;) {
339 339 } else if ($tabtype[$key] == 'payment') {
340 340  
341 341 $sqlmid = 'SELECT fac.facnumber';
342   - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
  342 + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture as fac ";
343 343 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
344 344 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
345 345 $sqlmid .= " WHERE pay.fk_bank=" . $key;
... ... @@ -354,7 +354,7 @@ if ($action == &#39;writeBookKeeping&#39;) {
354 354 } else if ($tabtype[$key] == 'payment_supplier') {
355 355  
356 356 $sqlmid = 'SELECT facf.facnumber';
357   - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
  357 + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as facf ";
358 358 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
359 359 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
360 360 $sqlmid .= " WHERE payf.fk_bank=" . $key;
... ... @@ -369,7 +369,7 @@ if ($action == &#39;writeBookKeeping&#39;) {
369 369 } else if ($tabtype[$key] == 'company') {
370 370  
371 371 $sqlmid = 'SELECT fac.facnumber';
372   - $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
  372 + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture as fac ";
373 373 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
374 374 $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
375 375 $sqlmid .= " WHERE pay.fk_bank=" . $key;
... ... @@ -429,9 +429,9 @@ if ($action == &#39;export_csv&#39;)
429 429 print $bank_journal . $sep;
430 430 print length_accountg(html_entity_decode($k)) . $sep;
431 431 print $sep;
432   - print $langs->trans("Bank") . $sep;
433 432 print ($mt < 0 ? 'C' : 'D') . $sep;
434 433 print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
  434 + print $langs->trans("Bank") . $sep;
435 435 print $val["ref"] . $sep;
436 436 print "\n";
437 437 }
... ... @@ -454,10 +454,10 @@ if ($action == &#39;export_csv&#39;)
454 454 print length_accountg($conf->global->COMPTA_ACCOUNT_CUSTOMER) . $sep;
455 455 }
456 456 print length_accounta(html_entity_decode($k)) . $sep;
457   - print $companystatic->name . $sep;
458 457 print ($mt < 0 ? 'D' : 'C') . $sep;
459 458 print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
460   - print $val["ref"] . '"' . $sep;
  459 + print $companystatic->name . $sep;
  460 + print $val["ref"] . $sep;
461 461 print "\n";
462 462 }
463 463 }
... ... @@ -472,9 +472,9 @@ if ($action == &#39;export_csv&#39;)
472 472 print $bank_journal . $sep;
473 473 print $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE . $sep;
474 474 print $sep;
475   - print $langs->trans("Bank") . $sep;
476 475 print ($mt < 0 ? 'D' : 'C') . $sep;
477 476 print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
  477 + print $langs->trans("Bank") . $sep;
478 478 print $val["ref"] . $sep;
479 479 print "\n";
480 480 }
... ... @@ -509,7 +509,6 @@ if ($action == &#39;export_csv&#39;)
509 509 if ($mt) {
510 510 print '"' . $date . '"' . $sep;
511 511 print '"' . $val["ref"] . '"' . $sep;
512   -
513 512 print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
514 513 print '"' . $companystatic->name . '"' . $sep;
515 514 print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
... ... @@ -555,7 +554,7 @@ else
555 554 'action' => ''
556 555 ));
557 556  
558   - print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
  557 + print '<input type="button" class="button" style="float: right;" value="'.$langs->trans("Export").'" onclick="launch_export();" />';
559 558  
560 559 print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';
561 560  
... ...
accountingex/journal/cashjournal.php
... ... @@ -378,7 +378,7 @@ if ($action == &#39;writeBookKeeping&#39;) {
378 378 setEventMessage($langs->trans('Success'), 'mesgs');
379 379 }
380 380 }
381   -// export csv
  381 +// Export
382 382 if ($action == 'export_csv') {
383 383 $sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV;
384 384  
... ... @@ -508,7 +508,7 @@ if ($action == &#39;export_csv&#39;) {
508 508 'action' => ''
509 509 ));
510 510  
511   - print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
  511 + print '<input type="button" class="button" style="float: right;" value="'.$langs->trans("Export").'" onclick="launch_export();" />';
512 512  
513 513 print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';
514 514  
... ...
accountingex/journal/purchasesjournal.php
... ... @@ -394,7 +394,7 @@ if ($action == &#39;export_csv&#39;) {
394 394 'action' => ''
395 395 ));
396 396  
397   - print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
  397 + print '<input type="button" class="button" style="float: right;" value="'.$langs->trans("Export").'" onclick="launch_export();" />';
398 398  
399 399 print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
400 400  
... ...
accountingex/journal/sellsjournal.php
... ... @@ -408,7 +408,7 @@ if ($action == &#39;export_csv&#39;) {
408 408 $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
409 409 report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
410 410  
411   - print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("ExportCSV") . '" onclick="launch_export();" />';
  411 + print '<input type="button" class="button" style="float: right;" value="'.$langs->trans("Export").'" onclick="launch_export();" />';
412 412  
413 413 print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
414 414  
... ...
accountingex/langs/en_US/accountingex.lang
... ... @@ -17,6 +17,7 @@ MenuTools=Tools
17 17 ConfigAccountingExpert=Configuration of the module accounting expert
18 18 Journaux=Journaux
19 19 Exports=Exports
  20 +Export=Export
20 21 About=About
21 22 Contributors=Contributors
22 23 Investors=Investors
... ...
accountingex/langs/fr_FR/accountingex.lang
... ... @@ -17,6 +17,7 @@ MenuTools=Outils
17 17 ConfigAccountingExpert=Configuration du module comptabilité expert
18 18 Journaux=Journaux
19 19 Exports=Exports
  20 +Export=Export
20 21 About=A propos
21 22 Contributors=Contributeurs
22 23 Investors=Investisseurs
... ...
accountingex/supplier/list.php
... ... @@ -137,7 +137,7 @@ if (! empty($conf-&gt;global-&gt;ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) {
137 137 $offset = $limit * $page;
138 138  
139 139 $sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, ";
140   -$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.product_type as type, p.accountancy_code_buy as code_buy";
  140 +$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, l.product_type as type, p.accountancy_code_buy as code_buy";
141 141 $sql .= " , aa.rowid as aarowid";
142 142 $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
143 143 $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
... ...