Browse Source

Fix Accountancy

Alexandre SPANGARO 7 years ago
parent
commit
e0c0f7fd9b

+ 3 - 3
htdocs/accountancy/bookkeeping/card.php

@@ -617,7 +617,7 @@ if ($action == 'create')
 						}
 						print '</td>';
 						print '<td><input type="text" class="minwidth100" name="label_compte" value="' . $line->label_compte . '"/></td>';
-						print '<td><input type="text" class="minwidth300" name="label_operation" value="' . $line->label_operation. '"/></td>';
+						print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $line->label_operation. '"/></td>';
 						print '<td align="right"><input type="text" size="6" class="right" name="debit" value="' . price($line->debit) . '"/></td>';
 						print '<td align="right"><input type="text" size="6" class="right" name="credit" value="' . price($line->credit) . '"/></td>';
 						print '<td>';
@@ -654,7 +654,7 @@ if ($action == 'create')
 
 				if ($total_debit != $total_credit)
 				{
-					setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings');
+					setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
 				}
 
 				if ($action == "" || $action == 'add') {
@@ -675,7 +675,7 @@ if ($action == 'create')
 					}
 					print '</td>';
 					print '<td><input type="text" class="minwidth100" name="label_compte" value=""/></td>';
-					print '<td><input type="text" class="minwidth300" name="label_operation" value=""/></td>';
+					print '<td><input type="text" class="minwidth200" name="label_operation" value=""/></td>';
 					print '<td align="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
 					print '<td align="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
 					print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';

+ 2 - 8
htdocs/accountancy/class/bookkeeping.class.php

@@ -246,9 +246,6 @@ class BookKeeping extends CommonObject
 				}
 
 				$now = dol_now();
-				if (empty($this->date_create)) {
-					$this->date_create = $now;
-				}
 
 				$sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " (";
 				$sql .= "doc_date";
@@ -291,7 +288,7 @@ class BookKeeping extends CommonObject
 				$sql .= "," . $this->montant;
 				$sql .= ",'" . $this->db->escape($this->sens) . "'";
 				$sql .= ",'" . $this->db->escape($this->fk_user_author) . "'";
-				$sql .= ",'" . $this->db->idate($this->date_create). "'";
+				$sql .= ",'" . $this->db->idate($now). "'";
 				$sql .= ",'" . $this->db->escape($this->code_journal) . "'";
 				$sql .= ",'" . $this->db->escape($this->journal_label) . "'";
 				$sql .= "," . $this->db->escape($this->piece_num);
@@ -496,9 +493,6 @@ class BookKeeping extends CommonObject
 		$this->credit = price2num($this->credit, 'MT');
 
 		$now = dol_now();
-		if (empty($this->date_create)) {
-		    $this->date_create = $now;
-		}
 
 		// Check parameters
 		// Put here code to add control on parameters values
@@ -545,7 +539,7 @@ class BookKeeping extends CommonObject
 		$sql .= ' ' . (! isset($this->montant) ? 'NULL' : $this->montant ). ',';
 		$sql .= ' ' . (! isset($this->sens) ? 'NULL' : "'" . $this->db->escape($this->sens) . "'") . ',';
 		$sql .= ' ' . $user->id . ',';
-		$sql .= ' ' . "'" . $this->db->idate($this->date_create) . "',";
+		$sql .= ' ' . "'" . $this->db->idate($now) . "',";
 		$sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ',';
 		$sql .= ' ' . (empty($this->journal_label) ? 'NULL' : "'" . $this->db->escape($this->journal_label) . "'") . ',';
 		$sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).',';

+ 2 - 2
htdocs/core/modules/modAccounting.class.php

@@ -240,11 +240,11 @@ class modAccounting extends DolibarrModules
         $r++;
         $this->export_code[$r]=$this->rights_class.'_'.$r;
         $this->export_label[$r]='Chartofaccounts';
-        $this->export_icon[$r]='accounting';
+        $this->export_icon[$r]='Accounting';
 		$this->export_permission[$r]=array(array("accounting","chartofaccount"));
         $this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
         $this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
-        $this->export_entities_array[$r]=array('ac.rowid'=>"accounting",'ac.pcg_version'=>"accounting",'aa.rowid'=>'accounting','aa.account_number'=>"accounting",'aa.label'=>"accounting",'aa.accountparent'=>"accounting",'aa.pcg_type'=>"accounting",'aa.pcgsubtype'=>"accounting",'aa_active'=>"accounting");
+        $this->export_entities_array[$r]=array('ac.rowid'=>"Accounting",'ac.pcg_version'=>"Accounting",'aa.rowid'=>'Accounting','aa.account_number'=>"Accounting",'aa.label'=>"Accounting",'aa.accountparent'=>"Accounting",'aa.pcg_type'=>"Accounting",'aa.pcgsubtype'=>"Accounting",'aa_active'=>"Accounting");
 
         $this->export_sql_start[$r]='SELECT DISTINCT ';
         $this->export_sql_end[$r]  =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa, '.MAIN_DB_PREFIX.'accounting_system as ac';

+ 1 - 0
htdocs/langs/en_US/accountancy.lang

@@ -1,4 +1,5 @@
 # Dolibarr language file - en_US - Accounting Expert
+Accounting=Accounting
 ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file
 ACCOUNTING_EXPORT_DATE=Date format for export file
 ACCOUNTING_EXPORT_PIECE=Export the number of piece