Removed unused code, misc corrections and corrected PHPDoc problems.

This commit is contained in:
Marcos García de La Fuente 2015-02-10 10:25:59 +01:00
parent 24ad1afdd2
commit 0d150b1d32
11 changed files with 38 additions and 59 deletions

View File

@ -94,7 +94,6 @@ if ($result)
while ($i < $num && $i < $max)
{
$obj = $db->fetch_object($result);
$fiscalyearstatic->ref=$obj->rowid;
$fiscalyearstatic->id=$obj->rowid;
print '<tr '.$bc[$var].'>';
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';

View File

@ -226,7 +226,7 @@ else if ($id)
// Ref
print "<tr>";
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
print $object->ref;
print $object->rowid;
print '</td></tr>';
// Label
@ -278,7 +278,7 @@ else if ($id)
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
print $object->ref;
print $object->rowid;
print '</td><td width="25%">';
print $linkback;
print '</td></tr>';

View File

@ -66,8 +66,8 @@ class AccountancySystem
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_system");
if ($id > 0) {
$this->id = $id;
$result = $this->id;
$this->rowid = $id;
$result = $this->rowid;
} else {
$result = - 2;
$this->error = "AccountancySystem::Create Erreur $result";

View File

@ -123,7 +123,7 @@ class AccountingAccount
*/
function create($user, $notrigger = 0)
{
global $conf, $langs;
global $conf;
$error = 0;
$now=dol_now();
@ -190,7 +190,7 @@ class AccountingAccount
if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount");
if (! $notrigger) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -200,7 +200,7 @@ class AccountingAccount
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
// }
}
// Commit or rollback
@ -225,8 +225,6 @@ class AccountingAccount
*/
function update($user)
{
global $langs;
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
@ -294,7 +292,6 @@ class AccountingAccount
*/
function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
$result = $this->checkUsage();
@ -303,8 +300,8 @@ class AccountingAccount
$this->db->begin();
if (! $error) {
if (! $notrigger) {
// if (! $error) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -314,8 +311,8 @@ class AccountingAccount
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
}
// }
// }
if (! $error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
@ -392,8 +389,6 @@ class AccountingAccount
*/
function account_desactivate($id)
{
global $langs;
$result = $this->checkUsage();
if ($result > 0) {
@ -427,8 +422,6 @@ class AccountingAccount
*/
function account_activate($id)
{
global $langs;
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";

View File

@ -225,8 +225,6 @@ class BookKeeping
*/
function create($user='')
{
global $conf, $user, $langs;
$this->piece_num = 0;
// first check if line not yet in bookkeeping
@ -355,7 +353,6 @@ class BookKeeping
*/
function create_std($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters
@ -445,7 +442,7 @@ class BookKeeping
if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping");
if (! $notrigger) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -455,7 +452,7 @@ class BookKeeping
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
// }
}
// Commit or rollback
@ -481,7 +478,6 @@ class BookKeeping
*/
function update($user = 0, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters
@ -550,8 +546,8 @@ class BookKeeping
$this->errors[] = "Error " . $this->db->lasterror();
}
if (! $error) {
if (! $notrigger) {
// if (! $error) {
// if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -561,8 +557,8 @@ class BookKeeping
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
}
}
// }
// }
// Commit or rollback
if ($error) {
@ -587,7 +583,6 @@ class BookKeeping
*/
function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
$this->db->begin();
@ -642,10 +637,10 @@ class BookKeeping
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
$resql = $this->db->query($sql);
dol_syslog(get_class($this) . "::export_bookkeping sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->linesexport = array ();

View File

@ -50,10 +50,6 @@ class FormVentilation extends Form
*/
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
{
global $langs;
$date_array = array ();
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
$sql .= ' ORDER BY import_key DESC';
@ -100,7 +96,7 @@ class FormVentilation extends Form
*/
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array())
{
global $conf, $user, $langs;
global $conf;
$out = '';
@ -161,7 +157,7 @@ class FormVentilation extends Form
*/
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array())
{
global $conf, $user, $langs;
global $conf;
$out = '';
@ -217,7 +213,7 @@ class FormVentilation extends Form
*/
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
{
global $conf, $user, $langs;
global $conf;
$out = '';

View File

@ -553,17 +553,15 @@ else
// Bank
foreach ( $tabbq[$key] as $k => $mt ) {
if (1) {
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $reflabel . "</td>";
print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $langs->trans('Bank') . "</td>";
print "<td>" . $val["type_payment"] . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>";
}
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $reflabel . "</td>";
print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $langs->trans('Bank') . "</td>";
print "<td>" . $val["type_payment"] . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>";
}
// Third party

View File

@ -230,7 +230,6 @@ if ($action == 'writebookkeeping') {
$bookkeeping->doc_type = 'customer_invoice';
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_facturedet"];
$bookkeeping->fk_compte = $compte->id;
$bookkeeping->code_tiers = '';
$bookkeeping->numero_compte = $k;
$bookkeeping->label_compte = $langs->trans("VAT");
@ -420,7 +419,6 @@ if ($action == 'export_csv') {
$invoicestatic->id = $key;
$invoicestatic->ref = $val["ref"];
$invoicestatic->type = $val["type"];
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
$date = dol_print_date($db->jdate($val["date"]), 'day');

View File

@ -261,7 +261,7 @@ class ICal
*/
function ical_rrule($value)
{
$result=aray();
$result=array();
$rrule = explode(';',$value);
foreach ($rrule as $line)
{

View File

@ -26,10 +26,10 @@
/**
* Prepare array with list of admin tabs
*
* @param Object $object Object instance we show card
* @param AccountingAccount $object Object instance we show card
* @return array Array of tabs to show
*/
function admin_accounting_prepare_head($object=null)
function admin_accounting_prepare_head(AccountingAccount $object=null)
{
global $langs, $conf;
@ -65,10 +65,10 @@ function admin_accounting_prepare_head($object=null)
/**
* Prepare array with list of tabs
*
* @param Object $object Accounting account
* @param AccountingAccount $object Accounting account
* @return array Array of tabs to show
*/
function accounting_prepare_head($object)
function accounting_prepare_head(AccountingAccount $object)
{
global $langs, $conf;

View File

@ -24,10 +24,10 @@
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param Fiscalyear $object Object related to tabs
* @return array Array of tabs to show
*/
function fiscalyear_prepare_head($object)
function fiscalyear_prepare_head(Fiscalyear $object)
{
global $langs, $conf;