Debug v13
This commit is contained in:
parent
cce0b2f31b
commit
b0e3f1678f
@ -707,4 +707,37 @@ class PaymentSocialContribution extends CommonObject
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return if object was dispatched into bookkeeping
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, 0=no, 1=yes
|
||||||
|
*/
|
||||||
|
public function getVentilExportCompta()
|
||||||
|
{
|
||||||
|
$alreadydispatched = 0;
|
||||||
|
|
||||||
|
$type = 'bank';
|
||||||
|
|
||||||
|
$sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".$this->bank_line;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
if ($obj)
|
||||||
|
{
|
||||||
|
$alreadydispatched = $obj->nb;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($alreadydispatched)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1781,7 +1781,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add if object was dispatched "into accountancy"
|
// Add if object was dispatched "into accountancy"
|
||||||
if (!empty($conf->accounting->enabled) && in_array($object->element, array('bank', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various')))
|
if (!empty($conf->accounting->enabled) && in_array($object->element, array('bank', 'paiementcharge', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various')))
|
||||||
{
|
{
|
||||||
// Note: For 'chargesociales', 'salaries'... this is the payments that are dispatched (so element = 'bank')
|
// Note: For 'chargesociales', 'salaries'... this is the payments that are dispatched (so element = 'bank')
|
||||||
if (method_exists($object, 'getVentilExportCompta'))
|
if (method_exists($object, 'getVentilExportCompta'))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user