PageRenderTime 282ms CodeModel.GetById 90ms app.highlight 75ms RepoModel.GetById 66ms app.codeStats 1ms

/htdocs/compta/bank/fiche.php

https://bitbucket.org/speedealing/speedealing
PHP | 613 lines | 406 code | 115 blank | 92 comment | 79 complexity | eb0392dd9d64d58e66aa7d575a403ef8 MD5 | raw file
  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-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
  5 * Copytight (C) 2005-2009 Regis Houssin        <regis.houssin@capnetworks.com>
  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 3 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/**
 22 *	    \file       htdocs/compta/bank/fiche.php
 23 *      \ingroup    banque
 24 *		\brief      Page to create/view a bank account
 25 */
 26
 27require 'pre.inc.php';
 28require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
 29require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
 30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
 31require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php';
 32
 33$langs->load("banks");
 34$langs->load("companies");
 35
 36$action=GETPOST("action");
 37
 38// Security check
 39if (isset($_GET["id"]) || isset($_GET["ref"]))
 40{
 41	$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
 42}
 43$fieldid = isset($_GET["ref"])?'ref':'rowid';
 44if ($user->societe_id) $socid=$user->societe_id;
 45$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
 46
 47
 48/*
 49 * Actions
 50 */
 51if ($_POST["action"] == 'add')
 52{
 53    $error=0;
 54
 55    // Create account
 56    $account = new Account($db,0);
 57
 58    $account->ref           = dol_sanitizeFileName(trim($_POST["ref"]));
 59    $account->label         = trim($_POST["label"]);
 60    $account->courant       = $_POST["type"];
 61    $account->clos          = $_POST["clos"];
 62    $account->rappro        = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1;
 63    $account->url           = $_POST["url"];
 64
 65    $account->account_number  = trim($_POST["account_number"]);
 66
 67    $account->solde           = $_POST["solde"];
 68    $account->date_solde      = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 69
 70    $account->currency_code   = trim($_POST["account_currency_code"]);
 71
 72    $account->fk_departement  = $_POST["account_departement_id"];
 73    $account->fk_pays         = $_POST["account_country_id"];
 74
 75    $account->min_allowed     = $_POST["account_min_allowed"];
 76    $account->min_desired     = $_POST["account_min_desired"];
 77    $account->comment         = trim($_POST["account_comment"]);
 78
 79    if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
 80    {
 81        $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
 82        $action='create';       // Force chargement page en mode creation
 83        $error++;
 84    }
 85
 86    if (empty($account->label))
 87    {
 88        $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
 89        $action='create';       // Force chargement page en mode creation
 90        $error++;
 91    }
 92
 93    if (! $error)
 94    {
 95        $id = $account->create($user->id);
 96        if ($id > 0)
 97        {
 98            $_GET["id"]=$id;            // Force chargement page en mode visu
 99        }
100        else {
101            $message='<div class="error">'.$account->error.'</div>';
102            $action='create';   // Force chargement page en mode creation
103        }
104    }
105}
106
107if ($_POST["action"] == 'update' && ! $_POST["cancel"])
108{
109    $error=0;
110
111    // Update account
112    $account = new Account($db, $_POST["id"]);
113    $account->fetch($_POST["id"]);
114
115    $account->ref             = dol_string_nospecial(trim($_POST["ref"]));
116    $account->label           = trim($_POST["label"]);
117    $account->courant         = $_POST["type"];
118    $account->clos            = $_POST["clos"];
119    $account->rappro          = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1;
120    $account->url             = trim($_POST["url"]);
121
122    $account->bank            = trim($_POST["bank"]);
123    $account->code_banque     = trim($_POST["code_banque"]);
124    $account->code_guichet    = trim($_POST["code_guichet"]);
125    $account->number          = trim($_POST["number"]);
126    $account->cle_rib         = trim($_POST["cle_rib"]);
127    $account->bic             = trim($_POST["bic"]);
128    $account->iban_prefix     = trim($_POST["iban_prefix"]);
129    $account->domiciliation   = trim($_POST["domiciliation"]);
130
131    $account->proprio 	      = trim($_POST["proprio"]);
132    $account->adresse_proprio = trim($_POST["adresse_proprio"]);
133
134    $account->account_number  = trim($_POST["account_number"]);
135
136    $account->currency_code   = trim($_POST["account_currency_code"]);
137
138    $account->state_id        = $_POST["account_departement_id"];
139    $account->country_id      = $_POST["account_country_id"];
140
141    $account->min_allowed     = $_POST["account_min_allowed"];
142    $account->min_desired     = $_POST["account_min_desired"];
143    $account->comment         = trim($_POST["account_comment"]);
144
145    if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
146    {
147        $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
148        $action='edit';       // Force chargement page en mode creation
149        $error++;
150    }
151
152    if (empty($account->label))
153    {
154        $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
155        $action='edit';       // Force chargement page en mode creation
156        $error++;
157    }
158
159    if (! $error)
160    {
161        $result = $account->update($user);
162        if ($result >= 0)
163        {
164            $_GET["id"]=$_POST["id"];   // Force chargement page en mode visu
165        }
166        else
167        {
168            $message='<div class="error">'.$account->error.'</div>';
169            $action='edit';     // Force chargement page edition
170        }
171    }
172}
173
174if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
175{
176    // Delete
177    $account = new Account($db);
178    $account->fetch($_GET["id"]);
179    $account->delete();
180
181    header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
182    exit;
183}
184
185
186/*
187 * View
188 */
189
190$form = new Form($db);
191$formbank = new FormBank($db);
192$formcompany = new FormCompany($db);
193
194$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
195
196llxHeader();
197
198
199// Creation
200
201if ($action == 'create')
202{
203	$account=new Account($db);
204
205	print_fiche_titre($langs->trans("NewFinancialAccount"));
206
207	dol_htmloutput_mesg($message);
208
209    if ($conf->use_javascript_ajax)
210    {
211        print "\n".'<script type="text/javascript" language="javascript">';
212        print 'jQuery(document).ready(function () {
213                    jQuery("#selectaccount_country_id").change(function() {
214                        document.formsoc.action.value="create";
215                        document.formsoc.submit();
216                    });
217               })';
218        print '</script>'."\n";
219    }
220
221	print '<form action="'.$_SERVER["PHP_SELF"].'" name="formsoc" method="post">';
222	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
223	print '<input type="hidden" name="action" value="add">';
224	print '<input type="hidden" name="clos" value="0">';
225
226	print '<table class="border" width="100%">';
227
228	// Ref
229	print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
230	print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$account->ref).'"></td></tr>';
231
232	// Label
233	print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
234	print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$_POST["label"].'"></td></tr>';
235
236	// Type
237	print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
238	print '<td colspan="3">';
239	print $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
240	print '</td></tr>';
241
242	// Currency
243	print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
244	print '<td colspan="3">';
245	$selectedcode=$account->account_currency_code;
246	if (! $selectedcode) $selectedcode=$conf->currency;
247	$form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
248	//print $langs->trans("Currency".$conf->currency);
249	//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
250	print '</td></tr>';
251
252	// Status
253    print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Status").'</td>';
254    print '<td colspan="3">';
255    print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos));
256    print '</td></tr>';
257
258	// Country
259	print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Country").'</td>';
260	print '<td colspan="3">';
261	$selectedcode='';
262	if (isset($_POST["account_country_id"]))
263	{
264		$selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$account->country_code;
265	}
266	else if (empty($selectedcode)) $selectedcode=$mysoc->country_code;
267	print $form->select_country($selectedcode,'account_country_id');
268	if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
269	print '</td></tr>';
270
271	// State
272	print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
273	if ($selectedcode)
274	{
275		$formcompany->select_departement(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:'',$selectedcode,'account_departement_id');
276	}
277	else
278	{
279		print $countrynotdefined;
280	}
281	print '</td></tr>';
282
283	// Accountancy code
284    if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
285    {
286        print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
287        print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
288    }
289    else
290    {
291        print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
292        print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
293    }
294
295	// Web
296	print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
297	print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
298
299	// Comment
300	print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
301	print '<td colspan="3">';
302    // Editor wysiwyg
303	require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
304	$doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
305	$doleditor->Create();
306	print '</td></tr>';
307
308	// Sold
309	print '<tr><td colspan="4"><b>'.$langs->trans("InitialBankBalance").'...</b></td></tr>';
310
311	print '<tr><td valign="top">'.$langs->trans("InitialBankBalance").'</td>';
312	print '<td colspan="3"><input size="12" type="text" class="flat" name="solde" value="'.($_POST["solde"]?$_POST["solde"]:price2num($account->solde)).'"></td></tr>';
313
314	print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
315	print '<td colspan="3">';
316	$form->select_date(time(), 're', 0, 0, 0, 'formsoc');
317	print '</td></tr>';
318
319	print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
320	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>';
321
322	print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
323	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>';
324
325	print '</table>';
326
327	print '<center><br><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></center>';
328
329	print '</form>';
330}
331/* ************************************************************************** */
332/*                                                                            */
333/* Visu et edition                                                            */
334/*                                                                            */
335/* ************************************************************************** */
336else
337{
338    if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
339	{
340		$account = new Account($db);
341		if ($_GET["id"])
342		{
343			$account->fetch($_GET["id"]);
344		}
345		if ($_GET["ref"])
346		{
347			$account->fetch(0,$_GET["ref"]);
348			$_GET["id"]=$account->id;
349		}
350
351		/*
352		* Affichage onglets
353		*/
354
355		// Onglets
356		$head=bank_prepare_head($account);
357		dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"),0,'account');
358
359		/*
360		* Confirmation to delete
361		*/
362		if ($action == 'delete')
363		{
364			$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
365			if ($ret == 'html') print '<br>';
366		}
367
368		print '<table class="border" width="100%">';
369
370		$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
371
372		// Ref
373		print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
374		print '<td colspan="3">';
375		print $form->showrefnav($account, 'ref', $linkback, 1, 'ref');
376		print '</td></tr>';
377
378		// Label
379		print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
380		print '<td colspan="3">'.$account->label.'</td></tr>';
381
382		// Type
383		print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
384		print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
385
386		// Currency
387		print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
388		print '<td colspan="3">';
389		$selectedcode=$account->account_currency_code;
390		if (! $selectedcode) $selectedcode=$conf->currency;
391		print $langs->trans("Currency".$selectedcode);
392		print '</td></tr>';
393
394		// Status
395		print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
396		print '<td colspan="3">'.$account->getLibStatut(4).'</td></tr>';
397
398		// Country
399		print '<tr><td>'.$langs->trans("Country").'</td><td>';
400		if ($account->fk_pays > 0)
401		{
402			$img=picto_from_langcode($account->country_code);
403			print $img?$img.' ':'';
404			print getCountry($account->getCountryCode(),0,$db);
405		}
406		print '</td></tr>';
407
408		// State
409		print '<tr><td>'.$langs->trans('State').'</td><td>';
410		if ($account->fk_departement > 0) print getState($account->fk_departement);
411		print '</td></tr>';
412
413		// Conciliate
414		print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
415		print '<td colspan="3">';
416		$conciliate=$account->canBeConciliated();
417		if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
418        else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
419		else print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
420		print '</td></tr>';
421
422		// Accountancy code
423		print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
424		print '<td colspan="3">'.$account->account_number.'</td></tr>';
425
426		print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
427		print '<td colspan="3">'.$account->min_allowed.'</td></tr>';
428
429		print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
430		print '<td colspan="3">'.$account->min_desired.'</td></tr>';
431
432		print '<tr><td valign="top">'.$langs->trans("Web").'</td><td colspan="3">';
433		if ($account->url) print '<a href="'.$account->url.'" target="_gobank">';
434		print $account->url;
435		if ($account->url) print '</a>';
436		print "</td></tr>\n";
437
438		print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
439		print '<td colspan="3">'.$account->comment.'</td></tr>';
440
441		print '</table>';
442
443		print '</div>';
444
445
446		/*
447		 * Barre d'actions
448		 */
449		print '<div class="tabsAction">';
450
451		if ($user->rights->banque->configurer)
452		{
453			print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$account->id.'">'.$langs->trans("Modify").'</a>';
454		}
455
456		$canbedeleted=$account->can_be_deleted();   // Renvoi vrai si compte sans mouvements
457		if ($user->rights->banque->configurer && $canbedeleted)
458		{
459			print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$account->id.'">'.$langs->trans("Delete").'</a>';
460		}
461
462		print '</div>';
463
464	}
465
466    /* ************************************************************************** */
467    /*                                                                            */
468    /* Edition                                                                    */
469    /*                                                                            */
470    /* ************************************************************************** */
471
472    if (GETPOST('id','int') && $action == 'edit' && $user->rights->banque->configurer)
473    {
474        $account = new Account($db);
475        $account->fetch(GETPOST('id','int'));
476
477        print_fiche_titre($langs->trans("EditFinancialAccount"));
478        print "<br>";
479
480        if ($message) { print "$message<br>\n"; }
481
482        if ($conf->use_javascript_ajax)
483        {
484            print "\n".'<script type="text/javascript" language="javascript">';
485            print 'jQuery(document).ready(function () {
486                        jQuery("#selectaccount_country_id").change(function() {
487                            document.formsoc.action.value="edit";
488                            document.formsoc.submit();
489                        });
490                   })';
491            print '</script>'."\n";
492        }
493
494        print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post" name="formsoc">';
495        print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
496        print '<input type="hidden" name="action" value="update">';
497        print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">'."\n\n";
498
499        print '<table class="border" width="100%">';
500
501		// Ref
502		print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
503		print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?$_POST["ref"]:$account->ref).'"></td></tr>';
504
505		// Label
506        print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Label").'</td>';
507        print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.(isset($_POST["label"])?$_POST["label"]:$account->label).'"></td></tr>';
508
509        // Type
510        print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
511        print '<td colspan="3">';
512		print $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
513        print '</td></tr>';
514
515		// Currency
516		print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency");
517		print '<input type="hidden" value="'.$account->currency_code.'">';
518		print '</td>';
519		print '<td colspan="3">';
520		$selectedcode=$account->account_currency_code;
521		if (! $selectedcode) $selectedcode=$conf->currency;
522		$form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
523		//print $langs->trans("Currency".$conf->currency);
524		//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
525		print '</td></tr>';
526
527		// Status
528        print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Status").'</td>';
529        print '<td colspan="3">';
530        print $form->selectarray("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos));
531        print '</td></tr>';
532
533		// Country
534		$account->country_id=$account->country_id?$account->country_id:$mysoc->country_id;
535		print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Country").'</td>';
536		print '<td colspan="3">';
537		$selectedcode=$account->country_code;
538		if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"];
539		else if (empty($selectedcode)) $selectedcode=$mysoc->country_code;
540		print $form->select_country($selectedcode,'account_country_id');
541		if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
542		print '</td></tr>';
543
544		// State
545		print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
546		if ($selectedcode)
547		{
548			print $formcompany->select_state(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:$account->fk_departement,$selectedcode,'account_departement_id');
549		}
550		else
551		{
552			print $countrynotdefined;
553		}
554		print '</td></tr>';
555
556		// Conciliable
557        print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
558        print '<td colspan="3">';
559        $conciliate=$account->canBeConciliated();
560        if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
561        else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
562        else print '<input type="checkbox" class="flat" name="norappro"'.($account->rappro?'':' checked="checked"').'"> '.$langs->trans("DisableConciliation");
563        print '</td></tr>';
564
565        // Accountancy code
566        if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
567        {
568            print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
569            print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
570        }
571        else
572        {
573            print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
574            print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
575        }
576
577		// Balance
578		print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
579		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>';
580
581		print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
582		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>';
583
584		// Web
585        print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
586        print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?$_POST["url"]:$account->url).'">';
587        print '</td></tr>';
588
589		// Comment
590		print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
591		print '<td colspan="3">';
592	   // Editor wysiwyg
593		require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
594		$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);
595		$doleditor->Create();
596		print '</td></tr>';
597
598        print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("Modify").'" type="submit" class="button">';
599        print ' &nbsp; <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
600        print '</td></tr>';
601        print '</table>';
602
603        print '</form>';
604	}
605
606}
607
608
609
610$db->close();
611
612llxFooter();
613?>