Removed unused code, misc corrections and corrected PHPDoc problems.
This commit is contained in:
parent
24ad1afdd2
commit
0d150b1d32
@ -94,7 +94,6 @@ if ($result)
|
|||||||
while ($i < $num && $i < $max)
|
while ($i < $num && $i < $max)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$fiscalyearstatic->ref=$obj->rowid;
|
|
||||||
$fiscalyearstatic->id=$obj->rowid;
|
$fiscalyearstatic->id=$obj->rowid;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';
|
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';
|
||||||
|
|||||||
@ -226,7 +226,7 @@ else if ($id)
|
|||||||
// Ref
|
// Ref
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||||
print $object->ref;
|
print $object->rowid;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
@ -278,7 +278,7 @@ else if ($id)
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
|
||||||
print $object->ref;
|
print $object->rowid;
|
||||||
print '</td><td width="25%">';
|
print '</td><td width="25%">';
|
||||||
print $linkback;
|
print $linkback;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -66,8 +66,8 @@ class AccountancySystem
|
|||||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_system");
|
$id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_system");
|
||||||
|
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$this->id = $id;
|
$this->rowid = $id;
|
||||||
$result = $this->id;
|
$result = $this->rowid;
|
||||||
} else {
|
} else {
|
||||||
$result = - 2;
|
$result = - 2;
|
||||||
$this->error = "AccountancySystem::Create Erreur $result";
|
$this->error = "AccountancySystem::Create Erreur $result";
|
||||||
|
|||||||
@ -123,7 +123,7 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
@ -190,7 +190,7 @@ class AccountingAccount
|
|||||||
if (! $error) {
|
if (! $error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount");
|
$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
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ class AccountingAccount
|
|||||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -225,8 +225,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function update($user)
|
function update($user)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||||
@ -294,7 +292,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
@ -303,8 +300,8 @@ class AccountingAccount
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error) {
|
// if (! $error) {
|
||||||
if (! $notrigger) {
|
// if (! $notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -314,8 +311,8 @@ class AccountingAccount
|
|||||||
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount";
|
||||||
@ -392,8 +389,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function account_desactivate($id)
|
function account_desactivate($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@ -427,8 +422,6 @@ class AccountingAccount
|
|||||||
*/
|
*/
|
||||||
function account_activate($id)
|
function account_activate($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount ";
|
||||||
|
|||||||
@ -225,8 +225,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function create($user='')
|
function create($user='')
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
|
||||||
|
|
||||||
$this->piece_num = 0;
|
$this->piece_num = 0;
|
||||||
|
|
||||||
// first check if line not yet in bookkeeping
|
// first check if line not yet in bookkeeping
|
||||||
@ -355,7 +353,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function create_std($user, $notrigger = 0)
|
function create_std($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -445,7 +442,7 @@ class BookKeeping
|
|||||||
if (! $error) {
|
if (! $error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping");
|
$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
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -455,7 +452,7 @@ class BookKeeping
|
|||||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -481,7 +478,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0)
|
function update($user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -550,8 +546,8 @@ class BookKeeping
|
|||||||
$this->errors[] = "Error " . $this->db->lasterror();
|
$this->errors[] = "Error " . $this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
// if (! $error) {
|
||||||
if (! $notrigger) {
|
// if (! $notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -561,8 +557,8 @@ class BookKeeping
|
|||||||
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -587,7 +583,6 @@ class BookKeeping
|
|||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -642,10 +637,10 @@ class BookKeeping
|
|||||||
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::export_bookkeping sql=" . $sql, LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$this->linesexport = array ();
|
$this->linesexport = array ();
|
||||||
|
|
||||||
|
|||||||
@ -50,10 +50,6 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
|
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey='')
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$date_array = array ();
|
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
||||||
$sql .= ' ORDER BY import_key DESC';
|
$sql .= ' ORDER BY import_key DESC';
|
||||||
|
|
||||||
@ -100,7 +96,7 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array())
|
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array())
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
@ -161,7 +157,7 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array())
|
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array())
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
@ -217,7 +213,7 @@ class FormVentilation extends Form
|
|||||||
*/
|
*/
|
||||||
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
|
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
|
|||||||
@ -553,17 +553,15 @@ else
|
|||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
if (1) {
|
print "<tr " . $bc[$var] . ">";
|
||||||
print "<tr " . $bc[$var] . ">";
|
print "<td>" . $date . "</td>";
|
||||||
print "<td>" . $date . "</td>";
|
print "<td>" . $reflabel . "</td>";
|
||||||
print "<td>" . $reflabel . "</td>";
|
print "<td>" . length_accountg($k) . "</td>";
|
||||||
print "<td>" . length_accountg($k) . "</td>";
|
print "<td>" . $langs->trans('Bank') . "</td>";
|
||||||
print "<td>" . $langs->trans('Bank') . "</td>";
|
print "<td>" . $val["type_payment"] . "</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 "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
print "</tr>";
|
||||||
print "</tr>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
|
|||||||
@ -230,7 +230,6 @@ if ($action == 'writebookkeeping') {
|
|||||||
$bookkeeping->doc_type = 'customer_invoice';
|
$bookkeeping->doc_type = 'customer_invoice';
|
||||||
$bookkeeping->fk_doc = $key;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
||||||
$bookkeeping->fk_compte = $compte->id;
|
|
||||||
$bookkeeping->code_tiers = '';
|
$bookkeeping->code_tiers = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = $langs->trans("VAT");
|
$bookkeeping->label_compte = $langs->trans("VAT");
|
||||||
@ -420,7 +419,6 @@ if ($action == 'export_csv') {
|
|||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
$invoicestatic->ref = $val["ref"];
|
$invoicestatic->ref = $val["ref"];
|
||||||
$invoicestatic->type = $val["type"];
|
$invoicestatic->type = $val["type"];
|
||||||
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
|
|
||||||
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
|
|||||||
@ -261,7 +261,7 @@ class ICal
|
|||||||
*/
|
*/
|
||||||
function ical_rrule($value)
|
function ical_rrule($value)
|
||||||
{
|
{
|
||||||
$result=aray();
|
$result=array();
|
||||||
$rrule = explode(';',$value);
|
$rrule = explode(';',$value);
|
||||||
foreach ($rrule as $line)
|
foreach ($rrule as $line)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,10 +26,10 @@
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of admin tabs
|
* 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
|
* @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;
|
global $langs, $conf;
|
||||||
|
|
||||||
@ -65,10 +65,10 @@ function admin_accounting_prepare_head($object=null)
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param Object $object Accounting account
|
* @param AccountingAccount $object Accounting account
|
||||||
* @return array Array of tabs to show
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function accounting_prepare_head($object)
|
function accounting_prepare_head(AccountingAccount $object)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
|
|||||||
@ -24,10 +24,10 @@
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* 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
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function fiscalyear_prepare_head($object)
|
function fiscalyear_prepare_head(Fiscalyear $object)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user