Can change value date in conciliation page
This commit is contained in:
parent
996bc94a4d
commit
009c73e2c0
@ -20,16 +20,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/bank/ligne.php
|
\file htdocs/compta/bank/ligne.php
|
||||||
\ingroup compta
|
\ingroup compta
|
||||||
\brief Page edition d'une ecriture bancaire
|
\brief Page edition d'une ecriture bancaire
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
if (! $user->rights->banque->lire && ! $user->rights->banque->consolidate)
|
if (! $user->rights->banque->lire && ! $user->rights->banque->consolidate)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -45,94 +45,94 @@ $html = new Form($db);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'dvnext')
|
if ($user->rights->banque->consolidate && $_GET["action"] == 'dvnext')
|
||||||
{
|
{
|
||||||
$ac = new Account($db);
|
$ac = new Account($db);
|
||||||
$ac->datev_next($_GET["rowid"]);
|
$ac->datev_next($_GET["rowid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'dvprev')
|
if ($user->rights->banque->consolidate && $_GET["action"] == 'dvprev')
|
||||||
{
|
{
|
||||||
$ac = new Account($db);
|
$ac = new Account($db);
|
||||||
$ac->datev_previous($_GET["rowid"]);
|
$ac->datev_previous($_GET["rowid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'confirm_delete_categ' && $_POST["confirm"] == "yes")
|
if ($_POST["action"] == 'confirm_delete_categ' && $_POST["confirm"] == "yes")
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_GET["cat1"];
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_GET["cat1"];
|
||||||
if (! $db->query($sql))
|
if (! $db->query($sql))
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'class')
|
if ($_POST["action"] == 'class')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"];
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"];
|
||||||
if (! $db->query($sql))
|
if (! $db->query($sql))
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$_GET["rowid"].", ".$_POST["cat1"].")";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$_GET["rowid"].", ".$_POST["cat1"].")";
|
||||||
if (! $db->query($sql))
|
if (! $db->query($sql))
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == "update")
|
if ($_POST["action"] == "update")
|
||||||
{
|
{
|
||||||
// Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche
|
// Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche
|
||||||
$sql = "SELECT b.rappro FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=".$rowid;
|
$sql = "SELECT b.rappro FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=".$rowid;
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
if ($objp->rappro)
|
if ($objp->rappro)
|
||||||
die ("Vous ne pouvez pas modifier une <20>criture d<>j<EFBFBD> rapproch<63>e");
|
die ("Vous ne pouvez pas modifier une <20>criture d<>j<EFBFBD> rapproch<63>e");
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$amount = price2num($_POST['amount']);
|
$amount = price2num($_POST['amount']);
|
||||||
$dateop = $_POST["dateoyear"].'-'.$_POST["dateomonth"].'-'.$_POST["dateoday"];
|
$dateop = $_POST["dateoyear"].'-'.$_POST["dateomonth"].'-'.$_POST["dateoday"];
|
||||||
$dateval= $_POST["datevyear"].'-'.$_POST["datevmonth"].'-'.$_POST["datevday"];
|
$dateval= $_POST["datevyear"].'-'.$_POST["datevmonth"].'-'.$_POST["datevday"];
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||||
$sql.= " SET label='".addslashes($_POST["label"])."',"; // Todo: cr<63>er une classe pour s<>parer les requ<71>tes sql
|
$sql.= " SET label='".addslashes($_POST["label"])."',"; // Todo: cr<63>er une classe pour s<>parer les requ<71>tes sql
|
||||||
if (isset($_POST['amount'])) $sql.=" amount='$amount',";
|
if (isset($_POST['amount'])) $sql.=" amount='$amount',";
|
||||||
$sql.= " dateo = '".$dateop."', datev = '".$dateval."',";
|
$sql.= " dateo = '".$dateop."', datev = '".$dateval."',";
|
||||||
$sql.= " fk_account = ".$_POST['accountid'];
|
$sql.= " fk_account = ".$_POST['accountid'];
|
||||||
$sql.= " WHERE rowid = ".$rowid;
|
$sql.= " WHERE rowid = ".$rowid;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'type')
|
if ($_POST["action"] == 'type')
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set fk_type='".$_POST["value"]."', num_chq='".$_POST["num_chq"]."' WHERE rowid = $rowid;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set fk_type='".$_POST["value"]."', num_chq='".$_POST["num_chq"]."' WHERE rowid = $rowid;";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'banque')
|
if ($_POST["action"] == 'banque')
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set banque='".addslashes($_POST["banque"])."' WHERE rowid = $rowid;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set banque='".addslashes($_POST["banque"])."' WHERE rowid = $rowid;";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'emetteur')
|
if ($_POST["action"] == 'emetteur')
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set emetteur='".addslashes($_POST["emetteur"])."' WHERE rowid = $rowid;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set emetteur='".addslashes($_POST["emetteur"])."' WHERE rowid = $rowid;";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'num_releve')
|
if ($_POST["action"] == 'num_releve')
|
||||||
@ -172,17 +172,17 @@ $sql.= " ORDER BY label";
|
|||||||
$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);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$options = "<option value=\"0\" selected=\"true\"> </option>";
|
$options = "<option value=\"0\" selected=\"true\"> </option>";
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
|
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$var=False;
|
$var=False;
|
||||||
@ -210,127 +210,129 @@ $sql.= " ORDER BY dateo ASC";
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
if ($db->num_rows($result))
|
if ($db->num_rows($result))
|
||||||
{
|
{
|
||||||
|
|
||||||
// Confirmations
|
// Confirmations
|
||||||
if ($_GET["action"] == 'delete_categ')
|
if ($_GET["action"] == 'delete_categ')
|
||||||
{
|
{
|
||||||
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"]."&orig_account=".$orig_account,$langs->trans("RemoveFromCategory"),$langs->trans("RemoveFromCategoryConfirm"),"confirm_delete_categ");
|
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"]."&orig_account=".$orig_account,$langs->trans("RemoveFromCategory"),$langs->trans("RemoveFromCategoryConfirm"),"confirm_delete_categ");
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$total = $total + $objp->amount;
|
$total = $total + $objp->amount;
|
||||||
|
|
||||||
$acct=new Account($db,$objp->fk_account);
|
$acct=new Account($db,$objp->fk_account);
|
||||||
$acct->fetch($objp->fk_account);
|
$acct->fetch($objp->fk_account);
|
||||||
$account = $acct->id;
|
$account = $acct->id;
|
||||||
|
|
||||||
$links=$acct->get_url($rowid);
|
$links=$acct->get_url($rowid);
|
||||||
|
|
||||||
// Tableau sur 4 colonne si deja rapproche, sinon sur 5 colonnes
|
// Tableau sur 4 colonne si deja rapproche, sinon sur 5 colonnes
|
||||||
|
|
||||||
// Author
|
// Author
|
||||||
print '<tr><td width="20%">'.$langs->trans("Author")."</td>";
|
print '<tr><td width="20%">'.$langs->trans("Author")."</td>";
|
||||||
if ($objp->fk_user_author)
|
if ($objp->fk_user_author)
|
||||||
{
|
{
|
||||||
$author=new User($db,$objp->fk_user_author);
|
$author=new User($db,$objp->fk_user_author);
|
||||||
$author->fetch();
|
$author->fetch();
|
||||||
print '<td colspan="4"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$author->id.'">';
|
print '<td colspan="4"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$author->id.'">';
|
||||||
print img_object($langs->trans("ShowUser"),'user').' '.$author->fullname.'</a></td>';
|
print img_object($langs->trans("ShowUser"),'user').' '.$author->fullname.'</a></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td colspan="4"> </td>';
|
print '<td colspan="4"> </td>';
|
||||||
}
|
}
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
print "<form name='update' method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
print "<form name='update' method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||||
|
|
||||||
// Account
|
// Account
|
||||||
print "<tr><td>".$langs->trans("Account")."</td>";
|
print "<tr><td>".$langs->trans("Account")."</td>";
|
||||||
print '<td colspan="4">';
|
print '<td colspan="4">';
|
||||||
print '<a href="account.php?account='.$acct->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acct->label.'</a>';
|
print '<a href="account.php?account='.$acct->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acct->label.'</a>';
|
||||||
print '<input type="hidden" name="accountid" value="'.$acct->id.'">';
|
print '<input type="hidden" name="accountid" value="'.$acct->id.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date ope
|
// Date ope
|
||||||
print '<tr><td>'.$langs->trans("DateOperation").'</td>';
|
print '<tr><td>'.$langs->trans("DateOperation").'</td>';
|
||||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||||
{
|
{
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$html->select_date($objp->do,'dateo','','','','update');
|
$html->select_date($objp->do,'dateo','','','','update');
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td colspan="4">';
|
print '<td colspan="4">';
|
||||||
print dolibarr_print_date($objp->do);
|
print dolibarr_print_date($objp->do);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Value date
|
// Value date
|
||||||
print "<tr><td>".$langs->trans("DateValue")."</td>";
|
print "<tr><td>".$langs->trans("DateValue")."</td>";
|
||||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||||
{
|
{
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$html->select_date($objp->dv,'datev','','','','update');
|
$html->select_date($objp->dv,'datev','','','','update');
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a href="ligne.php?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||||
print img_edit_remove() . "</a> ";
|
print img_edit_remove() . "</a> ";
|
||||||
print '<a href="ligne.php?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||||
print img_edit_add() ."</a>";
|
print img_edit_add() ."</a>";
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
print '</td>';
|
||||||
}
|
print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
print '<td colspan="4">';
|
{
|
||||||
print dolibarr_print_date($objp->dv);
|
print '<td colspan="4">';
|
||||||
}
|
print dolibarr_print_date($objp->dv,"day");
|
||||||
print "</td></tr>";
|
print '</td>';
|
||||||
|
}
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print "<tr><td>".$langs->trans("Label")."</td>";
|
print "<tr><td>".$langs->trans("Label")."</td>";
|
||||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||||
{
|
{
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<input name="label" class="flat" value="';
|
print '<input name="label" class="flat" value="';
|
||||||
if (eregi('^\((.*)\)$',$objp->label,$reg))
|
if (eregi('^\((.*)\)$',$objp->label,$reg))
|
||||||
{
|
{
|
||||||
// Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
|
// Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
|
||||||
print $langs->trans($reg[1]);
|
print $langs->trans($reg[1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $objp->label;
|
print $objp->label;
|
||||||
}
|
}
|
||||||
print '" size="50">';
|
print '" size="50">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td colspan="4">';
|
print '<td colspan="4">';
|
||||||
if (eregi('^\((.*)\)$',$objp->label,$reg))
|
if (eregi('^\((.*)\)$',$objp->label,$reg))
|
||||||
{
|
{
|
||||||
// Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
|
// Label g<>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
|
||||||
print $langs->trans($reg[1]);
|
print $langs->trans($reg[1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $objp->label;
|
print $objp->label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Affiche liens
|
// Affiche liens
|
||||||
if (sizeof($links))
|
if (sizeof($links))
|
||||||
@ -391,79 +393,79 @@ if ($result)
|
|||||||
print '</td><td> </td></tr>';
|
print '</td><td> </td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print "<tr><td>".$langs->trans("Amount")."</td>";
|
print "<tr><td>".$langs->trans("Amount")."</td>";
|
||||||
if (! $objp->rappro && $user->rights->banque->modifier)
|
if (! $objp->rappro && $user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<input name="amount" class="flat" size="10" value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie);
|
print '<input name="amount" class="flat" size="10" value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie);
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td colspan="4">';
|
print '<td colspan="4">';
|
||||||
print price($objp->amount);
|
print price($objp->amount);
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
// Type paiement
|
// Type paiement
|
||||||
print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero")."</td><td colspan=\"3\">";
|
print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero")."</td><td colspan=\"3\">";
|
||||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||||
{
|
{
|
||||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||||
print '<input type="hidden" name="action" value="type">';
|
print '<input type="hidden" name="action" value="type">';
|
||||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||||
print $html->select_types_paiements($objp->fk_type,"value",'',2);
|
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="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $objp->fk_type.' '.$objp->num_chq.'</td><td> </td>';
|
print $objp->fk_type.' '.$objp->num_chq.'</td><td> </td>';
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Banque
|
// Banque
|
||||||
print "<tr><td>".$langs->trans("Bank")."</td><td colspan=\"3\">";
|
print "<tr><td>".$langs->trans("Bank")."</td><td colspan=\"3\">";
|
||||||
if ($user->rights->banque->modifier)
|
if ($user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||||
print '<input type="hidden" name="action" value="banque">';
|
print '<input type="hidden" name="action" value="banque">';
|
||||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||||
print '<input type="text" class="flat" size="40" name="banque" value="'.(empty($objp->banque) ? '' : $objp->banque).'">';
|
print '<input type="text" class="flat" size="40" name="banque" value="'.(empty($objp->banque) ? '' : $objp->banque).'">';
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $objp->banque.' </td><td> </td>';
|
print $objp->banque.' </td><td> </td>';
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Emetteur
|
// Emetteur
|
||||||
print "<tr><td>".$langs->trans("CheckTransmitter")."</td><td colspan=\"3\">";
|
print "<tr><td>".$langs->trans("CheckTransmitter")."</td><td colspan=\"3\">";
|
||||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||||
{
|
{
|
||||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||||
print '<input type="hidden" name="action" value="emetteur">';
|
print '<input type="hidden" name="action" value="emetteur">';
|
||||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||||
print '<input type="text" class="flat" size="40" name="emetteur" value="'.(empty($objp->emetteur) ? '' : stripslashes($objp->emetteur)).'">';
|
print '<input type="text" class="flat" size="40" name="emetteur" value="'.(empty($objp->emetteur) ? '' : stripslashes($objp->emetteur)).'">';
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $objp->emetteur.' </td><td> </td>';
|
print $objp->emetteur.' </td><td> </td>';
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
|
||||||
// Releve rappro
|
// Releve rappro
|
||||||
if ($acct->rappro) // Si compte rapprochable
|
if ($acct->rappro) // Si compte rapprochable
|
||||||
{
|
{
|
||||||
print "<tr><td>".$langs->trans("Conciliation")."</td>";
|
print "<tr><td>".$langs->trans("Conciliation")."</td>";
|
||||||
if ($user->rights->banque->consolidate)
|
if ($user->rights->banque->consolidate)
|
||||||
{
|
{
|
||||||
@ -474,19 +476,19 @@ if ($result)
|
|||||||
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'">';
|
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'">';
|
||||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td colspan="4">'.$objp->num_releve.' </td>';
|
print '<td colspan="4">'.$objp->num_releve.' </td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@ -495,17 +497,17 @@ print '</div>';
|
|||||||
* Boutons actions
|
* Boutons actions
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($orig_account)
|
if ($orig_account)
|
||||||
{
|
{
|
||||||
$acct=new Account($db,$orig_account);
|
$acct=new Account($db,$orig_account);
|
||||||
$acct->fetch($orig_account);
|
$acct->fetch($orig_account);
|
||||||
print '<a class="butAction" href="rappro.php?account='.$orig_account.'">'.$langs->trans("BackToConciliate",$acct->label).'</a>';
|
print '<a class="butAction" href="rappro.php?account='.$orig_account.'">'.$langs->trans("BackToConciliate",$acct->label).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Liste les categories
|
// Liste les categories
|
||||||
|
|
||||||
@ -528,24 +530,24 @@ $sql.= " ORDER BY c.label";
|
|||||||
$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);
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print "<td>$objp->label</td>";
|
print "<td>$objp->label</td>";
|
||||||
print "<td align=\"center\"><a href=\"budget.php?bid=$objp->rowid\">".$langs->trans("List")."</a></td>";
|
print "<td align=\"center\"><a href=\"budget.php?bid=$objp->rowid\">".$langs->trans("List")."</a></td>";
|
||||||
print "<td align=\"center\"><a href=\"ligne.php?action=delete_categ&rowid=$rowid&fk_categ=$objp->rowid\">".img_delete($langs->trans("Remove"))."</a></td>";
|
print "<td align=\"center\"><a href=\"ligne.php?action=delete_categ&rowid=$rowid&fk_categ=$objp->rowid\">".img_delete($langs->trans("Remove"))."</a></td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
@ -15,15 +15,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/bank/rappro.php
|
\file htdocs/compta/bank/rappro.php
|
||||||
\ingroup banque
|
\ingroup banque
|
||||||
\brief Page de rapprochement bancaire
|
\brief Page de rapprochement bancaire
|
||||||
\version $Revision$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -36,8 +34,22 @@ if (! $user->rights->banque->consolidate) accessforbidden();
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action rapprochement
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $_GET["action"] == 'dvnext')
|
||||||
|
{
|
||||||
|
$ac = new Account($db);
|
||||||
|
$ac->datev_next($_GET["rowid"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $_GET["action"] == 'dvprev')
|
||||||
|
{
|
||||||
|
$ac = new Account($db);
|
||||||
|
$ac->datev_previous($_GET["rowid"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Conciliation
|
||||||
if ($user->rights->banque->consolidate && $_POST["action"] == 'rappro')
|
if ($user->rights->banque->consolidate && $_POST["action"] == 'rappro')
|
||||||
{
|
{
|
||||||
// Definition, nettoyage parametres
|
// Definition, nettoyage parametres
|
||||||
@ -120,12 +132,13 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
/*
|
|
||||||
* Affichage liste des transactions à rapprocher
|
|
||||||
*/
|
|
||||||
$acct = new Account($db);
|
$acct = new Account($db);
|
||||||
$acct->fetch($_GET["account"]);
|
$acct->fetch($_GET["account"]);
|
||||||
|
|
||||||
@ -133,7 +146,7 @@ $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, ".$db->pdate("b.datev").
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||||
$sql.= " WHERE rappro=0 AND fk_account=".$_GET["account"];
|
$sql.= " WHERE rappro=0 AND fk_account=".$_GET["account"];
|
||||||
$sql.= " ORDER BY dateo ASC";
|
$sql.= " ORDER BY dateo ASC";
|
||||||
$sql.= " LIMIT 1000"; // Limite juste pour eviter saturation page.
|
$sql.= " LIMIT 1000"; // Limit to avoid page overload
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -204,9 +217,30 @@ if ($resql)
|
|||||||
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."\">";
|
||||||
|
|
||||||
|
// Date op
|
||||||
print '<td align="center" nowrap="nowrap">'.dolibarr_print_date($objp->do,"day").'</td>';
|
print '<td align="center" nowrap="nowrap">'.dolibarr_print_date($objp->do,"day").'</td>';
|
||||||
print '<td align="center" nowrap="nowrap">'.dolibarr_print_date($objp->dv,"day").'</td>';
|
|
||||||
print '<td nowrap="nowrap">'.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
|
// Date value
|
||||||
|
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
print dolibarr_print_date($objp->dv,"day");
|
||||||
|
print ' ';
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_remove() . "</a> ";
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvnext&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_add() ."</a>";
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
print dolibarr_print_date($objp->dv,"day");
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Number
|
||||||
|
print '<td nowrap="nowrap">'.$objp->type.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$acct->id.'">';
|
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$acct->id.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user