Work on reports per date
This commit is contained in:
parent
e1fa37f7ff
commit
c1d31c34cd
@ -338,7 +338,7 @@ class AccountancyCategory
|
||||
* @param string $month Specifig month - Can be empty
|
||||
* @param string $date_start Date start
|
||||
* @param string $date_end Date end
|
||||
* @param int $sens Sens of the account 0: credit - debit 1: debit - credit
|
||||
* @param int $sens Sens of the account: 0: credit - debit, 1: debit - credit
|
||||
* @return integer Result in table
|
||||
*/
|
||||
public function getResult($cpt, $month, $date_start, $date_end, $sens)
|
||||
|
||||
@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
|
||||
$langs->loadLangs(array('compta','bills','donation','salaries'));
|
||||
|
||||
@ -119,11 +120,29 @@ $modecompta = $conf->global->ACCOUNTING_MODE;
|
||||
if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING';
|
||||
if (GETPOST("modecompta",'alpha')) $modecompta=GETPOST("modecompta",'alpha');
|
||||
|
||||
$AccCat = new AccountancyCategory($db);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$months = array(
|
||||
$langs->trans("JanuaryMin"),
|
||||
$langs->trans("FebruaryMin"),
|
||||
$langs->trans("MarchMin"),
|
||||
$langs->trans("AprilMin"),
|
||||
$langs->trans("MayMin"),
|
||||
$langs->trans("JuneMin"),
|
||||
$langs->trans("JulyMin"),
|
||||
$langs->trans("AugustMin"),
|
||||
$langs->trans("SeptemberMin"),
|
||||
$langs->trans("OctoberMin"),
|
||||
$langs->trans("NovemberMin"),
|
||||
$langs->trans("DecemberMin"),
|
||||
);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
@ -265,32 +284,14 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
// Loop on detail of all accounts
|
||||
// This make 14 calls for each detail of account (NP, N and month m)
|
||||
if ($showaccountdetail == 'yes')
|
||||
{ /*
|
||||
{
|
||||
// TODO Get list of account for this group/subgroup
|
||||
$cpts = array();
|
||||
|
||||
foreach($cpts as $i => $cpt)
|
||||
{
|
||||
// N-1
|
||||
$return = $AccCat->getResult($cpt['account_number'], 0, $date_start_previous, $date_end_previous, $cpt['dc']);
|
||||
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultNP=0;
|
||||
} else {
|
||||
$resultNP=$AccCat->sdc;
|
||||
}
|
||||
|
||||
//N
|
||||
$return = $AccCat->getResult($cpt['account_number'], 0, $date_start, $date_end, $cpt['dc']);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultN=0;
|
||||
} else {
|
||||
$resultN=$AccCat->sdc;
|
||||
}
|
||||
|
||||
$sommes[$code]['NP'] += $resultNP;
|
||||
$sommes[$code]['N'] += $resultN;
|
||||
|
||||
print '<tr>';
|
||||
|
||||
print '<td> ' . length_accountg($cpt['account_number']) . '</td>';
|
||||
print '<td>' . $cpt['name_cpt'] . '</td>';
|
||||
print '<td align="right">' . price($resultNP) . '</td>';
|
||||
@ -306,14 +307,11 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
$resultM=$AccCat->sdc;
|
||||
}
|
||||
$sommes[$code]['M'][$k] += $resultM;
|
||||
if ($showaccountdetail == 'yes') {
|
||||
print '<td align="right">' . price($resultM) . '</td>';
|
||||
}
|
||||
print '<td align="right">' . price($resultM) . '</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
@ -26,8 +26,8 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
|
||||
$langs->loadLangs(array('compta','bills','donation','salaries'));
|
||||
|
||||
@ -136,6 +136,21 @@ $AccCat = new AccountancyCategory($db);
|
||||
* View
|
||||
*/
|
||||
|
||||
$months = array(
|
||||
$langs->trans("JanuaryMin"),
|
||||
$langs->trans("FebruaryMin"),
|
||||
$langs->trans("MarchMin"),
|
||||
$langs->trans("AprilMin"),
|
||||
$langs->trans("MayMin"),
|
||||
$langs->trans("JuneMin"),
|
||||
$langs->trans("JulyMin"),
|
||||
$langs->trans("AugustMin"),
|
||||
$langs->trans("SeptemberMin"),
|
||||
$langs->trans("OctoberMin"),
|
||||
$langs->trans("NovemberMin"),
|
||||
$langs->trans("DecemberMin"),
|
||||
);
|
||||
|
||||
llxheader('', $langs->trans('ReportInOut'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
@ -205,20 +220,6 @@ $moreforfilter='';
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
$months = array( $langs->trans("JanuaryMin"),
|
||||
$langs->trans("FebruaryMin"),
|
||||
$langs->trans("MarchMin"),
|
||||
$langs->trans("AprilMin"),
|
||||
$langs->trans("MayMin"),
|
||||
$langs->trans("JuneMin"),
|
||||
$langs->trans("JulyMin"),
|
||||
$langs->trans("AugustMin"),
|
||||
$langs->trans("SeptemberMin"),
|
||||
$langs->trans("OctoberMin"),
|
||||
$langs->trans("NovemberMin"),
|
||||
$langs->trans("DecemberMin"),
|
||||
);
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th class="liste_titre">'.$langs->trans("AccountingCategory").'</th>';
|
||||
print '<th class="liste_titre"></th>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user