mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
New: Reorganize bank menu. Add state and country on bank accounts.
This commit is contained in:
parent
7d93be786b
commit
5ea293091b
|
|
@ -4,8 +4,8 @@ English Dolibarr ChangeLog
|
|||
|
||||
For users:
|
||||
- New: POS module allow to choose which warehouse use.
|
||||
- New: Support "Department/State" field on company setup, contact
|
||||
and members card.
|
||||
- New: Support "Department/State" field on company setup, contact,
|
||||
bank account and members card.
|
||||
- New: Can reopen a refused/canceled supplier order.
|
||||
- New: Add Gant diagramm on project module.
|
||||
- New: Add a new mode for automatic stock increase: Can be increased
|
||||
|
|
@ -40,6 +40,7 @@ For users:
|
|||
- New: IBAN value is called IFSC if country is India.
|
||||
- New: Add option to choose firstname-name or name-firstname.
|
||||
- New: Add company in fields exported by export of members tool.
|
||||
- New: Reorganise bank menu.
|
||||
- Fix: Debug experimental module widthrawal.
|
||||
- Fix: Format number was wrong for ar_AR language.
|
||||
- Fix: Can change password if has only permission change password.
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ if ($action == 'edit')
|
|||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Department
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
$htmlcompany->select_departement($adh->fk_departement,$adh->pays_code);
|
||||
print '</td></tr>';
|
||||
|
|
@ -1228,7 +1228,7 @@ if ($rowid && $action != 'edit')
|
|||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'.getCountry($adh->pays_id).'</td></tr>';
|
||||
|
||||
// Department
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$adh->departement.'</td>';
|
||||
|
||||
// Tel pro.
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||
|
||||
$langs->load("banks");
|
||||
|
||||
|
|
@ -61,6 +62,8 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||
$account->domiciliation = trim($_POST["domiciliation"]);
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
$account->adresse_proprio = trim($_POST["adresse_proprio"]);
|
||||
$account->fk_departement = trim($_POST["fk_departement"]);
|
||||
//$account->fk_pays = trim($_POST["fk_pays"]); // We do not change this.
|
||||
|
||||
if ($account->id)
|
||||
{
|
||||
|
|
@ -146,12 +149,23 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
|
|||
print $form->showrefnav($account,'ref','',1,'ref');
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||
print '<td colspan="3">'.$account->label.'</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
|
||||
|
||||
// Currency
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">'.$account->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
|
@ -182,16 +196,25 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
$ibankey="IBANNumber";
|
||||
$bickey="BICNumber";
|
||||
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
|
||||
if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
|
||||
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
|
||||
print '<td colspan="3">'.$account->bic.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||
print nl2br($account->domiciliation);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
print getCountry($account->getCountryCode());
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td><td colspan="3">';
|
||||
print $account->proprio;
|
||||
print "</td></tr>\n";
|
||||
|
|
@ -200,9 +223,6 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
|
|||
print nl2br($account->adresse_proprio);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("CountryCode").'</td><td colspan="3">';
|
||||
print $account->getCountryCode();
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -253,14 +273,25 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure
|
|||
print '<td colspan="3">'.$account->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||
print '<td colspan="3">'.$account->label;
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">'.$account->type_lib[$account->type];
|
||||
print '</td></tr>';
|
||||
|
||||
// Currency
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">'.$account->getLibStatut(4);
|
||||
print '</td></tr>';
|
||||
|
|
@ -268,7 +299,7 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure
|
|||
if ($account->type == 0 || $account->type == 1)
|
||||
{
|
||||
// If bank account
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -295,11 +326,16 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
$ibankey="IBANNumber";
|
||||
$bickey="BICNumber";
|
||||
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
|
||||
if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
|
||||
print '<td colspan="3"><input size="26" type="text" class="flat" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
|
||||
print '<td colspan="3"><input size="12" maxlength="11" type="text" class="flat" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||
|
|
@ -307,6 +343,10 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure
|
|||
print $account->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">';
|
||||
print getCountry($account->getCountryCode());
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.$account->proprio.'">';
|
||||
print '</td></tr>';
|
||||
|
|
|
|||
|
|
@ -64,6 +64,15 @@ class Account extends CommonObject
|
|||
var $iban_prefix;
|
||||
var $proprio;
|
||||
var $adresse_proprio;
|
||||
|
||||
var $fk_departement;
|
||||
var $departement_code;
|
||||
var $departement;
|
||||
|
||||
var $fk_pays;
|
||||
var $pays_code;
|
||||
var $pays;
|
||||
|
||||
var $type_lib=array();
|
||||
|
||||
var $account_number;
|
||||
|
|
@ -309,15 +318,23 @@ class Account extends CommonObject
|
|||
// Check parameters
|
||||
if (! $this->min_allowed) $this->min_allowed=0;
|
||||
if (! $this->min_desired) $this->min_desired=0;
|
||||
if (empty($this->fk_pays))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Country"));
|
||||
dol_syslog("Account::update ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (empty($this->ref))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
||||
dol_syslog("Account::update ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Chargement librairie pour acces fonction controle RIB
|
||||
require_once DOL_DOCUMENT_ROOT.'/lib/bank.lib.php';
|
||||
|
||||
if (! $this->ref)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
||||
return -1;
|
||||
}
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account (";
|
||||
$sql.= "datec";
|
||||
|
|
@ -330,8 +347,10 @@ class Account extends CommonObject
|
|||
$sql.= ", min_allowed";
|
||||
$sql.= ", min_desired";
|
||||
$sql.= ", comment";
|
||||
$sql.= ", fk_departement";
|
||||
$sql.= ", fk_pays";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->db->idate(mktime());
|
||||
$sql.= "'".$this->db->idate($now)."'";
|
||||
$sql.= ", '".addslashes($this->ref)."'";
|
||||
$sql.= ", '".addslashes($this->label)."'";
|
||||
$sql.= ", ".$conf->entity;
|
||||
|
|
@ -341,6 +360,8 @@ class Account extends CommonObject
|
|||
$sql.= ", ".price2num($this->min_allowed);
|
||||
$sql.= ", ".price2num($this->min_desired);
|
||||
$sql.= ", '".addslashes($this->comment)."'";
|
||||
$sql.= ", ".($this->fk_departement>0?"'".$this->fk_departement."'":"null");
|
||||
$sql.= ", ".$this->fk_pays;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Account::create sql=".$sql);
|
||||
|
|
@ -362,7 +383,7 @@ class Account extends CommonObject
|
|||
$sql.= ", fk_type";
|
||||
$sql.= ", rappro";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->db->idate(mktime());
|
||||
$sql.= $this->db->idate($now);
|
||||
$sql.= ", '(".$langs->trans("InitialBankBalance").")'";
|
||||
$sql.= ", ".price2num($this->solde);
|
||||
$sql.= ", '".$this->id."'";
|
||||
|
|
@ -405,10 +426,15 @@ class Account extends CommonObject
|
|||
// Check parameters
|
||||
if (! $this->min_allowed) $this->min_allowed=0;
|
||||
if (! $this->min_desired) $this->min_desired=0;
|
||||
|
||||
if (! $this->ref)
|
||||
if (empty($this->fk_pays))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Ref"));
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Country"));
|
||||
dol_syslog("Account::update ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (empty($this->ref))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
||||
dol_syslog("Account::update ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -431,6 +457,9 @@ class Account extends CommonObject
|
|||
$sql.= ",min_desired = '".price2num($this->min_desired)."'";
|
||||
$sql.= ",comment = '".addslashes($this->comment)."'";
|
||||
|
||||
$sql.= ",fk_departement = ".($this->fk_departement>0?"'".$this->fk_departement."'":"null");
|
||||
$sql.= ",fk_pays = ".$this->fk_pays;
|
||||
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
|
|
@ -481,6 +510,8 @@ class Account extends CommonObject
|
|||
$sql.= ",domiciliation='".addslashes($this->domiciliation)."'";
|
||||
$sql.= ",proprio = '".addslashes($this->proprio)."'";
|
||||
$sql.= ",adresse_proprio = '".addslashes($this->adresse_proprio)."'";
|
||||
$sql.= ",fk_departement = ".($this->fk_departement>0?"'".$this->fk_departement."'":"null");
|
||||
$sql.= ",fk_pays = ".$this->fk_pays;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
|
|
@ -509,15 +540,19 @@ class Account extends CommonObject
|
|||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
|
||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
|
||||
$sql.= " domiciliation, proprio, adresse_proprio,";
|
||||
$sql.= " account_number, currency_code,";
|
||||
$sql.= " min_allowed, min_desired, comment";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql = "SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url,";
|
||||
$sql.= " ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban,";
|
||||
$sql.= " ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays,";
|
||||
$sql.= " ba.account_number, ba.currency_code,";
|
||||
$sql.= " ba.min_allowed, ba.min_desired, ba.comment,";
|
||||
$sql.= ' p.code as pays_code, p.libelle as pays,';
|
||||
$sql.= ' d.code_departement as departement_code, d.nom as departement';
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.fk_departement = d.rowid';
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
if ($id) $sql.= " AND rowid = ".$id;
|
||||
if ($ref) $sql.= " AND ref = '".addslashes($ref)."'";
|
||||
if ($id) $sql.= " AND ba.rowid = ".$id;
|
||||
if ($ref) $sql.= " AND ba.ref = '".addslashes($ref)."'";
|
||||
|
||||
dol_syslog("Account::fetch sql=".$sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
|
@ -549,6 +584,14 @@ class Account extends CommonObject
|
|||
$this->proprio = $obj->proprio;
|
||||
$this->adresse_proprio = $obj->adresse_proprio;
|
||||
|
||||
$this->fk_departement = $obj->fk_departement;
|
||||
$this->departement_code= $obj->departement_code;
|
||||
$this->departement = $obj->departement;
|
||||
|
||||
$this->fk_pays = $obj->fk_pays;
|
||||
$this->pays_code = $obj->pays_code;
|
||||
$this->pays = $obj->pays;
|
||||
|
||||
$this->account_number = $obj->account_number;
|
||||
|
||||
$this->currency_code = $obj->currency_code;
|
||||
|
|
@ -824,21 +867,24 @@ class Account extends CommonObject
|
|||
/**
|
||||
* \brief Return account country code
|
||||
* \return String country code
|
||||
* TODO Manage field with country in bank_account
|
||||
*/
|
||||
function getCountryCode()
|
||||
{
|
||||
global $mysoc;
|
||||
|
||||
// We return country code of bank account
|
||||
if (! empty($this->pays_code)) return $this->pays_code;
|
||||
|
||||
// For backward compatibility, we try to guess country from other information
|
||||
if (! empty($this->iban))
|
||||
{
|
||||
if ($mysoc->pays_code === 'IN') return $mysoc->pays_code; // Test before to use IBAN
|
||||
if ($mysoc->pays_code === 'IN') return $mysoc->pays_code; // Test to know if we can trust IBAN
|
||||
|
||||
// If IBAN defined, we can know country of account from it
|
||||
if (preg_match("/^([a-zA-Z][a-zA-Z])/i",$this->iban,$reg)) return $reg[1];
|
||||
}
|
||||
|
||||
// We return country code
|
||||
// We return country code of company
|
||||
if (! empty($mysoc->pays_code)) return $mysoc->pays_code;
|
||||
|
||||
return '';
|
||||
|
|
|
|||
|
|
@ -28,8 +28,11 @@
|
|||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
|
|
@ -62,7 +65,9 @@ if ($_POST["action"] == 'add')
|
|||
$account->date_solde = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
|
||||
|
||||
$account->currency_code = trim($_POST["account_currency_code"]);
|
||||
$account->country_code = trim($_POST["account_country_code"]);
|
||||
|
||||
$account->fk_departement = $_POST["account_departement_id"];
|
||||
$account->fk_pays = $_POST["account_country_id"];
|
||||
|
||||
$account->min_allowed = $_POST["account_min_allowed"];
|
||||
$account->min_desired = $_POST["account_min_desired"];
|
||||
|
|
@ -77,11 +82,11 @@ if ($_POST["action"] == 'add')
|
|||
}
|
||||
else {
|
||||
$message='<div class="error">'.$account->error().'</div>';
|
||||
$_GET["action"]='create'; // Force chargement page en mode creation
|
||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
||||
}
|
||||
} else {
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||
$_GET["action"]='create'; // Force chargement page en mode creation
|
||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +118,10 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||
$account->account_number = trim($_POST["account_number"]);
|
||||
|
||||
$account->currency_code = trim($_POST["account_currency_code"]);
|
||||
$account->country_code = trim($_POST["account_country_code"]);
|
||||
|
||||
$account->fk_departement = $_POST["account_departement_id"];
|
||||
$account->fk_pays = $_POST["account_country_id"];
|
||||
|
||||
|
||||
$account->min_allowed = $_POST["account_min_allowed"];
|
||||
$account->min_desired = $_POST["account_min_desired"];
|
||||
|
|
@ -129,11 +137,11 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||
else
|
||||
{
|
||||
$message='<div class="error">'.$account->error().'</div>';
|
||||
$_GET["action"]='edit'; // Force chargement page edition
|
||||
$_REQUEST["action"]='edit'; // Force chargement page edition
|
||||
}
|
||||
} else {
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||
$_GET["action"]='create'; // Force chargement page en mode creation
|
||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -152,9 +160,12 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user-
|
|||
* View
|
||||
*/
|
||||
|
||||
$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$htmlcompany = new FormCompany($db);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
|
|
@ -162,13 +173,15 @@ $form = new Form($db);
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_GET["action"] == 'create')
|
||||
if ($_REQUEST["action"] == 'create')
|
||||
{
|
||||
$account=new Account($db);
|
||||
|
||||
print_fiche_titre($langs->trans("NewFinancialAccount"));
|
||||
|
||||
if ($message) { print "$message<br>\n"; }
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="createbankaccount" method="post">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="formsoc" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="clos" value="0">';
|
||||
|
|
@ -179,9 +192,11 @@ if ($_GET["action"] == 'create')
|
|||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.$account->ref.'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$_POST["label"].'"></td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
||||
|
|
@ -201,21 +216,42 @@ if ($_GET["action"] == 'create')
|
|||
// Currency
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
$form->select_currency($selectedcode, 'account_currency_code');
|
||||
$form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
|
||||
//print $langs->trans("Currency".$conf->monnaie);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Pays
|
||||
// Status
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$form->select_array("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Country").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_country_code;
|
||||
if (! $selectedcode) $selectedcode=$mysoc->pays_code;
|
||||
$form->select_pays($selectedcode, 'account_country_code');
|
||||
$selectedcode='';
|
||||
if (isset($_POST["account_country_id"]))
|
||||
{
|
||||
$selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$account->pays_code;
|
||||
}
|
||||
else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
|
||||
$form->select_pays($selectedcode,'account_country_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_create()"':'');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
||||
if ($selectedcode)
|
||||
{
|
||||
$htmlcompany->select_departement(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:'',$selectedcode,'account_departement_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $countrynotdefined;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Web
|
||||
|
|
@ -248,7 +284,7 @@ if ($_GET["action"] == 'create')
|
|||
|
||||
print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$form->select_date(time(), 're', 0, 0, 0, 'createbankaccount');
|
||||
$form->select_date(time(), 're', 0, 0, 0, 'formsoc');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
|
|
@ -268,7 +304,7 @@ if ($_GET["action"] == 'create')
|
|||
/* ************************************************************************** */
|
||||
else
|
||||
{
|
||||
if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
|
||||
if (($_GET["id"] || $_GET["ref"]) && $_REQUEST["action"] != 'edit')
|
||||
{
|
||||
$account = new Account($db);
|
||||
if ($_GET["id"])
|
||||
|
|
@ -292,7 +328,7 @@ else
|
|||
/*
|
||||
* Confirmation to delete
|
||||
*/
|
||||
if ($_GET["action"] == 'delete')
|
||||
if ($_REQUEST["action"] == 'delete')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
||||
if ($ret == 'html') print '<br>';
|
||||
|
|
@ -306,15 +342,37 @@ else
|
|||
print $form->showrefnav($account,'ref','',1,'ref');
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||
print '<td colspan="3">'.$account->label.'</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
|
||||
|
||||
// Currency
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">'.$account->getLibStatut(4).'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
||||
if ($account->fk_pays > 0) print getCountry($account->fk_pays);
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($account->fk_departement > 0) print getState($account->fk_departement);
|
||||
print '</td></tr>';
|
||||
|
||||
// Conciliate
|
||||
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if ($account->type == 0 || $account->type == 1) print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
|
||||
|
|
@ -328,16 +386,6 @@ else
|
|||
print '<td colspan="3">'.$account->account_number.'</td></tr>';
|
||||
}
|
||||
|
||||
// Currency
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
print '<td colspan="3">'.$account->min_allowed.'</td></tr>';
|
||||
|
||||
|
|
@ -385,40 +433,78 @@ else
|
|||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configurer)
|
||||
if ($_REQUEST["id"] && $_REQUEST["action"] == 'edit' && $user->rights->banque->configurer)
|
||||
{
|
||||
$account = new Account($db, $_GET["id"]);
|
||||
$account->fetch($_GET["id"]);
|
||||
$account = new Account($db, $_REQUEST["id"]);
|
||||
$account->fetch($_REQUEST["id"]);
|
||||
|
||||
print_titre($langs->trans("EditFinancialAccount"));
|
||||
print_fiche_titre($langs->trans("EditFinancialAccount"));
|
||||
print "<br>";
|
||||
|
||||
if ($message) { print "$message<br>\n"; }
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post" name="formsoc">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">'."\n\n";
|
||||
print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">'."\n\n";
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td valign="top">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.$account->ref.'"></td></tr>';
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?$_POST["ref"]:$account->ref).'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$account->label.'"></td></tr>';
|
||||
// Label
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.(isset($_POST["label"])?$_POST["label"]:$account->label).'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||
// Type
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->select_type_comptes_financiers($account->type,"type");
|
||||
print $form->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type");
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
// Currency
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency");
|
||||
print '<input type="hidden" value="'.$account->currency_code.'">';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
$form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
|
||||
//print $langs->trans("Currency".$conf->monnaie);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$form->select_array("clos",array(0=>$account->status[0],1=>$account->status[1]),$account->clos);
|
||||
$form->select_array("clos",array(0=>$account->status[0],1=>$account->status[1]),(isset($_POST["clos"])?$_POST["clos"]:$account->clos));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
$account->pays_id=$account->pays_id?$account->pays_id:$mysoc->pays_id;
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Country").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->pays_code;
|
||||
if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"];
|
||||
else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
|
||||
$form->select_pays($selectedcode,'account_country_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_edit()"':'');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
||||
if ($selectedcode)
|
||||
{
|
||||
$htmlcompany->select_departement(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:$account->fk_departement,$selectedcode,'account_departement_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
print $countrynotdefined;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if ($account->type == 0 || $account->type == 1) print '<input type="checkbox" class="flat" name="norappro" '.($account->rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation");
|
||||
|
|
@ -429,36 +515,23 @@ else
|
|||
if ($conf->accounting->enabled)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="hidden" name="account_number" value="'.$account->account_number.'">';
|
||||
print '<input type="hidden" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'">';
|
||||
}
|
||||
|
||||
// Currency
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency");
|
||||
print '<input type="hidden" value="'.$account->currency_code.'">';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
$form->select_currency($selectedcode, 'account_currency_code');
|
||||
//print $langs->trans("Currency".$conf->monnaie);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Balance
|
||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_allowed" value="'.$account->min_allowed.'"></td></tr>';
|
||||
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>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.$account->min_desired.'"></td></tr>';
|
||||
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>';
|
||||
|
||||
// Web
|
||||
print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
|
||||
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$account->url.'">';
|
||||
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?$_POST["url"]:$account->url).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Comment
|
||||
|
|
@ -468,13 +541,13 @@ else
|
|||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('account_comment',$account->comment,200,'dolibarr_notes','',false);
|
||||
$doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),200,'dolibarr_notes','',false);
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<textarea class="flat" name="account_comment" cols="70" rows="10">';
|
||||
print dol_htmlentitiesbr_decode($account->comment).'</textarea>';
|
||||
print dol_htmlentitiesbr_decode(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment).'</textarea>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -40,33 +40,6 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||
|
||||
$menu = new Menu();
|
||||
if ($user->rights->banque->lire)
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add(DOL_URL_ROOT."/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,0,$user->rights->banque->lire);
|
||||
/*
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
if ($objp->courant != 2) $menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire);
|
||||
|
|
@ -92,6 +65,37 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||
$menu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
|
||||
}
|
||||
|
||||
// Entry for each bank account
|
||||
if ($user->rights->banque->lire)
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
/*
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
if ($objp->courant != 2) $menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -40,33 +40,6 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||
|
||||
$menu = new Menu();
|
||||
if ($user->rights->banque->lire)
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add(DOL_URL_ROOT."/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,0,$user->rights->banque->lire);
|
||||
/*
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
if ($objp->courant != 2) $menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire);
|
||||
|
|
@ -92,6 +65,37 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||
$menu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
|
||||
}
|
||||
|
||||
// Entry for each bank account
|
||||
if ($user->rights->banque->lire)
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
/*
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
if ($objp->courant != 2) $menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,15 +182,15 @@ class FormCompany
|
|||
* \remarks La cle de la liste est le code (il peut y avoir plusieurs entree pour
|
||||
* un code donnee mais dans ce cas, le champ pays differe).
|
||||
* Ainsi les liens avec les departements se font sur un departement independemment de son nom.
|
||||
* \param selected Code forme juridique a preselectionne
|
||||
* \param pays_code 0=liste tous pays confondus, sinon code du pays a afficher
|
||||
* \param selected Code state preselected
|
||||
* \param pays_code 0=list for all countries, otherwise country code or country rowid to show
|
||||
* \param departement_id Id of department
|
||||
*/
|
||||
function select_departement($selected='',$pays_code=0, $htmlname='departement_id')
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
dol_syslog("Form::select_departement selected=$selected, pays_code=$pays_code",LOG_DEBUG);
|
||||
dol_syslog("FormCompany::select_departement selected=$selected, pays_code=$pays_code",LOG_DEBUG);
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
|
|
@ -199,10 +199,11 @@ class FormCompany
|
|||
$sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_pays as p";
|
||||
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid";
|
||||
$sql .= " AND d.active = 1 AND r.active = 1 AND p.active = 1";
|
||||
if ($pays_code) $sql .= " AND p.code = '".$pays_code."'";
|
||||
if ($pays_code && is_numeric($pays_code)) $sql .= " AND p.rowid = '".$pays_code."'";
|
||||
if ($pays_code && ! is_numeric($pays_code)) $sql .= " AND p.code = '".$pays_code."'";
|
||||
$sql .= " ORDER BY p.code, d.code_departement";
|
||||
|
||||
dol_syslog("Form::select_departement sql=".$sql);
|
||||
dol_syslog("FormCompany::select_departement sql=".$sql);
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
|
@ -210,7 +211,7 @@ class FormCompany
|
|||
if ($pays_code) print '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
dol_syslog("Form::select_departement num=$num",LOG_DEBUG);
|
||||
dol_syslog("FormCompany::select_departement num=$num",LOG_DEBUG);
|
||||
if ($num)
|
||||
{
|
||||
$pays='';
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
-- V4.1 UPDATE llx_projet_task set fk_user_creat=NULL WHERE fk_user_creat IS NOT NULL AND fk_user_creat NOT IN (SELECT rowid from llx_user);
|
||||
-- V4.1 UPDATE llx_projet_task set fk_user_valid=NULL WHERE fk_user_valid IS NOT NULL AND fk_user_valid NOT IN (SELECT rowid from llx_user);
|
||||
|
||||
ALTER table llx_bank_account ADD COLUMN fk_pays integer DEFAULT 0 after domiciliation;
|
||||
|
||||
ALTER table llx_bank_account ADD COLUMN fk_pays integer DEFAULT 0 NOT NULL after domiciliation;
|
||||
ALTER TABLE llx_bank_account ADD COLUMN fk_departement integer DEFAULT NULL after domiciliation;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN fk_departement integer DEFAULT NULL after ville;
|
||||
ALTER TABLE llx_adherent ADD COLUMN fk_departement integer DEFAULT NULL after ville;
|
||||
ALTER TABLE llx_entrepot ADD COLUMN fk_departement integer DEFAULT NULL after ville;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ create table llx_bank_account
|
|||
country_iban varchar(2), -- deprecated
|
||||
cle_iban varchar(2),
|
||||
domiciliation varchar(255),
|
||||
fk_pays integer DEFAULT 0,
|
||||
fk_departement integer DEFAULT NULL,
|
||||
fk_pays integer NOT NULL,
|
||||
proprio varchar(60),
|
||||
adresse_proprio varchar(255),
|
||||
courant smallint DEFAULT 0 NOT NULL,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ LastAccountStatements=Last account statements
|
|||
Rapprochement=Reconciliate
|
||||
IOMonthlyReporting=Monthly reporting
|
||||
BankAccountDomiciliation=Account address
|
||||
BankAccountCountry=Account country
|
||||
BankAccountOwner=Account owner name
|
||||
BankAccountOwnerAddress=Account owner address
|
||||
RIBControlError=Inetgrity checks of values fails. This means information for this account number are not complete or wrong (check country, numbers and IBAN).
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ LastAccountStatements=Derniers relevés bancaires
|
|||
Rapprochement=Rapprochement
|
||||
IOMonthlyReporting=Rapport mensuel E/S
|
||||
BankAccountDomiciliation=Domiciliation du compte
|
||||
BankAccountCountry=Pays du compte
|
||||
BankAccountOwner=Nom du propriétaire du compte
|
||||
BankAccountOwnerAddress=Adresse du propriétaire du compte
|
||||
RIBControlError=Les contrôles indiquent que les informations de ce compte bancaire sont incomplètes ou incorrectes (vérifier le pays, les numéros de compte ou IBAN).
|
||||
|
|
|
|||
|
|
@ -180,8 +180,8 @@ function societe_prepare_head2($objsoc)
|
|||
|
||||
|
||||
/**
|
||||
* \brief Return country translated from an id
|
||||
* \param id id of country
|
||||
* \brief Return country translated from an id or a code
|
||||
* \param id id or code of country
|
||||
* \param withcode 0=Return label, 1=Return code + label, 2=Return code
|
||||
* \return string String with country code or translated country name
|
||||
*/
|
||||
|
|
@ -190,7 +190,8 @@ function getCountry($id,$withcode=0)
|
|||
global $db,$langs;
|
||||
|
||||
$sql = "SELECT rowid, code, libelle FROM ".MAIN_DB_PREFIX."c_pays";
|
||||
$sql.= " WHERE rowid=".$id;
|
||||
if (is_numeric($id)) $sql.= " WHERE rowid=".$id;
|
||||
else $sql.= " WHERE code='".$id."'";
|
||||
|
||||
dol_syslog("Company.lib::getCountry sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user