Fix: Add social contributions in budget
This commit is contained in:
parent
ed159e1eaf
commit
83d240fbd9
@ -314,7 +314,7 @@ class ChargeSociales
|
|||||||
function getSommePaiement()
|
function getSommePaiement()
|
||||||
{
|
{
|
||||||
$table='paiementcharge';
|
$table='paiementcharge';
|
||||||
$field='amount';
|
$field='fk_charge';
|
||||||
|
|
||||||
$sql = 'SELECT sum(amount) as amount';
|
$sql = 'SELECT sum(amount) as amount';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.$table;
|
$sql.= ' FROM '.MAIN_DB_PREFIX.$table;
|
||||||
|
|||||||
@ -167,7 +167,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$sql2.= " ORDER BY dlr ASC";
|
$sql2.= " ORDER BY dlr ASC";
|
||||||
|
|
||||||
// Social contributions
|
// Social contributions
|
||||||
$sql3= " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, cs.amount as total_ttc, ccs.libelle as type, ".$db->pdate("cs.date_ech")." as dlr";
|
$sql3= " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, (-1*cs.amount) as total_ttc, ccs.libelle as type, ".$db->pdate("cs.date_ech")." as dlr";
|
||||||
$sql3.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
|
$sql3.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||||
$sql3.= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as ccs ON cs.fk_type = ccs.id";
|
$sql3.= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as ccs ON cs.fk_type = ccs.id";
|
||||||
$sql3.= " WHERE cs.paye = 0"; // Not payed
|
$sql3.= " WHERE cs.paye = 0"; // Not payed
|
||||||
@ -291,8 +291,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$socialcontribstatic->lib=$obj->type;
|
$socialcontribstatic->lib=$obj->type;
|
||||||
$ref = $socialcontribstatic->getNomUrl(1,24);
|
$ref = $socialcontribstatic->getNomUrl(1,24);
|
||||||
|
|
||||||
$paiement = $socialcontribstatic->getSommePaiement(); // Payment already done
|
$paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done
|
||||||
print 'x'.$paiement.'/'.$obj->total_ttc."x";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_ttc = $obj->total_ttc;
|
$total_ttc = $obj->total_ttc;
|
||||||
|
|||||||
@ -1638,7 +1638,7 @@ class Facture extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return amount aof payments already done
|
* \brief Return amount of payments already done
|
||||||
* \return int Amount of payment already done, <0 if KO
|
* \return int Amount of payment already done, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getSommePaiement()
|
function getSommePaiement()
|
||||||
|
|||||||
@ -60,13 +60,13 @@ function bank_prepare_head($obj)
|
|||||||
$head[$h][2] = 'graph';
|
$head[$h][2] = 'graph';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
|
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
|
||||||
{
|
// {
|
||||||
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$obj->id;
|
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$obj->id;
|
||||||
$head[$h][1] = $langs->trans("CashBudget");
|
$head[$h][1] = $langs->trans("CashBudget");
|
||||||
$head[$h][2] = 'cash';
|
$head[$h][2] = 'cash';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ($obj->courant != 2)
|
if ($obj->courant != 2)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user