Skip to content
Snippets Groups Projects
Commit f8ade01f authored by aspangaro's avatar aspangaro
Browse files

New : Add payment donation in accountancy expert

parent e0f2c41a
Branches
Tags
Loading
......@@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
......@@ -120,6 +121,7 @@ $paymentsupplierstatic = new PaiementFourn($db);
$societestatic = new Societe($db);
$userstatic = new User($db);
$chargestatic = new ChargeSociales($db);
$paymentdonstatic = new PaymentDonation($db);
$paymentvatstatic = new TVA($db);
$paymentsalstatic = new PaymentSalary($db);
......@@ -133,6 +135,7 @@ if ($result) {
$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
$accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
$accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
$accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
$tabpay = array ();
$tabbq = array ();
......@@ -174,7 +177,6 @@ if ($result) {
// get_url may return -1 which is not traversable
if (is_array($links))
{
foreach ( $links as $key => $val )
{
$tabtype[$obj->rowid] = $links[$key]['type'];
......@@ -238,6 +240,13 @@ if ($result) {
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
}
}
else if ($links[$key]['type'] == 'payment_donation')
{
$paymentdonstatic->id = $links[$key]['url_id'];
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentDonation");
$tabtp[$obj->rowid][$accountancy_account_pay_donation] += $obj->amount;
}
else if ($links[$key]['type'] == 'payment_vat')
{
$paymentvatstatic->id = $links[$key]['url_id'];
......@@ -262,7 +271,6 @@ if ($result) {
$tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
}*/
}
}
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment