Fix phpcs
This commit is contained in:
parent
944f9ac894
commit
8ce6f67773
@ -27,9 +27,8 @@
|
|||||||
* \brief Page ajout de categories bancaires
|
* \brief Page ajout de categories bancaires
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$res=@include("../main.inc.php");
|
require '../main.inc.php';
|
||||||
if (! $res) $res=@include("../../main.inc.php");
|
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
||||||
include_once 'class/cashcontrol.class.php';
|
|
||||||
|
|
||||||
$langs->loadLangs(array("cashcontrol","install","cashdesk","admin"));
|
$langs->loadLangs(array("cashcontrol","install","cashdesk","admin"));
|
||||||
|
|
||||||
@ -97,7 +96,7 @@ llxHeader();
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("DateCreationShort").'</td><td colspan="2">'.$langs->trans("DateEnd").'</td><td align=right>'.$langs->trans("Cash").'</td><td align=right>'.$langs->trans("PaymentTypeCB").'</td><td>'.$langs->trans("Status").'</td>';
|
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("DateCreationShort").'</td><td colspan="2">'.$langs->trans("DateEnd").'</td><td align=right>'.$langs->trans("Cash").'</td><td align=right>'.$langs->trans("PaymentTypeCB").'</td><td>'.$langs->trans("Status").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$sql = "SELECT *";
|
$sql = "SELECT *";
|
||||||
$sql.= " FROM ";
|
$sql.= " FROM ";
|
||||||
$sql.= MAIN_DB_PREFIX."pos_cash_fence order by rowid DESC";
|
$sql.= MAIN_DB_PREFIX."pos_cash_fence order by rowid DESC";
|
||||||
@ -126,7 +125,7 @@ llxHeader();
|
|||||||
} else {
|
} else {
|
||||||
//no hay
|
//no hay
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table></form>';
|
print '</table></form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,25 +141,25 @@ if ($action=="view")
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("Code");
|
print $langs->trans("Code");
|
||||||
print '</td><td colspan="2">';
|
print '</td><td colspan="2">';
|
||||||
print $id;
|
print $id;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("DateCreationShort");
|
print $langs->trans("DateCreationShort");
|
||||||
print '</td><td colspan="2">';
|
print '</td><td colspan="2">';
|
||||||
print dol_print_date($cashcontrol->date_creation, 'dayhour');
|
print dol_print_date($cashcontrol->date_creation, 'dayhour');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("DateEnd");
|
print $langs->trans("DateEnd");
|
||||||
print '</td><td colspan="2">';
|
print '</td><td colspan="2">';
|
||||||
print dol_print_date(strtotime($cashcontrol->year_close."-".$cashcontrol->month_close."-".$cashcontrol->day_close), 'day');
|
print dol_print_date(strtotime($cashcontrol->year_close."-".$cashcontrol->month_close."-".$cashcontrol->day_close), 'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("Status");
|
print $langs->trans("Status");
|
||||||
print '</td><td colspan="2">';
|
print '</td><td colspan="2">';
|
||||||
@ -177,11 +176,11 @@ if ($action=="view")
|
|||||||
print '<tr><td valign="middle">'.$langs->trans("InitialBankBalance").'</td><td colspan="3">';
|
print '<tr><td valign="middle">'.$langs->trans("InitialBankBalance").'</td><td colspan="3">';
|
||||||
print price($cashcontrol->opening);
|
print price($cashcontrol->opening);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="middle">'.$langs->trans("CashDesk").' ID</td><td colspan="3">';
|
print '<tr><td valign="middle">'.$langs->trans("CashDesk").' ID</td><td colspan="3">';
|
||||||
print $cashcontrol->posnumber;
|
print $cashcontrol->posnumber;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="middle">'.$langs->trans("Module").'</td><td colspan="3">';
|
print '<tr><td valign="middle">'.$langs->trans("Module").'</td><td colspan="3">';
|
||||||
print $cashcontrol->posmodule;
|
print $cashcontrol->posmodule;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -192,13 +191,15 @@ if ($action=="view")
|
|||||||
print '<div style="clear:both"></div>';
|
print '<div style="clear:both"></div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">' . $langs->trans('PrintTicket') . '</a></div>';
|
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">' . $langs->trans('PrintTicket') . '</a></div>';
|
||||||
if ($cashcontrol->status==1) print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=close">' . $langs->trans('Close') . '</a></div>';
|
if ($cashcontrol->status==1) print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=close">' . $langs->trans('Close') . '</a></div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
|
* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -38,7 +38,7 @@ class CashControl // extends CommonObject
|
|||||||
public $day_close;
|
public $day_close;
|
||||||
public $posmodule;
|
public $posmodule;
|
||||||
public $posnumber;
|
public $posnumber;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -71,14 +71,14 @@ class CashControl // extends CommonObject
|
|||||||
$sql .= ", status";
|
$sql .= ", status";
|
||||||
$sql .= ", date_creation";
|
$sql .= ", date_creation";
|
||||||
$sql .= ", posmodule";
|
$sql .= ", posmodule";
|
||||||
$sql .= ", posnumber";
|
$sql .= ", posnumber";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= $conf->entity;
|
$sql .= $conf->entity;
|
||||||
$sql .= ", ".$this->opening;
|
$sql .= ", ".$this->opening;
|
||||||
$sql .= ",1";
|
$sql .= ",1";
|
||||||
$sql .= ", now()";
|
$sql .= ", now()";
|
||||||
$sql .= ", '".$this->posmodule."'";
|
$sql .= ", '".$this->posmodule."'";
|
||||||
$sql .= ", '".$this->posnumber."'";
|
$sql .= ", '".$this->posnumber."'";
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -108,10 +108,13 @@ class CashControl // extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* close
|
||||||
|
*
|
||||||
|
* @param User $user User
|
||||||
|
* @param number $notrigger No trigger
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
public function close(User $user, $notrigger = 0)
|
public function close(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
@ -123,7 +126,7 @@ class CashControl // extends CommonObject
|
|||||||
$sql .= "SET";
|
$sql .= "SET";
|
||||||
$sql .= " day_close=DAYOFMONTH(NOW())";
|
$sql .= " day_close=DAYOFMONTH(NOW())";
|
||||||
$sql .= ", month_close=MONTH(NOW())";
|
$sql .= ", month_close=MONTH(NOW())";
|
||||||
$sql .= ", year_close=YEAR(NOW())";
|
$sql .= ", year_close=YEAR(NOW())";
|
||||||
$sql .= ", status=2";
|
$sql .= ", status=2";
|
||||||
$sql .= " where rowid=".$this->id;
|
$sql .= " where rowid=".$this->id;
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -152,16 +155,13 @@ class CashControl // extends CommonObject
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load object in memory from database
|
* Load object in memory from database
|
||||||
*
|
*
|
||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
@ -172,7 +172,7 @@ class CashControl // extends CommonObject
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."pos_cash_fence";
|
$sql .= " FROM ".MAIN_DB_PREFIX."pos_cash_fence";
|
||||||
$sql .= " WHERE rowid = ".$id;
|
$sql .= " WHERE rowid = ".$id;
|
||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
@ -196,4 +196,4 @@ class CashControl // extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,7 +7,7 @@
|
|||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
|
* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* \brief List of bank transactions
|
* \brief List of bank transactions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$res=@include("../main.inc.php");
|
require '../main.inc.php';
|
||||||
if (! $res) $res=@include("../../main.inc.php");
|
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
@ -48,7 +48,7 @@ $arrayfields=array(
|
|||||||
'b.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'b.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||||
'b.dateo'=>array('label'=>$langs->trans("DateOperationShort"), 'checked'=>1),
|
'b.dateo'=>array('label'=>$langs->trans("DateOperationShort"), 'checked'=>1),
|
||||||
'b.num_chq'=>array('label'=>$langs->trans("Number"), 'checked'=>1),
|
'b.num_chq'=>array('label'=>$langs->trans("Number"), 'checked'=>1),
|
||||||
'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1),
|
'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1),
|
||||||
'b.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1, 'position'=>600),
|
'b.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1, 'position'=>600),
|
||||||
'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605),
|
'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605),
|
||||||
);
|
);
|
||||||
@ -56,7 +56,7 @@ $arrayfields=array(
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $param);
|
llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $param);
|
||||||
|
|
||||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
|
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
|
||||||
@ -86,7 +86,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print "<center><h2>";
|
print "<center><h2>";
|
||||||
if ($cashcontrol->status==2) print "Cashcontrol ".$cashcontrol->id;
|
if ($cashcontrol->status==2) print "Cashcontrol ".$cashcontrol->id;
|
||||||
else print $langs->trans("Cashcontrol")." - ".$langs->trans("Draft");
|
else print $langs->trans("Cashcontrol")." - ".$langs->trans("Draft");
|
||||||
@ -199,7 +199,7 @@ if ($resql)
|
|||||||
$bankaccount = $cachebankaccount[$objp->bankid];
|
$bankaccount = $cachebankaccount[$objp->bankid];
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
if ($first==""){
|
if ($first==""){
|
||||||
print '<td>'.$langs->trans("InitialBankBalance").'</td><td></td><td></td><td></td><td align="right">'.price($cashcontrol->opening).'</td></tr>';
|
print '<td>'.$langs->trans("InitialBankBalance").'</td><td></td><td></td><td></td><td align="right">'.price($cashcontrol->opening).'</td></tr>';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -275,22 +275,23 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
$cash=$cash+$cashcontrol->opening;
|
$cash=$cash+$cashcontrol->opening;
|
||||||
print "<div style='text-align: right'><h2>".$langs->trans("Cash").": ".price($cash)."<br><br>".$langs->trans("PaymentTypeCB").": ".price($bank)."</h2></div>";
|
print "<div style='text-align: right'><h2>".$langs->trans("Cash").": ".price($cash)."<br><br>".$langs->trans("PaymentTypeCB").": ".price($bank)."</h2></div>";
|
||||||
|
|
||||||
|
|
||||||
//save totals to DB
|
//save totals to DB
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."pos_cash_fence ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."pos_cash_fence ";
|
||||||
$sql .= "SET";
|
$sql .= "SET";
|
||||||
$sql .= " cash='".$cash."'";
|
$sql .= " cash='".$cash."'";
|
||||||
$sql .= ", card='".$bank."'";
|
$sql .= ", card='".$bank."'";
|
||||||
$sql .= " where rowid=".$id;
|
$sql .= " where rowid=".$id;
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user