Merge pull request #7220 from guerrierk/develop
NEW|Add possibility to propose last num releve in conciliation
This commit is contained in:
commit
22a7c9bd6b
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
@ -24,7 +25,6 @@
|
|||||||
* \ingroup bank
|
* \ingroup bank
|
||||||
* \brief Page to setup the bank module
|
* \brief Page to setup the bank module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
||||||
@ -52,91 +52,101 @@ $type = 'bankaccount';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Order display of bank account
|
//Order display of bank account
|
||||||
if ($action == 'setbankorder')
|
if ($action == 'setbankorder') {
|
||||||
{
|
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",
|
||||||
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",GETPOST('value','alpha'),'chaine',0,'',$conf->entity) > 0)
|
GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) {
|
||||||
{
|
|
||||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Auto report last num releve on conciliate
|
||||||
|
if ($action == 'setreportlastnumreleve') {
|
||||||
|
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0,
|
||||||
|
'', $conf->entity) > 0) {
|
||||||
|
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($action == 'unsetreportlastnumreleve') {
|
||||||
|
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0,
|
||||||
|
'', $conf->entity) > 0) {
|
||||||
|
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'specimen')
|
if ($action == 'specimen') {
|
||||||
{
|
|
||||||
$modele = GETPOST('module', 'alpha');
|
$modele = GETPOST('module', 'alpha');
|
||||||
|
|
||||||
if ($modele == 'sepamandate')
|
if ($modele == 'sepamandate') {
|
||||||
{
|
|
||||||
$object = new CompanyBankAccount($db);
|
$object = new CompanyBankAccount($db);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
}
|
}
|
||||||
$object->initAsSpecimen();
|
$object->initAsSpecimen();
|
||||||
|
|
||||||
// Search template files
|
// Search template files
|
||||||
$file=''; $classname=''; $filefound=0;
|
$file = '';
|
||||||
|
$classname = '';
|
||||||
|
$filefound = 0;
|
||||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
foreach($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir) {
|
||||||
{
|
$file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php",
|
||||||
$file=dol_buildpath($reldir."core/modules/bank/doc/pdf_".$modele.".modules.php",0);
|
0);
|
||||||
if (file_exists($file))
|
if (file_exists($file)) {
|
||||||
{
|
|
||||||
$filefound = 1;
|
$filefound = 1;
|
||||||
$classname = "pdf_" . $modele;
|
$classname = "pdf_" . $modele;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filefound)
|
if ($filefound) {
|
||||||
{
|
|
||||||
require_once $file;
|
require_once $file;
|
||||||
|
|
||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
if ($module->write_file($object,$langs) > 0)
|
if ($module->write_file($object, $langs) > 0) {
|
||||||
{
|
|
||||||
header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=bank&file=SPECIMEN.pdf");
|
header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=bank&file=SPECIMEN.pdf");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($module->error, null, 'errors');
|
setEventMessages($module->error, null, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
if ($action == 'set')
|
if ($action == 'set') {
|
||||||
{
|
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
else if ($action == 'del') {
|
||||||
else if ($action == 'del')
|
|
||||||
{
|
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0) {
|
||||||
{
|
if ($conf->global->BANKADDON_PDF == "$value")
|
||||||
if ($conf->global->BANKADDON_PDF == "$value") dolibarr_del_const($db, 'BANKADDON_PDF',$conf->entity);
|
dolibarr_del_const($db, 'BANKADDON_PDF', $conf->entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
else if ($action == 'setdoc') {
|
||||||
{
|
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
|
||||||
if (dolibarr_set_const($db, "BANKADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
$conf->entity)) {
|
||||||
{
|
|
||||||
// The constant that was read before the new set
|
// The constant that was read before the new set
|
||||||
// We therefore requires a variable to have a coherent view
|
// We therefore requires a variable to have a coherent view
|
||||||
$conf->global->BANKADDON_PDF = $value;
|
$conf->global->BANKADDON_PDF = $value;
|
||||||
@ -144,8 +154,7 @@ else if ($action == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0) {
|
||||||
{
|
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,7 +172,8 @@ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
|||||||
llxHeader("", $langs->trans("BankSetupModule"));
|
llxHeader("", $langs->trans("BankSetupModule"));
|
||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup');
|
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback,
|
||||||
|
'title_setup');
|
||||||
|
|
||||||
$head = bank_admin_prepare_head(null);
|
$head = bank_admin_prepare_head(null);
|
||||||
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
|
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
|
||||||
@ -195,8 +205,7 @@ $var = true;
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$nbofbank = count($bankorder);
|
$nbofbank = count($bankorder);
|
||||||
while ($i < $nbofbank)
|
while ($i < $nbofbank) {
|
||||||
{
|
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -205,21 +214,19 @@ while ($i < $nbofbank)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmparray = explode(' ', $bankorder[$i][2]);
|
$tmparray = explode(' ', $bankorder[$i][2]);
|
||||||
foreach($tmparray as $key => $val)
|
foreach ($tmparray as $key => $val) {
|
||||||
{
|
if ($key > 0)
|
||||||
if ($key > 0) print ', ';
|
print ', ';
|
||||||
print $langs->trans($val);
|
print $langs->trans($val);
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
|
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
|
||||||
{
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print img_picto($langs->trans("Activated"), 'on');
|
print img_picto($langs->trans("Activated"), 'on');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&value=' . $i . '">';
|
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&value=' . $i . '">';
|
||||||
print img_picto($langs->trans("Disabled"), 'off');
|
print img_picto($langs->trans("Disabled"), 'off');
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
@ -257,7 +264,8 @@ if ($resql) {
|
|||||||
array_push($def, $array[0]);
|
array_push($def, $array[0]);
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +281,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir) {
|
||||||
{
|
|
||||||
foreach (array('', '/doc') as $valdir) {
|
foreach (array('', '/doc') as $valdir) {
|
||||||
$dir = dol_buildpath($reldir . "core/modules/bank" . $valdir);
|
$dir = dol_buildpath($reldir . "core/modules/bank" . $valdir);
|
||||||
|
|
||||||
@ -288,7 +295,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
arsort($filelist);
|
arsort($filelist);
|
||||||
|
|
||||||
foreach ($filelist as $file) {
|
foreach ($filelist as $file) {
|
||||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/',
|
||||||
|
$file)) {
|
||||||
|
|
||||||
if (file_exists($dir . '/' . $file)) {
|
if (file_exists($dir . '/' . $file)) {
|
||||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||||
@ -298,9 +306,11 @@ foreach ($dirmodels as $reldir)
|
|||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
$modulequalified = 1;
|
$modulequalified = 1;
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2)
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL
|
||||||
|
< 2)
|
||||||
$modulequalified = 0;
|
$modulequalified = 0;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1)
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL
|
||||||
|
< 1)
|
||||||
$modulequalified = 0;
|
$modulequalified = 0;
|
||||||
|
|
||||||
if ($modulequalified) {
|
if ($modulequalified) {
|
||||||
@ -317,21 +327,27 @@ foreach ($dirmodels as $reldir)
|
|||||||
if (in_array($name, $def)) {
|
if (in_array($name, $def)) {
|
||||||
print '<td align="center">' . "\n";
|
print '<td align="center">' . "\n";
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
|
||||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
print img_picto($langs->trans("Enabled"),
|
||||||
|
'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
print '<td align="center">' . "\n";
|
print '<td align="center">' . "\n";
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"),
|
||||||
|
'switch_off') . '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($conf->global->BANKADDON_PDF == $name) {
|
if ($conf->global->BANKADDON_PDF == $name) {
|
||||||
print img_picto($langs->trans("Default"), 'on');
|
print img_picto($langs->trans("Default"),
|
||||||
} else {
|
'on');
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
}
|
||||||
|
else {
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"),
|
||||||
|
'off') . '</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -342,24 +358,30 @@ foreach ($dirmodels as $reldir)
|
|||||||
$htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
|
$htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
|
||||||
}
|
}
|
||||||
$htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
|
$htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
|
||||||
$htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo,
|
||||||
|
1, 1);
|
||||||
//$htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
|
//$htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
|
||||||
//$htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
|
//$htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
|
||||||
$htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
|
$htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang,
|
||||||
|
1, 1);
|
||||||
// $htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
|
// $htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
|
||||||
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||||
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
|
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
|
||||||
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1,
|
||||||
|
0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($module->type == 'pdf') {
|
if ($module->type == 'pdf') {
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'bill') . '</a>';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"),
|
||||||
} else {
|
'bill') . '</a>';
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
}
|
||||||
|
else {
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"),
|
||||||
|
'generic');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -372,9 +394,51 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print '</table>';
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<br /><br />';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Document templates generators
|
||||||
|
*/
|
||||||
|
//if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
|
//{
|
||||||
|
print load_fiche_titre($langs->trans("BankAccountReleveModule"), '', '');
|
||||||
|
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||||
|
print "<tr class=\"liste_titre\">\n";
|
||||||
|
print '<td>' . $langs->trans("Name") . '</td>';
|
||||||
|
print '<td>' . $langs->trans("Description") . '</td>';
|
||||||
|
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td width="100">';
|
||||||
|
print $langs->trans('AccountStatement');
|
||||||
|
print "</td><td>\n";
|
||||||
|
print $langs->trans('AutoReportLastAccountStatement');
|
||||||
|
print '</td>';
|
||||||
|
// Active
|
||||||
|
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
|
||||||
|
print '<td align="center">' . "\n";
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetreportlastnumreleve">';
|
||||||
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '<td align="center">' . "\n";
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"),
|
||||||
|
'switch_off') . '</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
print '</table>';
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -605,7 +605,7 @@ if ($resql)
|
|||||||
// print '<td>';
|
// print '<td>';
|
||||||
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
||||||
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
|
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
|
||||||
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
|
print '<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if ($options) {
|
if ($options) {
|
||||||
print $langs->trans("EventualyAddCategory").': ';
|
print $langs->trans("EventualyAddCategory").': ';
|
||||||
@ -648,6 +648,16 @@ if ($resql)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
|
||||||
|
*/
|
||||||
|
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE == 1) {
|
||||||
|
print '
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#num_releve").val("' . $last_releve . '");
|
||||||
|
</script>
|
||||||
|
';
|
||||||
}
|
}
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
// print '</td></tr></table>';
|
// print '</td></tr></table>';
|
||||||
@ -1117,7 +1127,16 @@ if ($resql)
|
|||||||
// Date ope
|
// Date ope
|
||||||
if (! empty($arrayfields['b.dateo']['checked']))
|
if (! empty($arrayfields['b.dateo']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
print '<td align="center" class="nowrap">';
|
||||||
|
print '<span id="dateoperation_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->do),"day")."</span>";
|
||||||
|
print ' ';
|
||||||
|
print '<span class="inline-block">';
|
||||||
|
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=doprev&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_remove() . "</a> ";
|
||||||
|
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=donext&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_add() ."</a>";
|
||||||
|
print '</span>';
|
||||||
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1959,6 +1959,67 @@ class AccountLine extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increase/decrease operation date of a rowid
|
||||||
|
*
|
||||||
|
* @param int $rowid Id of line
|
||||||
|
* @param int $sign 1 or -1
|
||||||
|
* @return int >0 if OK, 0 if KO
|
||||||
|
*/
|
||||||
|
function dateo_change($rowid,$sign=1)
|
||||||
|
{
|
||||||
|
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$obj=$this->db->fetch_object($resql);
|
||||||
|
$newdate=$this->db->jdate($obj->dateo)+(3600*24*$sign);
|
||||||
|
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET";
|
||||||
|
$sql.= " dateo = '".$this->db->idate($newdate)."'";
|
||||||
|
$sql.= " WHERE rowid = ".$rowid;
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
if ($this->db->affected_rows($result))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error($this->db);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increase operation date of a rowid
|
||||||
|
*
|
||||||
|
* @param int $id Id of line to change
|
||||||
|
* @return int >0 if OK, 0 if KO
|
||||||
|
*/
|
||||||
|
function dateo_next($id)
|
||||||
|
{
|
||||||
|
return $this->dateo_change($id,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrease operation date of a rowid
|
||||||
|
*
|
||||||
|
* @param int $id Id of line to change
|
||||||
|
* @return int >0 if OK, 0 if KO
|
||||||
|
*/
|
||||||
|
function dateo_previous($id)
|
||||||
|
{
|
||||||
|
return $this->dateo_change($id,-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load miscellaneous information for tab "Info"
|
* Load miscellaneous information for tab "Info"
|
||||||
*
|
*
|
||||||
|
|||||||
@ -71,13 +71,20 @@ if ($cancel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->banque->consolidate && $action == 'dvnext')
|
|
||||||
|
if ($user->rights->banque->consolidate && $action == 'donext')
|
||||||
|
{
|
||||||
|
$al = new AccountLine($db);
|
||||||
|
$al->dateo_next($_GET["rowid"]);
|
||||||
|
}elseif ($user->rights->banque->consolidate && $action == 'doprev')
|
||||||
|
{
|
||||||
|
$al = new AccountLine($db);
|
||||||
|
$al->dateo_previous($_GET["rowid"]);
|
||||||
|
}elseif ($user->rights->banque->consolidate && $action == 'dvnext')
|
||||||
{
|
{
|
||||||
$al = new AccountLine($db);
|
$al = new AccountLine($db);
|
||||||
$al->datev_next($_GET["rowid"]);
|
$al->datev_next($_GET["rowid"]);
|
||||||
}
|
}elseif ($user->rights->banque->consolidate && $action == 'dvprev')
|
||||||
|
|
||||||
if ($user->rights->banque->consolidate && $action == 'dvprev')
|
|
||||||
{
|
{
|
||||||
$al = new AccountLine($db);
|
$al = new AccountLine($db);
|
||||||
$al->datev_previous($_GET["rowid"]);
|
$al->datev_previous($_GET["rowid"]);
|
||||||
@ -479,6 +486,14 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
|
print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
|
||||||
|
if (! $objp->rappro)
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=doprev&id='.$id.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_remove() . "</a> ";
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=donext&id='.$id.'&rowid='.$objp->rowid.'">';
|
||||||
|
print img_edit_add() ."</a>";
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -71,3 +71,27 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext')
|
||||||
|
{
|
||||||
|
// Increase date
|
||||||
|
$al = new AccountLine($db);
|
||||||
|
$al->dateo_next(GETPOST('rowid','int'));
|
||||||
|
$al->fetch(GETPOST('rowid','int'));
|
||||||
|
|
||||||
|
print '<span>'.dol_print_date($db->jdate($al->dateo),"day").'</span>';
|
||||||
|
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev')
|
||||||
|
{
|
||||||
|
// Decrease date
|
||||||
|
$al =new AccountLine($db);
|
||||||
|
$al->dateo_previous(GETPOST('rowid','int'));
|
||||||
|
$al->fetch(GETPOST('rowid','int'));
|
||||||
|
|
||||||
|
print '<span>'.dol_print_date($db->jdate($al->dateo),"day").'</span>';
|
||||||
|
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,3 +18,5 @@ RejectCheck=Cheque returned
|
|||||||
RejectCheckDate=Date the cheque was returned
|
RejectCheckDate=Date the cheque was returned
|
||||||
CheckRejected=Cheque returned
|
CheckRejected=Cheque returned
|
||||||
CheckRejectedAndInvoicesReopened=Cheque returned and invoices reopened
|
CheckRejectedAndInvoicesReopened=Cheque returned and invoices reopened
|
||||||
|
AutoReportLastAccountStatement=Use automatically last account statement to reconcile
|
||||||
|
BankAccountReleveModule=Bank Statement
|
||||||
@ -38,6 +38,9 @@ AccountStatement=Relevé
|
|||||||
AccountStatementShort=Relevé
|
AccountStatementShort=Relevé
|
||||||
AccountStatements=Relevés
|
AccountStatements=Relevés
|
||||||
LastAccountStatements=Derniers relevés bancaires
|
LastAccountStatements=Derniers relevés bancaires
|
||||||
|
AutoReportLastAccountStatement=Proposer automatiquement le dernier relevé bancaire rapproché
|
||||||
|
BankAccountReleveModule=Rapprochement relevés bancaires
|
||||||
|
Conciliated=Rapproché
|
||||||
IOMonthlyReporting=Rapport mensuel E/S
|
IOMonthlyReporting=Rapport mensuel E/S
|
||||||
BankAccountDomiciliation=Domiciliation du compte
|
BankAccountDomiciliation=Domiciliation du compte
|
||||||
BankAccountCountry=Pays du compte
|
BankAccountCountry=Pays du compte
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user