Browse Source

FIX/NEW : Accountancy

bobby 9 years ago
parent
commit
46532ccb55

+ 12 - 0
htdocs/accountancy/bookkeeping/card.php

@@ -213,6 +213,18 @@ if ($action == 'create') {
             $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL => $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL,
             $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL => $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL
     );
+    
+    $sql = 'SELECT DISTINCT accountancy_journal FROM '.MAIN_DB_PREFIX.'bank_account WHERE clos=0';
+    $resql=$db->query($sql);
+    if (!$resql) {
+    	setEventMessages($db->lasterror,null,'errors');
+    } else {
+    	while ($obj_bank=$db->fetch_object($resql)) {
+    		if (!empty($obj_bank->accountancy_journal)) {
+    			$code_journal_array[$obj_bank->accountancy_journal]=$obj_bank->accountancy_journal;
+    		}
+    	}
+    }
 
     $book = new BookKeeping($db);
     $next_num_mvt = $book->getNextNumMvt();

+ 1 - 1
htdocs/accountancy/journal/bankjournal.php

@@ -577,9 +577,9 @@ else
 	$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);
 
 	$varlink = 'id_account='.$id_bank_account;
+	
 	report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
 
-	
 	print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
 
 	print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';

+ 0 - 2
htdocs/core/lib/report.lib.php

@@ -48,8 +48,6 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
 	
 	if(! empty($varlink)) $varlink = '?'.$varlink;
 
-	if(! empty($varlink)) $varlink = '?'.$varlink;
-
 	$h=0;
 	$head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
 	$head[$h][1] = $langs->trans("Report");