PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/compta/bank/fiche.php

https://github.com/asterix14/dolibarr
PHP | 612 lines | 402 code | 114 blank | 96 comment | 79 complexity | e92fa3ba52dabd974193f98331220e0d MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
  4. * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  5. * Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/compta/bank/fiche.php
  22. * \ingroup banque
  23. * \brief Page to create/view a bank account
  24. */
  25. require("./pre.inc.php");
  26. require_once(DOL_DOCUMENT_ROOT."/core/lib/bank.lib.php");
  27. require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
  28. require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
  29. $langs->load("banks");
  30. $langs->load("companies");
  31. $action=GETPOST("action");
  32. // Security check
  33. if (isset($_GET["id"]) || isset($_GET["ref"]))
  34. {
  35. $id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
  36. }
  37. $fieldid = isset($_GET["ref"])?'ref':'rowid';
  38. if ($user->societe_id) $socid=$user->societe_id;
  39. $result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
  40. /*
  41. * Actions
  42. */
  43. if ($_POST["action"] == 'add')
  44. {
  45. $error=0;
  46. // Create account
  47. $account = new Account($db,0);
  48. $account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
  49. $account->label = trim($_POST["label"]);
  50. $account->courant = $_POST["type"];
  51. $account->clos = $_POST["clos"];
  52. $account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1;
  53. $account->url = $_POST["url"];
  54. $account->account_number = trim($_POST["account_number"]);
  55. $account->solde = $_POST["solde"];
  56. $account->date_solde = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
  57. $account->currency_code = trim($_POST["account_currency_code"]);
  58. $account->fk_departement = $_POST["account_departement_id"];
  59. $account->fk_pays = $_POST["account_country_id"];
  60. $account->min_allowed = $_POST["account_min_allowed"];
  61. $account->min_desired = $_POST["account_min_desired"];
  62. $account->comment = trim($_POST["account_comment"]);
  63. if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
  64. {
  65. $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
  66. $action='create'; // Force chargement page en mode creation
  67. $error++;
  68. }
  69. if (empty($account->label))
  70. {
  71. $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
  72. $action='create'; // Force chargement page en mode creation
  73. $error++;
  74. }
  75. if (! $error)
  76. {
  77. $id = $account->create($user->id);
  78. if ($id > 0)
  79. {
  80. $_GET["id"]=$id; // Force chargement page en mode visu
  81. }
  82. else {
  83. $message='<div class="error">'.$account->error.'</div>';
  84. $action='create'; // Force chargement page en mode creation
  85. }
  86. }
  87. }
  88. if ($_POST["action"] == 'update' && ! $_POST["cancel"])
  89. {
  90. $error=0;
  91. // Update account
  92. $account = new Account($db, $_POST["id"]);
  93. $account->fetch($_POST["id"]);
  94. $account->ref = dol_string_nospecial(trim($_POST["ref"]));
  95. $account->label = trim($_POST["label"]);
  96. $account->courant = $_POST["type"];
  97. $account->clos = $_POST["clos"];
  98. $account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1;
  99. $account->url = trim($_POST["url"]);
  100. $account->bank = trim($_POST["bank"]);
  101. $account->code_banque = trim($_POST["code_banque"]);
  102. $account->code_guichet = trim($_POST["code_guichet"]);
  103. $account->number = trim($_POST["number"]);
  104. $account->cle_rib = trim($_POST["cle_rib"]);
  105. $account->bic = trim($_POST["bic"]);
  106. $account->iban_prefix = trim($_POST["iban_prefix"]);
  107. $account->domiciliation = trim($_POST["domiciliation"]);
  108. $account->proprio = trim($_POST["proprio"]);
  109. $account->adresse_proprio = trim($_POST["adresse_proprio"]);
  110. $account->account_number = trim($_POST["account_number"]);
  111. $account->currency_code = trim($_POST["account_currency_code"]);
  112. $account->fk_departement = $_POST["account_departement_id"];
  113. $account->fk_pays = $_POST["account_country_id"];
  114. $account->min_allowed = $_POST["account_min_allowed"];
  115. $account->min_desired = $_POST["account_min_desired"];
  116. $account->comment = trim($_POST["account_comment"]);
  117. if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
  118. {
  119. $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
  120. $action='edit'; // Force chargement page en mode creation
  121. $error++;
  122. }
  123. if (empty($account->label))
  124. {
  125. $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
  126. $action='edit'; // Force chargement page en mode creation
  127. $error++;
  128. }
  129. if (! $error)
  130. {
  131. $result = $account->update($user);
  132. if ($result >= 0)
  133. {
  134. $_GET["id"]=$_POST["id"]; // Force chargement page en mode visu
  135. }
  136. else
  137. {
  138. $message='<div class="error">'.$account->error.'</div>';
  139. $action='edit'; // Force chargement page edition
  140. }
  141. }
  142. }
  143. if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
  144. {
  145. // Modification
  146. $account = new Account($db, $_GET["id"]);
  147. $account->delete($_GET["id"]);
  148. header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
  149. exit;
  150. }
  151. /*
  152. * View
  153. */
  154. $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
  155. llxHeader();
  156. $form = new Form($db);
  157. $formcompany = new FormCompany($db);
  158. /* ************************************************************************** */
  159. /* */
  160. /* Affichage page en mode creation */
  161. /* */
  162. /* ************************************************************************** */
  163. if ($action == 'create')
  164. {
  165. $account=new Account($db);
  166. print_fiche_titre($langs->trans("NewFinancialAccount"));
  167. dol_htmloutput_mesg($message);
  168. if ($conf->use_javascript_ajax)
  169. {
  170. print "\n".'<script type="text/javascript" language="javascript">';
  171. print 'jQuery(document).ready(function () {
  172. jQuery("#selectaccount_country_id").change(function() {
  173. document.formsoc.action.value="create";
  174. document.formsoc.submit();
  175. });
  176. })';
  177. print '</script>'."\n";
  178. }
  179. print '<form action="'.$_SERVER["PHP_SELF"].'" name="formsoc" method="post">';
  180. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  181. print '<input type="hidden" name="action" value="add">';
  182. print '<input type="hidden" name="clos" value="0">';
  183. print '<table class="border" width="100%">';
  184. // Ref
  185. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
  186. print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$account->ref).'"></td></tr>';
  187. // Label
  188. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
  189. print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$_POST["label"].'"></td></tr>';
  190. // Type
  191. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
  192. print '<td colspan="3">';
  193. print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
  194. print '</td></tr>';
  195. // Currency
  196. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
  197. print '<td colspan="3">';
  198. $selectedcode=$account->account_currency_code;
  199. if (! $selectedcode) $selectedcode=$conf->monnaie;
  200. $form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
  201. //print $langs->trans("Currency".$conf->monnaie);
  202. //print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
  203. print '</td></tr>';
  204. // Status
  205. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Status").'</td>';
  206. print '<td colspan="3">';
  207. print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos));
  208. print '</td></tr>';
  209. // Country
  210. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Country").'</td>';
  211. print '<td colspan="3">';
  212. $selectedcode='';
  213. if (isset($_POST["account_country_id"]))
  214. {
  215. $selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$account->pays_code;
  216. }
  217. else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
  218. $form->select_pays($selectedcode,'account_country_id');
  219. if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
  220. print '</td></tr>';
  221. // State
  222. print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
  223. if ($selectedcode)
  224. {
  225. $formcompany->select_departement(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:'',$selectedcode,'account_departement_id');
  226. }
  227. else
  228. {
  229. print $countrynotdefined;
  230. }
  231. print '</td></tr>';
  232. // Accountancy code
  233. if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
  234. {
  235. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
  236. print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
  237. }
  238. else
  239. {
  240. print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
  241. print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
  242. }
  243. // Web
  244. print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
  245. print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
  246. // Comment
  247. print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
  248. print '<td colspan="3">';
  249. // Editor wysiwyg
  250. require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
  251. $doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
  252. $doleditor->Create();
  253. print '</td></tr>';
  254. // Sold
  255. print '<tr><td colspan="4"><b>'.$langs->trans("InitialBankBalance").'...</b></td></tr>';
  256. print '<tr><td valign="top">'.$langs->trans("InitialBankBalance").'</td>';
  257. print '<td colspan="3"><input size="12" type="text" class="flat" name="solde" value="'.($_POST["solde"]?$_POST["solde"]:price2num($account->solde)).'"></td></tr>';
  258. print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
  259. print '<td colspan="3">';
  260. $form->select_date(time(), 're', 0, 0, 0, 'formsoc');
  261. print '</td></tr>';
  262. print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
  263. print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_allowed" value="'.($_POST["account_min_allowed"]?$_POST["account_min_allowed"]:$account->account_min_allowed).'"></td></tr>';
  264. print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
  265. print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.($_POST["account_min_desired"]?$_POST["account_min_desired"]:$account->account_min_desired).'"></td></tr>';
  266. print '</table>';
  267. print '<center><br><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></center>';
  268. print '</form>';
  269. }
  270. /* ************************************************************************** */
  271. /* */
  272. /* Visu et edition */
  273. /* */
  274. /* ************************************************************************** */
  275. else
  276. {
  277. if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
  278. {
  279. $account = new Account($db);
  280. if ($_GET["id"])
  281. {
  282. $account->fetch($_GET["id"]);
  283. }
  284. if ($_GET["ref"])
  285. {
  286. $account->fetch(0,$_GET["ref"]);
  287. $_GET["id"]=$account->id;
  288. }
  289. /*
  290. * Affichage onglets
  291. */
  292. // Onglets
  293. $head=bank_prepare_head($account);
  294. dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"),0,'account');
  295. /*
  296. * Confirmation to delete
  297. */
  298. if ($action == 'delete')
  299. {
  300. $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
  301. if ($ret == 'html') print '<br>';
  302. }
  303. print '<table class="border" width="100%">';
  304. // Ref
  305. print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
  306. print '<td colspan="3">';
  307. print $form->showrefnav($account,'ref','',1,'ref');
  308. print '</td></tr>';
  309. // Label
  310. print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
  311. print '<td colspan="3">'.$account->label.'</td></tr>';
  312. // Type
  313. print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
  314. print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
  315. // Currency
  316. print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
  317. print '<td colspan="3">';
  318. $selectedcode=$account->account_currency_code;
  319. if (! $selectedcode) $selectedcode=$conf->monnaie;
  320. print $langs->trans("Currency".$selectedcode);
  321. print '</td></tr>';
  322. // Status
  323. print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
  324. print '<td colspan="3">'.$account->getLibStatut(4).'</td></tr>';
  325. // Country
  326. print '<tr><td>'.$langs->trans("Country").'</td><td>';
  327. if ($account->fk_pays > 0)
  328. {
  329. $img=picto_from_langcode($account->pays_code);
  330. print $img?$img.' ':'';
  331. print getCountry($account->getCountryCode(),0,$db);
  332. }
  333. print '</td></tr>';
  334. // State
  335. print '<tr><td>'.$langs->trans('State').'</td><td>';
  336. if ($account->fk_departement > 0) print getState($account->fk_departement);
  337. print '</td></tr>';
  338. // Conciliate
  339. print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
  340. print '<td colspan="3">';
  341. $conciliate=$account->canBeConciliated();
  342. if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
  343. else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
  344. else print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
  345. print '</td></tr>';
  346. // Accountancy code
  347. print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
  348. print '<td colspan="3">'.$account->account_number.'</td></tr>';
  349. print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
  350. print '<td colspan="3">'.$account->min_allowed.'</td></tr>';
  351. print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
  352. print '<td colspan="3">'.$account->min_desired.'</td></tr>';
  353. print '<tr><td valign="top">'.$langs->trans("Web").'</td><td colspan="3">';
  354. if ($account->url) print '<a href="'.$account->url.'" target="_gobank">';
  355. print $account->url;
  356. if ($account->url) print '</a>';
  357. print "</td></tr>\n";
  358. print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
  359. print '<td colspan="3">'.$account->comment.'</td></tr>';
  360. print '</table>';
  361. print '</div>';
  362. /*
  363. * Barre d'actions
  364. */
  365. print '<div class="tabsAction">';
  366. if ($user->rights->banque->configurer)
  367. {
  368. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$account->id.'">'.$langs->trans("Modify").'</a>';
  369. }
  370. $canbedeleted=$account->can_be_deleted(); // Renvoi vrai si compte sans mouvements
  371. if ($user->rights->banque->configurer && $canbedeleted)
  372. {
  373. print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$account->id.'">'.$langs->trans("Delete").'</a>';
  374. }
  375. print '</div>';
  376. }
  377. /* ************************************************************************** */
  378. /* */
  379. /* Edition */
  380. /* */
  381. /* ************************************************************************** */
  382. if (GETPOST("id") && $action == 'edit' && $user->rights->banque->configurer)
  383. {
  384. $account = new Account($db);
  385. $account->fetch(GETPOST("id"));
  386. print_fiche_titre($langs->trans("EditFinancialAccount"));
  387. print "<br>";
  388. if ($message) { print "$message<br>\n"; }
  389. if ($conf->use_javascript_ajax)
  390. {
  391. print "\n".'<script type="text/javascript" language="javascript">';
  392. print 'jQuery(document).ready(function () {
  393. jQuery("#selectaccount_country_id").change(function() {
  394. document.formsoc.action.value="edit";
  395. document.formsoc.submit();
  396. });
  397. })';
  398. print '</script>'."\n";
  399. }
  400. print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post" name="formsoc">';
  401. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  402. print '<input type="hidden" name="action" value="update">';
  403. print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">'."\n\n";
  404. print '<table class="border" width="100%">';
  405. // Ref
  406. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
  407. print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?$_POST["ref"]:$account->ref).'"></td></tr>';
  408. // Label
  409. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Label").'</td>';
  410. print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.(isset($_POST["label"])?$_POST["label"]:$account->label).'"></td></tr>';
  411. // Type
  412. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
  413. print '<td colspan="3">';
  414. print $form->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
  415. print '</td></tr>';
  416. // Currency
  417. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency");
  418. print '<input type="hidden" value="'.$account->currency_code.'">';
  419. print '</td>';
  420. print '<td colspan="3">';
  421. $selectedcode=$account->account_currency_code;
  422. if (! $selectedcode) $selectedcode=$conf->monnaie;
  423. $form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
  424. //print $langs->trans("Currency".$conf->monnaie);
  425. //print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
  426. print '</td></tr>';
  427. // Status
  428. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Status").'</td>';
  429. print '<td colspan="3">';
  430. print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos));
  431. print '</td></tr>';
  432. // Country
  433. $account->pays_id=$account->pays_id?$account->pays_id:$mysoc->pays_id;
  434. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Country").'</td>';
  435. print '<td colspan="3">';
  436. $selectedcode=$account->pays_code;
  437. if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"];
  438. else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
  439. $form->select_pays($selectedcode,'account_country_id');
  440. if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
  441. print '</td></tr>';
  442. // State
  443. print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
  444. if ($selectedcode)
  445. {
  446. $formcompany->select_departement(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:$account->fk_departement,$selectedcode,'account_departement_id');
  447. }
  448. else
  449. {
  450. print $countrynotdefined;
  451. }
  452. print '</td></tr>';
  453. // Conciliable
  454. print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
  455. print '<td colspan="3">';
  456. $conciliate=$account->canBeConciliated();
  457. if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
  458. else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
  459. else print '<input type="checkbox" class="flat" name="norappro"'.($account->rappro?'':' checked="checked"').'"> '.$langs->trans("DisableConciliation");
  460. print '</td></tr>';
  461. // Accountancy code
  462. if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
  463. {
  464. print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
  465. print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
  466. }
  467. else
  468. {
  469. print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
  470. print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
  471. }
  472. // Balance
  473. print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
  474. print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(isset($_POST["account_min_allowed"])?$_POST["account_min_allowed"]:$account->min_allowed).'"></td></tr>';
  475. print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
  476. print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"])?$_POST["account_min_desired"]:$account->min_desired).'"></td></tr>';
  477. // Web
  478. print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
  479. print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?$_POST["url"]:$account->url).'">';
  480. print '</td></tr>';
  481. // Comment
  482. print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
  483. print '<td colspan="3">';
  484. // Editor wysiwyg
  485. require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
  486. $doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
  487. $doleditor->Create();
  488. print '</td></tr>';
  489. print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("Modify").'" type="submit" class="button">';
  490. print ' &nbsp; <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
  491. print '</td></tr>';
  492. print '</table>';
  493. print '</form>';
  494. }
  495. }
  496. $db->close();
  497. llxFooter();
  498. ?>