Standardize the selection of the calculation mode in account reports
This commit is contained in:
parent
8e4f91514e
commit
24104118e0
@ -119,6 +119,7 @@ if (isModEnabled('accounting')) {
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
||||
print '<br>';
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
@ -70,36 +70,34 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
// Date range
|
||||
$year = GETPOST('year', 'int');
|
||||
$year = GETPOST('year', 'int'); // this is used for navigation previous/next. It is the last year to show in filter
|
||||
if (empty($year)) {
|
||||
$year_current = dol_print_date(dol_now(), "%Y");
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year_current;
|
||||
$year_start = $year_current - ($nbofyear - 1);
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year;
|
||||
$year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
}
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
// We define date_start and date_end
|
||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||
$q = GETPOST("q") ?GETPOST("q") : 0;
|
||||
$q = GETPOST("q") ? GETPOST("q", 'int') : 0;
|
||||
if ($q == 0) {
|
||||
// We define date_start and date_end
|
||||
$year_end = $year_start;
|
||||
$month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
$year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
$month_start = GETPOST("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if (!GETPOST('month')) {
|
||||
if (!GETPOST("year") && $month_start > $month_current) {
|
||||
if (!$year && $month_start > $month_current) {
|
||||
$year_start--;
|
||||
$year_end--;
|
||||
}
|
||||
$month_end = $month_start - 1;
|
||||
if ($month_end < 1) {
|
||||
$month_end = 12;
|
||||
} else {
|
||||
$year_end++;
|
||||
}
|
||||
} else {
|
||||
$month_end = $month_start;
|
||||
@ -157,6 +155,7 @@ if (isModEnabled('accounting')) {
|
||||
}
|
||||
$hookmanager->initHooks(['customersupplierreportlist']);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -174,13 +173,6 @@ $total_ttc = 0;
|
||||
// Affiche en-tete de rapport
|
||||
if ($modecompta == "CREANCES-DETTES") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
|
||||
}
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] - 1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] + 1)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesResultDue");
|
||||
@ -196,13 +188,6 @@ if ($modecompta == "CREANCES-DETTES") {
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
|
||||
}
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] - 1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] + 1)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesResultInOut");
|
||||
@ -210,14 +195,9 @@ if ($modecompta == "CREANCES-DETTES") {
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$arraylist = array('no'=>$langs->trans("CustomerCode"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
|
||||
$period .= ' '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
|
||||
$period .= ' <span class="opacitymedium">'.$langs->trans("DetailBy").'</span> '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] - 1)."&modecompta=".$modecompta."&showaccountdetail=".$showaccountdetail."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] + 1)."&modecompta=".$modecompta."&showaccountdetail=".$showaccountdetail."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesResultBookkeepingPredefined");
|
||||
$description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("Chartofaccounts")).')';
|
||||
@ -225,7 +205,23 @@ if ($modecompta == "CREANCES-DETTES") {
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
|
||||
$hselected = 'report';
|
||||
// Define $calcmode line
|
||||
$calcmode = '';
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'showaccountdetail'=>$showaccountdetail), $calcmode);
|
||||
|
||||
|
||||
@ -36,11 +36,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'bills', 'donation', 'salaries'));
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth', 'int');
|
||||
$date_startday = GETPOST('date_startday', 'int');
|
||||
$date_startmonth = GETPOST('date_startmonth', 'int');
|
||||
$date_startyear = GETPOST('date_startyear', 'int');
|
||||
$date_endmonth = GETPOST('date_endmonth', 'int');
|
||||
$date_endday = GETPOST('date_endday', 'int');
|
||||
$date_endmonth = GETPOST('date_endmonth', 'int');
|
||||
$date_endyear = GETPOST('date_endyear', 'int');
|
||||
|
||||
$nbofyear = 4;
|
||||
@ -60,8 +60,8 @@ if (empty($year)) {
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
}
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver');
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver');
|
||||
|
||||
// We define date_start and date_end
|
||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||
@ -151,13 +151,6 @@ $decaiss_ttc = array();
|
||||
// Affiche en-tete du rapport
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
|
||||
}
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesAmountWithTaxExcluded");
|
||||
@ -174,13 +167,6 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
|
||||
}
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesAmountWithTaxIncluded");
|
||||
@ -189,11 +175,6 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesAmountOnInOutBookkeepingRecord");
|
||||
@ -202,8 +183,25 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
|
||||
// Define $calcmode line
|
||||
$calcmode = '';
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta), $calcmode);
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||
|
||||
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
|
||||
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
|
||||
@ -1006,7 +1004,7 @@ print '<tr class="liste_titre"><td class="liste_titre"> </td>';
|
||||
|
||||
for ($annee = $year_start; $annee <= $year_end_for_table; $annee++) {
|
||||
print '<td align="center" colspan="2" class="liste_titre borderrightlight">';
|
||||
print '<a href="clientfourn.php?year='.$annee.'">';
|
||||
print '<a href="clientfourn.php?year='.((int) $annee).'">';
|
||||
print $annee;
|
||||
if (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1) {
|
||||
print '-'.($annee + 1);
|
||||
|
||||
@ -63,11 +63,11 @@ $nbofyear = 1;
|
||||
$year = GETPOST('year', 'int'); // year with current month, is the month of the period we must show
|
||||
if (empty($year)) {
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$month_current = strftime("%m", dol_now());
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year_current - ($nbofyear - 1);
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$month_current = strftime("%m", dol_now());
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year - ($nbofyear - 1);
|
||||
}
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
@ -75,14 +75,14 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
// We define date_start and date_end
|
||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||
$q = GETPOST("q") ?GETPOST("q") : 0;
|
||||
$q = GETPOST("q") ?GETPOST("q", 'int') : 0;
|
||||
if ($q == 0) {
|
||||
// We define date_start and date_end
|
||||
$year_end = $year_start + ($nbofyear - 1);
|
||||
$month_start = GETPOST("month", 'int') ?GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
$date_startmonth = $month_start;
|
||||
if (!GETPOST('month')) {
|
||||
if (!GETPOST("year") && $month_start > $month_current) {
|
||||
if (!$year && $month_start > $month_current) {
|
||||
$year_start--;
|
||||
$year_end--;
|
||||
}
|
||||
@ -144,7 +144,7 @@ $modecompta = $conf->global->ACCOUNTING_MODE;
|
||||
if (isModEnabled('accounting')) {
|
||||
$modecompta = 'BOOKKEEPING';
|
||||
}
|
||||
if (GETPOST("modecompta")) {
|
||||
if (GETPOST("modecompta", 'alpha')) {
|
||||
$modecompta = GETPOST("modecompta", 'alpha');
|
||||
}
|
||||
|
||||
@ -231,8 +231,8 @@ if ($modecompta == "CREANCES-DETTES") {
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$arraylist = array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
|
||||
$period .= ' '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
|
||||
$arraylist = array('no'=>$langs->trans("None"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
|
||||
$period .= ' <span class="opacitymedium">'.$langs->trans("DetailBy").'</span> '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
|
||||
$periodlink = $textprevyear.$textnextyear;
|
||||
$exportlink = '';
|
||||
$description = $langs->trans("RulesResultBookkeepingPersonalized");
|
||||
|
||||
@ -50,28 +50,26 @@ if (empty($year)) {
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year - ($nbofyear - 1);
|
||||
$year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
}
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver');
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver');
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere
|
||||
|
||||
// We define date_start and date_end
|
||||
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||
$q = GETPOST("q") ? GETPOST("q") : 0;
|
||||
if ($q == 0) {
|
||||
// We define date_start and date_end
|
||||
$year_end = $year_start + ($nbofyear - 1);
|
||||
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if (!GETPOST('month')) {
|
||||
if (!GETPOST("year") && $month_start > $month_current) {
|
||||
if (!$year && $month_start > $month_current) {
|
||||
$year_start--;
|
||||
$year_end--;
|
||||
}
|
||||
$month_end = $month_start - 1;
|
||||
if ($month_end < 1) {
|
||||
$month_end = 12;
|
||||
} else {
|
||||
$year_end++;
|
||||
}
|
||||
} else {
|
||||
$month_end = $month_start;
|
||||
@ -97,9 +95,6 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
|
||||
}
|
||||
}
|
||||
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$tmps = dol_getdate($date_start);
|
||||
$mothn_start = $tmps['mon'];
|
||||
$year_start = $tmps['year'];
|
||||
@ -113,11 +108,14 @@ $modecompta = $conf->global->ACCOUNTING_MODE;
|
||||
if (isModEnabled('accounting')) {
|
||||
$modecompta = 'BOOKKEEPING';
|
||||
}
|
||||
if (GETPOST("modecompta")) {
|
||||
if (GETPOST("modecompta", 'alpha')) {
|
||||
$modecompta = GETPOST("modecompta", 'alpha');
|
||||
}
|
||||
|
||||
$userid = GETPOST('userid', 'int');
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
@ -147,18 +145,13 @@ llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$exportlink="";
|
||||
$namelink="";
|
||||
$exportlink = '';
|
||||
$namelink = '';
|
||||
$builddate = dol_now();
|
||||
|
||||
// Affiche en-tete du rapport
|
||||
if ($modecompta == "CREANCES-DETTES") {
|
||||
$name = $langs->trans("Turnover");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
}
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesCADue");
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
@ -166,30 +159,17 @@ if ($modecompta == "CREANCES-DETTES") {
|
||||
} else {
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
}
|
||||
$builddate = dol_now();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("TurnoverCollected");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
//$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
//if (isModEnabled('accounting')) {
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPINGCOLLECTED">','</a>').')';
|
||||
//}
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesCAIn");
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
$builddate = dol_now();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$name = $langs->trans("Turnover");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=CREANCES-DETTES">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesSalesTurnoverOfIncomeAccounts");
|
||||
$builddate = dol_now();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
|
||||
@ -200,6 +180,31 @@ $moreparam = array();
|
||||
if (!empty($modecompta)) {
|
||||
$moreparam['modecompta'] = $modecompta;
|
||||
}
|
||||
|
||||
// Define $calcmode line
|
||||
$calcmode = '';
|
||||
if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEINGCOLLECTED") {
|
||||
/*if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPINGCOLLECTED"'.($modecompta == 'BOOKKEEPINGCOLLECTED' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}*/
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
} else {
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
}
|
||||
|
||||
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
|
||||
|
||||
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
|
||||
|
||||
@ -46,7 +46,7 @@ if (empty($year)) {
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year - ($nbofyear - 1);
|
||||
$year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
}
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere
|
||||
@ -56,18 +56,16 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
|
||||
$q = GETPOST("q") ?GETPOST("q") : 0;
|
||||
if ($q == 0) {
|
||||
// We define date_start and date_end
|
||||
$year_end = $year_start + ($nbofyear - 1);
|
||||
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
|
||||
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if (!GETPOST('month')) {
|
||||
if (!GETPOST("year") && $month_start > $month_current) {
|
||||
if (!$year && $month_start > $month_current) {
|
||||
$year_start--;
|
||||
$year_end--;
|
||||
}
|
||||
$month_end = $month_start - 1;
|
||||
if ($month_end < 1) {
|
||||
$month_end = 12;
|
||||
} else {
|
||||
$year_end++;
|
||||
}
|
||||
} else {
|
||||
$month_end = $month_start;
|
||||
@ -107,7 +105,7 @@ $modecompta = $conf->global->ACCOUNTING_MODE;
|
||||
if (isModEnabled('accounting')) {
|
||||
$modecompta = 'BOOKKEEPING';
|
||||
}
|
||||
if (GETPOST("modecompta")) {
|
||||
if (GETPOST("modecompta", 'alpha')) {
|
||||
$modecompta = GETPOST("modecompta", 'alpha');
|
||||
}
|
||||
|
||||
@ -131,10 +129,14 @@ llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$exportlink = '';
|
||||
$namelink = '';
|
||||
$builddate = dol_now();
|
||||
|
||||
// TODO Report from bookkeeping not yet available, so we switch on report on business events
|
||||
if ($modecompta == "BOOKKEEPING") {
|
||||
/*if ($modecompta == "BOOKKEEPING") {
|
||||
$modecompta = "CREANCES-DETTES";
|
||||
}
|
||||
}*/
|
||||
if ($modecompta == "BOOKKEEPINGCOLLECTED") {
|
||||
$modecompta = "RECETTES-DEPENSES";
|
||||
}
|
||||
@ -142,42 +144,26 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
|
||||
// Affiche en-tete du rapport
|
||||
if ($modecompta == "CREANCES-DETTES") {
|
||||
$name = $langs->trans("PurchaseTurnover");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
}
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesPurchaseTurnoverDue");
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("PurchaseTurnoverCollected");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesPurchaseTurnoverIn");
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$name = $langs->trans("PurchaseTurnover");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesPurchaseTurnoverOfExpenseAccounts");
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
|
||||
$name = $langs->trans("PurchaseTurnoverCollected");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesPurchaseTurnoverCollectedOfExpenseAccounts");
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
|
||||
$builddate = dol_now();
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
|
||||
$period .= ' - ';
|
||||
$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
|
||||
@ -187,9 +173,32 @@ if (!empty($modecompta)) {
|
||||
$moreparam['modecompta'] = $modecompta;
|
||||
}
|
||||
|
||||
$exportlink = '';
|
||||
// Define $calcmode line
|
||||
$calcmode = '';
|
||||
if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEPINGCOLLECTED") {
|
||||
/*if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPINGCOLLECTED"'.($modecompta == 'BOOKKEEPINGCOLLECTED' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}*/
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
} else {
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
}
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
|
||||
|
||||
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
|
||||
|
||||
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
|
||||
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
|
||||
@ -242,14 +251,19 @@ $sql .= " ORDER BY dm";
|
||||
|
||||
$minyearmonth = $maxyearmonth = 0;
|
||||
|
||||
$cum = array();
|
||||
$cum_ht = array();
|
||||
$total_ht = array();
|
||||
$total = array();
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0;
|
||||
$cum[$obj->dm] = $obj->amount_ttc;
|
||||
$cum_ht[$obj->dm] = empty($obj->amount) ? 0 : $obj->amount;
|
||||
$cum[$obj->dm] = empty($obj->amount_ttc) ? 0 : $obj->amount_ttc;
|
||||
if ($obj->amount_ttc) {
|
||||
$minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm);
|
||||
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
||||
@ -348,7 +362,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
||||
|
||||
if ($annee >= $year_start) { // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
// Valeur CA du mois w/o VAT
|
||||
// Value turnover of month w/o VAT
|
||||
print '<td class="right">';
|
||||
if (!empty($cum_ht[$case])) {
|
||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||
@ -363,7 +377,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Valeur CA du mois
|
||||
// Value turnover of month
|
||||
print '<td class="right">';
|
||||
if (!empty($cum[$case])) {
|
||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||
@ -383,7 +397,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Pourcentage du mois
|
||||
// Percentage of month
|
||||
if ($annee_decalage > $minyear && $case <= $casenow) {
|
||||
if (!empty($cum[$caseprev]) && !empty($cum[$case])) {
|
||||
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
|
||||
@ -439,7 +453,9 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) {
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
// Montant total HT
|
||||
if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
|
||||
print '<td class="nowrap right">'.($total_ht[$annee] ?price($total_ht[$annee]) : "0")."</td>";
|
||||
print '<td class="nowrap right">';
|
||||
print ($total_ht[$annee] ?price($total_ht[$annee]) : "0");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
}
|
||||
@ -456,20 +472,22 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) {
|
||||
if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) {
|
||||
if ($total[$annee - 1] && $total[$annee]) {
|
||||
$percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100);
|
||||
print '<td class="nowrap borderrightlight right">'.($percent >= 0 ? "+$percent" : "$percent").'%</td>';
|
||||
print '<td class="nowrap borderrightlight right">';
|
||||
print ($percent >= 0 ? "+$percent" : "$percent").'%';
|
||||
print '</td>';
|
||||
}
|
||||
if ($total[$annee - 1] && !$total[$annee]) {
|
||||
if (!empty($total[$annee - 1]) && empty($total[$annee])) {
|
||||
print '<td class="borderrightlight right">-100%</td>';
|
||||
}
|
||||
if (!$total[$annee - 1] && $total[$annee]) {
|
||||
if (empty($total[$annee - 1]) && !empty($total[$annee])) {
|
||||
print '<td class="borderrightlight right">+'.$langs->trans('Inf').'%</td>';
|
||||
}
|
||||
if (!$total[$annee - 1] && !$total[$annee]) {
|
||||
if (empty($total[$annee - 1]) && empty($total[$annee])) {
|
||||
print '<td class="borderrightlight right">+0%</td>';
|
||||
}
|
||||
} else {
|
||||
print '<td class="borderrightlight right">';
|
||||
if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) {
|
||||
if (!empty($total[$annee]) || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) {
|
||||
print '-';
|
||||
} else {
|
||||
print ' ';
|
||||
|
||||
@ -41,6 +41,7 @@ AlreadyInGeneralLedger=Already transferred to accounting journals and ledger
|
||||
NotYetInGeneralLedger=Not yet transferred to accouting journals and ledger
|
||||
GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group
|
||||
DetailByAccount=Show detail by account
|
||||
DetailBy=Detail by
|
||||
AccountWithNonZeroValues=Accounts with non-zero values
|
||||
ListOfAccounts=List of accounts
|
||||
CountriesInEEC=Countries in EEC
|
||||
|
||||
@ -159,9 +159,10 @@ ConfirmDeleteVariousPayment=Are you sure you want to delete this various payment
|
||||
ExportDataset_tax_1=Social and fiscal taxes and payments
|
||||
CalcModeVATDebt=Mode <b>%sVAT on commitment accounting%s</b>.
|
||||
CalcModeVATEngagement=Mode <b>%sVAT on incomes-expenses%s</b>.
|
||||
CalcModeDebt=Analysis of known recorded documents even if they are not yet accounted in ledger.
|
||||
CalcModeEngagement=Analysis of known recorded payments, even if they are not yet accounted in Ledger.
|
||||
CalcModeDebt=Analysis of known recorded documents
|
||||
CalcModeEngagement=Analysis of known recorded payments
|
||||
CalcModeBookkeeping=Analysis of data journalized in Bookkeeping Ledger table.
|
||||
CalcModeNoBookKeeping=Even if they are not yet accounted in Ledger
|
||||
CalcModeLT1= Mode <b>%sRE on customer invoices - suppliers invoices%s</b>
|
||||
CalcModeLT1Debt=Mode <b>%sRE on customer invoices%s</b>
|
||||
CalcModeLT1Rec= Mode <b>%sRE on suppliers invoices%s</b>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user