Browse Source

NEW: Loan - Add list to select accounting account in admin

aspangaro 9 years ago
parent
commit
c652d5b02d
1 changed files with 11 additions and 2 deletions
  1. 11 2
      htdocs/admin/loan.php

+ 11 - 2
htdocs/admin/loan.php

@@ -1,5 +1,5 @@
 <?php
-/* Copyright (C) 2014		Alexandre Spangaro	<aspangaro.dolibarr@gmail.com>
+/* Copyright (C) 2014-2016	Alexandre Spangaro	<aspangaro.dolibarr@gmail.com>
  *
  * 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
@@ -26,6 +26,7 @@ require '../main.inc.php';
 	
 // Class
 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
 
 $langs->load("admin");
 $langs->load("loan");
@@ -76,6 +77,7 @@ if ($action == 'update')
 llxHeader();
 
 $form = new Form($db);
+if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
 
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
 print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup');
@@ -104,7 +106,14 @@ foreach ($list as $key)
 
 	// Value
 	print '<td>';
-	print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
+	if (! empty($conf->accounting->enabled))
+	{
+		print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
+	}
+	else
+	{
+		print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
+	}
 	print '</td></tr>';
 }