Fix: If a transaction was reconciliated and should not, there was no way to reverse error.
This commit is contained in:
parent
a2f949a4df
commit
e9b48f8b0b
@ -53,6 +53,7 @@ For users:
|
||||
- New: Task #10796: Add Spain ProfId1 Verification
|
||||
- New: Page "supplier summary" is now available.
|
||||
- New: Task #10611: Add option to choose order of field in bank account info on PDF
|
||||
- New: If a transaction was reconciliated and should not, there was no way to reverse error.
|
||||
- Perf: Avoid reading database to determine country code after each
|
||||
page call.
|
||||
- Fix: Special chars are now supported in ECM module for filename (not yet for
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/bank/account.php
|
||||
* \ingroup banque
|
||||
* \brief List of detail of bank transaction for an account
|
||||
* \brief List of details of bank transactions for an account
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
@ -646,12 +646,12 @@ if ($account || $_GET["ref"])
|
||||
print '<td align="right">-</td>';
|
||||
}
|
||||
|
||||
// Receipt conciliate or edit link
|
||||
// Transaction reconciliated or edit link
|
||||
if ($objp->rappro && $acct->type != 2) // Si non compte cash
|
||||
{
|
||||
print "<td align=\"center\" nowrap>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$acct->id.'&page='.$page.'">';
|
||||
print img_view();
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print " ";
|
||||
print "<a href=\"releve.php?num=$objp->num_releve&account=$acct->id\">$objp->num_releve</a>";
|
||||
|
||||
@ -49,119 +49,133 @@ $html = new Form($db);
|
||||
|
||||
if ($user->rights->banque->consolidate && $_GET["action"] == 'dvnext')
|
||||
{
|
||||
$ac = new Account($db);
|
||||
$ac->datev_next($_GET["rowid"]);
|
||||
$ac = new Account($db);
|
||||
$ac->datev_next($_GET["rowid"]);
|
||||
}
|
||||
|
||||
if ($user->rights->banque->consolidate && $_GET["action"] == 'dvprev')
|
||||
{
|
||||
$ac = new Account($db);
|
||||
$ac->datev_previous($_GET["rowid"]);
|
||||
$ac = new Account($db);
|
||||
$ac->datev_previous($_GET["rowid"]);
|
||||
}
|
||||
|
||||
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"];
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_GET["cat1"];
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'class')
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"];
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"];
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$_GET["rowid"].", ".$_POST["cat1"].")";
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$_GET["rowid"].", ".$_POST["cat1"].")";
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == "update")
|
||||
{
|
||||
// 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;
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
if ($objp->rappro)
|
||||
die ("Conciliation of a line already conciliated is not possible");
|
||||
}
|
||||
// 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;
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
if ($objp->rappro)
|
||||
die ("Conciliation of a line already conciliated is not possible");
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
|
||||
$amount = price2num($_POST['amount']);
|
||||
$dateop = dol_mktime(12,0,0,$_POST["dateomonth"],$_POST["dateoday"],$_POST["dateoyear"]);
|
||||
$dateval= dol_mktime(12,0,0,$_POST["datevmonth"],$_POST["datevday"],$_POST["datevyear"]);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||
$sql.= " SET label='".addslashes($_POST["label"])."',";
|
||||
if (isset($_POST['amount'])) $sql.=" amount='$amount',";
|
||||
$sql.= " dateo = '".$db->idate($dateop)."', datev = '".$db->idate($dateval)."',";
|
||||
$sql.= " fk_account = ".$_POST['accountid'];
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
$amount = price2num($_POST['amount']);
|
||||
$dateop = dol_mktime(12,0,0,$_POST["dateomonth"],$_POST["dateoday"],$_POST["dateoyear"]);
|
||||
$dateval= dol_mktime(12,0,0,$_POST["datevmonth"],$_POST["datevday"],$_POST["datevyear"]);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||
$sql.= " SET label='".addslashes($_POST["label"])."',";
|
||||
if (isset($_POST['amount'])) $sql.=" amount='$amount',";
|
||||
$sql.= " dateo = '".$db->idate($dateop)."', datev = '".$db->idate($dateval)."',";
|
||||
$sql.= " fk_account = ".$_POST['accountid'];
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'type')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set fk_type='".$_POST["value"]."', num_chq='".$_POST["num_chq"]."' WHERE rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set fk_type='".$_POST["value"]."', num_chq='".$_POST["num_chq"]."' WHERE rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'banque')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set banque='".addslashes($_POST["banque"])."' WHERE rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set banque='".addslashes($_POST["banque"])."' WHERE rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'emetteur')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set emetteur='".addslashes($_POST["emetteur"])."' WHERE rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank set emetteur='".addslashes($_POST["emetteur"])."' WHERE rowid = $rowid;";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($user->rights->banque->consolidate && $_POST["action"] == 'num_releve')
|
||||
// Reconcile
|
||||
if ($user->rights->banque->consolidate && ($_POST["action"] == 'num_releve' || $_POST["action"] == 'setreconcile'))
|
||||
{
|
||||
$db->begin();
|
||||
$num_rel=trim($_POST["num_rel"]);
|
||||
$rappro=$_POST['reconciled']?1:0;
|
||||
|
||||
$num_rel=trim($_POST["num_rel"]);
|
||||
// Check parameters
|
||||
if ($rappro && empty($num_rel))
|
||||
{
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountStatement"));
|
||||
$error++;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||
$sql.= " SET num_releve=".($num_rel?"'".$num_rel."'":"null");
|
||||
if (! $num_rel) $sql.= ", rappro = 0";
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
dol_syslog("ligne.php sql=".$sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||
$sql.= " SET num_releve=".($num_rel?"'".$num_rel."'":"null");
|
||||
if (empty($num_rel)) $sql.= ", rappro = 0";
|
||||
else $sql.=", rappro = ".$rappro;
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
dol_syslog("ligne.php sql=".$sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -175,17 +189,17 @@ $sql.= " ORDER BY label";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$var=True;
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$options = "<option value=\"0\" selected=\"true\"> </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=\"true\"> </option>";
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
$var=False;
|
||||
@ -203,6 +217,7 @@ $h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans('LineRecord'),0,'account');
|
||||
|
||||
if ($mesg) print '<div class="error">'.$mesg.'</div><br>';
|
||||
|
||||
$sql = "SELECT b.rowid,b.dateo as do,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";
|
||||
@ -213,54 +228,48 @@ $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))
|
||||
{
|
||||
|
||||
// Confirmations
|
||||
if ($_GET["action"] == 'delete_categ')
|
||||
{
|
||||
$ret=$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"]."&orig_account=".$orig_account,$langs->trans("RemoveFromRubrique"),$langs->trans("RemoveFromRubriqueConfirm"),"confirm_delete_categ");
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
// Confirmations
|
||||
if ($_GET["action"] == 'delete_categ')
|
||||
{
|
||||
$ret=$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"]."&orig_account=".$orig_account,$langs->trans("RemoveFromRubrique"),$langs->trans("RemoveFromRubriqueConfirm"),"confirm_delete_categ");
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$objp = $db->fetch_object($result);
|
||||
$total = $total + $objp->amount;
|
||||
$objp = $db->fetch_object($result);
|
||||
$total = $total + $objp->amount;
|
||||
|
||||
$acct=new Account($db);
|
||||
$acct->fetch($objp->fk_account);
|
||||
$account = $acct->id;
|
||||
$acct=new Account($db);
|
||||
$acct->fetch($objp->fk_account);
|
||||
$account = $acct->id;
|
||||
|
||||
$bankline = new AccountLine($db);
|
||||
$bankline->fetch($rowid,$ref);
|
||||
$bankline = new AccountLine($db);
|
||||
$bankline->fetch($rowid,$ref);
|
||||
|
||||
$links=$acct->get_url($rowid);
|
||||
$links=$acct->get_url($rowid);
|
||||
$bankline->load_previous_next_ref('','rowid');
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref")."</td>";
|
||||
print '<td colspan="4">';
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref")."</td>";
|
||||
print '<td colspan="4">';
|
||||
print $html->showrefnav($bankline,'rowid','',1,'rowid','rowid');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
|
||||
print '<form name="update" method="post" action="ligne.php?rowid='.$objp->rowid.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||
|
||||
|
||||
// Account
|
||||
print "<tr><td>".$langs->trans("Account")."</td>";
|
||||
print '<td colspan="4">';
|
||||
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 '</td>';
|
||||
print '</tr>';
|
||||
print "<tr><td>".$langs->trans("Account")."</td>";
|
||||
print '<td colspan="4">';
|
||||
print '<a href="account.php?account='.$acct->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acct->label.'</a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Show links of bank transactions
|
||||
if (sizeof($links))
|
||||
@ -327,177 +336,218 @@ if ($result)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Type of payment / Number
|
||||
print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero")."</td><td colspan=\"3\">";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||
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 '</td><td align="center" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->fk_type.' '.$objp->num_chq.'</td><td> </td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
// Bank
|
||||
print "<tr><td>".$langs->trans("Bank")."</td><td colspan=\"3\">";
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="banque">';
|
||||
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 '</td><td align="center" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->banque.' </td><td> </td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
// Transmitter
|
||||
print "<tr><td>".$langs->trans("CheckTransmitter")."</td><td colspan=\"3\">";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="emetteur">';
|
||||
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 '</td><td align="center" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->emetteur.' </td><td> </td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
print '<form name="update" method="post" action="ligne.php?rowid='.$objp->rowid.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||
print '<input type="hidden" name="accountid" value="'.$acct->id.'">';
|
||||
|
||||
// Date ope
|
||||
print '<tr><td>'.$langs->trans("DateOperation").'</td>';
|
||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
$html->select_date($db->jdate($objp->do),'dateo','','','','update');
|
||||
print '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
print dol_print_date($db->jdate($objp->do),"day");
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DateOperation").'</td>';
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
if ($objp->rappro) print dol_print_date($db->jdate($objp->do),"day");
|
||||
else $html->select_date($db->jdate($objp->do),'dateo','','','','update');
|
||||
print '</td><td align="center" rowspan="4" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'"'.($objp->rappro?' disabled="true"':'').'></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
print dol_print_date($db->jdate($objp->do),"day");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Value date
|
||||
print "<tr><td>".$langs->trans("DateValue")."</td>";
|
||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
$html->select_date($db->jdate($objp->dv),'datev','','','','update');
|
||||
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>';
|
||||
print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
print dol_print_date($db->jdate($objp->dv),"day");
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>";
|
||||
// Value date
|
||||
print "<tr><td>".$langs->trans("DateValue")."</td>";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
if ($objp->rappro) print dol_print_date($db->jdate($objp->dv),"day");
|
||||
else
|
||||
{
|
||||
$html->select_date($db->jdate($objp->dv),'datev','','','','update');
|
||||
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>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
print dol_print_date($db->jdate($objp->dv),"day");
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
// Description
|
||||
print "<tr><td>".$langs->trans("Label")."</td>";
|
||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
print '<input name="label" class="flat" value="';
|
||||
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
|
||||
{
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->label;
|
||||
}
|
||||
print '" size="50">';
|
||||
print '</td>';
|
||||
print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
|
||||
{
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->label;
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Description
|
||||
print "<tr><td>".$langs->trans("Label")."</td>";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
if ($objp->rappro)
|
||||
{
|
||||
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
|
||||
{
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->label;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input name="label" class="flat" value="';
|
||||
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
|
||||
{
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->label;
|
||||
}
|
||||
print '" size="50">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
|
||||
{
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->label;
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
print "<tr><td>".$langs->trans("Amount")."</td>";
|
||||
if (! $objp->rappro && $user->rights->banque->modifier)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
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").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
print price($objp->amount);
|
||||
}
|
||||
print "</td></tr>";
|
||||
// Amount
|
||||
print "<tr><td>".$langs->trans("Amount")."</td>";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
if ($objp->rappro) print price($objp->amount);
|
||||
else print '<input name="amount" class="flat" size="10" value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">';
|
||||
print price($objp->amount);
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
print "</form>";
|
||||
print "</form>";
|
||||
print "</table>";
|
||||
|
||||
// Type paiement
|
||||
print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero")."</td><td colspan=\"3\">";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||
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 '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->fk_type.' '.$objp->num_chq.'</td><td> </td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
// Releve rappro
|
||||
if ($acct->rappro) // Si compte rapprochable
|
||||
{
|
||||
print '<br>'."\n";
|
||||
print_fiche_titre($langs->trans("Reconciliation"),'','');
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setreconcile">';
|
||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||
|
||||
// Banque
|
||||
print "<tr><td>".$langs->trans("Bank")."</td><td colspan=\"3\">";
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="banque">';
|
||||
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 '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->banque.' </td><td> </td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Emetteur
|
||||
print "<tr><td>".$langs->trans("CheckTransmitter")."</td><td colspan=\"3\">";
|
||||
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="emetteur">';
|
||||
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 '</td><td align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $objp->emetteur.' </td><td> </td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
print '<tr><td width="20%">'.$langs->trans("Conciliation")."</td>";
|
||||
if ($user->rights->banque->consolidate)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'">';
|
||||
print '</td><td align="center" rowspan="2" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">'.$objp->num_releve.' </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print "<tr><td>".$langs->trans("BankLineConciliated")."</td>";
|
||||
if ($user->rights->banque->consolidate)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"])?($_POST["reconciled"]?' checked="true"':''):($objp->rappro?' checked="true"':'')).'">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">'.yn($objp->rappro).'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Releve rappro
|
||||
if ($acct->rappro) // Si compte rapprochable
|
||||
{
|
||||
print "<tr><td>".$langs->trans("Conciliation")."</td>";
|
||||
if ($user->rights->banque->consolidate)
|
||||
{
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="num_releve">';
|
||||
print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
|
||||
print '<td colspan="3">';
|
||||
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 '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="4">'.$objp->num_releve.' </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
$db->free($result);
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
@ -525,24 +575,24 @@ $sql.= " ORDER BY c.label";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$var=True;
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=True;
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print "<td>$objp->label</td>";
|
||||
print "<td align=\"center\"><a href=\"budget.php?bid=$objp->rowid\">".$langs->trans("ListBankTransactions")."</a></td>";
|
||||
print "<td align=\"right\"><a href=\"ligne.php?action=delete_categ&rowid=$rowid&fk_categ=$objp->rowid\">".img_delete($langs->trans("Remove"))."</a></td>";
|
||||
print "</tr>";
|
||||
print "<td>$objp->label</td>";
|
||||
print "<td align=\"center\"><a href=\"budget.php?bid=$objp->rowid\">".$langs->trans("ListBankTransactions")."</a></td>";
|
||||
print "<td align=\"right\"><a href=\"ligne.php?action=delete_categ&rowid=$rowid&fk_categ=$objp->rowid\">".img_delete($langs->trans("Remove"))."</a></td>";
|
||||
print "</tr>";
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->free($result);
|
||||
$i++;
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","bc.number","",$paramlist,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),"liste.php","dp","",$paramlist,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),"liste.php","dp","",$paramlist,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"),"liste.php","ba.label","",$paramlist,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NbOfCheques"),"liste.php","bc.nbcheque","",$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),"liste.php","bc.amount","",$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user