Corezioni errori da MI
git-svn-id: svn://10.65.10.50/trunk@1443 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9d790e27f3
commit
a19b49d1f5
@ -1,16 +1,20 @@
|
||||
#include <confapp.h>
|
||||
#include <isam.h>
|
||||
#include <tabutil.h>
|
||||
#include <attiv.h>
|
||||
#include <prefix.h>
|
||||
#include <attiv.h>
|
||||
#include <extcdecl.h>
|
||||
#include <utility.h>
|
||||
#include "cg5100a.h"
|
||||
|
||||
class TParametri_ditta : public TConfig_application
|
||||
{
|
||||
bool _change_pcon;
|
||||
TString16 _val;
|
||||
// bool _change_pcon;
|
||||
// TString16 _val;
|
||||
TArray _atts;
|
||||
|
||||
void swap_file(int logicnum, bool tocom);
|
||||
void load_file(int logicnum);
|
||||
void check_registers(int year);
|
||||
|
||||
public:
|
||||
@ -20,14 +24,13 @@ public:
|
||||
const char* oldv, const char* newv);
|
||||
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
TParametri_ditta() : TConfig_application(CONFIG_DITTA) {}
|
||||
virtual ~TParametri_ditta() {}
|
||||
};
|
||||
|
||||
bool TParametri_ditta::user_create()
|
||||
{
|
||||
_change_pcon = FALSE;
|
||||
// _change_pcon = FALSE;
|
||||
|
||||
TLocalisamfile attiv(LF_ATTIV);
|
||||
attiv.zero();
|
||||
@ -126,17 +129,23 @@ void TParametri_ditta::swap_file(int logicnum, bool tocom)
|
||||
}
|
||||
}
|
||||
|
||||
bool TParametri_ditta::user_destroy()
|
||||
void TParametri_ditta::load_file(int logicnum)
|
||||
{
|
||||
if (_change_pcon)
|
||||
{
|
||||
swap_file(LF_PCON, _val[0] == 'X');
|
||||
swap_file(LF_CAUSALI, _val[0] == 'X');
|
||||
swap_file(LF_RCAUSALI, _val[0] == 'X');
|
||||
}
|
||||
return TRUE;
|
||||
TDir dir;
|
||||
|
||||
dir.get(logicnum);
|
||||
|
||||
TSystemisamfile f(logicnum);
|
||||
TFilename lf;
|
||||
|
||||
if (dir.eox() > 0L)
|
||||
f.build(10L);
|
||||
lf.format("%sstd/lf%04d.txt", __ptprf, logicnum);
|
||||
if (fexist(lf))
|
||||
f.load(lf, '|', '\0', '\n', TRUE, TRUE);
|
||||
}
|
||||
|
||||
|
||||
bool TParametri_ditta::preprocess_config (TMask& mask, TConfig& config)
|
||||
{
|
||||
// these are disabled in normal applications
|
||||
@ -144,16 +153,11 @@ bool TParametri_ditta::preprocess_config (TMask& mask, TConfig& config)
|
||||
const bool movempty = mov.empty();
|
||||
mask.enable(CHK_ANCFCM, movempty);
|
||||
mask.enable(CHK_PCTCCM, movempty);
|
||||
disable_menu_item(M_FILE_NEW);
|
||||
disable_menu_item(M_FILE_REVERT);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TParametri_ditta::postprocess_config(TMask& mask, TConfig& config)
|
||||
{
|
||||
enable_menu_item(M_FILE_NEW);
|
||||
enable_menu_item(M_FILE_REVERT);
|
||||
|
||||
check_registers(mask.get_int(FLD_ANLIIV));
|
||||
if (mask.get_bool(CHK_GELIDI))
|
||||
{
|
||||
@ -197,8 +201,25 @@ bool TParametri_ditta::postprocess_config_changed(const char* par, const char* v
|
||||
{
|
||||
if (yesno_box("Confermi il cambiamento del piano conti/causali"))
|
||||
{
|
||||
_change_pcon = TRUE;
|
||||
_val = newv;
|
||||
// _change_pcon = TRUE;
|
||||
// _val = newv;
|
||||
swap_file(LF_PCON, *newv == 'X');
|
||||
swap_file(LF_CAUSALI, *newv == 'X');
|
||||
swap_file(LF_RCAUSALI, *newv == 'X');
|
||||
const long firm = get_firm();
|
||||
prefix().set("COM");
|
||||
set_firm(firm);
|
||||
if (*newv == 'X')
|
||||
{
|
||||
TDir d;
|
||||
d.get(LF_PCON, _nolock, _comdir);
|
||||
if (d.eod() == 0 && yesno_box("Vuoi caricare gli archivi standard ?"))
|
||||
{
|
||||
load_file(LF_PCON);
|
||||
load_file(LF_CAUSALI);
|
||||
load_file(LF_RCAUSALI);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user