Update notified
This commit is contained in:
parent
7c0350e948
commit
305b338a11
@ -524,10 +524,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
$accountancyexport = new AccountancyExport($db);
|
$accountancyexport = new AccountancyExport($db);
|
||||||
$accountancyexport->export($object->lines, $formatexportset);
|
$accountancyexport->export($object->lines, $formatexportset);
|
||||||
|
|
||||||
|
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
|
||||||
|
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
|
||||||
|
|
||||||
|
dol_syslog("date_export/date_validated=".$notifiedexportdate.'/'.$notifiedvalidationdate, LOG_DEBUG);
|
||||||
|
|
||||||
if (!empty($accountancyexport->errors)) {
|
if (!empty($accountancyexport->errors)) {
|
||||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||||
} else {
|
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
|
||||||
// Specify as export : update field date_export
|
// Specify as export : update field date_export or date_validated
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -536,8 +541,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||||
$sql .= " SET date_export = '".$db->idate($now)."'";
|
$sql .= " SET";
|
||||||
$sql .= " , date_validated = '".$db->idate($now)."'";
|
if (!$notifiedexportdate && !$notifiedvalidationdate) {
|
||||||
|
$sql .= " date_export = '".$db->idate($now)."'";
|
||||||
|
$sql .= ", date_validated = '".$db->idate($now)."'";
|
||||||
|
} elseif (!$notifiedexportdate) {
|
||||||
|
$sql .= " date_export = '".$db->idate($now)."'";
|
||||||
|
} elseif (!$notifiedvalidationdate) {
|
||||||
|
$sql .= " date_validated = '".$db->idate($now)."'";
|
||||||
|
}
|
||||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||||
|
|
||||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
||||||
@ -551,11 +563,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
|
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
|
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
@ -603,6 +615,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
|
|||||||
|
|
||||||
llxHeader('', $title_page);
|
llxHeader('', $title_page);
|
||||||
|
|
||||||
|
$formconfirm = '';
|
||||||
|
|
||||||
if ($action == 'export_file') {
|
if ($action == 'export_file') {
|
||||||
$form_question = array();
|
$form_question = array();
|
||||||
|
|
||||||
@ -614,17 +628,15 @@ if ($action == 'export_file') {
|
|||||||
);
|
);
|
||||||
$form_question['notifiedvalidationdate'] = array(
|
$form_question['notifiedvalidationdate'] = array(
|
||||||
'name' => 'notifiedvalidationdate',
|
'name' => 'notifiedvalidationdate',
|
||||||
'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component
|
'type' => 'checkbox',
|
||||||
'label' => $langs->trans('NotifiedValidationDate'),
|
'label' => $langs->trans('NotifiedValidationDate'),
|
||||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
|
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
|
||||||
print $formconfirm;
|
|
||||||
}
|
}
|
||||||
if ($action == 'delmouv') {
|
if ($action == 'delmouv') {
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
|
||||||
print $formconfirm;
|
|
||||||
}
|
}
|
||||||
if ($action == 'delbookkeepingyear') {
|
if ($action == 'delbookkeepingyear') {
|
||||||
$form_question = array();
|
$form_question = array();
|
||||||
@ -664,9 +676,11 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||||
print $formconfirm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print form confirm
|
||||||
|
print $formconfirm;
|
||||||
|
|
||||||
//$param=''; param started before
|
//$param=''; param started before
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
|||||||
@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
if ($id) {
|
if ($id) {
|
||||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||||
} else {
|
} else {
|
||||||
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
|
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid
|
||||||
if ($code) {
|
if ($code) {
|
||||||
$sql .= " AND t.code = '".$this->db->escape($code)."'";
|
$sql .= " AND t.code = '".$this->db->escape($code)."'";
|
||||||
} elseif ($label) {
|
} elseif ($label) {
|
||||||
|
|||||||
@ -993,8 +993,8 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " t.date_creation,";
|
$sql .= " t.date_creation,";
|
||||||
$sql .= " t.date_lim_reglement,";
|
$sql .= " t.date_lim_reglement,";
|
||||||
$sql .= " t.tms as date_modification,";
|
$sql .= " t.tms as date_modification,";
|
||||||
$sql .= " t.date_export";
|
$sql .= " t.date_export,";
|
||||||
$sql .= " t.date_validated as date_validation,";
|
$sql .= " t.date_validated as date_validation";
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
|
||||||
// Manage filter
|
// Manage filter
|
||||||
$sqlwhere = array();
|
$sqlwhere = array();
|
||||||
|
|||||||
@ -328,7 +328,7 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc
|
|||||||
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
|
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
|
||||||
|
|
||||||
## Export
|
## Export
|
||||||
NotifiedExportDate=Notified export date
|
NotifiedExportDate=Notified export date (modification of the entries will not be possible)
|
||||||
NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible)
|
NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible)
|
||||||
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
|
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
|
||||||
ExportDraftJournal=Export draft journal
|
ExportDraftJournal=Export draft journal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user