New: Cheques into cheques receipts are ordered by operation date.
This commit is contained in:
parent
53daae649c
commit
b6b48d61bf
@ -22,6 +22,7 @@ For users:
|
||||
- New: Can export into Excel 2007 format.
|
||||
- New: Add hidden option CASHDESK_FORCE_STOCK_ON_BILL
|
||||
- New: Can search on part of barcode into POS module.
|
||||
- New: Cheques into cheques receipts are ordered by operation date.
|
||||
- Fix: Can use POS module with several concurrent users.
|
||||
|
||||
For developers:
|
||||
|
||||
@ -56,9 +56,9 @@ class RemiseCheque extends CommonObject
|
||||
/**
|
||||
* Load record
|
||||
*
|
||||
* @param id Id record
|
||||
* @param ref Ref record
|
||||
* @return int <0 if KO, > 0 if OK
|
||||
* @param int $id Id record
|
||||
* @param string $ref Ref record
|
||||
* @return int <0 if KO, > 0 if OK
|
||||
*/
|
||||
function fetch($id,$ref='')
|
||||
{
|
||||
@ -72,7 +72,7 @@ class RemiseCheque extends CommonObject
|
||||
$sql.= " WHERE bc.entity = ".$conf->entity;
|
||||
if ($id) $sql.= " AND bc.rowid = ".$id;
|
||||
if ($ref) $sql.= " AND bc.number = '".$this->db->escape($ref)."'";
|
||||
|
||||
|
||||
dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -503,14 +503,14 @@ class RemiseCheque extends CommonObject
|
||||
$sql.= " AND b.fk_bordereau = bc.rowid";
|
||||
$sql.= " AND bc.rowid = ".$this->id;
|
||||
$sql.= " AND bc.entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY b.emetteur ASC, b.rowid ASC;";
|
||||
$sql.= " ORDER BY b.dateo ASC, b.rowid ASC";
|
||||
|
||||
dol_syslog("RemiseCheque::generatePdf sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$i = 0;
|
||||
while ( $objp = $this->db->fetch_object($result) )
|
||||
while ($objp = $this->db->fetch_object($result))
|
||||
{
|
||||
$docmodel->lines[$i]->bank_chq = $objp->banque;
|
||||
$docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
|
||||
@ -531,7 +531,7 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
// We save charset_output to restore it because write_file can change it if needed for
|
||||
// output format that does not support UTF8.
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
$sav_charseSupprimert_output=$outputlangs->charset_output;
|
||||
$result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs);
|
||||
if ($result > 0)
|
||||
{
|
||||
|
||||
@ -46,11 +46,11 @@ $result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldid
|
||||
|
||||
$mesg='';
|
||||
|
||||
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$sortfield=GETPOST("sortfield");
|
||||
$sortorder=GETPOST("sortorder");
|
||||
$page=$_GET["page"];
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="b.emetteur";
|
||||
if (! $sortfield) $sortfield="b.dateo,b.rowid";
|
||||
if ($page < 0) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
@ -309,15 +309,15 @@ if ($action == 'new')
|
||||
print '<tr><td>'.$langs->trans("BankAccount").'</td><td>';
|
||||
print $html->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '</table>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" name="filter" value="'.dol_escape_htmltag($langs->trans("ToFilter")).'">';
|
||||
if ($filterdate || $filteraccountid > 0)
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '</center>';
|
||||
//print '</fieldset>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
@ -522,12 +522,12 @@ else
|
||||
$param="&id=".$remisecheque->id;
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Cheque"),'','','','','width="30"');
|
||||
print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo,b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"b.num_chq", "",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CheckTransmitter"),$_SERVER["PHP_SELF"],"b.emetteur", "",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Bank"),$_SERVER["PHP_SELF"],"b.banque", "",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo", "",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print "</tr>\n";
|
||||
$i=1;
|
||||
@ -539,6 +539,7 @@ else
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td align="center">'.$i.'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->date),'day').'</td>'; // Date operation
|
||||
print '<td align="center">'.($objp->num_chq?$objp->num_chq:' ').'</td>';
|
||||
print '<td>'.dol_trunc($objp->emetteur,24).'</td>';
|
||||
print '<td>'.dol_trunc($objp->banque,24).'</td>';
|
||||
@ -554,7 +555,6 @@ else
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->date),'day').'</td>';
|
||||
if($remisecheque->statut == 0)
|
||||
{
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'</a></td>';
|
||||
@ -593,12 +593,12 @@ if ($user->societe_id == 0 && count($accounts) == 1 && $action == 'new' && $user
|
||||
|
||||
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $remisecheque->id && $user->rights->banque->cheque)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&action=valide">'.$langs->trans('Valid').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&action=valide&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$langs->trans('Valid').'</a>';
|
||||
}
|
||||
|
||||
if ($user->societe_id == 0 && $remisecheque->id && $user->rights->banque->cheque)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&action=delete&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$langs->trans('Delete').'</a>';
|
||||
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
@ -39,7 +39,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function BordereauChequeBlochet($db)
|
||||
{
|
||||
@ -76,6 +78,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
/**
|
||||
* Fonction generant le rapport sur le disque
|
||||
*
|
||||
* @param _dir Directory
|
||||
* @param number Number
|
||||
* @param outputlangs Lang output object
|
||||
|
||||
Loading…
Reference in New Issue
Block a user