Look: Modifications esthétiques mineures
This commit is contained in:
parent
0dee88b364
commit
7cae46ecfb
@ -29,10 +29,11 @@
|
|||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
|
$langs->load("banks");
|
||||||
|
|
||||||
$user->getrights('compta');
|
$user->getrights('compta');
|
||||||
|
|
||||||
if (! $user->rights->banque->modifier)
|
if (! $user->rights->banque->modifier) accessforbidden();
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
@ -54,7 +55,6 @@ if ($_POST["action"] == 'rappro')
|
|||||||
$sql .= " WHERE rowid=".$_POST["rowid"];
|
$sql .= " WHERE rowid=".$_POST["rowid"];
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if ($cat1 && $_POST["action"]) {
|
if ($cat1 && $_POST["action"]) {
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES ($rowid, $cat1)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES ($rowid, $cat1)";
|
||||||
@ -67,23 +67,23 @@ if ($_POST["action"] == 'rappro')
|
|||||||
else {
|
else {
|
||||||
$msg="Erreur: Saisissez le relevé qui référence la transaction pour la rapprocher.";
|
$msg="Erreur: Saisissez le relevé qui référence la transaction pour la rapprocher.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action suppression ecriture
|
* Action suppression ecriture
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'del') {
|
if ($_GET["action"] == 'del') {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$_GET["rowid"];
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$_GET["rowid"];
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result) {
|
if (! $result) {
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ ORDER BY label";
|
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ ORDER BY label";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$options="";
|
$options="";
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$var=True;
|
$var=True;
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -93,23 +93,23 @@ if ($result) {
|
|||||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage liste des transactions à rapprocher
|
* Affichage liste des transactions à rapprocher
|
||||||
*/
|
*/
|
||||||
$acct = new Account($db);
|
$acct = new Account($db);
|
||||||
$acct->fetch($_GET["account"]);
|
$acct->fetch($_GET["account"]);
|
||||||
|
|
||||||
$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 as type";
|
$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 as type";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b WHERE rappro=0 AND fk_account=".$_GET["account"];
|
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b WHERE rappro=0 AND fk_account=".$_GET["account"];
|
||||||
$sql .= " ORDER BY dateo";
|
$sql .= " ORDER BY dateo";
|
||||||
$sql .= " ASC LIMIT ".$conf->liste_limit;
|
$sql .= " ASC LIMIT ".$conf->liste_limit;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
@ -165,8 +165,8 @@ if ($result)
|
|||||||
print '<td>'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Debit").'</td>';
|
print '<td align="right">'.$langs->trans("Debit").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Credit").'</td>';
|
print '<td align="right">'.$langs->trans("Credit").'</td>';
|
||||||
print '<td align="center" width="100">'.$langs->trans("AccountStatement").'<br>(Ex: YYYYMM)</td>';
|
print '<td align="center" width="60">'.$langs->trans("Action").'</td>';
|
||||||
print '<td align="center" width="100" colspan="2">'.$langs->trans("Action").'</td>';
|
print '<td align="center" width="100" colspan="2">'.$langs->trans("AccountStatement").' (Ex: YYYYMM)</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,9 +182,9 @@ if ($result)
|
|||||||
print "<input type=\"hidden\" name=\"account\" value=\"".$_GET["account"]."\">";
|
print "<input type=\"hidden\" name=\"account\" value=\"".$_GET["account"]."\">";
|
||||||
print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">";
|
print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">";
|
||||||
|
|
||||||
print '<td>'.dolibarr_print_date($objp->do).'</td>';
|
print '<td nowrap>'.dolibarr_print_date($objp->do).'</td>';
|
||||||
print '<td>'.dolibarr_print_date($objp->dv).'</td>';
|
print '<td nowrap>'.dolibarr_print_date($objp->dv).'</td>';
|
||||||
print '<td>'.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
|
print '<td nowrap>'.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
|
||||||
print '<td>'.$objp->label.'</td>';
|
print '<td>'.$objp->label.'</td>';
|
||||||
|
|
||||||
if ($objp->amount < 0)
|
if ($objp->amount < 0)
|
||||||
@ -196,6 +196,40 @@ if ($result)
|
|||||||
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
print "<td> </td><td align=\"right\">".price($objp->amount)."</td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($objp->rappro)
|
||||||
|
{
|
||||||
|
// Si ligne déjà rapprochée, on affiche relevé.
|
||||||
|
print "<td align=\"center\"><a href=\"releve.php?num=$objp->num_releve&account=$acct->id\">$objp->num_releve</a></td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Si pas encore rapproché
|
||||||
|
if ($user->rights->banque->modifier)
|
||||||
|
{
|
||||||
|
print '<td align="center" width="30">';
|
||||||
|
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$acct->id.'">';
|
||||||
|
print img_edit();
|
||||||
|
print '</a> ';
|
||||||
|
|
||||||
|
if ($objp->do <= mktime() ) {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?action=del&rowid='.$objp->rowid.'&account='.$acct->id.'">';
|
||||||
|
print img_delete();
|
||||||
|
print "</a>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print " "; // On n'empeche la suppression car le raprochement ne pourra se faire qu'après la date passée et que l'écriture apparaissent bien sur le compte.
|
||||||
|
}
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td align=\"center\"> </td>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Affiche bouton "Rapprocher"
|
||||||
if ($objp->do <= mktime() ) {
|
if ($objp->do <= mktime() ) {
|
||||||
print "<td align=\"center\">";
|
print "<td align=\"center\">";
|
||||||
print "<input class=\"flat\" name=\"num_releve\" type=\"text\" value=\"\" size=\"8\">";
|
print "<input class=\"flat\" name=\"num_releve\" type=\"text\" value=\"\" size=\"8\">";
|
||||||
@ -213,31 +247,6 @@ if ($result)
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($objp->rappro)
|
|
||||||
{
|
|
||||||
print "<td align=\"center\"><a href=\"releve.php?num=$objp->num_releve&account=$acct->id\">$objp->num_releve</a></td>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($user->rights->banque->modifier)
|
|
||||||
{
|
|
||||||
print '<td align="center" width="30">';
|
|
||||||
if ($objp->do <= mktime() ) {
|
|
||||||
print "<a href=\"rappro.php?action=del&rowid=$objp->rowid&account=$acct->id\">";
|
|
||||||
print img_delete();
|
|
||||||
print "</a>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print " "; // On n'empeche la suppression car le raprochement ne pourra se faire qu'après la date passée et que l'écriture apparaissent bien sur le compte.
|
|
||||||
}
|
|
||||||
print "</td>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<td align=\"center\"> </td>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
@ -249,11 +258,11 @@ if ($result)
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user