Merge pull request #11175 from aspangaro/10.0_Differentiated_export
NEW Accountancy - Differentiated export
This commit is contained in:
commit
c0949e3cf9
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/account.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief List accounting account
|
||||
*/
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/accountmodel.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page to administer model of chart of accounts
|
||||
*/
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Card of accounting account
|
||||
*/
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/categories.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page to assign mass categories to accounts
|
||||
*/
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/closure.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/defaultaccounts.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/export.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/fiscalyear.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Setup page to configure fiscal year
|
||||
*/
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/fiscalyear_card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page to show a fiscal year
|
||||
*/
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/fiscalyear_info.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page to show info of a fiscal year
|
||||
*/
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/index.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/journals_list.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Setup page to configure journals
|
||||
*/
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/productaccount.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief To define accounting account on product / service
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/balance.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Balance of book keeping
|
||||
*/
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/balancebymonth.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Balance by month
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page to show book-entry
|
||||
*/
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/list.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief List operation of book keeping
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
@ -47,6 +48,9 @@ $search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmo
|
||||
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
|
||||
//var_dump($search_date_start);exit;
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
$action = 'delbookkeepingyear';
|
||||
@ -143,6 +147,7 @@ $arrayfields=array(
|
||||
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
|
||||
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
||||
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
|
||||
@ -178,6 +183,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_date_creation_end = '';
|
||||
$search_date_modification_start = '';
|
||||
$search_date_modification_end = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_end = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -269,6 +276,16 @@ if (! empty($search_date_modification_end)) {
|
||||
$tmp=dol_getdate($search_date_modification_end);
|
||||
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_export_start)) {
|
||||
$filter['t.date_export>='] = $search_date_export_start;
|
||||
$tmp=dol_getdate($search_date_export_start);
|
||||
$param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_date_export_end)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$tmp=dol_getdate($search_date_export_end);
|
||||
$param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_debit)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
$param .= '&search_debit=' . urlencode($search_debit);
|
||||
@ -348,8 +365,7 @@ if ($action == 'delmouvconfirm') {
|
||||
|
||||
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||
if ($action == 'export_file') {
|
||||
|
||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -357,17 +373,57 @@ if ($action == 'export_file') {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Export files
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
$accountancyexport->export($object->lines);
|
||||
|
||||
if (!empty($accountancyexport->errors))
|
||||
{
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
}
|
||||
if (! empty($accountancyexport->errors))
|
||||
{
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
} else {
|
||||
// Specify as export : update field date_export
|
||||
// TODO Move in class bookKeeping
|
||||
$error=0;
|
||||
$db->begin();
|
||||
|
||||
if (is_array($object->lines)) {
|
||||
foreach ($object->lines as $movement) {
|
||||
$now = dol_now();
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
||||
$sql .= " SET date_export = '" . $db->idate($now) . "'";
|
||||
$sql .= " WHERE rowid = " . $movement->id;
|
||||
|
||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$db->commit();
|
||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
// setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setreexport') {
|
||||
$export = 0;
|
||||
$setreexport = GETPOST('value', 'int');
|
||||
if (! dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) $error++;
|
||||
|
||||
if (! $error) {
|
||||
if ($conf->global->ACCOUNTING_REEXPORT == 1) {
|
||||
setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs');
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -380,14 +436,14 @@ llxHeader('', $title_page);
|
||||
// List
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Do not use this
|
||||
$result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter);
|
||||
$result = $object->fetchAll($sortorder, $sortfield, $limit, $offset, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -442,18 +498,26 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$listofformat=AccountancyExport::getType();
|
||||
$button .= '<a class="butAction" title="" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
|
||||
|
||||
$listofformat=AccountancyExport::getType();
|
||||
if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
|
||||
else $buttonLabel = $langs->trans("ExportList");
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($buttonLabel, '', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
|
||||
// Button re-export
|
||||
if (! empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=0'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
|
||||
} else {
|
||||
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=1'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
|
||||
}
|
||||
$newcardbutton.= $langs->trans("IncludeDocsAlreadyExported");
|
||||
|
||||
$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
|
||||
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
|
||||
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create');
|
||||
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
@ -596,6 +660,20 @@ if (! empty($arrayfields['t.tms']['checked']))
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date export
|
||||
if (! empty($arrayfields['t.date_export']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
@ -616,6 +694,7 @@ if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_tit
|
||||
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -728,11 +807,20 @@ if ($num > 0)
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Exported operation date
|
||||
if (! empty($arrayfields['t.date_export']['checked']))
|
||||
{
|
||||
print '<td align="center">' . dol_print_date($line->date_export, 'dayhour') . '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowraponall center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a> ';
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>';
|
||||
print '</td>';
|
||||
if(empty($line->date_export)) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a> ';
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/listbyaccount.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief List operation of book keeping ordered by account number
|
||||
*/
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Tab to setup lettering
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountancycategory.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief File of class to manage categories of an accounting category_type
|
||||
*/
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountancyexport.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Class accountancy export
|
||||
*/
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountancysystem.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief File of class to manage accountancy systems
|
||||
*/
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountingaccount.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief File of class to manage accounting accounts
|
||||
*/
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountingjournal.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief File of class to manage accounting journals
|
||||
*/
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/bookkeeping.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief File of class to manage Ledger (General Ledger and Subledger)
|
||||
*/
|
||||
|
||||
@ -860,15 +860,16 @@ class BookKeeping extends CommonObject
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param string $sortorder Sort Order
|
||||
* @param string $sortfield Sort field
|
||||
* @param int $limit Offset limit
|
||||
* @param int $offset Offset limit
|
||||
* @param array $filter Filter array
|
||||
* @param string $filtermode Filter mode (AND or OR)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param string $sortorder Sort Order
|
||||
* @param string $sortfield Sort field
|
||||
* @param int $limit Offset limit
|
||||
* @param int $offset Offset limit
|
||||
* @param array $filter Filter array
|
||||
* @param string $filtermode Filter mode (AND or OR)
|
||||
* @param int $showAlreadyExportMovements Show movements when field 'date_export' is not empty (0:No / 1:Yes (Default))
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $showAlreadyExportMovements = 1)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -898,7 +899,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.tms as date_modification";
|
||||
$sql .= " t.tms as date_modification,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
||||
// Manage filter
|
||||
$sqlwhere = array ();
|
||||
@ -918,6 +920,8 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
|
||||
} elseif ($key == 't.tms>=' || $key == 't.tms<=') {
|
||||
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} else {
|
||||
@ -926,10 +930,12 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
}
|
||||
$sql.= ' WHERE t.entity IN (' . getEntity('accountancy') . ')';
|
||||
if ($showAlreadyExportMovements == 0) {
|
||||
$sql .= " AND t.date_export IS NULL";
|
||||
}
|
||||
if (count($sqlwhere) > 0) {
|
||||
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
|
||||
}
|
||||
|
||||
if (! empty($sortfield)) {
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
}
|
||||
@ -972,6 +978,7 @@ class BookKeeping extends CommonObject
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/lettering.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief File of class for lettering
|
||||
*/
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/customer/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Card customer ventilation
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/customer/index.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Home customer journalization page
|
||||
*/
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/customer/lines.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page of detail of the lines of ventilation of invoices customers
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/customer/list.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Ventilation page from customers invoices
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Card expense report ventilation
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/expensereport/index.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Home expense report ventilation
|
||||
*/
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/expensereport/lines.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page of detail of the lines of ventilation of expense reports
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/expensereport/list.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Ventilation page from expense reports
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/index.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Home accounting module
|
||||
*/
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page with bank journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/expensereportsjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page with expense reports journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/purchasesjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page with purchases journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/sellsjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page with sells journal
|
||||
*/
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Card supplier ventilation
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/index.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Home supplier journalization page
|
||||
*/
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/lines.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Page of detail of the lines of ventilation of invoices suppliers
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/list.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Accountancy (Double entries)
|
||||
* \brief Ventilation page from suppliers invoices
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -382,7 +382,7 @@ ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_ob
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet integer DEFAULT NULL;
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL;
|
||||
|
||||
|
||||
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL after date_validated;
|
||||
|
||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1);
|
||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
-- Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
-- Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
@ -50,6 +50,7 @@ CREATE TABLE llx_accounting_bookkeeping
|
||||
journal_label varchar(255), -- FEC:JournalLib
|
||||
piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document
|
||||
date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification)
|
||||
date_export datetime DEFAULT NULL, --
|
||||
import_key varchar(14),
|
||||
extraparams varchar(255) -- for other parameters with json format
|
||||
extraparams varchar(255) -- for other parameters with json format
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -842,6 +842,11 @@ Exports=Exports
|
||||
ExportFilteredList=Export filtered list
|
||||
ExportList=Export list
|
||||
ExportOptions=Export Options
|
||||
IncludeDocsAlreadyExported=Include docs already exported
|
||||
ExportOfPiecesAlreadyExportedIsEnable=Export of pieces already exported is enable
|
||||
ExportOfPiecesAlreadyExportedIsDisable=Export of pieces already exported is disable
|
||||
AllExportedMovementsWereRecordedAsExported=All exported movements were recorded as exported
|
||||
NotAllExportedMovementsCouldBeRecordedAsExported=Not all exported movements could be recorded as exported
|
||||
Miscellaneous=Miscellaneous
|
||||
Calendar=Calendar
|
||||
GroupBy=Group by...
|
||||
|
||||
Loading…
Reference in New Issue
Block a user