Work on accounting reports.
This commit is contained in:
parent
8248bc1c64
commit
31a74d448c
@ -69,8 +69,8 @@ $arrayfields=array(
|
||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
|
||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||
);
|
||||
|
||||
@ -94,9 +94,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (! empty($cancel)) $action = '';
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_account = "";
|
||||
@ -106,13 +106,13 @@ if (empty($reshook))
|
||||
$search_pcgsubtype = "";
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
|
||||
if (GETPOST('change_chart'))
|
||||
{
|
||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||
|
||||
|
||||
if (! empty($chartofaccounts)) {
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
@ -120,12 +120,12 @@ if (empty($reshook))
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'disable') {
|
||||
if ($accounting->fetch($id)) {
|
||||
$result = $accounting->account_desactivate($id);
|
||||
}
|
||||
|
||||
|
||||
$action = 'update';
|
||||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
@ -179,7 +179,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
@ -209,11 +209,11 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
|
||||
$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
|
||||
|
||||
|
||||
// Box to select active chart of account
|
||||
print $langs->trans("Selectchartofaccounts") . " : ";
|
||||
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
||||
@ -227,22 +227,22 @@ if ($resql)
|
||||
$i = 0;
|
||||
while ( $i < $numbis ) {
|
||||
$row = $db->fetch_row($resqlchart);
|
||||
|
||||
|
||||
print '<option value="' . $row[0] . '"';
|
||||
print $pcgver == $row[0] ? ' selected' : '';
|
||||
print '>' . $row[1] . ' - ' . $row[2] . '</option>';
|
||||
|
||||
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
@ -259,13 +259,13 @@ if ($resql)
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_type']['help']);
|
||||
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_subtype']['help']);
|
||||
if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
@ -274,14 +274,14 @@ if ($resql)
|
||||
$accountparent = new AccountingAccount($db);
|
||||
|
||||
$i=0;
|
||||
while ($i < min($num, $limit))
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$accountstatic->id = $obj->rowid;
|
||||
$accountstatic->label = $obj->label;
|
||||
$accountstatic->account_number = $obj->account_number;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Account number
|
||||
@ -310,7 +310,7 @@ if ($resql)
|
||||
$accountparent->id = $obj->rowid2;
|
||||
$accountparent->label = $obj->label2;
|
||||
$accountparent->account_number = $obj->account_number2;
|
||||
|
||||
|
||||
print "<td>";
|
||||
print $accountparent->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
@ -371,11 +371,11 @@ if ($resql)
|
||||
}
|
||||
print '</td>' . "\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
print '</form>';
|
||||
|
||||
@ -458,6 +458,10 @@ $titlepicto='title_setup';
|
||||
|
||||
print load_fiche_titre($titre,$linkback,$titlepicto);
|
||||
|
||||
if ($id == 32)
|
||||
{
|
||||
print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'<br><br>';
|
||||
}
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete')
|
||||
|
||||
@ -334,19 +334,20 @@ class AccountancyCategory
|
||||
/**
|
||||
* Function to show result of an accounting account from the ledger with a direction and a period
|
||||
*
|
||||
* @param int $cpt Id accounting account
|
||||
* @param string $month Specifig month - Can be empty
|
||||
* @param string $year Specific year
|
||||
* @param int $sens Sens of the account 0: credit - debit 1: debit - credit
|
||||
*
|
||||
* @return integer Result in table
|
||||
* @param int $cpt Id accounting account
|
||||
* @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
|
||||
* @return integer Result in table
|
||||
*/
|
||||
public function getResult($cpt, $month, $year, $sens) {
|
||||
public function getResult($cpt, $month, $date_start, $date_end, $sens)
|
||||
{
|
||||
$sql = "SELECT SUM(t.debit) as debit, SUM(t.credit) as credit";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t";
|
||||
$sql .= " WHERE t.numero_compte = '" . $cpt."'";
|
||||
$sql .= " AND YEAR(t.doc_date) = " . $year;
|
||||
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND t.doc_date >= '".$this->db->idate($date_start)."' AND t.doc_date <= '".$this->db->idate($date_end)."'";
|
||||
if (! empty($month)) {
|
||||
$sql .= " AND MONTH(t.doc_date) = " . $month;
|
||||
}
|
||||
|
||||
@ -138,6 +138,9 @@ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step,
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print_fiche_titre($langs->trans("AccountancyAreaDescActionFreq"), '', 'object_calendarweek');
|
||||
print '<hr>';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -29,11 +29,9 @@ 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';
|
||||
|
||||
$error = 0;
|
||||
$langs->loadLangs(array('compta','bills','donation','salaries'));
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
$langs->load("compta");
|
||||
$error = 0;
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action','aZ09');
|
||||
@ -98,6 +96,24 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||
}
|
||||
|
||||
if (($date_start < dol_time_plus_duree($date_end, -1, 'y')) || ($date_start > $date_end))
|
||||
{
|
||||
$date_end = dol_time_plus_duree($date_start - 1, 1, 'y');
|
||||
}
|
||||
|
||||
// $date_start and $date_end are defined. We force $start_year and $nbofyear
|
||||
$tmps=dol_getdate($date_start);
|
||||
$start_year = $tmps['year'];
|
||||
$tmpe=dol_getdate($date_end);
|
||||
$year_end = $tmpe['year'];
|
||||
$nbofyear = ($year_end - $start_year) + 1;
|
||||
|
||||
$date_start_previous = dol_time_plus_duree($date_start, -1, 'y');
|
||||
$date_end_previous = dol_time_plus_duree($date_end, -1, 'y');
|
||||
|
||||
//var_dump($date_start." ".$date_end." ".$date_start_previous." ".$date_end_previous." ".$nbofyear);
|
||||
|
||||
|
||||
if($cat_id == 0){
|
||||
$cat_id = null;
|
||||
}
|
||||
@ -125,8 +141,8 @@ llxheader('', $langs->trans('ReportInOut'));
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($start_year - 1) . '">' . img_previous() . '</a>';
|
||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($start_year + 1) . '">' . img_next() . '</a>';
|
||||
|
||||
|
||||
|
||||
@ -135,8 +151,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
$name=$langs->trans("AnnualByAccountDueDebtMode");
|
||||
$calcmode=$langs->trans("CalcModeDebt");
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.'&modecompta=BOOKKEEPING">','</a>').')';
|
||||
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||
//$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$description=$langs->trans("RulesResultDue");
|
||||
@ -149,7 +165,7 @@ else if ($modecompta=="RECETTES-DEPENSES") {
|
||||
$name=$langs->trans("AnnualByAccountInputOutputMode");
|
||||
$calcmode=$langs->trans("CalcModeEngagement");
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
|
||||
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=BOOKKEEPING">','</a>').')';
|
||||
//$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1);
|
||||
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||
//$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
@ -159,18 +175,18 @@ else if ($modecompta=="RECETTES-DEPENSES") {
|
||||
}
|
||||
else if ($modecompta=="BOOKKEEPING")
|
||||
{
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByAccounts");
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups");
|
||||
$calcmode=$langs->trans("CalcModeBookkeeping");
|
||||
$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>').')';
|
||||
//$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>').')';
|
||||
$nomlink = '';
|
||||
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||
$period.=' '.$langs->trans("Detail").' '. $form->selectyesno('simple_report',$simple_report,0);
|
||||
$periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear ;
|
||||
$period.=' '.$langs->trans("DetailByAccount").' '. $form->selectyesno('simple_report',$simple_report,0);
|
||||
$periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $start_year . " " . $textnextyear ;
|
||||
$exportlink = '';
|
||||
$description=$langs->trans("RulesResultDue");
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
|
||||
else $description.= $langs->trans("DepositsAreIncluded");
|
||||
$description=$langs->trans("RulesResultBookkeepingPersonalized", $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("AccountingCategory"));
|
||||
//if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
|
||||
//else $description.= $langs->trans("DepositsAreIncluded");
|
||||
$builddate = time();
|
||||
}
|
||||
|
||||
@ -203,190 +219,239 @@ $months = array( $langs->trans("JanuaryMin"),
|
||||
);
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th class="liste_titre">'.$langs->trans("Account").'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans("Description").'</th>';
|
||||
print '<th class="liste_titre" align="center">N-1</th>';
|
||||
print '<th class="liste_titre" align="center">'.$langs->trans("NReal").'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans("AccountingCategory").'</th>';
|
||||
print '<th class="liste_titre"></th>';
|
||||
print '<th class="liste_titre" align="right">'.$langs->trans("PreviousYear").'</th>';
|
||||
print '<th class="liste_titre" align="right">'.$langs->trans("SelectedPeriod").'</th>';
|
||||
foreach($months as $k => $v){
|
||||
print '<th class="liste_titre" align="center">'.$langs->trans($v).'</th>';
|
||||
print '<th class="liste_titre" align="right">'.$langs->trans($v).'</th>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
//if (! empty($date_start) && ! empty($date_end))
|
||||
// $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
else if ($modecompta=="RECETTES-DEPENSES")
|
||||
{
|
||||
//if (! empty($date_start) && ! empty($date_end))
|
||||
// $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
else if ($modecompta=="BOOKKEEPING")
|
||||
{
|
||||
// TODO
|
||||
//if (! empty($date_start) && ! empty($date_end))
|
||||
// $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
|
||||
//All categories
|
||||
$cats = $AccCat->getCats();
|
||||
if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors);
|
||||
|
||||
//All categories
|
||||
$cats = $AccCat->getCats();
|
||||
if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors);
|
||||
$j=1;
|
||||
$sommes = array();
|
||||
|
||||
$j=1;
|
||||
$sommes = array();
|
||||
foreach ($cats as $cat) // Loop on each group
|
||||
{
|
||||
if (!empty($cat['category_type'])) // category calculed
|
||||
{
|
||||
$formula = $cat['formula'];
|
||||
|
||||
foreach($cats as $cat ){
|
||||
if(!empty($cat['category_type'])){ // category calculed
|
||||
print "<tr>";
|
||||
//print '<td colspan="2"><font color="blue">' . $cat['label'] . '</font></td>';
|
||||
print '<td colspan="2">' . $cat['label'] . '</td>';
|
||||
|
||||
$formula = $cat['formula'];
|
||||
$vars = array();
|
||||
|
||||
print "<tr class='liste_titre'>";
|
||||
print '<td colspan="2">' . $cat['label'] . '</td>';
|
||||
|
||||
$vars = array();
|
||||
|
||||
// Previous Fiscal year (N-1)
|
||||
foreach($sommes as $code => $det){
|
||||
$vars[$code] = $det['NP'];
|
||||
}
|
||||
|
||||
|
||||
$result = strtr($formula, $vars);
|
||||
|
||||
|
||||
$r = $AccCat->calculate($result);
|
||||
|
||||
print '<td align="right"><font color="blue">' . price($r) . '</td>';
|
||||
$code = $cat['code']; // code categorie de calcule
|
||||
$sommes[$code]['NP'] += $r;
|
||||
|
||||
// Current fiscal year (N)
|
||||
if (is_array($sommes) && ! empty($sommes)){
|
||||
// Previous Fiscal year (N-1)
|
||||
foreach($sommes as $code => $det){
|
||||
$vars[$code] = $det['N'];
|
||||
$vars[$code] = $det['NP'];
|
||||
}
|
||||
}
|
||||
|
||||
$result = strtr($formula, $vars);
|
||||
|
||||
$r = $AccCat->calculate($result);
|
||||
|
||||
print '<td align="right"><font color="blue">' . price($r) . '</td>';
|
||||
$sommes[$code]['N'] += $r;
|
||||
|
||||
// Detail by month
|
||||
foreach($months as $k => $v){
|
||||
foreach($sommes as $code => $det){
|
||||
$vars[$code] = $det['M'][$k];
|
||||
}
|
||||
$result = strtr($formula, $vars);
|
||||
|
||||
|
||||
$r = $AccCat->calculate($result);
|
||||
print '<td align="right"><font color="blue">' . price($r) . '</td>';
|
||||
$sommes[$code]['M'][$k] += $r;
|
||||
}
|
||||
|
||||
print '<td align="right"><font color="blue">' . price($r) . '</font></td>';
|
||||
$code = $cat['code']; // code categorie de calcule
|
||||
$sommes[$code]['NP'] += $r;
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
}else{ // normal category
|
||||
|
||||
$totCat = array();
|
||||
$totCat['M'] = array();
|
||||
|
||||
// get cpts of category
|
||||
$cpts = $AccCat->getCptsCat($cat['rowid']);
|
||||
|
||||
|
||||
print "<tr class='liste_titre'>";
|
||||
print '<td colspan="2">' . $cat['label'] . '</td>';
|
||||
|
||||
foreach($cpts as $i => $cpt){
|
||||
$var = ! $var;
|
||||
|
||||
$code = $cat['code'];
|
||||
|
||||
// N-1
|
||||
$return = $AccCat->getResult($cpt['account_number'], 0, $year_current -1, $cpt['dc']);
|
||||
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultNP=0;
|
||||
} else {
|
||||
$resultNP=$AccCat->sdc;
|
||||
// Current fiscal year (N)
|
||||
if (is_array($sommes) && ! empty($sommes)){
|
||||
foreach($sommes as $code => $det){
|
||||
$vars[$code] = $det['N'];
|
||||
}
|
||||
}
|
||||
|
||||
//N
|
||||
$return = $AccCat->getResult($cpt['account_number'], 0, $year_current, $cpt['dc']);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultN=0;
|
||||
} else {
|
||||
$resultN=$AccCat->sdc;
|
||||
}
|
||||
$result = strtr($formula, $vars);
|
||||
|
||||
$totCat['NP'] += $resultNP;
|
||||
$totCat['N'] += $resultN;
|
||||
$r = $AccCat->calculate($result);
|
||||
|
||||
print '<td align="right"><font color="blue">' . price($r) . '</font></td>';
|
||||
$sommes[$code]['N'] += $r;
|
||||
|
||||
// Detail by month
|
||||
foreach($months as $k => $v){
|
||||
$return = $AccCat->getResult($cpt['account_number'], $k+1, $year_current, $cpt['dc']);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM=0;
|
||||
} else {
|
||||
$resultM=$AccCat->sdc;
|
||||
foreach($sommes as $code => $det){
|
||||
$vars[$code] = $det['M'][$k];
|
||||
}
|
||||
$totCat['M'][$k] += $resultM;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="right">' . price($totCat['NP']) . '</td>';
|
||||
print '<td align="right">' . price($totCat['N']) . '</td>';
|
||||
|
||||
foreach($totCat['M'] as $k => $v){
|
||||
print '<td align="right">' . price($v) . '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
foreach($cpts as $i => $cpt){
|
||||
$var = ! $var;
|
||||
|
||||
$code = $cat['code'];
|
||||
|
||||
// N-1
|
||||
$return = $AccCat->getResult($cpt['account_number'], 0, $year_current -1, $cpt['dc']);
|
||||
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultNP=0;
|
||||
} else {
|
||||
$resultNP=$AccCat->sdc;
|
||||
$result = strtr($formula, $vars);
|
||||
$r = $AccCat->calculate($result);
|
||||
print '<td align="right"><font color="blue">' . price($r) . '</font></td>';
|
||||
$sommes[$code]['M'][$k] += $r;
|
||||
}
|
||||
|
||||
//N
|
||||
$return = $AccCat->getResult($cpt['account_number'], 0, $year_current, $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'. $bc[$var].'>';
|
||||
if ($simple_report == 'yes') {
|
||||
print '<td>' . length_accountg($cpt['account_number']) . '</td>';
|
||||
print '<td>' . $cpt['name_cpt'] . '</td>';
|
||||
print '<td align="right">' . price($resultNP) . '</td>';
|
||||
print '<td align="right">' . price($resultN) . '</td>';
|
||||
}
|
||||
|
||||
foreach($months as $k => $v){
|
||||
$return = $AccCat->getResult($cpt['account_number'], $k+1, $year_current, $cpt['dc']);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM=0;
|
||||
} else {
|
||||
$resultM=$AccCat->sdc;
|
||||
}
|
||||
$sommes[$code]['M'][$k] += $resultM;
|
||||
if ($simple_report == 'yes') {
|
||||
print '<td align="right">' . price($resultM) . '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
}
|
||||
else // normal category
|
||||
{
|
||||
$totCat = array();
|
||||
$totCat['NP'] = 0;
|
||||
$totCat['N'] = 0;
|
||||
$totCat['M'] = array();
|
||||
foreach($months as $k => $v)
|
||||
{
|
||||
$totCat['M'][$k] = 0;
|
||||
}
|
||||
|
||||
// Get cpts of category/group
|
||||
$cpts = $AccCat->getCptsCat($cat['rowid']);
|
||||
|
||||
print "<tr>";
|
||||
|
||||
// Column group
|
||||
print '<td colspan="2">';
|
||||
print $cat['label'];
|
||||
if (count($cpts) > 0)
|
||||
{
|
||||
$i=0;
|
||||
foreach($cpts as $cpt)
|
||||
{
|
||||
if ($i > 5)
|
||||
{
|
||||
print '...)';
|
||||
break;
|
||||
}
|
||||
if ($i > 0) print ', ';
|
||||
else print ' (';
|
||||
print $cpt['account_number'];
|
||||
$i++;
|
||||
}
|
||||
if ($i <= 5) print ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' - <span class="warning">'.$langs->trans("GroupIsEmptyCheckSetup").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$code = $cat['code'];
|
||||
|
||||
// Column N Previous and N
|
||||
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;
|
||||
}
|
||||
|
||||
$totCat['NP'] += $resultNP;
|
||||
$totCat['N'] += $resultN;
|
||||
|
||||
foreach($months as $k => $v)
|
||||
{
|
||||
$return = $AccCat->getResult($cpt['account_number'], $k+1, $date_start, $date_end, $cpt['dc']);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM=0;
|
||||
} else {
|
||||
$resultM=$AccCat->sdc;
|
||||
}
|
||||
$totCat['M'][$k] += $resultM;
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="right">' . price($totCat['NP']) . '</td>';
|
||||
print '<td align="right">' . price($totCat['N']) . '</td>';
|
||||
|
||||
foreach($totCat['M'] as $k => $v){
|
||||
print '<td align="right">' . price($v) . '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
//
|
||||
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;
|
||||
|
||||
if ($simple_report == 'yes') {
|
||||
print '<tr>';
|
||||
print '<td> ' . length_accountg($cpt['account_number']) . '</td>';
|
||||
print '<td>' . $cpt['name_cpt'] . '</td>';
|
||||
print '<td align="right">' . price($resultNP) . '</td>';
|
||||
print '<td align="right">' . price($resultN) . '</td>';
|
||||
}
|
||||
|
||||
foreach($months as $k => $v)
|
||||
{
|
||||
$return = $AccCat->getResult($cpt['account_number'], $k+1, $date_start, $date_end, $cpt['dc']);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM=0;
|
||||
} else {
|
||||
$resultM=$AccCat->sdc;
|
||||
}
|
||||
$sommes[$code]['M'][$k] += $resultM;
|
||||
if ($simple_report == 'yes') {
|
||||
print '<td align="right">' . price($resultM) . '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($simple_report == 'yes') {
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -186,6 +186,9 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
|
||||
}
|
||||
|
||||
|
||||
|
||||
$name=array();
|
||||
|
||||
// SQL request
|
||||
$catotal=0;
|
||||
$catotal_ht=0;
|
||||
|
||||
@ -167,6 +167,8 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
|
||||
}
|
||||
|
||||
|
||||
$name=array();
|
||||
|
||||
// Show array
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
// Extra parameters management
|
||||
|
||||
@ -195,6 +195,8 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
|
||||
}
|
||||
|
||||
|
||||
$name=array();
|
||||
|
||||
// Show Array
|
||||
$catotal=0;
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
|
||||
@ -27,6 +27,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
$langs->loadLangs(array('compta','bills','donation','salaries'));
|
||||
|
||||
$date_startmonth=GETPOST('date_startmonth');
|
||||
$date_startday=GETPOST('date_startday');
|
||||
|
||||
@ -3284,32 +3284,34 @@ function dol_print_error_email($prefixcode, $errormessage='')
|
||||
* @param string $sortfield Current field used to sort
|
||||
* @param string $sortorder Current sort order
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
|
||||
* @param string $tooltip Tooltip
|
||||
* @return void
|
||||
*/
|
||||
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="")
|
||||
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
|
||||
{
|
||||
print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix);
|
||||
print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix, 0, $tooltip);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title line of an array
|
||||
*
|
||||
* @param string $name Translation key of field
|
||||
* @param int $thead 0=To use with standard table format, 1=To use inside <thead><tr>, 2=To use with <div>
|
||||
* @param string $file Url used when we click on sort picto
|
||||
* @param string $field Field to use for new sorting. Empty if this field is not sortable.
|
||||
* @param string $begin ("" by defaut)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix.
|
||||
* @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
|
||||
* @param string $sortorder Current sort order (Ex: 'asc,desc')
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
|
||||
* @param string $name Translation key of field
|
||||
* @param int $thead 0=To use with standard table format, 1=To use inside <thead><tr>, 2=To use with <div>
|
||||
* @param string $file Url used when we click on sort picto
|
||||
* @param string $field Field to use for new sorting. Empty if this field is not sortable.
|
||||
* @param string $begin ("" by defaut)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix.
|
||||
* @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
|
||||
* @param string $sortorder Current sort order (Ex: 'asc,desc')
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
|
||||
* @param string $disablesortlink 1=Disable sort link
|
||||
* @param string $tooltip Tooltip
|
||||
* @return string
|
||||
*/
|
||||
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0)
|
||||
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $form;
|
||||
//print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder<br>\n";
|
||||
|
||||
$sortorder=strtoupper($sortorder);
|
||||
@ -3350,7 +3352,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
|
||||
}
|
||||
}
|
||||
|
||||
$out.=$langs->trans($name);
|
||||
if ($tooltip) $out.=$form->textwithpicto($langs->trans($name), $langs->trans($tooltip));
|
||||
else $out.=$langs->trans($name);
|
||||
|
||||
if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field
|
||||
{
|
||||
|
||||
@ -249,10 +249,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
-- Balance
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__);
|
||||
-- Reports
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByAccounts', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__);
|
||||
|
||||
@ -1118,11 +1118,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Reports
|
||||
$langs->load("compta");
|
||||
|
||||
$newmenu->add("/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
||||
$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
||||
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByAccounts"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -24,6 +24,6 @@
|
||||
-- Categories compte de résultat Français
|
||||
--
|
||||
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1,'VTE', 'Ventes de marchandises', '707xxx', 0, 0, '', '10', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2,'MAR', 'Coût achats marchandises vendues', '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3,'MARGE','Marge commerciale', '', 0, 1, '1 + 2', '30', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VTE', 'Ventes de marchandises', '707xxx', 0, 0, '', '10', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'MAR', 'Coût achats marchandises vendues', '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'MARGE', 'Marge commerciale', '', 0, 1, '1 + 2', '30', 1, 1);
|
||||
@ -208,6 +208,10 @@ UPDATE llx_const set name = 'ONLINE_PAYMENT_CSS_URL' where name = 'PAYPAL_CS
|
||||
UPDATE llx_const set name = 'ONLINE_PAYMENT_NEWFORMTEXT' where name = 'PAYPAL_NEWFORMTEXT';
|
||||
UPDATE llx_const set name = 'ONLINE_PAYMENT_LOGO' where name = 'PAYPAL_LOGO';
|
||||
|
||||
UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'PROD';
|
||||
UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'CHARGE';
|
||||
UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'VENTAS_E_INGRESOS';
|
||||
UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'COMPRAS_GASTOS';
|
||||
|
||||
|
||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
||||
|
||||
@ -31,6 +31,10 @@ ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account
|
||||
JournalizationInLedgerStatus=Status of journalization
|
||||
AlreadyInGeneralLedger=Already journalized in ledgers
|
||||
NotYetInGeneralLedger=Not yet journalized in ledgers
|
||||
PreviousYear=Previous year
|
||||
SelectedPeriod=Selected period
|
||||
GroupIsEmptyCheckSetup=Group is empty, check setup of the accounting group
|
||||
DetailByAccount=Show detail by account
|
||||
|
||||
MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup
|
||||
MainAccountForSuppliersNotDefined=Main accounting account for suppliers not defined in setup
|
||||
@ -150,7 +154,10 @@ NumPiece=Piece number
|
||||
TransactionNumShort=Num. transaction
|
||||
AccountingCategory=Accounting account groups
|
||||
GroupByAccountAccounting=Group by accounting account
|
||||
AccountingAccountGroupsDesc=You can define here some groups of accounting account. It will be used in the report <b>%s</b> to show your income/expense with data grouped according to your groups.
|
||||
ByAccounts=By accounts
|
||||
ByPredefinedAccountGroups=By predefined groups
|
||||
ByPersonalizedAccountGroups=By personalized groups
|
||||
NotMatch=Not Set
|
||||
DeleteMvt=Delete Ledger lines
|
||||
DelYear=Year to delete
|
||||
@ -180,8 +187,9 @@ ListAccounts=List of the accounting accounts
|
||||
UnknownAccountForThirdparty=Unknown third party account. We will use %s
|
||||
UnknownAccountForThirdpartyBlocking=Unknown third party account. Blocking error
|
||||
|
||||
Pcgtype=Class of account
|
||||
Pcgsubtype=Subclass of account
|
||||
Pcgtype=Group of account
|
||||
Pcgsubtype=Subgroup of account
|
||||
PcgtypeDesc=Group and subgroup of account are used as predefined 'filter' and 'grouping' criterias for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as group for accounting account products to build the expense/income report.
|
||||
|
||||
TotalVente=Total turnover before tax
|
||||
TotalMarge=Total sales margin
|
||||
|
||||
@ -143,8 +143,9 @@ CalcModeLT2Debt=Mode <b>%sIRPF on customer invoices%s</b>
|
||||
CalcModeLT2Rec= Mode <b>%sIRPF on suppliers invoices%s</b>
|
||||
AnnualSummaryDueDebtMode=Balance of income and expenses, annual summary
|
||||
AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary
|
||||
AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by third parties, mode <b>%sClaims-Debts%s</b> said <b>Commitment accounting</b>.
|
||||
AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third parties, mode <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b>.
|
||||
AnnualByCompanies=Income / Expenses, By predefined groups of account
|
||||
AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by predefined groups, mode <b>%sClaims-Debts%s</b> said <b>Commitment accounting</b>.
|
||||
AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by predefined groups, mode <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b>.
|
||||
SeeReportInInputOutputMode=See report <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b> for a calculation on actual payments made
|
||||
SeeReportInDueDebtMode=See report <b>%sClaims-Debts%s</b> said <b>commitment accounting</b> for a calculation on issued invoices
|
||||
SeeReportInBookkeepingMode=See report <b>%sBookeeping%s</b> for a calculation on bookkeeping table analysis
|
||||
@ -153,6 +154,9 @@ RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whet
|
||||
RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries. <br>- It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation.
|
||||
RulesCADue=- It includes the client's due invoices whether they are paid or not. <br>- It is based on the validation date of these invoices.<br>
|
||||
RulesCAIn=- It includes all the effective payments of invoices received from clients.<br>- It is based on the payment date of these invoices<br>
|
||||
RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" (See <b>%s</b>)
|
||||
RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" (See <b>%s</b>)
|
||||
RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts <b>grouped by personalized groups</b> (See menu <b>%s</b> to define accounting account groups)
|
||||
DepositsAreNotIncluded=- Down payment invoices are nor included
|
||||
DepositsAreIncluded=- Down payment invoices are included
|
||||
LT2ReportByCustomersInInputOutputModeES=Report by third party IRPF
|
||||
@ -227,3 +231,4 @@ ImportDataset_tax_vat=Vat payments
|
||||
ErrorBankAccountNotFound=Error: Bank account not found
|
||||
FiscalPeriod=Accounting period
|
||||
ListSocialContributionAssociatedProject=List of social contributions associated with the project
|
||||
DeleteFromCat=Remove from accounting group
|
||||
|
||||
@ -69,6 +69,7 @@ class MyObject extends CommonObject
|
||||
* 'position' is the sort order of field.
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||
* 'help' is a string visible as a tooltip on field
|
||||
* 'comment' is not used. You can store here any text of your choice.
|
||||
*/
|
||||
|
||||
@ -81,7 +82,7 @@ class MyObject extends CommonObject
|
||||
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Amount'),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user