New: Ajout caractristique "rapprochable" sur les comptes bancaires.
Uniformisation page des journaux de comptes Debuggage de la fonction des graphiques de solde
This commit is contained in:
parent
d4f43f1fed
commit
7583146b73
@ -43,6 +43,8 @@ class Account
|
||||
var $type;
|
||||
var $bank;
|
||||
var $clos;
|
||||
var $rappro;
|
||||
|
||||
var $code_banque;
|
||||
var $code_guichet;
|
||||
var $number;
|
||||
@ -68,6 +70,9 @@ class Account
|
||||
$this->type_lib[1]=$langs->trans("BankType1");
|
||||
$this->type_lib[2]=$langs->trans("BankType2");
|
||||
|
||||
$this->status[0]=$langs->trans("StatusAccountOpened");
|
||||
$this->status[1]=$langs->trans("StatusAccountClosed");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -76,6 +81,8 @@ class Account
|
||||
*/
|
||||
function deleteline($rowid)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=$rowid";
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -84,6 +91,8 @@ class Account
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=$rowid";
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -236,7 +245,7 @@ class Account
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_account");
|
||||
if ( $this->update() )
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, label, amount, fk_account,datev,dateo,fk_type,rappro) ";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, label, amount, fk_account, datev, dateo, fk_type, rappro) ";
|
||||
$sql .= " VALUES (now(),'".$langs->trans("Balance")."','" . ereg_replace(',','.',$this->solde) . "','$this->id','".$this->db->idate($this->date_solde)."','".$this->db->idate($this->date_solde)."','SOLD',1);";
|
||||
$this->db->query($sql);
|
||||
}
|
||||
@ -288,6 +297,7 @@ class Account
|
||||
$sql .= ",adresse_proprio = '".$this->adresse_proprio."'";
|
||||
$sql .= ",courant = ".$this->courant;
|
||||
$sql .= ",clos = ".$this->clos;
|
||||
$sql .= ",rappro = ".$this->rappro;
|
||||
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
@ -310,8 +320,9 @@ class Account
|
||||
function fetch($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
$sql = "SELECT rowid, label, bank, number, courant, clos, code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql .= " WHERE rowid = ".$id;
|
||||
$sql = "SELECT rowid, label, bank, number, courant, clos, rappro,";
|
||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -326,6 +337,8 @@ class Account
|
||||
$this->courant = $obj->courant;
|
||||
$this->bank = $obj->bank;
|
||||
$this->clos = $obj->clos;
|
||||
$this->rappro = $obj->rappro;
|
||||
|
||||
$this->code_banque = $obj->code_banque;
|
||||
$this->code_guichet = $obj->code_guichet;
|
||||
$this->number = $obj->number;
|
||||
|
||||
@ -40,7 +40,7 @@ $vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"];
|
||||
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
||||
$page=isset($_GET["page"])?$_GET["page"]:0;
|
||||
|
||||
if ($_POST["action"] == 'add' && $account)
|
||||
if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]))
|
||||
{
|
||||
|
||||
if ($_POST["credit"] > 0)
|
||||
@ -100,21 +100,24 @@ if ($account > 0)
|
||||
$acct = new Account($db);
|
||||
$acct->fetch($account);
|
||||
|
||||
// Chargement des categories dans $options
|
||||
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
// Chargement des categories dans $options
|
||||
$nbcategories=0;
|
||||
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$var=True;
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$options = "<option value=\"0\" selected></option>";
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||
}
|
||||
$db->free($result);
|
||||
$var=True;
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$options = "<option value=\"0\" selected></option>";
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
|
||||
$nbcategories++;
|
||||
$i++;
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -190,131 +193,150 @@ if ($account > 0)
|
||||
{
|
||||
$mesg.= '<a href="account.php?account='.$acct->id.'&page='.($page-1).'">'.img_next().'</a>';
|
||||
}
|
||||
print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg);
|
||||
|
||||
|
||||
print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg);
|
||||
|
||||
print '<br>';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<br>';
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
|
||||
/*
|
||||
* Affiche tableau des transactions bancaires
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Affiche tableau des transactions bancaires
|
||||
*
|
||||
*/
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Value").'</td><td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td><td align="right">'.$langs->trans("BankBalance").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($acct->type != 2) print $langs->trans("AccountStatement");
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<form method="post" action="account.php">';
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
print '<input type="hidden" name="account" value="' . $acct->id . '">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
|
||||
|
||||
print '<td colspan="3"><a href="graph.php?id='.$acct->id.'">Graph</a></td>';
|
||||
print '<td><input type="text" class="flat" name="req_desc" value="'.$_POST["req_desc"].'" size="40"></td>';
|
||||
|
||||
print '<td align="right"><input type="text" class="flat" name="req_debit" value="'.$_POST["req_debit"].'" size="6"></td>';
|
||||
print '<td align="right"><input type="text" class="flat" name="req_credit" value="'.$_POST["req_credit"].'" size="6"></td>';
|
||||
print '<td align="center"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'"></td>';
|
||||
print '<td align="center">';
|
||||
if ($user->rights->banque->modifier && $acct->type != 2) // Si non compte cash
|
||||
// Formulaire de saisie d'une opération hors factures
|
||||
if ($user->rights->banque->modifier && $_GET["action"]=='rappro')
|
||||
{
|
||||
print '<a class="tabAction" href="rappro.php?account='.$acct->id.'">'.$langs->trans("Rappro").'</a>';
|
||||
$html=new Form($db);
|
||||
|
||||
print '<form method="post" action="account.php">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="vline" value="' . $vline . '">';
|
||||
print '<input type="hidden" name="account" value="' . $acct->id . '">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td align="left" colspan="8"><b>Saisie d\'une écriture manuelle hors facture</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td><small>YYYY MMDD</small></td><td colspan="2"> </td><td>'.$langs->trans("Description").'</td><td align=right>0000.00</td><td align=right>0000.00</td>';
|
||||
print '<td colspan="2" align="center"> ';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td nowrap>';
|
||||
print '<input name="dateoy" class="flat" type="text" size="2" value="'.strftime("%Y",time()).'" maxlength="4">';
|
||||
print '<input name="dateo" class="flat" type="text" size="2" maxlength="4"></td>';
|
||||
print '<td colspan="2" nowrap>';
|
||||
$html->select_types_paiements('','operation','1,2',1);
|
||||
print '<input name="num_chq" class="flat" type="text" size="4"></td>';
|
||||
print '<td>';
|
||||
print '<input name="label" class="flat" type="text" size="40">';
|
||||
if ($nbcategories)
|
||||
{
|
||||
print '<br>'.$langs->trans("Category").': <select class="flat" name="cat1">'.$options.'</select>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align=right><input name="debit" class="flat" type="text" size="6"></td>';
|
||||
print '<td align=right><input name="credit" class="flat" type="text" size="6"></td>';
|
||||
print '<td colspan="2" align="center">';
|
||||
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Add").'"><br>';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
print "</form>";
|
||||
|
||||
print "<tr class=\"noborder\"><td colspan=\"8\"> </td></tr>\n";
|
||||
}
|
||||
else
|
||||
|
||||
// Ligne de titre
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Value").'</td><td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td>';
|
||||
print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>';
|
||||
print '<td align="center" width="60">';
|
||||
if ($acct->type != 2 && $acct->rappro) print $langs->trans("AccountStatement");
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<form method="post" action="account.php">';
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
print '<input type="hidden" name="account" value="' . $acct->id . '">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3"><a href="graph.php?id='.$acct->id.'">Graph</a></td>';
|
||||
print '<td><input type="text" class="flat" name="req_desc" value="'.$_POST["req_desc"].'" size="40"></td>';
|
||||
print '<td align="right"><input type="text" class="flat" name="req_debit" value="'.$_POST["req_debit"].'" size="6"></td>';
|
||||
print '<td align="right"><input type="text" class="flat" name="req_credit" value="'.$_POST["req_credit"].'" size="6"></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="center" width="40"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'"></td>';
|
||||
print "</tr>\n";
|
||||
print "</form>\n";
|
||||
|
||||
/* Another solution
|
||||
* create temporary table solde type=heap select amount from llx_bank limit 100 ;
|
||||
* select sum(amount) from solde ;
|
||||
*/
|
||||
|
||||
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b ";
|
||||
$sql .= " WHERE fk_account=".$acct->id;
|
||||
|
||||
if ($req_debit)
|
||||
{
|
||||
print " ";
|
||||
$sql .= " AND b.amount = -".$req_debit;
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
print "</form>\n";
|
||||
|
||||
/* Another solution
|
||||
* create temporary table solde type=heap select amount from llx_bank limit 100 ;
|
||||
* select sum(amount) from solde ;
|
||||
*/
|
||||
|
||||
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b ";
|
||||
$sql .= " WHERE fk_account=".$acct->id;
|
||||
|
||||
if ($req_debit)
|
||||
{
|
||||
$sql .= " AND b.amount = -".$req_debit;
|
||||
}
|
||||
|
||||
$sql .= $sql_rech;
|
||||
|
||||
if ($vue)
|
||||
|
||||
$sql .= $sql_rech;
|
||||
|
||||
if ($vue)
|
||||
{
|
||||
if ($vue == 'credit')
|
||||
{
|
||||
$sql .= " AND b.amount >= 0 ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= " AND b.amount < 0 ";
|
||||
}
|
||||
if ($vue == 'credit')
|
||||
{
|
||||
$sql .= " AND b.amount >= 0 ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= " AND b.amount < 0 ";
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY b.datev ASC";
|
||||
$sql .= $db->plimit($limitsql, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
||||
$sql .= " ORDER BY b.datev ASC";
|
||||
$sql .= $db->plimit($limitsql, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
_print_lines($db, $result, $sql, $acct);
|
||||
$db->free($result);
|
||||
_print_lines($db, $result, $sql, $acct);
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
/*
|
||||
* Formulaire de saisie d'une opération hors factures
|
||||
*
|
||||
*/
|
||||
if ($user->rights->banque->modifier)
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
if ($_GET["action"] != 'rappro')
|
||||
{
|
||||
$html=new Form($db);
|
||||
|
||||
print '<form method="post" action="account.php">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="vline" value="' . $vline . '">';
|
||||
print '<input type="hidden" name="account" value="' . $acct->id . '">';
|
||||
print "<tr class=\"noborder\"><td colspan=\"8\"> </td></tr>\n";
|
||||
|
||||
print "<tr>";
|
||||
print "<td align=\"left\" colspan=\"8\"><b>Saisie d'une transaction hors facture</b></td></tr>";
|
||||
print '<tr>';
|
||||
print '<td><small>YYYY MMDD</small></td><td colspan="2"> </td><td>'.$langs->trans("Description").'</td><td align=right>0000.00</td><td align=right>0000.00</td>';
|
||||
print '<td colspan="2" align="center">';
|
||||
print '<select class="flat" name="cat1">'.$options.'</select>';
|
||||
print '</td></tr>';
|
||||
print '<tr>';
|
||||
print '<td nowrap>';
|
||||
print '<input name="dateoy" class="flat" type="text" size="2" value="'.strftime("%Y",time()).'" maxlength="4">';
|
||||
print '<input name="dateo" class="flat" type="text" size="2" maxlength="4"></td>';
|
||||
print '<td colspan="2" nowrap>';
|
||||
$html->select_types_paiements('','operation','1,2',1);
|
||||
print '<input name="num_chq" class="flat" type="text" size="4"></td>';
|
||||
print '<td>';
|
||||
print '<input name="label" class="flat" type="text" size="40"></td>';
|
||||
|
||||
print '<td align=right><input name="debit" class="flat" type="text" size="6"></td>';
|
||||
print '<td align=right><input name="credit" class="flat" type="text" size="6"></td>';
|
||||
print '<td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '</td></tr>';
|
||||
print "</form>";
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->banque->modifier && $acct->type != 2 && $acct->rappro) // Si non compte cash et rapprochable
|
||||
{
|
||||
print '<a class="tabAction" href="rappro.php?account='.$acct->id.'">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
print '<a class="tabAction" href="account.php?action=rappro&account='.$acct->id.'&page='.$page.'">'.$langs->trans("AddBankRecord").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print '<br>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -356,8 +378,8 @@ function _print_lines($db,$result,$sql,$acct)
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td nowrap>".dolibarr_print_date($objp->do,"%d/%m/%y")."</td>\n";
|
||||
print "<td nowrap>".dolibarr_print_date($objp->dv,"%d/%m/%y")."</td>\n";
|
||||
print "<td nowrap>".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
||||
print "<td nowrap> ".dolibarr_print_date($objp->dv,"%d/%m/%y")."</td>\n";
|
||||
print "<td nowrap> ".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
||||
print "<td><a href=\"ligne.php?rowid=$objp->rowid&account=$acct->id\">$objp->label</a>";
|
||||
/*
|
||||
* Ajout les liens
|
||||
@ -378,18 +400,18 @@ function _print_lines($db,$result,$sql,$acct)
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td> </td><td align=\"right\" nowrap>".price($objp->amount)."</td>\n";
|
||||
print "<td> </td><td align=\"right\" nowrap> ".price($objp->amount)."</td>\n";
|
||||
}
|
||||
|
||||
if ($action !='search')
|
||||
{
|
||||
if ($total > 0)
|
||||
if ($total >= 0)
|
||||
{
|
||||
print '<td align="right" nowrap>'.price($total)."</td>\n";
|
||||
print '<td align="right" nowrap> '.price($total).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"right\" nowrap><b>".price($total)."</b></td>\n";
|
||||
print '<td align="right" class="error" nowrap> '.price($total).'</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -397,9 +419,10 @@ function _print_lines($db,$result,$sql,$acct)
|
||||
print '<td align="right">-</td>';
|
||||
}
|
||||
|
||||
if ($objp->rappro && $acct->type != 2) // Si non compte cash)
|
||||
// Relevé rappro ou lien edition
|
||||
if ($objp->rappro && $acct->type != 2) // Si non compte cash
|
||||
{
|
||||
print "<td align=\"center\">";
|
||||
print "<td align=\"center\" nowrap> ";
|
||||
print "<a href=\"releve.php?num=$objp->num_releve&account=$acct->id\">$objp->num_releve</a>";
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -39,12 +39,13 @@ print_titre($langs->trans("AccountSetup"));
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td>".$langs->trans("Ref")."</td><td>".$langs->trans("Label")."</td><td>".$langs->trans("Type")."</td><td>".$langs->trans("Bank")."</td>";
|
||||
print "<td align=\"left\">".$langs->trans("Numero")."</a></td>";
|
||||
print "<td align=\"center\">".$langs->trans("Closed")."</a></td>";
|
||||
print '<td>'.$langs->trans("Ref")."</td><td>".$langs->trans("Label")."</td><td>".$langs->trans("Type")."</td><td>".$langs->trans("Bank").'</td>';
|
||||
print '<td align="left">'.$langs->trans("AccountIdShort").'</a></td>';
|
||||
print '<td align="center">'.$langs->trans("Conciliable").'</a></td>';
|
||||
print '<td align="center">'.$langs->trans("Status").'</a></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT rowid, label, number, bank, courant as type, clos";
|
||||
$sql = "SELECT rowid, label, number, bank, courant as type, clos, rappro";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
@ -66,7 +67,9 @@ if ($result)
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>$objp->rowid</td><td><a href=\"fiche.php?id=$objp->rowid\">$objp->label</a></td>";
|
||||
print '<td>'.$account->type_lib[$objp->type].'</td>';
|
||||
print "<td>$objp->bank </td><td>$objp->number </td><td align=\"center\">".yn($objp->clos)."</td></tr>";
|
||||
print '<td>'.$objp->bank.' </td><td>'.$objp->number.' </td>';
|
||||
print '<td align="center">'.yn($objp->rappro).'</td>';
|
||||
print '<td align="center">'.$account->status[$objp->clos].'</td></tr>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -49,6 +49,7 @@ if ($_POST["action"] == 'add')
|
||||
$account->label = trim($_POST["label"]);
|
||||
$account->courant = $_POST["type"];
|
||||
$account->clos = $_POST["clos"];
|
||||
$account->rappro = $_POST["norappro"]?1:0;
|
||||
|
||||
$account->bank = trim($_POST["bank"]);
|
||||
$account->code_banque = $_POST["code_banque"];
|
||||
@ -89,6 +90,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
$account->label = trim($_POST["label"]);
|
||||
$account->courant = $_POST["type"];
|
||||
$account->clos = $_POST["clos"];
|
||||
$account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"]=='on')?0:1;
|
||||
|
||||
$account->bank = $_POST["bank"];
|
||||
$account->code_banque = $_POST["code_banque"];
|
||||
@ -154,7 +156,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("LabelBankCashAccount").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" name="label" value="'.$_POST["label"].'"></td></tr>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$_POST["label"].'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">';
|
||||
@ -163,7 +165,7 @@ if ($_GET["action"] == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("InitialBankBalance").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" name="solde" value="0.00"></td></tr>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="solde" value="0.00"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">'; $now=time();
|
||||
@ -172,32 +174,35 @@ if ($_GET["action"] == 'create')
|
||||
print '<input type="text" size="4" maxlength="4" name="reyear" value="'.strftime("%Y",$now).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top"> </td>';
|
||||
print '<td colspan="3"><input type="checkbox" name="norappro" value="'.$_POST["norappro"].'"> '.$langs->trans("DisableConciliation").'</td></tr>';
|
||||
|
||||
print '<tr><td colspan="4"><b>'.$langs->trans("IfBankAccount").'...</b></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" name="bank" value="'.$_POST["bank"].'"></td></tr>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$_POST["bank"].'"></td></tr>';
|
||||
|
||||
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Numéro</td><td>Clé RIB</td></tr>';
|
||||
print '<tr><td><input size="8" type="text" name="code_banque" value="'.$_POST["code_banque"].'"></td>';
|
||||
print '<td><input size="8" type="text" name="code_guichet" value="'.$_POST["code_guichet"].'"></td>';
|
||||
print '<td><input size="15" type="text" name="number" value="'.$_POST["number"].'"></td>';
|
||||
print '<td><input size="3" type="text" name="cle_rib" value="'.$_POST["cle_rib"].'"></td></tr>';
|
||||
print '<tr><td><input size="8" type="text" class="flat" name="code_banque" value="'.$_POST["code_banque"].'"></td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$_POST["code_guichet"].'"></td>';
|
||||
print '<td><input size="15" type="text" class="flat" name="number" value="'.$_POST["number"].'"></td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$_POST["cle_rib"].'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="3"><input size="24" type="text" name="iban_prefix" value="'.$_POST["iban_prefix"].'"></td></tr>';
|
||||
print '<td colspan="3"><input size="24" type="text" class="flat" name="iban_prefix" value="'.$_POST["iban_prefix"].'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="3"><input size="24" type="text" name="bic" value="'.$_POST["bic"].'"></td></tr>';
|
||||
print '<td colspan="3"><input size="24" type="text" class="flat" name="bic" value="'.$_POST["bic"].'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||
print "<textarea name=\"domiciliation\" rows=\"3\" cols=\"40\">".$_POST["domiciliation"];
|
||||
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">".$_POST["domiciliation"];
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" name="proprio" value="'.$_POST["proprio"].'"></td></tr>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="proprio" value="'.$_POST["proprio"].'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||
print "<textarea name=\"adresse_proprio\" rows=\"3\" cols=\"40\">".$_POST["adresse_proprio"];
|
||||
print "<textarea class=\"flat\" name=\"adresse_proprio\" rows=\"2\" cols=\"40\">".$_POST["adresse_proprio"];
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></td></tr>';
|
||||
@ -245,9 +250,16 @@ else
|
||||
print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">'.($account->clos?$langs->trans("Closed"):$langs->trans("Opened")).'</td></tr>';
|
||||
print '<td colspan="3">'.$account->status[$account->clos].'</td></tr>';
|
||||
|
||||
if ($account->type == 0 || $account->type == 1) {
|
||||
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").')'));
|
||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||
print '</td></tr>';
|
||||
|
||||
if ($account->type == 0 || $account->type == 1)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="3">'.$account->bank.'</td></tr>';
|
||||
|
||||
@ -326,45 +338,51 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" name="label" value="'.$account->label.'"></td></tr>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$account->label.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
|
||||
print '<input type="hidden" name="type" value="'.$account->type.'">';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Closed").'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$form->selectyesnonum("clos",$account->clos);
|
||||
$form->select_array("clos",array(0=>$account->status[0],1=>$account->status[1]),$account->clos);
|
||||
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");
|
||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||
print '</td></tr>';
|
||||
|
||||
if ($account->type == 0 || $account->type == 1) {
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td></tr>';
|
||||
|
||||
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Numéro</td><td>Clé RIB</td></tr>';
|
||||
print '<tr><td><input size="8" type="text" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '<td><input size="8" type="text" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '<td><input size="15" type="text" name="number" value="'.$account->number.'"></td>';
|
||||
print '<td><input size="3" type="text" name="cle_rib" value="'.$account->cle_rib.'"></td></tr>';
|
||||
print '<tr><td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
|
||||
print '<td><input size="15" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
|
||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$account->cle_rib.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="3"><input size="24" type="text" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>';
|
||||
print '<td colspan="3"><input size="24" type="text" class="flat" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="3"><input size="24" type="text" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
print '<td colspan="3"><input size="24" type="text" class="flat" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||
print "<textarea name=\"domiciliation\" rows=\"3\" cols=\"40\">";
|
||||
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">";
|
||||
print $account->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" name="proprio" value="'.$account->proprio.'"></td></tr>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.$account->proprio.'"></td></tr>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||
print "<textarea name=\"adresse_proprio\" rows=\"3\" cols=\"40\">";
|
||||
print "<textarea class=\"flat\" name=\"adresse_proprio\" rows=\"2\" cols=\"40\">";
|
||||
print $account->adresse_proprio;
|
||||
print "</textarea></td></tr>";
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file htdocs/compta/bank/graph.php
|
||||
@ -38,29 +37,36 @@ $account = $_GET["id"];
|
||||
|
||||
if ($account > 0)
|
||||
{
|
||||
$datetime = time();
|
||||
$month = strftime("%m", $datetime);
|
||||
$year = strftime("%Y", $datetime);
|
||||
|
||||
$acct = new Account($db);
|
||||
$acct->fetch($account);
|
||||
|
||||
print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr><td>';
|
||||
|
||||
$file = "solde.$account.$year.png";
|
||||
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
|
||||
|
||||
print '</td></tr><tr><td>';
|
||||
|
||||
$file = "solde.$account.png";
|
||||
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
|
||||
|
||||
print '</td></tr></table>';
|
||||
$datetime = time();
|
||||
$month = strftime("%m", $datetime);
|
||||
$year = strftime("%Y", $datetime);
|
||||
|
||||
$acct = new Account($db);
|
||||
$acct->fetch($account);
|
||||
|
||||
print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg);
|
||||
|
||||
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
|
||||
print '<tr><td>';
|
||||
|
||||
$file = "solde.$account.$year.png";
|
||||
if (! file_exists($file))
|
||||
{
|
||||
print "Pour générer ou regénérer les graphiques, lancer le script scripts/banque/graph-solde.php en ligne de commande.<br>";
|
||||
print '<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
|
||||
}
|
||||
print '</td></tr><tr><td>';
|
||||
|
||||
$file = "solde.$account.png";
|
||||
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
|
||||
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
?>
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -59,7 +58,7 @@ print '<br>';
|
||||
// On charge tableau des comptes financiers (ouverts par defaut)
|
||||
$accounts = array();
|
||||
|
||||
$sql = "SELECT rowid, courant";
|
||||
$sql = "SELECT rowid, courant, rappro";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
if ($statut != 'all') {
|
||||
$sql .= " WHERE clos = 0";
|
||||
@ -87,7 +86,10 @@ if ($resql)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="30%">'.$langs->trans("CurrentAccounts").'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Bank").'</td>';
|
||||
print '<td align="left">'.$langs->trans("Numero").'</td><td align="right" width="120">'.$langs->trans("BankBalance").'</td><td align="center" width="70">'.$langs->trans("Closed").'</td>';
|
||||
print '<td align="left">'.$langs->trans("AccountIdShort").'</td>';
|
||||
print '<td align="center" width="100">'.$langs->trans("Conciliable").'</a></td>';
|
||||
print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
@ -105,14 +107,17 @@ foreach ($accounts as $key=>$type)
|
||||
print '<tr '.$bc[$var].'><td width="30%">';
|
||||
print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
|
||||
print '</td><td>'.$acc->bank."</td><td>$acc->number</td>";
|
||||
print '<td align="right">'.price($solde).'</td><td align="center">'.yn($acc->clos).'</td></tr>';
|
||||
print '<td align="center">'.yn($acc->rappro).'</td>';
|
||||
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
||||
print '<td align="right">'.price($solde).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$total += $solde;
|
||||
}
|
||||
}
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td colspan="3" align="right"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td><td> </td></tr>';
|
||||
print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>';
|
||||
|
||||
|
||||
print '<tr><td colspan="5"> </td></tr>';
|
||||
@ -123,7 +128,10 @@ print '<tr><td colspan="5"> </td></tr>';
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="30%">'.$langs->trans("SavingAccounts").'</td><td width="20%">'.$langs->trans("Bank").'</td>';
|
||||
print '<td align="left">'.$langs->trans("Numero").'</td><td align="right" width="120">'.$langs->trans("BankBalance").'</td><td align="center" width="70">'.$langs->trans("Closed").'</td>';
|
||||
print '<td align="left">'.$langs->trans("Numero").'</td>';
|
||||
print '<td align="center" width="100">'.$langs->trans("Conciliable").'</a></td>';
|
||||
print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
@ -141,14 +149,17 @@ foreach ($accounts as $key=>$type)
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
|
||||
print "</td><td>$acc->bank</td><td>$acc->number</td>";
|
||||
print '<td align="right">'.price($solde).'</td><td align="center">'.yn($acc->clos).'</td></tr>';
|
||||
print '<td align="center">'.yn($acc->rappro).'</td>';
|
||||
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
||||
print '<td align="right">'.price($solde).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$total += $solde;
|
||||
}
|
||||
}
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td colspan="3" align="right"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td><td> </td></tr>';
|
||||
print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>';
|
||||
|
||||
|
||||
print '<tr><td colspan="5"> </td></tr>';
|
||||
@ -159,7 +170,10 @@ print '<tr><td colspan="5"> </td></tr>';
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="30%">'.$langs->trans("CashAccounts").'</td><td width="20%"> </td>';
|
||||
print '<td align="left"> </td><td align="right" width="120">'.$langs->trans("BankBalance").'</td><td align="center" width="70">'.$langs->trans("Closed").'</td>';
|
||||
print '<td align="left"> </td>';
|
||||
print '<td align="left" width="100"> </td>';
|
||||
print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
@ -176,22 +190,26 @@ foreach ($accounts as $key=>$type)
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
|
||||
print "</td><td>$acc->bank</td><td> </td>";
|
||||
print '<td align="right">'.price($solde).'</td><td align="center">'.yn($acc->clos).'</td></tr>';
|
||||
print '</td><td>'.$acc->bank.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center">'.$acc->status[$acc->clos].'</td>';
|
||||
print '<td align="right">'.price($solde).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$total += $solde;
|
||||
}
|
||||
}
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td colspan="3" align="right"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td><td> </td></tr>';
|
||||
print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>';
|
||||
|
||||
|
||||
/*
|
||||
* Dettes
|
||||
*/
|
||||
print '<tr><td colspan="5"> </td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("Debts").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="7">'.$langs->trans("Debts").'</td></tr>';
|
||||
|
||||
// TVA
|
||||
if ($conf->compta->tva)
|
||||
@ -204,7 +222,7 @@ if ($conf->compta->tva)
|
||||
|
||||
$total = $total + $tva_solde;
|
||||
|
||||
print "<tr ".$bc[$var].">".'<td colspan="3">'.$langs->trans("VAT").'</td><td align="right">'.price($tva_solde).'</td><td> </td></tr>';
|
||||
print "<tr ".$bc[$var].">".'<td colspan="5">'.$langs->trans("VAT").'</td><td align="right">'.price($tva_solde).'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -216,10 +234,10 @@ $chs_a_payer = $chs->solde();
|
||||
|
||||
$total = $total - $chs_a_payer;
|
||||
|
||||
print "<tr ".$bc[$var].">".'<td colspan="3">'.$langs->trans("SocialContributions").'</td><td align="right">'.price($chs_a_payer).'</td><td> </td></tr>';
|
||||
print "<tr ".$bc[$var].">".'<td colspan="5">'.$langs->trans("SocialContributions").'</td><td align="right">'.price($chs_a_payer).'</td></tr>';
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td colspan="3" align="right"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td><td> </td></tr>';
|
||||
print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>';
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -36,22 +36,22 @@ if (!$user->rights->banque->modifier)
|
||||
|
||||
$langs->load("banks");
|
||||
|
||||
llxHeader();
|
||||
|
||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'dvnext')
|
||||
{
|
||||
$ac = new Account($db);
|
||||
$ac->datev_next($_GET["rowid"]);
|
||||
}
|
||||
|
||||
|
||||
if ($_GET["action"] == 'dvprev')
|
||||
{
|
||||
$ac = new Account($db);
|
||||
@ -67,7 +67,6 @@ if ($_POST["action"] == 'confirm_delete_categ' && $_POST["confirm"] == "yes")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($_POST["action"] == 'class')
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"];
|
||||
@ -123,6 +122,12 @@ if ($_POST["action"] == 'num_releve')
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Affichage fiche ligne ecriture en mode edition
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
// On initialise la liste des categories
|
||||
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;";
|
||||
$result = $db->query($sql);
|
||||
@ -141,19 +146,17 @@ if ($result)
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
print_titre("Edition de l'écriture bancaire");
|
||||
|
||||
|
||||
if ($_GET["action"] == 'delete_categ')
|
||||
{
|
||||
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ");
|
||||
}
|
||||
|
||||
$var=False;
|
||||
$h=0;
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$_GET["rowid"];
|
||||
$head[$h][1] = $langs->trans('Card');
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord').' : '.$_GET["rowid"]);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,";
|
||||
$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account";
|
||||
@ -163,92 +166,108 @@ $sql.= " ORDER BY dateo ASC";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$i = 0; $total = 0;
|
||||
if ($db->num_rows($result))
|
||||
$i = 0; $total = 0;
|
||||
if ($db->num_rows($result))
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$acct=new Account($db,$objp->fk_account);
|
||||
$acct->fetch($objp->fk_account);
|
||||
$account = $acct->id;
|
||||
|
||||
// Account
|
||||
print "<tr><td>".$langs->trans("Account")."</td><td colspan=\"3\"><a href=\"account.php?account=$account\">".$acct->label."</a></td></tr>";
|
||||
// Confirmations
|
||||
if ($_GET["action"] == 'delete_categ')
|
||||
{
|
||||
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Date
|
||||
if (! $objp->rappro)
|
||||
{
|
||||
print "<tr><td>".$langs->trans("Date")."</td><td colspan=\"3\">";
|
||||
$html->select_date($objp->do);
|
||||
//print '<input name="date" value="'.strftime("%Y%m%d",$objp->do).'">';
|
||||
$objp = $db->fetch_object($result);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$acct=new Account($db,$objp->fk_account);
|
||||
$acct->fetch($objp->fk_account);
|
||||
$account = $acct->id;
|
||||
|
||||
// Account
|
||||
print "<tr><td>".$langs->trans("Account")."</td><td colspan=\"3\"><a href=\"account.php?account=$account\">".$acct->label."</a></td></tr>";
|
||||
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
// Date
|
||||
if (! $objp->rappro)
|
||||
{
|
||||
print "<tr><td>".$langs->trans("Date")."</td><td colspan=\"3\">";
|
||||
$html->select_date($objp->do);
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// Value date
|
||||
print "<tr>";
|
||||
print '<td colspan="2">'.$langs->trans("DateValue").'</td><td colspan="2">'.strftime("%d %b %Y",$objp->dv)." ";
|
||||
print '<a href="ligne.php?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_remove() . "</a> ";
|
||||
print '<a href="ligne.php?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_add() ."</a></td>";
|
||||
print '</tr>';
|
||||
|
||||
// Description
|
||||
print "<tr><td>".$langs->trans("Label")."</td><td colspan=\"3\">";
|
||||
print '<input name="label" class="flat" value="'.$objp->label.'" size="50">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// Value date
|
||||
print "<tr>";
|
||||
print '<td colspan="2">'.$langs->trans("DateValue").'</td><td colspan="2">'.strftime("%d %b %Y",$objp->dv)." ";
|
||||
print '<a href="ligne.php?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_remove() . "</a> ";
|
||||
print '<a href="ligne.php?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_add() ."</a></td>";
|
||||
print '</tr>';
|
||||
// Amount
|
||||
if (! $objp->rappro)
|
||||
{
|
||||
print "<tr><td>".$langs->trans("Amount")."</td><td colspan=\"3\">";
|
||||
print '<input name="amount" class="flat" value="'.price($objp->amount).'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print "<tr><td>".$langs->trans("Label")."</td><td colspan=\"3\">";
|
||||
print '<input name="label" value="'.$objp->label.'" size="50">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
print "</form>";
|
||||
|
||||
// Amount
|
||||
if (! $objp->rappro)
|
||||
{
|
||||
print "<tr><td>".$langs->trans("Amount")."</td><td colspan=\"3\">";
|
||||
print '<input name="amount" value="'.price($objp->amount).'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
}
|
||||
// Type paiement
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td colspan=\"3\">";
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
print $html->select_types_paiements($objp->fk_type,"value",'',2);
|
||||
print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
print "</td></tr>";
|
||||
|
||||
print "</form>";
|
||||
// Author
|
||||
print "<tr><td>".$langs->trans("Author")."</td>";
|
||||
if ($objp->fk_user_author) {
|
||||
$author=new User($db,$objp->fk_user_author);
|
||||
$author->fetch();
|
||||
print "<td colspan=\"3\">".$author->fullname."</td>";
|
||||
} else {
|
||||
print "<td colspan=\"3\"> </td>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
// Type paiement
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td colspan=\"3\">";
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
print $html->select_types_paiements($objp->fk_type,"value",'',2);
|
||||
print '<input type="text" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
print "</td></tr>";
|
||||
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="num_releve">';
|
||||
print "<tr><td>".$langs->trans("AccountStatement")."</td><td colspan=\"3\">";
|
||||
print '<input name="num_rel" value="'.$objp->num_releve.'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
print "</form>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Author
|
||||
print "<tr><td>".$langs->trans("Author")."</td>";
|
||||
if ($objp->fk_user_author) {
|
||||
$author=new User($db,$objp->fk_user_author);
|
||||
$author->fetch();
|
||||
print "<td colspan=\"3\">".$author->fullname."</td>";
|
||||
} else {
|
||||
print "<td colspan=\"3\"> </td>";
|
||||
}
|
||||
print "</tr>";
|
||||
// Releve rappro
|
||||
if ($acct->rappro)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="num_releve">';
|
||||
print "<tr><td>".$langs->trans("Conciliation")."</td><td colspan=\"3\">";
|
||||
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
print "</tr>";
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
$i++;
|
||||
print "</table>";
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -60,7 +60,18 @@ ByCategories=By categories
|
||||
SearchTransaction=Search transaction
|
||||
TransactionsToConciliate=Transactions to conciliate
|
||||
Rappro=Conciliate
|
||||
Conciliable=Conciliable
|
||||
Conciliate=Conciliate
|
||||
Conciliation=Conciliation
|
||||
ConciliationForAccount=Conciliate this account
|
||||
IncludeClosedAccount=Include closed accounts
|
||||
OnlyOpenedAccount=Only opened accounts
|
||||
AccountToCredit=Account to credit
|
||||
AccountToCredit=Account to credit
|
||||
DisableConciliation=Disable conciliation feature for this account
|
||||
ConciliationDisabled=Conciliation feature disabled
|
||||
StatusAccountOpened=Opened
|
||||
StatusAccountClosed=Closed
|
||||
AccountIdShort=Number
|
||||
EditBankRecord=Edit record
|
||||
LineRecord=Transaction
|
||||
AddBankRecord=Add transaction
|
||||
@ -60,7 +60,18 @@ ByCategories=Par cat
|
||||
SearchTransaction=Recherche écriture
|
||||
TransactionsToConciliate=Ecritures à rapprocher
|
||||
Rappro=Rapprocher
|
||||
Conciliable=Rapprochable
|
||||
Conciliate=Rapprocher
|
||||
Conciliation=Rapprochement
|
||||
ConciliationForAccount=Rapprochements sur ce compte
|
||||
IncludeClosedAccount=Inclure comptes fermés
|
||||
OnlyOpenedAccount=Uniquement comptes ouverts
|
||||
AccountToCredit=Compte à créditer
|
||||
AccountToCredit=Compte à créditer
|
||||
DisableConciliation=Désactiver la fonction de rapprochement pour ce compte
|
||||
ConciliationDisabled=Fonction rapprochement désactivée
|
||||
StatusAccountOpened=Ouvert
|
||||
StatusAccountClosed=Fermé
|
||||
AccountIdShort=Numéro
|
||||
EditBankRecord=Editer écriture
|
||||
LineRecord=Ecriture
|
||||
AddBankRecord=Ajouter écriture
|
||||
@ -176,6 +176,7 @@ if (! defined('PEAR_PATH')) { define('PEAR_PATH', DOL_DOCUMEN
|
||||
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
|
||||
if (! defined('PHPLOT_PATH')) { define('PHPLOT_PATH', DOL_DOCUMENT_ROOT .'/includes/phplot/'); }
|
||||
if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); }
|
||||
if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); }
|
||||
define('FPDF_FONTPATH', FPDF_PATH . 'font/');
|
||||
define('MAGPIE_DIR', MAGPIERSS_PATH);
|
||||
|
||||
@ -233,6 +234,8 @@ $conf->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABIL
|
||||
$conf->compta->dir_output=DOL_DATA_ROOT."/compta";
|
||||
$conf->compta->dir_images=DOL_DATA_ROOT."/compta/images";
|
||||
$conf->banque->enabled=defined("MAIN_MODULE_BANQUE")?MAIN_MODULE_BANQUE:0;
|
||||
$conf->banque->dir_output=DOL_DATA_ROOT."/banque";
|
||||
$conf->banque->dir_images=DOL_DATA_ROOT."/banque/images";
|
||||
$conf->caisse->enabled=defined("MAIN_MODULE_CAISSE")?MAIN_MODULE_CAISSE:0;
|
||||
$conf->don->enabled=defined("MAIN_MODULE_DON")?MAIN_MODULE_DON:0;
|
||||
$conf->syslog->enabled=defined("MAIN_MODULE_SYSLOG")?MAIN_MODULE_SYSLOG:0;
|
||||
|
||||
@ -153,7 +153,7 @@ if ($modulepart)
|
||||
$user->getrights('prelevement');
|
||||
if ($user->rights->prelevement->bons->lire) $accessallowed=1;
|
||||
|
||||
$original_file=DOL_DATA_ROOT.'/prelevement/bon/'.$original_file;
|
||||
$original_file=$conf->prelevement->dir_output.'/bon/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les graph telephonie
|
||||
@ -178,7 +178,7 @@ if ($modulepart)
|
||||
if ($modulepart == 'bank')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=DOL_DATA_ROOT.'/graph/banque/'.$original_file;
|
||||
$original_file=$conf->banque->dir_images.'/'.$original_file;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user