Patch level : 4.0 667
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 patch 766 git-svn-id: svn://10.65.10.50/trunk@14628 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d05897718d
commit
d030bbabe2
@ -1,20 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Archiviazione Bilanci
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Anno
|
|
||||||
1|@20g%s|Cod.Per.
|
|
||||||
1|@30g%s|Tipo bil.
|
|
||||||
1|@35g%s|Data arc.
|
|
||||||
1|@47g%s|Data rip.
|
|
||||||
1|@58g%s|Per. Chiuso
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,5]|@2g@7,ls
|
|
||||||
1|CODTAB[6,9]|@11g@16,ls
|
|
||||||
1|CODTAB[10,12]|@21g@24,ls
|
|
||||||
1|CODTAB[13,15]|@31g@34,ls
|
|
||||||
1|D0|@35g@46d
|
|
||||||
1|D1|@47g@58d
|
|
||||||
1|B0|@65g@68f
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Tipi di Bilancio
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@10g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@10g@80,ls
|
|
@ -1,19 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Periodi di Bilancio
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione
|
|
||||||
1|@50g%s|gg/mm inizio
|
|
||||||
1|@65g%s|gg/mm fine
|
|
||||||
1|@80g%s|Num. Anni
|
|
||||||
1|@91g%s|Descrizione alternativa stampa raffr.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@3,ls
|
|
||||||
1|S0|@10g@49,ls
|
|
||||||
1|I0|@50g@2,ls
|
|
||||||
1|I1|@55g@2,ls
|
|
||||||
1|I2|@65g@2,ls
|
|
||||||
1|I3|@70g@2,ls
|
|
||||||
1|I4|@80g@4,ls
|
|
||||||
1|S1|@91g@40,ls
|
|
@ -1252,9 +1252,9 @@ bool TStampaPerCategorie::user_create()
|
|||||||
_sfamiglia = new TRecord_array(LF_FAMIGLIE,FAM_PROGFAM);
|
_sfamiglia = new TRecord_array(LF_FAMIGLIE,FAM_PROGFAM);
|
||||||
add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ|SOG_CODSOT","",3));
|
add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ|SOG_CODSOT","",3));
|
||||||
_msk = new TMask("at2700a");
|
_msk = new TMask("at2700a");
|
||||||
TFilename filename = "file";
|
TFilename filename = "filecat";
|
||||||
filename.ext("dbf");
|
filename.ext("dbf");
|
||||||
TFilename filetrr = "file";
|
TFilename filetrr = "filecat";
|
||||||
filetrr.ext("trr");
|
filetrr.ext("trr");
|
||||||
filetrr.custom_path();
|
filetrr.custom_path();
|
||||||
_file = new TExternisamfile(filename, filetrr, FALSE);
|
_file = new TExternisamfile(filename, filetrr, FALSE);
|
||||||
|
@ -383,8 +383,8 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
RECT rct;
|
RECT rct;
|
||||||
const char* s1 = "Installa la versione normale";
|
const char* s1 = "Installazione / Aggiornamento della versione normale";
|
||||||
const char* s2 = "Installa la versione dimostrativa";
|
const char* s2 = "Installazione della versione dimostrativa";
|
||||||
const char* s4 = "Termina installazione";
|
const char* s4 = "Termina installazione";
|
||||||
const char* s5 = "Scelta installazione";
|
const char* s5 = "Scelta installazione";
|
||||||
|
|
||||||
|
105
ba/ba0100.cpp
105
ba/ba0100.cpp
@ -7,6 +7,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <controls.h>
|
#include <controls.h>
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
|
#include <modaut.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
@ -91,7 +92,6 @@ protected:
|
|||||||
void manage_preferred();
|
void manage_preferred();
|
||||||
|
|
||||||
bool test_programs();
|
bool test_programs();
|
||||||
bool test_network();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void select_tree_current();
|
void select_tree_current();
|
||||||
@ -227,8 +227,8 @@ bool TPicture_mask::on_key(KEY k)
|
|||||||
{
|
{
|
||||||
case K_F3:
|
case K_F3:
|
||||||
case K_F8:
|
case K_F8:
|
||||||
set(DLG_USER, app().main_menu().last_search_string(), TRUE);
|
set(DLG_USER, app().main_menu().last_search_string(), true);
|
||||||
return TRUE;
|
return true;
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
case K_UP:
|
case K_UP:
|
||||||
case K_DOWN:
|
case K_DOWN:
|
||||||
@ -376,7 +376,9 @@ bool TExplorer_mask::stop_run(KEY k)
|
|||||||
xvt_image_destroy(image[i]);
|
xvt_image_destroy(image[i]);
|
||||||
|
|
||||||
if (sys_dll_changed()) //se e' stato installato SY..
|
if (sys_dll_changed()) //se e' stato installato SY..
|
||||||
xvt_sys_sleep(1000); //..aspetta un secondo poi forza l'uscita
|
{
|
||||||
|
xvt_sys_sleep(1); //..aspetta un attimo poi forza l'uscita
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!yesno_box(TR("Si desidera uscire?"))) //..altrimenti chiede educatamente se si desidera uscire
|
if (!yesno_box(TR("Si desidera uscire?"))) //..altrimenti chiede educatamente se si desidera uscire
|
||||||
@ -488,8 +490,8 @@ bool TExplorer_mask::on_key(KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_F3 || k == K_F8)
|
if (k == K_F3 || k == K_F8)
|
||||||
{
|
{
|
||||||
set(DLG_USER, app().main_menu().last_search_string(), TRUE);
|
set(DLG_USER, app().main_menu().last_search_string(), true);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return TMask::on_key(k);
|
return TMask::on_key(k);
|
||||||
}
|
}
|
||||||
@ -508,7 +510,7 @@ bool TExplorer_mask::explore_handler(TMask_field& f, KEY k)
|
|||||||
mf.set_menu(mt);
|
mf.set_menu(mt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
TExplorer_mask::TExplorer_mask(TMenu& menu)
|
TExplorer_mask::TExplorer_mask(TMenu& menu)
|
||||||
@ -578,7 +580,7 @@ public:
|
|||||||
bool TColor_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
bool TColor_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||||
{
|
{
|
||||||
const short id = f.dlg();
|
const short id = f.dlg();
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
@ -789,13 +791,10 @@ COLOR TColor_mask::cid2color(short cid) const
|
|||||||
// Menu application
|
// Menu application
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//int TMenu_application::_last_button = 0;
|
|
||||||
//bool TMenu_application::_find_button = false;
|
|
||||||
|
|
||||||
|
|
||||||
bool TMenu_application::test_assistance_year() const
|
bool TMenu_application::test_assistance_year() const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::menu_item_handler(TMask_field&f, KEY k)
|
bool TMenu_application::menu_item_handler(TMask_field&f, KEY k)
|
||||||
@ -806,7 +805,7 @@ bool TMenu_application::menu_item_handler(TMask_field&f, KEY k)
|
|||||||
f.set_focusdirty(false);
|
f.set_focusdirty(false);
|
||||||
return f.mask().stop_run(K_AUTO_ENTER);
|
return f.mask().stop_run(K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::menu_find_handler(TMask_field&f, KEY k)
|
bool TMenu_application::menu_find_handler(TMask_field&f, KEY k)
|
||||||
@ -829,7 +828,7 @@ bool TMenu_application::menu_find_handler(TMask_field&f, KEY k)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMenu_application::do_level()
|
int TMenu_application::do_level()
|
||||||
@ -915,7 +914,7 @@ void TMenu_application::test_temp()
|
|||||||
|
|
||||||
if (count > 0 && yesno_box(TR("Cancellare tutti i file temporanei in %s?"), dir.path()))
|
if (count > 0 && yesno_box(TR("Cancellare tutti i file temporanei in %s?"), dir.path()))
|
||||||
{
|
{
|
||||||
TProgind bar(count, TR("Cancellazione file temporanei"), TRUE, TRUE);
|
TProgind bar(count, TR("Cancellazione file temporanei"), true, true);
|
||||||
for (int i = count-1; i >= 0; i--)
|
for (int i = count-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
bar.addstatus(1);
|
bar.addstatus(1);
|
||||||
@ -942,7 +941,7 @@ HIDDEN bool pwd_handler(TMask_field& fld, KEY key)
|
|||||||
m.set(F_PASSWORD, pwd);
|
m.set(F_PASSWORD, pwd);
|
||||||
m.stop_run(K_ENTER);
|
m.stop_run(K_ENTER);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::reload_images()
|
void TMenu_application::reload_images()
|
||||||
@ -964,7 +963,6 @@ const TString& TMenu_application::ask_user_password()
|
|||||||
TMask m("ba0100a");
|
TMask m("ba0100a");
|
||||||
|
|
||||||
if (is_power_station())
|
if (is_power_station())
|
||||||
|
|
||||||
{
|
{
|
||||||
m.set_handler(F_USER, pwd_handler);
|
m.set_handler(F_USER, pwd_handler);
|
||||||
m.set_handler(F_PASSWORD, pwd_handler);
|
m.set_handler(F_PASSWORD, pwd_handler);
|
||||||
@ -1104,7 +1102,7 @@ bool TMenu_application::check_user()
|
|||||||
if (autstr == "CONVERTING")
|
if (autstr == "CONVERTING")
|
||||||
{
|
{
|
||||||
TString msg; msg << TR("E' in corso una conversione archivi") << ":\n";
|
TString msg; msg << TR("E' in corso una conversione archivi") << ":\n";
|
||||||
if (user() == dongle().administrator())
|
if (utente == dongle().administrator())
|
||||||
{
|
{
|
||||||
msg << TR("Si desidera continuare ugualmente?");
|
msg << TR("Si desidera continuare ugualmente?");
|
||||||
ok = yesno_box(msg);
|
ok = yesno_box(msg);
|
||||||
@ -1165,7 +1163,7 @@ HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
|
|||||||
if (ver2.len() == 4)
|
if (ver2.len() == 4)
|
||||||
ver2.insert((v2[0] == '9') ? "19" : "20", 0);
|
ver2.insert((v2[0] == '9') ? "19" : "20", 0);
|
||||||
|
|
||||||
int res = ver1.compare(ver2, -1, TRUE);
|
int res = ver1.compare(ver2, -1, true);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
res = p1 - p2;
|
res = p1 - p2;
|
||||||
|
|
||||||
@ -1186,14 +1184,6 @@ static int get_module_version(TConfig& cfg, void* jolly)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::test_network()
|
|
||||||
{
|
|
||||||
if (!xvt_sys_test_network_version())
|
|
||||||
return error_box(TR("Il driver di rete VREDIR.VXD contiene un bug riconosciuto da Microsoft.\n"
|
|
||||||
"Consultare la documentazione sul sito AGA per eliminare questo inconveniente."));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TMenu_application::test_programs()
|
bool TMenu_application::test_programs()
|
||||||
{
|
{
|
||||||
TToken_string dangerous;
|
TToken_string dangerous;
|
||||||
@ -1214,6 +1204,7 @@ bool TMenu_application::test_programs()
|
|||||||
if (remote_name.exist())
|
if (remote_name.exist())
|
||||||
{
|
{
|
||||||
TProgind pi(3, TR("Controllo aggiornamento programmi"), false, TRUE);
|
TProgind pi(3, TR("Controllo aggiornamento programmi"), false, TRUE);
|
||||||
|
|
||||||
TConfig remote_install(remote_name, "Main");
|
TConfig remote_install(remote_name, "Main");
|
||||||
remote_install.write_protect();
|
remote_install.write_protect();
|
||||||
|
|
||||||
@ -1223,16 +1214,15 @@ bool TMenu_application::test_programs()
|
|||||||
pi.addstatus(1);
|
pi.addstatus(1);
|
||||||
remote_install.for_each_paragraph(get_module_version, &his_modules);
|
remote_install.for_each_paragraph(get_module_version, &his_modules);
|
||||||
pi.addstatus(1);
|
pi.addstatus(1);
|
||||||
TScanner scan(AUT_FILE);
|
|
||||||
|
|
||||||
TString msg = TR("I seguenti moduli devono essere aggiornati prima dell'utilizzo:");
|
TString msg = TR("I seguenti moduli devono essere aggiornati prima dell'utilizzo:");
|
||||||
int update_needed = 0;
|
int update_needed = 0;
|
||||||
|
|
||||||
for (int module = 0; scan.line().full(); module++)
|
for (word module = 0; module < ENDAUT; module++)
|
||||||
{
|
{
|
||||||
if (dongle().active(module))
|
if (dongle().active(module) && dongle().shown(module))
|
||||||
{
|
{
|
||||||
const TString4 code = scan.token().left(2);
|
const TString4 code = dongle().module_code2name(module);
|
||||||
TToken_string* mytok = (TToken_string*)my_modules.objptr(code);
|
TToken_string* mytok = (TToken_string*)my_modules.objptr(code);
|
||||||
TToken_string* histok = (TToken_string*)his_modules.objptr(code);
|
TToken_string* histok = (TToken_string*)his_modules.objptr(code);
|
||||||
|
|
||||||
@ -1242,12 +1232,13 @@ bool TMenu_application::test_programs()
|
|||||||
const int p2 = histok ? histok->get_int() : 0;
|
const int p2 = histok ? histok->get_int() : 0;
|
||||||
if (!v1.blank() && compare_version(v1, p1, v2, p2) < 0)
|
if (!v1.blank() && compare_version(v1, p1, v2, p2) < 0)
|
||||||
{
|
{
|
||||||
dangerous.add(code);
|
if (module > 0) // Non disabilitare mai il modulo base!
|
||||||
|
dangerous.add(code);
|
||||||
if (!more)
|
if (!more)
|
||||||
{
|
{
|
||||||
const TString& name = scan.token().mid(3);
|
|
||||||
if (msg.len() < 200)
|
if (msg.len() < 200)
|
||||||
{
|
{
|
||||||
|
const TString& name = dongle().module_code2desc(module);
|
||||||
if (update_needed > 0)
|
if (update_needed > 0)
|
||||||
msg << ',';
|
msg << ',';
|
||||||
msg << name;
|
msg << name;
|
||||||
@ -1276,11 +1267,11 @@ bool TMenu_application::test_programs()
|
|||||||
const TString old_user = user();
|
const TString old_user = user();
|
||||||
user() = dongle().administrator(); // Divento temporaneamente amministratore
|
user() = dongle().administrator(); // Divento temporaneamente amministratore
|
||||||
TExternal_app app("ba1 -6");
|
TExternal_app app("ba1 -6");
|
||||||
app.run();
|
app.run(true); //lancia ba1 senza ba0
|
||||||
user() = old_user; // Ripristino utente normale
|
user() = old_user; // Ripristino utente normale
|
||||||
more = true; // ricontrolla
|
more = true; // ricontrolla
|
||||||
|
|
||||||
if (sys_dll_changed()) //costringe ad uscire dal programma se si e' installato il modulo SY
|
//if (sys_dll_changed()) //costringe ad uscire dal programma se si e' installato il modulo SY
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_menu.set_dangerous_modules(dangerous);
|
_menu.set_dangerous_modules(dangerous);
|
||||||
@ -1289,9 +1280,6 @@ bool TMenu_application::test_programs()
|
|||||||
|
|
||||||
bool TMenu_application::user_create()
|
bool TMenu_application::user_create()
|
||||||
{
|
{
|
||||||
if (!test_network())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
disable_menu_item(M_FILE_PRINT); // Questa voce di menu non serve per ora
|
disable_menu_item(M_FILE_PRINT); // Questa voce di menu non serve per ora
|
||||||
|
|
||||||
#ifdef _DEMO_
|
#ifdef _DEMO_
|
||||||
@ -1331,7 +1319,7 @@ bool TMenu_application::user_create()
|
|||||||
update_preferred_tree();
|
update_preferred_tree();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::deconnect_user()
|
void TMenu_application::deconnect_user()
|
||||||
@ -1356,14 +1344,15 @@ bool TMenu_application::destroy()
|
|||||||
if (sys_dll_changed())
|
if (sys_dll_changed())
|
||||||
{
|
{
|
||||||
TExternal_app ba0close("ba0close.exe");
|
TExternal_app ba0close("ba0close.exe");
|
||||||
ba0close.run(TRUE,TRUE,TRUE); // run asynchronous...
|
ba0close.run(true, true, false); // run asynchronous...
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::main_loop()
|
void TMenu_application::main_loop()
|
||||||
{
|
{
|
||||||
bool run = user_create();
|
bool run = user_create();
|
||||||
|
|
||||||
while (run)
|
while (run)
|
||||||
{
|
{
|
||||||
int m = 0;
|
int m = 0;
|
||||||
@ -1401,12 +1390,12 @@ bool TMenu_application::choose_colors()
|
|||||||
}
|
}
|
||||||
enable_menu_item(OPTIONS_MENU);
|
enable_menu_item(OPTIONS_MENU);
|
||||||
delete cm;
|
delete cm;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN bool browse_file_handler(TMask_field& f, KEY k)
|
HIDDEN bool browse_file_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
|
|
||||||
if (k == K_F9)
|
if (k == K_F9)
|
||||||
{
|
{
|
||||||
@ -1452,7 +1441,7 @@ HIDDEN bool browse_file_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
HIDDEN bool link_notify(TSheet_field& s, int r, KEY k)
|
HIDDEN bool link_notify(TSheet_field& s, int r, KEY k)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (k == K_INS)
|
if (k == K_INS)
|
||||||
{
|
{
|
||||||
ok = s.items() < 29; // Accetta 29 righe al massimo
|
ok = s.items() < 29; // Accetta 29 righe al massimo
|
||||||
@ -1505,7 +1494,7 @@ bool TMenu_application::choose_editors()
|
|||||||
|
|
||||||
enable_menu_item(OPTIONS_MENU);
|
enable_menu_item(OPTIONS_MENU);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN int dir_sort(const TObject** d1, const TObject** d2)
|
HIDDEN int dir_sort(const TObject** d1, const TObject** d2)
|
||||||
@ -1517,7 +1506,7 @@ HIDDEN int dir_sort(const TObject** d1, const TObject** d2)
|
|||||||
|
|
||||||
HIDDEN bool study_handler(TMask_field& f, KEY k)
|
HIDDEN bool study_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (f.to_check(k))
|
if (f.to_check(k))
|
||||||
{
|
{
|
||||||
TFilename path(f.get());
|
TFilename path(f.get());
|
||||||
@ -1538,10 +1527,10 @@ HIDDEN bool study_handler(TMask_field& f, KEY k)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
str.add("*");
|
str.add("*");
|
||||||
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str.get_buffer(), TRUE);
|
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str.get_buffer(), true);
|
||||||
|
|
||||||
TFilename dirgen;
|
TFilename dirgen;
|
||||||
TArray_sheet sht(-1, -1, 78, 16, TR("Scelta studio"), "Studio@76");
|
TArray_sheet sht(-1, -1, 78, 16, TR("Scelta studio"), HR("Studio@76"));
|
||||||
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
||||||
{
|
{
|
||||||
const char* f = xvt_slist_get(dirs, e, NULL);
|
const char* f = xvt_slist_get(dirs, e, NULL);
|
||||||
@ -1627,7 +1616,7 @@ bool TMenu_application::tree_handler(TMask_field& f, KEY k)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::select_tree_current()
|
void TMenu_application::select_tree_current()
|
||||||
@ -1664,7 +1653,7 @@ bool TMenu_application::tree_find_handler(TMask_field&f, KEY k)
|
|||||||
else
|
else
|
||||||
beep();
|
beep();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::tree_shrink_handler(TMask_field&f, KEY k)
|
bool TMenu_application::tree_shrink_handler(TMask_field&f, KEY k)
|
||||||
@ -1677,7 +1666,7 @@ bool TMenu_application::tree_shrink_handler(TMask_field&f, KEY k)
|
|||||||
mt.goto_root();
|
mt.goto_root();
|
||||||
app().select_tree_current();
|
app().select_tree_current();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::update_preferred()
|
void TMenu_application::update_preferred()
|
||||||
@ -1708,14 +1697,14 @@ void TMenu_application::update_preferred()
|
|||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
{
|
{
|
||||||
m.tag = MENU_ITEM(50+i);
|
m.tag = MENU_ITEM(50+i);
|
||||||
m.enabled = TRUE;
|
m.enabled = true;
|
||||||
const char* src = _preferred.row(i).get(0);
|
const char* src = _preferred.row(i).get(0);
|
||||||
m.text = xvt_str_duplicate(src);
|
m.text = xvt_str_duplicate(src);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m.tag = -1;
|
m.tag = -1;
|
||||||
m.separator = TRUE;
|
m.separator = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1781,8 +1770,8 @@ void TMenu_application::save_preferences()
|
|||||||
TConfig cfg(CONFIG_GUI, "ba0");
|
TConfig cfg(CONFIG_GUI, "ba0");
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < _preferred.items(); i++)
|
for (i = 0; i < _preferred.items(); i++)
|
||||||
cfg.set("Preferred", _preferred.row(i), NULL, TRUE, i);
|
cfg.set("Preferred", _preferred.row(i), NULL, true, i);
|
||||||
cfg.set("Preferred", "", NULL, TRUE, i);
|
cfg.set("Preferred", "", NULL, true, i);
|
||||||
cfg.set("TreeView", _tree_view);
|
cfg.set("TreeView", _tree_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1905,7 +1894,7 @@ bool TPreferred_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::manage_preferred()
|
void TMenu_application::manage_preferred()
|
||||||
@ -1998,7 +1987,7 @@ void TMenu_application::on_firm_change()
|
|||||||
|
|
||||||
bool TMenu_application::menu(MENU_TAG mt)
|
bool TMenu_application::menu(MENU_TAG mt)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
switch (mt)
|
switch (mt)
|
||||||
{
|
{
|
||||||
case BAR_ITEM(1): main_loop(); ok = false; break;
|
case BAR_ITEM(1): main_loop(); ok = false; break;
|
||||||
@ -2031,7 +2020,7 @@ bool TMenu_application::menu(MENU_TAG mt)
|
|||||||
TSubmenu* sm = _menu.find(sub);
|
TSubmenu* sm = _menu.find(sub);
|
||||||
if (sm && _menu.jumpto(sm))
|
if (sm && _menu.jumpto(sm))
|
||||||
{
|
{
|
||||||
ok = TRUE;
|
ok = true;
|
||||||
_menu.select(mi.get_int());
|
_menu.select(mi.get_int());
|
||||||
_mask->stop_run(K_CTRL + 'R');
|
_mask->stop_run(K_CTRL + 'R');
|
||||||
}
|
}
|
||||||
|
158
ba/ba0101.cpp
158
ba/ba0101.cpp
@ -1,12 +1,14 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <currency.h>
|
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <modaut.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
#include "ba0100a.h"
|
#include "ba0100a.h"
|
||||||
#include "ba0101.h"
|
#include "ba0101.h"
|
||||||
#include "ba0100.h"
|
#include "ba0100.h"
|
||||||
@ -24,6 +26,21 @@ bool sys_dll_changed()
|
|||||||
return k > 0;
|
return k > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool is_visible(const int cod)
|
||||||
|
{
|
||||||
|
static TString_array shown;
|
||||||
|
TToken_string* str = (TToken_string*)shown.objptr(cod);
|
||||||
|
|
||||||
|
if (str == NULL)
|
||||||
|
{
|
||||||
|
str = new TToken_string(dongle().shown(cod) ? "X" : "");
|
||||||
|
shown.add(str, cod);
|
||||||
|
}
|
||||||
|
|
||||||
|
return *str == "X";
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Menu management
|
// Menu management
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -140,8 +157,10 @@ TMenuitem::TMenuitem(const TMenuitem& mi)
|
|||||||
TMenu& TMenuitem::menu() const
|
TMenu& TMenuitem::menu() const
|
||||||
{ return _submenu->menu(); }
|
{ return _submenu->menu(); }
|
||||||
|
|
||||||
void TMenuitem::create(const char* t)
|
bool TMenuitem::create(const char* t)
|
||||||
{
|
{
|
||||||
|
bool visible = true;
|
||||||
|
|
||||||
TString16 flags;
|
TString16 flags;
|
||||||
char brace;
|
char brace;
|
||||||
int start = 0;
|
int start = 0;
|
||||||
@ -160,31 +179,39 @@ void TMenuitem::create(const char* t)
|
|||||||
case 'F': _firm = TRUE; break;
|
case 'F': _firm = TRUE; break;
|
||||||
case 'P': _password = TRUE; break;
|
case 'P': _password = TRUE; break;
|
||||||
case 'R': _reloadmenu = TRUE; break;
|
case 'R': _reloadmenu = TRUE; break;
|
||||||
|
case 'E': visible = dongle().active(EEAUT); // Nascondi i moduli dipendenti da EE
|
||||||
default : break;
|
default : break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_type == '<')
|
if (visible)
|
||||||
{
|
{
|
||||||
if (_action.find('.') < 0)
|
if (_type == '<')
|
||||||
_action << ".men";
|
{
|
||||||
TFilename n = _action;
|
if (_action.find('.') < 0)
|
||||||
if (n.custom_path())
|
_action << ".men";
|
||||||
menu().read(_action, _action);
|
TFilename n = _action;
|
||||||
else
|
if (n.custom_path())
|
||||||
_action.cut(0);
|
visible = menu().read(n, _action);
|
||||||
_type = '[';
|
else
|
||||||
|
_action.cut(0);
|
||||||
|
_type = '[';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_action.blank())
|
||||||
|
_exist = _enabled = false;
|
||||||
|
|
||||||
|
// Controlla lo stato di aggiornamento
|
||||||
|
if (_enabled && is_program())
|
||||||
|
_enabled = !menu().is_dangerous(_action);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_action.cut(0);
|
||||||
|
_exist = _enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_action.empty())
|
return visible;
|
||||||
{
|
|
||||||
_exist = FALSE;
|
|
||||||
_enabled = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Controlla lo stato di aggiornamento
|
|
||||||
if (_enabled && is_program())
|
|
||||||
_enabled = !menu().is_dangerous(_action);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMenuitem::icon() const
|
int TMenuitem::icon() const
|
||||||
@ -239,7 +266,7 @@ bool TMenuitem::enabled() const
|
|||||||
yes = app.can_run();
|
yes = app.can_run();
|
||||||
}
|
}
|
||||||
if (!yes)
|
if (!yes)
|
||||||
((TMenuitem*)this)->_enabled = FALSE;
|
((TMenuitem*)this)->_enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return yes;
|
return yes;
|
||||||
@ -282,12 +309,15 @@ bool TMenuitem::perform_program() const
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
TCurrency::force_cache_update(); // Chiude cache valute
|
// const bool maintenance_app = _action.starts_with("ba1 -0", true);
|
||||||
prefix().set(NULL); // Chiude prefix
|
const bool install_app = _action.starts_with("ba1 -6", true);
|
||||||
TExternal_app a(_action);
|
|
||||||
a.run(FALSE,3);
|
|
||||||
|
|
||||||
const bool maintenance_app = _action.starts_with("ba1 -0", TRUE);
|
TCurrency::force_cache_update(); // Chiude cache valute
|
||||||
|
prefix().set(NULL); // Chiude prefix
|
||||||
|
TExternal_app a(_action);
|
||||||
|
const bool async = install_app; // Lancio l'installazione moduli sempre asincrona
|
||||||
|
a.run(async, 3);
|
||||||
|
/*
|
||||||
if (maintenance_app)
|
if (maintenance_app)
|
||||||
{
|
{
|
||||||
char line1[16],line2[16];
|
char line1[16],line2[16];
|
||||||
@ -315,15 +345,14 @@ bool TMenuitem::perform_program() const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
prefix().set("DEF"); // Aggiorna prefix
|
prefix().set("DEF"); // Aggiorna prefix
|
||||||
|
|
||||||
const bool install_app = _action.starts_with("ba1 -6", TRUE);
|
if (install_app)
|
||||||
if (install_app && sys_dll_changed())
|
|
||||||
{
|
{
|
||||||
WINDOW w = cur_win();
|
WINDOW w = cur_win();
|
||||||
if (w != NULL_WIN)
|
if (w != NULL_WIN)
|
||||||
dispatch_e_char(w, K_QUIT);
|
dispatch_e_char(w, K_QUIT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printer_destroy(); // Forza rilettura parametri della stampante
|
printer_destroy(); // Forza rilettura parametri della stampante
|
||||||
@ -350,7 +379,8 @@ bool TMenuitem::perform() const
|
|||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TSubmenu::TSubmenu(TMenu* menu, const char* name)
|
TSubmenu::TSubmenu(TMenu* menu, const char* name)
|
||||||
: _menu(menu), _name(name), _items(12), _enabled(TRUE), _firm(FALSE)
|
: _menu(menu), _name(name), _items(12),
|
||||||
|
_enabled(TRUE), _firm(FALSE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,64 +398,66 @@ void TSubmenu::read(TScanner& scanner)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char brace;
|
char brace;
|
||||||
if (line.compare("Caption", 7, TRUE) == 0)
|
if (line.starts_with("Caption", true))
|
||||||
{
|
{
|
||||||
get_next_string(line, 8, _caption, brace);
|
get_next_string(line, 8, _caption, brace);
|
||||||
_caption = dictionary_translate(_caption);
|
_caption = dictionary_translate(_caption);
|
||||||
} else
|
} else
|
||||||
if (line.compare("Module", 6, TRUE) == 0)
|
if (line.starts_with("Module", true))
|
||||||
{
|
{
|
||||||
const int equal = line.find('=');
|
const int equal = line.find('=');
|
||||||
if (equal > 0)
|
if (equal > 0)
|
||||||
{
|
{
|
||||||
bool disable = TRUE;
|
bool disable = true;
|
||||||
TToken_string mod(line.mid(equal+1, -1), ',');
|
TToken_string mod(line.mid(equal+1, -1), ',');
|
||||||
FOR_EACH_TOKEN(mod, cod)
|
FOR_EACH_TOKEN(mod, cod)
|
||||||
{
|
{
|
||||||
const int code = atoi(cod);
|
const int code = dongle().module_name2code(cod);
|
||||||
if (code == 0 || main_app().has_module(code))
|
if (code == 0 || is_visible(code))
|
||||||
{
|
{
|
||||||
disable = FALSE;
|
disable = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (disable)
|
if (disable)
|
||||||
_enabled = FALSE;
|
_enabled = false;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (line.compare("Picture", 7, TRUE) == 0)
|
if (line.starts_with("Picture", true))
|
||||||
{
|
{
|
||||||
// Estrae solamente il nome del file immagine, elimina path ed estensione
|
// Estrae solamente il nome del file immagine, elimina path ed estensione
|
||||||
TFilename name;
|
TFilename name;
|
||||||
get_next_string(line, 8, name, brace);
|
get_next_string(line, 8, name, brace);
|
||||||
xvt_fsys_parse_pathname(name, NULL, NULL, _picture.get_buffer(), NULL, NULL);
|
xvt_fsys_parse_pathname(name, NULL, NULL, _picture.get_buffer(), NULL, NULL);
|
||||||
} else
|
} else
|
||||||
if (line.compare("Flags", 5, TRUE) == 0)
|
if (line.starts_with("Flags", true))
|
||||||
{
|
{
|
||||||
TString16 flags;
|
TString16 flags;
|
||||||
get_next_string(line, 6, flags, brace);
|
get_next_string(line, 6, flags, brace);
|
||||||
if (flags.find('D') >= 0)
|
if (flags.find('D') >= 0)
|
||||||
_enabled = FALSE;
|
_enabled = FALSE;
|
||||||
if (flags.find('F') >= 0)
|
if (flags.find('F') >= 0)
|
||||||
_firm = TRUE;
|
_firm = true;
|
||||||
} else
|
} else
|
||||||
if (line.compare("Item", 4, TRUE) == 0)
|
if (line.starts_with("Item", true))
|
||||||
{
|
{
|
||||||
TMenuitem* item = new TMenuitem(this);
|
TMenuitem* item = new TMenuitem(this);
|
||||||
add(item);
|
if (item->create(line))
|
||||||
item->create(line);
|
add(item);
|
||||||
|
else
|
||||||
|
delete item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TSubmenu::find_string(const TString& str) const
|
int TSubmenu::find_string(const TString& str) const
|
||||||
{
|
{
|
||||||
bool found = FALSE;
|
bool found = false;
|
||||||
|
|
||||||
TString caption;
|
TString caption;
|
||||||
caption = _caption; caption.upper();
|
caption = _caption; caption.upper();
|
||||||
if (caption.find(str) >= 0 || caption.match(str))
|
if (caption.find(str) >= 0 || caption.match(str))
|
||||||
found = TRUE;
|
found = true;
|
||||||
|
|
||||||
for (int i = 0; i < items(); i++)
|
for (int i = 0; i < items(); i++)
|
||||||
{
|
{
|
||||||
@ -469,24 +501,24 @@ bool TSubmenu::perform(int i)
|
|||||||
bool TMenu::read(const char* name, TString& root)
|
bool TMenu::read(const char* name, TString& root)
|
||||||
{
|
{
|
||||||
TString str(255);
|
TString str(255);
|
||||||
bool first = TRUE;
|
bool found = false;
|
||||||
|
|
||||||
TFilename menuname = name;
|
TFilename menuname = name;
|
||||||
menuname.custom_path();
|
menuname.custom_path();
|
||||||
TScanner scanner(menuname);
|
TScanner scanner(menuname);
|
||||||
while (scanner.ok())
|
while (scanner.ok())
|
||||||
{
|
{
|
||||||
const TString& line = first ? scanner.line() : scanner.pop();
|
const TString& line = found ? scanner.pop() : scanner.line();
|
||||||
if (line.empty())
|
if (line.empty())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
char brace = '[';
|
char brace = '[';
|
||||||
get_next_string(line, 0, str, brace);
|
get_next_string(line, 0, str, brace);
|
||||||
|
|
||||||
if (first)
|
if (!found)
|
||||||
{
|
{
|
||||||
root = str;
|
root = str;
|
||||||
first = FALSE;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objptr(str) == NULL)
|
if (objptr(str) == NULL)
|
||||||
@ -499,7 +531,7 @@ bool TMenu::read(const char* name, TString& root)
|
|||||||
break; // Menu gia' caricato!
|
break; // Menu gia' caricato!
|
||||||
}
|
}
|
||||||
|
|
||||||
return first == FALSE;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -529,7 +561,7 @@ bool TMenu::set_firm(long firm) const
|
|||||||
if (cur.items() == 1)
|
if (cur.items() == 1)
|
||||||
{
|
{
|
||||||
cur = 0L;
|
cur = 0L;
|
||||||
firm = rel.curr().get_long("CODDITTA");
|
firm = rel.curr().get_long(NDT_CODDITTA);
|
||||||
if (!prefix().exist(firm))
|
if (!prefix().exist(firm))
|
||||||
firm = 0;
|
firm = 0;
|
||||||
}
|
}
|
||||||
@ -728,27 +760,7 @@ void TMenu::reload_images()
|
|||||||
|
|
||||||
bool TMenu::has_module(const char* mod)
|
bool TMenu::has_module(const char* mod)
|
||||||
{
|
{
|
||||||
TString16 key;
|
const word module = dongle().module_name2code(mod);
|
||||||
|
|
||||||
if (_modules.items() == 0)
|
|
||||||
{
|
|
||||||
TScanner scanner(AUT_FILE);
|
|
||||||
TString16 val;
|
|
||||||
for (int aut = 0; scanner.line() != ""; aut++)
|
|
||||||
{
|
|
||||||
key.strncpy(scanner.token(), 2);
|
|
||||||
key.lower();
|
|
||||||
val.format("%d", aut);
|
|
||||||
_modules.add(key, val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
key.strncpy(mod, 2);
|
|
||||||
key.lower();
|
|
||||||
|
|
||||||
int module = 0;
|
|
||||||
TString* cod = (TString*)_modules.objptr(key);
|
|
||||||
if (cod) module = atoi(*cod);
|
|
||||||
return main_app().has_module(module);
|
return main_app().has_module(module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
TSubmenu& submenu() const { return *_submenu; }
|
TSubmenu& submenu() const { return *_submenu; }
|
||||||
TMenu& menu() const;
|
TMenu& menu() const;
|
||||||
|
|
||||||
void create(const char* t);
|
bool create(const char* t);
|
||||||
|
|
||||||
TMenuitem(TSubmenu* sm);
|
TMenuitem(TSubmenu* sm);
|
||||||
TMenuitem(const TMenuitem& mi);
|
TMenuitem(const TMenuitem& mi);
|
||||||
@ -119,7 +119,6 @@ class TMenu : public TAssoc_array
|
|||||||
TString _default_menu;
|
TString _default_menu;
|
||||||
|
|
||||||
TAssoc_array _images;
|
TAssoc_array _images;
|
||||||
TAssoc_array _modules;
|
|
||||||
|
|
||||||
TToken_string _dangerous;
|
TToken_string _dangerous;
|
||||||
|
|
||||||
|
@ -4,17 +4,18 @@
|
|||||||
|
|
||||||
void Renamer(const char* mask)
|
void Renamer(const char* mask)
|
||||||
{
|
{
|
||||||
|
char drive[_MAX_DRIVE], path[_MAX_PATH], fname[_MAX_FNAME], ext[_MAX_EXT];
|
||||||
|
_splitpath(mask, drive, path, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
WIN32_FIND_DATA data;
|
WIN32_FIND_DATA data;
|
||||||
HANDLE hHandle = ::FindFirstFile(mask, &data);
|
HANDLE hHandle = ::FindFirstFile(mask, &data);
|
||||||
BOOL bRunning = hHandle != INVALID_HANDLE_VALUE;
|
BOOL bRunning = hHandle != INVALID_HANDLE_VALUE;
|
||||||
while (bRunning)
|
while (bRunning)
|
||||||
{
|
{
|
||||||
|
_splitpath(data.cFileName, NULL, NULL, fname, ext);
|
||||||
|
|
||||||
const char* newext = NULL;
|
const char* newext = NULL;
|
||||||
const char* oldpath = data.cFileName;
|
|
||||||
|
|
||||||
char drive[_MAX_DRIVE], path[_MAX_PATH], fname[_MAX_FNAME], ext[_MAX_EXT];
|
|
||||||
_splitpath(oldpath, drive, path, fname, ext);
|
|
||||||
|
|
||||||
if (stricmp(ext, ".ex_") == 0)
|
if (stricmp(ext, ".ex_") == 0)
|
||||||
newext = ".exe"; else
|
newext = ".exe"; else
|
||||||
if (stricmp(ext, ".dl_") == 0)
|
if (stricmp(ext, ".dl_") == 0)
|
||||||
@ -22,7 +23,8 @@ void Renamer(const char* mask)
|
|||||||
|
|
||||||
if (newext != NULL)
|
if (newext != NULL)
|
||||||
{
|
{
|
||||||
char newpath[_MAX_PATH];
|
char oldpath[_MAX_PATH], newpath[_MAX_PATH];
|
||||||
|
_makepath(oldpath, drive, path, fname, ext);
|
||||||
_makepath(newpath, drive, path, fname, newext);
|
_makepath(newpath, drive, path, fname, newext);
|
||||||
if (::CopyFile(oldpath, newpath, FALSE))
|
if (::CopyFile(oldpath, newpath, FALSE))
|
||||||
{
|
{
|
||||||
@ -47,16 +49,31 @@ void Renamer(const char* mask)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int PASCAL WinMain(HINSTANCE, HINSTANCE , LPSTR, int)
|
int PASCAL WinMain(HINSTANCE, HINSTANCE , LPSTR cmd_line, int)
|
||||||
{
|
{
|
||||||
::MessageBox(NULL, "Premere OK prima di riavviare il programma",
|
::MessageBox(NULL, "Premere OK ed attendere il riavvio del programma",
|
||||||
"Aggiornamento sistema", MB_ICONWARNING | MB_OK);
|
"Aggiornamento sistema", MB_ICONWARNING | MB_OK);
|
||||||
// ::Sleep(5000); // Apetta qualche secondo che termini ba0.exe
|
::Sleep(3000); // Apetta qualche secondo che termini ba0.exe
|
||||||
|
|
||||||
Renamer("*.??_");
|
Renamer("*.??_");
|
||||||
Renamer("Servers\\*.??_");
|
Renamer("Servers\\*.??_");
|
||||||
|
|
||||||
|
int modules_pending = ::GetPrivateProfileInt("ba0close", "ModulesPending", 0, "./campo.ini");
|
||||||
|
|
||||||
WinExec("ba0.exe", SW_SHOWNORMAL);
|
if (modules_pending != 0)
|
||||||
|
{
|
||||||
|
char cmd[256];
|
||||||
|
strcpy(cmd, "ba1.exe -6 /u");
|
||||||
|
const char* u = strstr(cmd_line, "/u");
|
||||||
|
if (u != NULL)
|
||||||
|
strcat(cmd, u+2);
|
||||||
|
else
|
||||||
|
strcat(cmd, "ADMIN");
|
||||||
|
|
||||||
|
WinExec(cmd, SW_SHOWNORMAL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
WinExec("ba0.exe", SW_SHOWNORMAL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
125
ba/ba1100.cpp
125
ba/ba1100.cpp
@ -1,4 +1,17 @@
|
|||||||
|
#include "ba1.h"
|
||||||
|
#include "ba1100.h"
|
||||||
|
|
||||||
|
#include <applicat.h>
|
||||||
|
#include <dongle.h>
|
||||||
|
#include <printer.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
|
#include <user.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <share.h>
|
#include <share.h>
|
||||||
@ -7,25 +20,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include <applicat.h>
|
|
||||||
#include <extcdecl.h>
|
|
||||||
#include <dongle.h>
|
|
||||||
#include <execp.h>
|
|
||||||
#include <isam.h>
|
|
||||||
#include <mask.h>
|
|
||||||
#include <prefix.h>
|
|
||||||
#include <printer.h>
|
|
||||||
#include <progind.h>
|
|
||||||
#include <urldefid.h>
|
|
||||||
#include <utility.h>
|
|
||||||
#include <validate.h>
|
|
||||||
|
|
||||||
#include "ba1.h"
|
|
||||||
#include "ba1100.h"
|
|
||||||
|
|
||||||
#define History_file "conv.his"
|
#define History_file "conv.his"
|
||||||
#define Dir_file "dir.gen"
|
#define Dir_file "dir.gen"
|
||||||
@ -163,7 +158,7 @@ void TManutenzione_app::do_print(TPrinter & p, TRec_sheet & r)
|
|||||||
TTrec & rec = *r.rec();
|
TTrec & rec = *r.rec();
|
||||||
TDir & dir = *r.dir();
|
TDir & dir = *r.dir();
|
||||||
const char * descfname = r.descfname();
|
const char * descfname = r.descfname();
|
||||||
TString16 tab(r.tab());
|
TString4 tab(r.tab());
|
||||||
const bool istab = tab.not_empty();
|
const bool istab = tab.not_empty();
|
||||||
|
|
||||||
tab.upper();
|
tab.upper();
|
||||||
@ -180,12 +175,12 @@ void TManutenzione_app::do_print(TPrinter & p, TRec_sheet & r)
|
|||||||
row.put(TR("Pag. @#"), 69);
|
row.put(TR("Pag. @#"), 69);
|
||||||
p.setheaderline(2, row);
|
p.setheaderline(2, row);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(TR("Nome"), 7);
|
row.put(HR("Nome"), 7);
|
||||||
row.put(TR("Tipo"), 18);
|
row.put(HR("Tipo"), 18);
|
||||||
row.put(TR("Lun."), 38);
|
row.put(HR("Lun."), 38);
|
||||||
row.put(TR("Dec."), 44);
|
row.put(HR("Dec."), 44);
|
||||||
row.put(TR("Pos."), 48);
|
row.put(HR("Pos."), 48);
|
||||||
row.put(TR("Descrizione"), 53);
|
row.put(HR("Descrizione"), 53);
|
||||||
p.setheaderline(4, row);
|
p.setheaderline(4, row);
|
||||||
|
|
||||||
TString riga(78); riga.fill('-');
|
TString riga(78); riga.fill('-');
|
||||||
@ -233,8 +228,8 @@ void TManutenzione_app::do_print(TPrinter & p, TRec_sheet & r)
|
|||||||
row.reset();
|
row.reset();
|
||||||
p.print(row);
|
p.print(row);
|
||||||
|
|
||||||
row.put(TR("Espressione chiave"), 7);
|
row.put(HR("Espressione chiave"), 7);
|
||||||
row.put(TR("Duplicabile"), 68);
|
row.put(HR("Duplicabile"), 68);
|
||||||
p.setheaderline(4, row);
|
p.setheaderline(4, row);
|
||||||
|
|
||||||
if (p.rows_left() < 5)
|
if (p.rows_left() < 5)
|
||||||
@ -373,9 +368,10 @@ bool TManutenzione_app::create() // initvar e arrmask
|
|||||||
_browse = new TDir_sheet (TR("Manutenzione file di sistema"), _superprassi ? 0xC : 0x8);
|
_browse = new TDir_sheet (TR("Manutenzione file di sistema"), _superprassi ? 0xC : 0x8);
|
||||||
if (_superprassi)
|
if (_superprassi)
|
||||||
{
|
{
|
||||||
_browse->add_button(DLG_INSFILE, BR("~Inserisci", 9), K_F6);
|
|
||||||
_browse->add_button(DLG_CONVERT, BR("~Converti", 9), K_F7);
|
_browse->add_button(DLG_CONVERT, BR("~Converti", 9), K_F7);
|
||||||
_browse->add_button(DLG_ADDFILE, BR("~Aggiungi", 9), K_F8);
|
// _browse->add_button(DLG_INSFILE, BR("~Inserisci", 9), K_F6);
|
||||||
|
if (is_power_station())
|
||||||
|
_browse->add_button(DLG_ADDFILE, BR("~Aggiungi", 9), K_F8);
|
||||||
TButton_field& butt = ((TMask*)_browse)->add_button(DLG_OTHERFILE, 0, BR("A~ltri", 9), 0, -1, 9, 2, "", 0, 0);
|
TButton_field& butt = ((TMask*)_browse)->add_button(DLG_OTHERFILE, 0, BR("A~ltri", 9), 0, -1, 9, 2, "", 0, 0);
|
||||||
butt.set_exit_key(K_F5);
|
butt.set_exit_key(K_F5);
|
||||||
_mask->enable(-1); // Abilita campi privilegiati
|
_mask->enable(-1); // Abilita campi privilegiati
|
||||||
@ -540,8 +536,7 @@ void TManutenzione_app::dump_trc(const char * dir, const bool des_too, const lon
|
|||||||
descfname.format("%s/d%d.des", DESCDIR, i);
|
descfname.format("%s/d%d.des", DESCDIR, i);
|
||||||
if (!fexist(descfname)) // crea la descrizione se non esiste
|
if (!fexist(descfname)) // crea la descrizione se non esiste
|
||||||
{
|
{
|
||||||
FILE * fd = fopen(descfname, "w");
|
FILE * fd = fopen(descfname, "w");
|
||||||
|
|
||||||
if (fd != NULL)
|
if (fd != NULL)
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
}
|
}
|
||||||
@ -729,7 +724,7 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
|||||||
const char rs = *esc(m.get(FLD_RS));
|
const char rs = *esc(m.get(FLD_RS));
|
||||||
const bool withdel = m.get_bool(FLD_WITHDEL);
|
const bool withdel = m.get_bool(FLD_WITHDEL);
|
||||||
const int keyno = m.get_int(FLD_KEYNO);
|
const int keyno = m.get_int(FLD_KEYNO);
|
||||||
const TString16 tabella(_mask->get(F_TAB));
|
const TString4 tabella(_mask->get(F_TAB));
|
||||||
if (tabella.not_empty())
|
if (tabella.not_empty())
|
||||||
{
|
{
|
||||||
TToken_string filter;
|
TToken_string filter;
|
||||||
@ -749,11 +744,12 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
|||||||
m.set(FLD_INFILE, ninp);
|
m.set(FLD_INFILE, ninp);
|
||||||
if (m.run() == K_ENTER)
|
if (m.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
char fs = *esc(m.get(FLD_FS));
|
const char fs = *esc(m.get(FLD_FS));
|
||||||
char fd = *esc(m.get(FLD_FD));
|
const char fd = *esc(m.get(FLD_FD));
|
||||||
char rs = *esc(m.get(FLD_RS));
|
const char rs = *esc(m.get(FLD_RS));
|
||||||
|
const bool indexed = !m.get_bool(FLD_WITHKEY);
|
||||||
ninp = m.get(FLD_INFILE);
|
ninp = m.get(FLD_INFILE);
|
||||||
f.load(ninp, fs, fd, rs);
|
f.load(ninp, fs, fd, rs, true, false, indexed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -904,7 +900,6 @@ void TManutenzione_app::update_dir()
|
|||||||
d.put(i, _nordir, _sysdirop);
|
d.put(i, _nordir, _sysdirop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!fs.exist())
|
if (!fs.exist())
|
||||||
{
|
{
|
||||||
if (d.eox() > 0L)
|
if (d.eox() > 0L)
|
||||||
@ -994,7 +989,7 @@ void TManutenzione_app::update_dir()
|
|||||||
bool cmn_file = false;
|
bool cmn_file = false;
|
||||||
bool valid_file = moveable_file(i);
|
bool valid_file = moveable_file(i);
|
||||||
if (!is_com && valid_file && d.is_com())
|
if (!is_com && valid_file && d.is_com())
|
||||||
cmn_file = true; // Salta in questo caso:
|
cmn_file = true; // Salta in questo caso:
|
||||||
// sto aggiornando le ditte,
|
// sto aggiornando le ditte,
|
||||||
// il file in questione e' uno di quelli che possono essere comuni
|
// il file in questione e' uno di quelli che possono essere comuni
|
||||||
// il file e' in comune
|
// il file e' in comune
|
||||||
@ -1089,10 +1084,12 @@ void TManutenzione_app::update_dir()
|
|||||||
{
|
{
|
||||||
towrite = (TString(ds.des()) != d.des());
|
towrite = (TString(ds.des()) != d.des());
|
||||||
if (towrite)
|
if (towrite)
|
||||||
|
{
|
||||||
if (!valid_file)
|
if (!valid_file)
|
||||||
d.set(ds.name(), d.eox(), d.eod(), ds.des(), d.expr());
|
d.set(ds.name(), d.eox(), d.eod(), ds.des(), d.expr());
|
||||||
else
|
else
|
||||||
strcpy((char *) d.des(), ds.des());
|
strcpy((char *) d.des(), ds.des());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (is_com && valid_file && d.name()[0] == '$')
|
if (is_com && valid_file && d.name()[0] == '$')
|
||||||
{
|
{
|
||||||
@ -1397,39 +1394,30 @@ void TManutenzione_app::update()
|
|||||||
TIsamfile utenti(LF_USER);
|
TIsamfile utenti(LF_USER);
|
||||||
utenti.open(_excllock);
|
utenti.open(_excllock);
|
||||||
|
|
||||||
|
#ifndef DBG
|
||||||
for (int err = utenti.first(); err == NOERR; err = utenti.next())
|
for (int err = utenti.first(); err == NOERR; err = utenti.next())
|
||||||
{
|
{
|
||||||
const TString16 u = utenti.get("USERNAME");
|
const TString& u = utenti.get(USR_USERNAME);
|
||||||
if (u == ::dongle().administrator())
|
if (u != ::dongle().administrator() && utenti.get_bool(USR_CONNECTED))
|
||||||
{
|
{
|
||||||
if (utenti.get("AUTSTR") == "CONVERTING")
|
ok = error_box(FR("La conversione non puo' essere effettuata\nmentre l'utente %s e' collegato"), (const char*)u);
|
||||||
{
|
break;
|
||||||
#ifdef DBG
|
|
||||||
ok = yesno_box(TR("Conversione in corso:\nProseguire ugualmente?"));
|
|
||||||
if (!ok)
|
|
||||||
break;
|
|
||||||
#else
|
|
||||||
ok = error_box(TR("Conversione in corso:\nImpossibile proseguire"));
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
utenti.put("AUTSTR", "CONVERTING");
|
|
||||||
utenti.rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (utenti.get_bool("CONNECTED"))
|
|
||||||
{
|
|
||||||
#ifndef DBG
|
|
||||||
ok = error_box(FR("La conversione non puo' essere effettuata\nmentre l'utente %s e' collegato"), (const char*)u);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
// Scrive CONVERTING solo dopo aver testato che non ci sia nessuno connesso
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
utenti.zero();
|
||||||
|
utenti.put(USR_USERNAME, dongle().administrator());
|
||||||
|
ok = utenti.read() == NOERR;
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
utenti.put(USR_AUTSTR, "CONVERTING");
|
||||||
|
ok = utenti.rewrite() == NOERR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
utenti.close();
|
utenti.close();
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
@ -1510,10 +1498,11 @@ void TManutenzione_app::update()
|
|||||||
do_events();
|
do_events();
|
||||||
}
|
}
|
||||||
|
|
||||||
utenti.put("USERNAME", ::dongle().administrator());
|
// Azzera la scritta converting
|
||||||
|
utenti.put(USR_USERNAME, ::dongle().administrator());
|
||||||
if (utenti.read() == NOERR)
|
if (utenti.read() == NOERR)
|
||||||
{
|
{
|
||||||
utenti.zero("AUTSTR");
|
utenti.zero(USR_AUTSTR);
|
||||||
utenti.rewrite();
|
utenti.rewrite();
|
||||||
}
|
}
|
||||||
utenti.close();
|
utenti.close();
|
||||||
|
20
ba/ba1100.h
20
ba/ba1100.h
@ -1,12 +1,16 @@
|
|||||||
#ifndef __BA1100_H
|
#ifndef __BA1100_H
|
||||||
#define __BA1100_H
|
#define __BA1100_H
|
||||||
|
|
||||||
#ifndef __SHEET_H
|
#ifndef __CONFIG_H
|
||||||
#include <sheet.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CONFIG_H
|
#ifndef __SHEET_H
|
||||||
#include <config.h>
|
#include <isam.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __SHEET_H
|
||||||
|
#include <sheet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __MASKFLD_H
|
#ifndef __MASKFLD_H
|
||||||
@ -21,7 +25,7 @@ class TMask_field;
|
|||||||
|
|
||||||
class TDir_sheet : public TSheet
|
class TDir_sheet : public TSheet
|
||||||
{
|
{
|
||||||
TTrec *_rec;
|
TTrec *_rec;
|
||||||
TDir *_dir;
|
TDir *_dir;
|
||||||
FileDes _s_dir;
|
FileDes _s_dir;
|
||||||
long _items;
|
long _items;
|
||||||
@ -65,11 +69,11 @@ protected:
|
|||||||
public:
|
public:
|
||||||
TDir* dir() const { return _dir; }
|
TDir* dir() const { return _dir; }
|
||||||
TTrec* rec() const { return _rec; }
|
TTrec* rec() const { return _rec; }
|
||||||
const char * descfname() const { return _descfname;}
|
const char* descfname() const { return _descfname;}
|
||||||
const char * tab() const { return _tab; }
|
const char* tab() const { return _tab; }
|
||||||
void edit();
|
void edit();
|
||||||
|
|
||||||
TRec_sheet(int logicnum, const char * tab);
|
TRec_sheet(int logicnum, const char* tab);
|
||||||
TRec_sheet(TExternisamfile* file);
|
TRec_sheet(TExternisamfile* file);
|
||||||
virtual ~TRec_sheet();
|
virtual ~TRec_sheet();
|
||||||
};
|
};
|
||||||
|
@ -17,6 +17,11 @@ BEGIN
|
|||||||
MESSAGE TRUE DISABLE,FLD_FS|DISABLE,FLD_FD|DISABLE,FLD_RS|"\0",FLD_FS|"\0",FLD_FD|"\n",FLD_RS
|
MESSAGE TRUE DISABLE,FLD_FS|DISABLE,FLD_FD|DISABLE,FLD_RS|"\0",FLD_FS|"\0",FLD_FD|"\n",FLD_RS
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN FLD_WITHKEY
|
||||||
|
BEGIN
|
||||||
|
PROMPT 24 3 "Indicizza solo alla fine del processo (Usare SOLO su file vuoti)"
|
||||||
|
END
|
||||||
|
|
||||||
STRING FLD_FS 5
|
STRING FLD_FS 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Separatore di campi "
|
PROMPT 2 5 "Separatore di campi "
|
||||||
@ -38,12 +43,13 @@ BEGIN
|
|||||||
FLAGS "P"
|
FLAGS "P"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_OK 9 2
|
|
||||||
|
BUTTON DLG_OK 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 -1 ""
|
PROMPT -12 -1 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_CANCEL 9 2
|
BUTTON DLG_CANCEL 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 -1 ""
|
PROMPT -22 -1 ""
|
||||||
END
|
END
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#include "ba1500.h"
|
#include "ba1500.h"
|
||||||
#include "ba0100a.h"
|
#include "ba0100a.h"
|
||||||
|
|
||||||
|
#include <user.h>
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Menu item
|
// Menu item
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -21,8 +24,8 @@ class TMenu_item : public TString
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TObject* dup() const { return new TMenu_item(*this); }
|
virtual TObject* dup() const { return new TMenu_item(*this); }
|
||||||
const TString& cmd() const { return _cmd; }
|
const TString& cmd() const { return _cmd; }
|
||||||
TString& cmd() { return _cmd; }
|
TString& cmd() { return _cmd; }
|
||||||
|
|
||||||
TMenu_item(const TMenu_item& mi);
|
TMenu_item(const TMenu_item& mi);
|
||||||
TMenu_item(const char* line);
|
TMenu_item(const char* line);
|
||||||
@ -52,7 +55,7 @@ TMenu_item::TMenu_item(const char* line)
|
|||||||
class TSubmenu : public TString
|
class TSubmenu : public TString
|
||||||
{
|
{
|
||||||
TArray _child;
|
TArray _child;
|
||||||
int _module;
|
word _module;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TMenu_item& operator[](int c) { return (TMenu_item&)*_child.objptr(c); }
|
TMenu_item& operator[](int c) { return (TMenu_item&)*_child.objptr(c); }
|
||||||
@ -60,7 +63,7 @@ public:
|
|||||||
|
|
||||||
int items() const { return _child.items(); }
|
int items() const { return _child.items(); }
|
||||||
int module() const { return _module; }
|
int module() const { return _module; }
|
||||||
void set_module(int m) { _module = m; }
|
void set_module(word m) { _module = m; }
|
||||||
|
|
||||||
TSubmenu& operator=(const char* str) { set(str); return *this; }
|
TSubmenu& operator=(const char* str) { set(str); return *this; }
|
||||||
TSubmenu& operator=(const TSubmenu& str) { set(str); _module = str._module; return *this; }
|
TSubmenu& operator=(const TSubmenu& str) { set(str); _module = str._module; return *this; }
|
||||||
@ -94,13 +97,13 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
const TString& TMenu_node::command() const
|
const TString& TMenu_node::command() const
|
||||||
{
|
{
|
||||||
if (_item)
|
if (_item)
|
||||||
return _item->cmd();
|
return _item->cmd();
|
||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
TMenu_node::TMenu_node(TMenu_item* i, int module)
|
TMenu_node::TMenu_node(TMenu_item* i, int module)
|
||||||
: _item(i), _module(module)
|
: _item(i), _module(module)
|
||||||
{
|
{
|
||||||
set(*i);
|
set(*i);
|
||||||
@ -108,8 +111,8 @@ TMenu_node::TMenu_node(TMenu_item* i, int module)
|
|||||||
|
|
||||||
TMenu_node::TMenu_node(const char* str)
|
TMenu_node::TMenu_node(const char* str)
|
||||||
: _item(NULL), _module(0)
|
: _item(NULL), _module(0)
|
||||||
{
|
{
|
||||||
set(str);
|
set(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -312,7 +315,7 @@ void TMenu::import(const char* filename, TString& first)
|
|||||||
first = line;
|
first = line;
|
||||||
sub = &get_submenu(line);
|
sub = &get_submenu(line);
|
||||||
} else
|
} else
|
||||||
if (line.compare("Caption", 7, true) == 0)
|
if (line.starts_with("Caption", true))
|
||||||
{
|
{
|
||||||
CHECK(sub, "Invalid menu file");
|
CHECK(sub, "Invalid menu file");
|
||||||
const int equal = line.find('=');
|
const int equal = line.find('=');
|
||||||
@ -321,14 +324,15 @@ void TMenu::import(const char* filename, TString& first)
|
|||||||
line.strip("\"");
|
line.strip("\"");
|
||||||
*sub = line;
|
*sub = line;
|
||||||
} else
|
} else
|
||||||
if (line.compare("Module", 6, true) == 0)
|
if (line.starts_with("Module", true))
|
||||||
{
|
{
|
||||||
CHECK(sub, "Invalid menu file");
|
CHECK(sub, "Invalid menu file");
|
||||||
const int equal = line.find('=');
|
const int equal = line.find('=');
|
||||||
CHECK(equal > 0, "Invalid menu Module");
|
CHECK(equal > 0, "Invalid menu Module");
|
||||||
sub->set_module(atoi(line.mid(equal+1)));
|
const word mod = atoi(line.mid(equal+1));
|
||||||
|
sub->set_module(mod);
|
||||||
} else
|
} else
|
||||||
if (line.compare("Item", 4, true) == 0)
|
if (line.starts_with("Item", true))
|
||||||
{
|
{
|
||||||
CHECK(sub, "Invalid menu file");
|
CHECK(sub, "Invalid menu file");
|
||||||
const int equal = line.find('=');
|
const int equal = line.find('=');
|
||||||
@ -342,9 +346,15 @@ void TMenu::import(const char* filename, TString& first)
|
|||||||
TFilename name = line.sub(bracket+1, endbracket);
|
TFilename name = line.sub(bracket+1, endbracket);
|
||||||
if (name.custom_path())
|
if (name.custom_path())
|
||||||
{
|
{
|
||||||
import(name, name);
|
bool proceed = true;
|
||||||
TMenu_item& child = sub->add_child(line);
|
if (line.find('E', endbracket+1) > 0)
|
||||||
child.cmd() = name;
|
proceed = dongle().active(EEAUT);
|
||||||
|
if (proceed)
|
||||||
|
{
|
||||||
|
import(name, name);
|
||||||
|
TMenu_item& child = sub->add_child(line);
|
||||||
|
child.cmd() = name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -402,9 +412,9 @@ bool TSet_users::group_handler(TMask_field& f, KEY key)
|
|||||||
const TString& gruppo = m.get(F_GROUPNAME);
|
const TString& gruppo = m.get(F_GROUPNAME);
|
||||||
TEdit_field& ef = (TEdit_field&)f;
|
TEdit_field& ef = (TEdit_field&)f;
|
||||||
TRectype& rec = ef.browse()->cursor()->curr();
|
TRectype& rec = ef.browse()->cursor()->curr();
|
||||||
if (rec.get("USERNAME") != gruppo)
|
if (rec.get(USR_USERNAME) != gruppo)
|
||||||
{
|
{
|
||||||
rec.put("USERNAME", gruppo);
|
rec.put(USR_USERNAME, gruppo);
|
||||||
ef.browse()->cursor()->read();
|
ef.browse()->cursor()->read();
|
||||||
}
|
}
|
||||||
app().build_sheet(&rec);
|
app().build_sheet(&rec);
|
||||||
@ -425,7 +435,7 @@ bool TSet_user_passwd::password_handler(TMask_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (pwd[i] >= 0 && pwd[i] <= ' ')
|
if (pwd[i] >= 0 && pwd[i] <= ' ')
|
||||||
{
|
{
|
||||||
ok = error_box("La password contiene un carattere non valido.");
|
ok = error_box(FR("La password contiene un carattere non valido alla posizione %d"), i+1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -533,7 +543,7 @@ void TSet_user_passwd::build_sheet(const TRectype* r)
|
|||||||
{
|
{
|
||||||
TString autstr, d;
|
TString autstr, d;
|
||||||
if (r != NULL)
|
if (r != NULL)
|
||||||
autstr = r->get("AUTSTR");
|
autstr = r->get(USR_AUTSTR);
|
||||||
const int l = autstr.len();
|
const int l = autstr.len();
|
||||||
|
|
||||||
TSheet_field& sf = sheet_field();
|
TSheet_field& sf = sheet_field();
|
||||||
@ -563,7 +573,7 @@ void TSet_users::build_tree(const TRectype* r)
|
|||||||
|
|
||||||
if (r)
|
if (r)
|
||||||
{
|
{
|
||||||
TToken_string prop_field(r->get("PERMISSION"), '\n');
|
TToken_string prop_field(r->get(USR_PERMISSION), '\n');
|
||||||
TToken_string pro("",SAFE_PIPE_CHR),row("",SAFE_PIPE_CHR);
|
TToken_string pro("",SAFE_PIPE_CHR),row("",SAFE_PIPE_CHR);
|
||||||
TString app;
|
TString app;
|
||||||
FOR_EACH_TOKEN(prop_field, tok)
|
FOR_EACH_TOKEN(prop_field, tok)
|
||||||
@ -666,8 +676,6 @@ bool TSet_users::user_create()
|
|||||||
sf.set_notify(k_notify);
|
sf.set_notify(k_notify);
|
||||||
|
|
||||||
const char* menuname = "bamenu.men";
|
const char* menuname = "bamenu.men";
|
||||||
if (argc() > 2)
|
|
||||||
menuname = argv(2);
|
|
||||||
|
|
||||||
_tree = new TMenu(menuname);
|
_tree = new TMenu(menuname);
|
||||||
_msk->set_handler(F_PERMESSI, tree_handler);
|
_msk->set_handler(F_PERMESSI, tree_handler);
|
||||||
@ -683,7 +691,7 @@ int TSet_users::read(TMask& m)
|
|||||||
const TRectype& r = get_relation()->curr();
|
const TRectype& r = get_relation()->curr();
|
||||||
build_sheet(&r);
|
build_sheet(&r);
|
||||||
|
|
||||||
const char* pwd = decode(r.get("PASSWORD"));
|
const char* pwd = decode(r.get(USR_PASSWORD));
|
||||||
m.set(F_PASSWORD, pwd);
|
m.set(F_PASSWORD, pwd);
|
||||||
m.set(F_PROVA, pwd);
|
m.set(F_PROVA, pwd);
|
||||||
|
|
||||||
@ -696,11 +704,11 @@ void TSet_user_passwd::put_in_record(const TMask& m)
|
|||||||
{
|
{
|
||||||
TRectype& r = get_relation()->curr();
|
TRectype& r = get_relation()->curr();
|
||||||
const char* s = encode(m.get(F_PASSWORD));
|
const char* s = encode(m.get(F_PASSWORD));
|
||||||
if (r.get("PASSWORD") != s)
|
if (r.get(USR_PASSWORD) != s)
|
||||||
{
|
{
|
||||||
r.put("PASSWORD", s);
|
r.put(USR_PASSWORD, s);
|
||||||
if (r.exist("DATAPWD"))
|
if (r.exist(USR_DATAPWD))
|
||||||
r.put("DATAPWD", TDate(TODAY));
|
r.put(USR_DATAPWD, TDate(TODAY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,14 +720,16 @@ void TSet_users::put_in_record(const TMask& m)
|
|||||||
TSheet_field& sf = sheet_field();
|
TSheet_field& sf = sheet_field();
|
||||||
FOR_EACH_SHEET_ROW(sf, i, riga)
|
FOR_EACH_SHEET_ROW(sf, i, riga)
|
||||||
{
|
{
|
||||||
const char c = riga->get(1)[0];
|
const char c = riga->get_char(1);
|
||||||
const int module = riga->get_int();
|
|
||||||
if (c == 'X')
|
if (c == 'X')
|
||||||
|
{
|
||||||
|
const int module = riga->get_int();
|
||||||
autstr[module] = c;
|
autstr[module] = c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRectype& r = get_relation()->curr();
|
TRectype& r = get_relation()->curr();
|
||||||
r.put("AUTSTR", autstr);
|
r.put(USR_AUTSTR, autstr);
|
||||||
|
|
||||||
TToken_string prop_field(256, '\n');
|
TToken_string prop_field(256, '\n');
|
||||||
TAssoc_array& prop = _tree->properties();
|
TAssoc_array& prop = _tree->properties();
|
||||||
@ -735,7 +745,7 @@ void TSet_users::put_in_record(const TMask& m)
|
|||||||
prop_field.add(*row);
|
prop_field.add(*row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r.put("PERMISSION", prop_field);
|
r.put(USR_PERMISSION, prop_field);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TSet_user_passwd::write(const TMask& m)
|
int TSet_user_passwd::write(const TMask& m)
|
||||||
@ -757,7 +767,7 @@ bool TSet_users::remove()
|
|||||||
{
|
{
|
||||||
TFilename file = firm2dir(-1); // Directory dati
|
TFilename file = firm2dir(-1); // Directory dati
|
||||||
file.add("config"); // Directory configurazioni
|
file.add("config"); // Directory configurazioni
|
||||||
file.add(get_relation()->curr().get("USERNAME")); // Nome utente
|
file.add(get_relation()->curr().get(USR_USERNAME)); // Nome utente
|
||||||
file.ext("ini"); // Estensione
|
file.ext("ini"); // Estensione
|
||||||
::remove(file);
|
::remove(file);
|
||||||
}
|
}
|
||||||
@ -787,7 +797,7 @@ int TSet_user_passwd::read(TMask& m)
|
|||||||
const TRectype& r = get_relation()->curr();
|
const TRectype& r = get_relation()->curr();
|
||||||
build_sheet(&r);
|
build_sheet(&r);
|
||||||
|
|
||||||
const char* pwd = decode(r.get("PASSWORD"));
|
const char* pwd = decode(r.get(USR_PASSWORD));
|
||||||
m.set(F_PASSWORD, pwd);
|
m.set(F_PASSWORD, pwd);
|
||||||
m.set(F_PROVA, pwd);
|
m.set(F_PROVA, pwd);
|
||||||
|
|
||||||
|
458
ba/ba1500.cpp
458
ba/ba1500.cpp
@ -1,72 +1,44 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <date.h>
|
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <modaut.h>
|
#include <modaut.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
#include <prefix.h>
|
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
|
|
||||||
#define BITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
|
|
||||||
#define BITSET(w,p,v) ((v) ? ((w) |= (0x0001 << (p))) : ((w) &= (~(0x0001 << (p)))))
|
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
#include "ba1500.h"
|
#include "ba1500.h"
|
||||||
#include "ba1500a.h"
|
#include "ba1500a.h"
|
||||||
#include "ba1500b.h"
|
#include "ba1500b.h"
|
||||||
#include "ba1600.h"
|
#include "ba1600.h"
|
||||||
|
|
||||||
#define K1 0x4500
|
|
||||||
#define LBYTEMASK 0x00FF
|
|
||||||
#define UBYTEMASK 0xFF00
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TInformazione_moduli::TInformazione_moduli()
|
TInformazione_moduli::TInformazione_moduli()
|
||||||
: _unassigned_modules(0)
|
: _unassigned_modules(0)
|
||||||
{
|
{
|
||||||
int mod = 0;
|
const TDongle& d = dongle();
|
||||||
TString s(256);
|
for (word mod = M77AUT; mod < ENDAUT; mod++)
|
||||||
TToken_string t;
|
|
||||||
TString_array descs;
|
|
||||||
|
|
||||||
ifstream in(AUT_FILE);
|
|
||||||
while (!in.eof() && in.good())
|
|
||||||
{
|
{
|
||||||
in.getline(s.get_buffer(), s.size());
|
TToken_string t = d.module_code2desc(mod);
|
||||||
s.trim();
|
if (t.len() > 2 && !t.starts_with("Modulo vario", true)) // Scarta moduli ignoti
|
||||||
if (s.empty())
|
|
||||||
break;
|
|
||||||
const int l = s.len();
|
|
||||||
if (l >= 3 && s[3] > ' ')
|
|
||||||
{
|
{
|
||||||
t = s.mid(3);
|
if (d.shown(mod)) //controlla che sia veramente un modulo da mostrare!
|
||||||
t.add(s.left(2));
|
{
|
||||||
} else {
|
t.add(d.module_code2name(mod));
|
||||||
t = "{Modulo Sconosciuto}";
|
t.add(mod);
|
||||||
t.add(s.left(2));
|
_infos.add(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
t.add(mod++);
|
|
||||||
s = t.get(0);
|
|
||||||
descs.add(s);
|
|
||||||
s.upper();
|
|
||||||
t.add(s, 0);
|
|
||||||
_infos.add(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in.bad() && !in.eof())
|
|
||||||
error_box(TR("Si e' verificato un errore leggendo il file di descrizione moduli."));
|
|
||||||
|
|
||||||
_infos.sort();
|
_infos.sort();
|
||||||
for (int i=0;i<mod;i++)
|
for (int i = 0; i < _infos.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string& riga = _infos.row(i);
|
TToken_string& riga = _infos.row(i);
|
||||||
const int mod = riga.get_int(2);
|
const int mod = riga.get_int(2);
|
||||||
_index[mod] = i;
|
_index[mod] = i;
|
||||||
s = descs.row(mod).get(0);
|
|
||||||
riga.add(s, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,27 +76,6 @@ int TInformazione_moduli::get_module_by_order(int index)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calcola il produttore ufficiale di module
|
|
||||||
TDongleType TInformazione_moduli::get_owner(int module) const
|
|
||||||
{
|
|
||||||
// const int aut[] = { CMAUT, ATAUT, POAUT, AFAUT, TCAUT, TMAUT,
|
|
||||||
// VEAUT, MGAUT, ORAUT, EFAUT, DBAUT, PRAUT, SVAUT, -1 };
|
|
||||||
// for (int a = 0; aut[a] >= 0; a++)
|
|
||||||
// if (module == aut[a])
|
|
||||||
return _aga_dongle;
|
|
||||||
|
|
||||||
// return _prassi_dongle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Testa se module appartiene al produttore owner
|
|
||||||
// N.B. L'AGA possiede anche tutti i moduli PRASSI
|
|
||||||
bool TInformazione_moduli::test_owner(int module, TDongleType owner) const
|
|
||||||
{
|
|
||||||
TDongleType ow = get_owner(module);
|
|
||||||
bool yes = owner == ow || (owner == _aga_dongle && ow == _prassi_dongle);
|
|
||||||
return yes;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* TInformazione_moduli::get_description(int module)
|
const char* TInformazione_moduli::get_description(int module)
|
||||||
{ return get_description_by_order(_index[module]); }
|
{ return get_description_by_order(_index[module]); }
|
||||||
|
|
||||||
@ -144,8 +95,6 @@ int TInformazione_moduli::get_index_by_name(const char* code) const
|
|||||||
return i >= 0 ? get_index(i) : i;
|
return i >= 0 ? get_index(i) : i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TForm richiesta attivazione
|
// TForm richiesta attivazione
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -154,7 +103,7 @@ class TRequest_form : public TForm
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void update_serno(const TString& serno);
|
void update_serno(const TString& serno);
|
||||||
void update_dongle(const TDongle& dongle);
|
void update_dongle();
|
||||||
void update_os();
|
void update_os();
|
||||||
void print_footer();
|
void print_footer();
|
||||||
|
|
||||||
@ -193,30 +142,31 @@ void TRequest_form::update_serno(const TString& num)
|
|||||||
data.set(today.string());
|
data.set(today.string());
|
||||||
switch (::dongle().hardware() )
|
switch (::dongle().hardware() )
|
||||||
{
|
{
|
||||||
case _dongle_eutron:
|
case _dongle_hardlock:
|
||||||
find_field('H',odd_page,FF_DONGLE_HW).set("EUTRON"); break;
|
find_field('H',odd_page,FF_DONGLE_HW).set("HARDLOCK"); break;
|
||||||
default:
|
default:
|
||||||
find_field('H',odd_page,FF_DONGLE_HW).set("HARDLOCK"); break;
|
find_field('H',odd_page,FF_DONGLE_HW).set("EUTRON"); break;
|
||||||
}
|
}
|
||||||
TForm_item& serno = find_field('H', odd_page, FF_DONGLE_SN);
|
TForm_item& serno = find_field('H', odd_page, FF_DONGLE_SN);
|
||||||
serno.set(num);
|
serno.set(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRequest_form::update_dongle(const TDongle& dongle)
|
void TRequest_form::update_dongle()
|
||||||
{
|
{
|
||||||
|
const TDongle& d = dongle();
|
||||||
|
|
||||||
TForm_item& year = find_field('H', odd_page, FF_YEAR);
|
TForm_item& year = find_field('H', odd_page, FF_YEAR);
|
||||||
TString str;
|
TString16 str;
|
||||||
str << "31-12-" << (int)dongle.year_assist();
|
str << "31-12-" << (int)d.year_assist();
|
||||||
year.set(str);
|
year.set(str);
|
||||||
|
|
||||||
TForm_item& user = find_field('H', odd_page, FF_NUTENTI);
|
TForm_item& user = find_field('H', odd_page, FF_NUTENTI);
|
||||||
str.format("%d", dongle.max_users());
|
str.format("%d", d.max_users());
|
||||||
user.set(str);
|
user.set(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRequest_form::update_os()
|
void TRequest_form::update_os()
|
||||||
{
|
{
|
||||||
TForm_item& os = find_field('H', odd_page, FF_OS);
|
|
||||||
const char* stros = NULL;
|
const char* stros = NULL;
|
||||||
switch (xvt_sys_get_os_version())
|
switch (xvt_sys_get_os_version())
|
||||||
{
|
{
|
||||||
@ -225,12 +175,14 @@ void TRequest_form::update_os()
|
|||||||
case XVT_WS_WIN_98: stros = "Windows 98"; break;
|
case XVT_WS_WIN_98: stros = "Windows 98"; break;
|
||||||
default : stros = "Windows NT/XP"; break;
|
default : stros = "Windows NT/XP"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TForm_item& os = find_field('H', odd_page, FF_OS);
|
||||||
os.set(stros);
|
os.set(stros);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRequest_form::print_footer()
|
void TRequest_form::print_footer()
|
||||||
{
|
{
|
||||||
set_footer(odd_page, TRUE);
|
set_footer(odd_page, true);
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +202,7 @@ protected:
|
|||||||
virtual bool create() ;
|
virtual bool create() ;
|
||||||
virtual bool destroy() ;
|
virtual bool destroy() ;
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
virtual bool use_files() const { return FALSE; }
|
virtual bool use_files() const { return false; }
|
||||||
virtual bool test_assistance_year() const;
|
virtual bool test_assistance_year() const;
|
||||||
|
|
||||||
void garble(word k[4]) const;
|
void garble(word k[4]) const;
|
||||||
@ -264,7 +216,7 @@ protected:
|
|||||||
void update_listino();
|
void update_listino();
|
||||||
void load_masklistino(TMask & m);
|
void load_masklistino(TMask & m);
|
||||||
void save_masklistino(TMask & m);
|
void save_masklistino(TMask & m);
|
||||||
int build_sheet(bool on = TRUE);
|
int build_sheet(bool on = true);
|
||||||
void build_key_column();
|
void build_key_column();
|
||||||
|
|
||||||
bool burn_dongle();
|
bool burn_dongle();
|
||||||
@ -272,11 +224,11 @@ protected:
|
|||||||
static void keyext(const TString & s, word * v);
|
static void keyext(const TString & s, word * v);
|
||||||
static void encode_second_key();
|
static void encode_second_key();
|
||||||
|
|
||||||
static bool user_hnd(TMask_field& f, KEY k);
|
// static bool user_hnd(TMask_field& f, KEY k);
|
||||||
|
// static bool decode_hnd(TMask_field& f, KEY k);
|
||||||
|
// static bool activate_hnd(TMask_field& f, KEY k);
|
||||||
static bool date_hnd(TMask_field& f, KEY k);
|
static bool date_hnd(TMask_field& f, KEY k);
|
||||||
static bool serno_hnd(TMask_field& f, KEY k);
|
static bool serno_hnd(TMask_field& f, KEY k);
|
||||||
static bool decode_hnd(TMask_field& f, KEY k);
|
|
||||||
static bool activate_hnd(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
static bool k_notify(TSheet_field& f, int r, KEY k);
|
static bool k_notify(TSheet_field& f, int r, KEY k);
|
||||||
static bool change_users_handler(TMask_field&, KEY key);
|
static bool change_users_handler(TMask_field&, KEY key);
|
||||||
@ -298,7 +250,7 @@ protected:
|
|||||||
void print_request();
|
void print_request();
|
||||||
void print_answer();
|
void print_answer();
|
||||||
void print_status();
|
void print_status();
|
||||||
void print_listino();
|
//void print_listino();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void print();
|
virtual void print();
|
||||||
@ -326,7 +278,7 @@ bool TAttivazione_moduli::sh_nposti_handler(TMask_field& fld, KEY key)
|
|||||||
// default
|
// default
|
||||||
int posti = atoi(fld.get());
|
int posti = atoi(fld.get());
|
||||||
if (posti<=1)
|
if (posti<=1)
|
||||||
return TRUE;
|
return true;
|
||||||
int val = fld.mask().get_int(F_ACQ1);
|
int val = fld.mask().get_int(F_ACQ1);
|
||||||
switch (posti)
|
switch (posti)
|
||||||
{
|
{
|
||||||
@ -351,12 +303,12 @@ bool TAttivazione_moduli::sh_nposti_handler(TMask_field& fld, KEY key)
|
|||||||
val = round_price(val);
|
val = round_price(val);
|
||||||
fld.mask().field(fld.dlg()+2).set(val) ; // costo di aggiornamento
|
fld.mask().field(fld.dlg()+2).set(val) ; // costo di aggiornamento
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAttivazione_moduli::sh_acquisto_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::sh_acquisto_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
bool TAttivazione_moduli::sh_aggiornamento_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::sh_aggiornamento_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
@ -364,7 +316,7 @@ bool TAttivazione_moduli::sh_aggiornamento_handler(TMask_field& fld, KEY key)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -385,8 +337,6 @@ void TAttivazione_moduli::update_listino()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TAttivazione_moduli::load_masklistino(TMask &msklistino)
|
void TAttivazione_moduli::load_masklistino(TMask &msklistino)
|
||||||
{
|
{
|
||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
@ -396,7 +346,7 @@ void TAttivazione_moduli::load_masklistino(TMask &msklistino)
|
|||||||
msklistino.set(F_DATALIST,dt);
|
msklistino.set(F_DATALIST,dt);
|
||||||
|
|
||||||
TSheet_field& sf = msklistino.sfield(F_MODULILIST);
|
TSheet_field& sf = msklistino.sfield(F_MODULILIST);
|
||||||
for (int i = 0; i < MAX_AUT; i++)
|
for (int i = 0; i < sf.items(); i++)
|
||||||
{
|
{
|
||||||
const TString16 modname(_im->get_name_by_order(i));
|
const TString16 modname(_im->get_name_by_order(i));
|
||||||
if (modname.empty())
|
if (modname.empty())
|
||||||
@ -412,11 +362,11 @@ void TAttivazione_moduli::load_masklistino(TMask &msklistino)
|
|||||||
|
|
||||||
TString_array prices;
|
TString_array prices;
|
||||||
ini.set_paragraph(modname);
|
ini.set_paragraph(modname);
|
||||||
ini.list_variables(prices, TRUE,modname,TRUE); // get array sorted by var name
|
ini.list_variables(prices, true,modname,true); // get array sorted by var name
|
||||||
FOR_EACH_ARRAY_ROW(prices, v, key)
|
FOR_EACH_ARRAY_ROW(prices, v, key)
|
||||||
{
|
{
|
||||||
const TFixed_string price(key->get(0));
|
const TFixed_string price(key->get(0));
|
||||||
if (price.compare("Prezzo", 6, TRUE) == 0)
|
if (price.compare("Prezzo", 6, true) == 0)
|
||||||
{
|
{
|
||||||
TString16 colonna(price.sub(7,price.len()-1));
|
TString16 colonna(price.sub(7,price.len()-1));
|
||||||
if (atoi(colonna) != 1)
|
if (atoi(colonna) != 1)
|
||||||
@ -466,15 +416,11 @@ void TAttivazione_moduli::save_masklistino(TMask &msklistino)
|
|||||||
int TAttivazione_moduli::build_sheet(bool on)
|
int TAttivazione_moduli::build_sheet(bool on)
|
||||||
{
|
{
|
||||||
int nmod = 0;
|
int nmod = 0;
|
||||||
TSheet_field& sf = (TSheet_field&)_msk->field(F_MODULI);
|
TSheet_field& sf = _msk->sfield(F_MODULI);
|
||||||
for (int i = 0; i < MAX_AUT; i++)
|
for (int i = 0; i < _im->items(); i++)
|
||||||
{
|
{
|
||||||
if (*_im->get_name_by_order(i)=='\0')
|
|
||||||
break;
|
|
||||||
|
|
||||||
const TFixed_string d(_im->get_description_by_order(i));
|
|
||||||
TToken_string& riga = sf.row(i);
|
TToken_string& riga = sf.row(i);
|
||||||
riga = d;
|
riga = _im->get_description_by_order(i);
|
||||||
riga.trim();
|
riga.trim();
|
||||||
const int module = _im->get_module_by_order(i);
|
const int module = _im->get_module_by_order(i);
|
||||||
|
|
||||||
@ -544,7 +490,7 @@ void TAttivazione_moduli::garble_year(word y, TString& str) const
|
|||||||
void TAttivazione_moduli::build_key_column()
|
void TAttivazione_moduli::build_key_column()
|
||||||
{
|
{
|
||||||
TSheet_field& sf = _msk->sfield(F_MODULI);
|
TSheet_field& sf = _msk->sfield(F_MODULI);
|
||||||
sf.enable_column(F_KEY, FALSE);
|
sf.enable_column(F_KEY, false);
|
||||||
|
|
||||||
TString16 tmp;
|
TString16 tmp;
|
||||||
FOR_EACH_SHEET_ROW_BACK(sf, i, riga)
|
FOR_EACH_SHEET_ROW_BACK(sf, i, riga)
|
||||||
@ -609,7 +555,7 @@ bool TAttivazione_moduli::burn_dongle()
|
|||||||
|
|
||||||
bool TAttivazione_moduli::maxuser_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::maxuser_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (key == K_TAB && fld.focusdirty())
|
if (key == K_TAB && fld.focusdirty())
|
||||||
{
|
{
|
||||||
const int utenti = atoi(fld.get());
|
const int utenti = atoi(fld.get());
|
||||||
@ -678,12 +624,12 @@ bool TAttivazione_moduli::change_users_handler(TMask_field& fld, KEY key)
|
|||||||
app()._wanted_users = utenti;
|
app()._wanted_users = utenti;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAttivazione_moduli::assist_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::assist_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (key == K_TAB && fld.focusdirty())
|
if (key == K_TAB && fld.focusdirty())
|
||||||
{
|
{
|
||||||
const int year = atoi(fld.get());
|
const int year = atoi(fld.get());
|
||||||
@ -754,23 +700,24 @@ bool TAttivazione_moduli::change_assist_handler(TMask_field& fld, KEY key)
|
|||||||
app()._wanted_assist = year;
|
app()._wanted_assist = year;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAttivazione_moduli::print_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::print_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
app().print();
|
app().print();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
bool TAttivazione_moduli::printlist_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::printlist_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
app().print_listino();
|
app().print_listino();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool TAttivazione_moduli::aga_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::aga_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
@ -778,8 +725,8 @@ bool TAttivazione_moduli::aga_handler(TMask_field& fld, KEY key)
|
|||||||
{
|
{
|
||||||
TMask mask(TR("Produttore"), 1, 50, 6);
|
TMask mask(TR("Produttore"), 1, 50, 6);
|
||||||
mask.add_string(101, 0, PR("Ditta "), 1, 1, 40);
|
mask.add_string(101, 0, PR("Ditta "), 1, 1, 40);
|
||||||
mask.add_string(102, 0, PR("Amministratore di sistema "), 1, 2, 8, "U");
|
mask.add_string(102, 0, PR("Amministratore di sistema "), 1, 2, 16, "U");
|
||||||
mask.add_string(103, 0, PR("Password di amministratore "), 1, 3, 8, "*");
|
mask.add_string(103, 0, PR("Password di amministratore "), 1, 3, 16, "*");
|
||||||
|
|
||||||
mask.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
mask.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
||||||
mask.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
|
mask.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
|
||||||
@ -795,48 +742,58 @@ bool TAttivazione_moduli::aga_handler(TMask_field& fld, KEY key)
|
|||||||
ini.set("Password", ::encode(mask.get(103)));
|
ini.set("Password", ::encode(mask.get(103)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAttivazione_moduli::init_mask()
|
void TAttivazione_moduli::init_mask()
|
||||||
{
|
{
|
||||||
const TDate oggi(TODAY);
|
const TDate oggi(TODAY);
|
||||||
const int nmod = build_sheet();
|
const int nmod = build_sheet();
|
||||||
|
const TDongle& d = ::dongle();
|
||||||
if (::dongle().hardware() == _dongle_hardlock)
|
if (d.hardware() == _dongle_hardlock)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
word ud[4];
|
word ud[4];
|
||||||
::dongle().read_words(48, 4, ud);
|
d.read_words(48, 4, ud);
|
||||||
_msk->set(F_K2, format("%04X%04X%04X%04X", ud[0], ud[1], ud[2], ud[3]));
|
_msk->set(F_K2, format("%04X%04X%04X%04X", ud[0], ud[1], ud[2], ud[3]));
|
||||||
|
|
||||||
ud[0] = ::dongle().number();
|
ud[0] = d.number();
|
||||||
ud[1] = K1 | (nmod & LBYTEMASK);
|
ud[1] = K1 | (nmod & LBYTEMASK);
|
||||||
long& l = (long&)ud[2];
|
long& l = (long&)ud[2];
|
||||||
l = oggi.year()*10000L + oggi.month()*100L + oggi.day();
|
l = oggi.year()*10000L + oggi.month()*100L + oggi.day();
|
||||||
|
|
||||||
garble(ud);
|
garble(ud);
|
||||||
_msk->set(F_K1, format("%04X%04X%04X%04X", ud[0], ud[1], ud[2], ud[3]));
|
_msk->set(F_K1, format("%04X%04X%04X%04X", ud[0], ud[1], ud[2], ud[3]));
|
||||||
|
*/
|
||||||
_msk->set_caption(TR("Attivazione HARDLOCK"));
|
_msk->set_caption(TR("Attivazione HARDLOCK"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
_msk->hide(F_K1);
|
_msk->hide(F_K1);
|
||||||
_msk->hide(F_K2);
|
_msk->hide(F_K2);
|
||||||
_msk->hide(F_K3);
|
_msk->hide(F_K3);
|
||||||
_msk->hide(F_K4);
|
_msk->hide(F_K4);
|
||||||
|
*/
|
||||||
_msk->set_caption(TR("Attivazione EUTRON"));
|
_msk->set_caption(TR("Attivazione EUTRON"));
|
||||||
}
|
}
|
||||||
|
|
||||||
_msk->set(F_SN, ::dongle().number());
|
_msk->set(F_SN, d.number());
|
||||||
_msk->set(F_DT, oggi);
|
_msk->set(F_DT, oggi);
|
||||||
_msk->set(F_USERS, ::dongle().max_users());
|
_msk->set(F_USERS, d.max_users());
|
||||||
_msk->set(F_ASSIST, ::dongle().year_assist());
|
_msk->set(F_ASSIST, d.year_assist());
|
||||||
}
|
}
|
||||||
|
|
||||||
int hexdigit(char c)
|
/*
|
||||||
{
|
|
||||||
return c >= 'A' ? (c - 'A' + 10) : (c - '0');
|
#define BITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
|
||||||
}
|
#define BITSET(w,p,v) ((v) ? ((w) |= (0x0001 << (p))) : ((w) &= (~(0x0001 << (p)))))
|
||||||
|
#define K1 0x4500
|
||||||
|
#define LBYTEMASK 0x00FF
|
||||||
|
#define UBYTEMASK 0xFF00
|
||||||
|
|
||||||
|
inline int hexdigit(char c)
|
||||||
|
{ return c >= 'A' ? (c - 'A' + 10) : (c - '0'); }
|
||||||
|
|
||||||
void TAttivazione_moduli::keyext(const TString& s, word * val)
|
void TAttivazione_moduli::keyext(const TString& s, word * val)
|
||||||
{
|
{
|
||||||
@ -855,7 +812,7 @@ bool TAttivazione_moduli::user_hnd(TMask_field & f, KEY k)
|
|||||||
{
|
{
|
||||||
const TString16 k4(f.get());
|
const TString16 k4(f.get());
|
||||||
if (!f.to_check(k) || k4.empty())
|
if (!f.to_check(k) || k4.empty())
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
TMask & m = f.mask();
|
TMask & m = f.mask();
|
||||||
word ud1[4], ud2[4];
|
word ud1[4], ud2[4];
|
||||||
@ -904,8 +861,9 @@ bool TAttivazione_moduli::user_hnd(TMask_field & f, KEY k)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
sf.force_update();
|
sf.force_update();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool TAttivazione_moduli::serno_hnd(TMask_field& f, KEY k)
|
bool TAttivazione_moduli::serno_hnd(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
@ -913,7 +871,7 @@ bool TAttivazione_moduli::serno_hnd(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
app().build_key_column();
|
app().build_key_column();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAttivazione_moduli::date_hnd(TMask_field& f, KEY k)
|
bool TAttivazione_moduli::date_hnd(TMask_field& f, KEY k)
|
||||||
@ -933,9 +891,10 @@ bool TAttivazione_moduli::date_hnd(TMask_field& f, KEY k)
|
|||||||
if (data.year() > year_assist)
|
if (data.year() > year_assist)
|
||||||
return f.error_box(FR("La data deve essere antecedente al 31-12-%d"), year_assist);
|
return f.error_box(FR("La data deve essere antecedente al 31-12-%d"), year_assist);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void TAttivazione_moduli::encode_second_key()
|
void TAttivazione_moduli::encode_second_key()
|
||||||
{
|
{
|
||||||
TMask * m = app()._msk;
|
TMask * m = app()._msk;
|
||||||
@ -952,7 +911,7 @@ void TAttivazione_moduli::encode_second_key()
|
|||||||
TToken_string& tt = sf.row(i-un);
|
TToken_string& tt = sf.row(i-un);
|
||||||
if (tt.get(1)[0] == 'X')
|
if (tt.get(1)[0] == 'X')
|
||||||
{
|
{
|
||||||
BITSET(ud2[af / 16], af % 16, TRUE);
|
BITSET(ud2[af / 16], af % 16, true);
|
||||||
nmod++;
|
nmod++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -976,7 +935,7 @@ bool TAttivazione_moduli::decode_hnd(TMask_field & f, KEY k)
|
|||||||
{
|
{
|
||||||
const TString16 k2(f.get());
|
const TString16 k2(f.get());
|
||||||
if (!f.to_check(k) || k2.empty())
|
if (!f.to_check(k) || k2.empty())
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
word ud1[4], ud2[4];
|
word ud1[4], ud2[4];
|
||||||
@ -1011,35 +970,33 @@ bool TAttivazione_moduli::decode_hnd(TMask_field & f, KEY k)
|
|||||||
}
|
}
|
||||||
encode_second_key();
|
encode_second_key();
|
||||||
sf.force_update();
|
sf.force_update();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAttivazione_moduli::activate_hnd(TMask_field & f, KEY k)
|
bool TAttivazione_moduli::activate_hnd(TMask_field & f, KEY k)
|
||||||
{
|
{
|
||||||
encode_second_key();
|
encode_second_key();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool TAttivazione_moduli::k_notify(TSheet_field& f, int r, KEY k)
|
bool TAttivazione_moduli::k_notify(TSheet_field& f, int r, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_INS || k == K_DEL)
|
if (k == K_INS || k == K_DEL)
|
||||||
return FALSE;
|
return false;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TAttivazione_moduli::modifica_listino_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::modifica_listino_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
{
|
|
||||||
app().update_listino();
|
app().update_listino();
|
||||||
}
|
return true;
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
bool TAttivazione_moduli::aggiorna_listino_handler(TMask_field& fld, KEY key)
|
bool TAttivazione_moduli::aggiorna_listino_handler(TMask_field& fld, KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
{
|
{
|
||||||
TInstall_ini ini;
|
TInstall_ini ini;
|
||||||
@ -1056,7 +1013,7 @@ bool TAttivazione_moduli::aggiorna_listino_handler(TMask_field& fld, KEY key)
|
|||||||
name = msk.get(DLG_USER);
|
name = msk.get(DLG_USER);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1088,101 +1045,87 @@ void TAttivazione_moduli::print_request()
|
|||||||
|
|
||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
TSheet_field& sheet = _msk->sfield(F_MODULI);
|
TSheet_field& sheet = _msk->sfield(F_MODULI);
|
||||||
for (TDongleType owner = _aga_dongle;
|
int found = 0;
|
||||||
owner <= _prassi_dongle;
|
TString str;
|
||||||
owner = TDongleType(owner+1))
|
|
||||||
{
|
FOR_EACH_SHEET_ROW(sheet, r, row)
|
||||||
int found = 0;
|
{
|
||||||
TString str;
|
const int module = row->get_int(2) ;
|
||||||
|
const bool active = ::dongle().active(module);
|
||||||
FOR_EACH_SHEET_ROW(sheet, r, row)
|
const bool wanted = *row->get(1) > ' ';
|
||||||
{
|
|
||||||
//const int module = _im->get_module_by_order(r);
|
|
||||||
const int module = row->get_int(2) ;
|
|
||||||
const bool active = ::dongle().active(module);
|
|
||||||
const bool wanted = *row->get(1) > ' ';
|
|
||||||
|
|
||||||
if (!special && active)
|
if (!special && active)
|
||||||
continue;
|
continue;
|
||||||
if (!wanted && !active)
|
if (!wanted && !active)
|
||||||
continue;
|
continue;
|
||||||
if (_im->get_owner(module) != owner)
|
|
||||||
continue;
|
if (found == 0)
|
||||||
|
{
|
||||||
|
printer().open();
|
||||||
|
form.find_field('H',odd_page,1).set(dongle().reseller());
|
||||||
|
form.update_serno(_msk->get(F_SN));
|
||||||
|
form.update_dongle();
|
||||||
|
form.update_os();
|
||||||
|
}
|
||||||
|
|
||||||
if (found == 0)
|
str.format("%3d", ++found);
|
||||||
{
|
num.set(str);
|
||||||
printer().open();
|
|
||||||
switch (owner)
|
str = row->get(0);
|
||||||
{
|
descr.set(str);
|
||||||
case _prassi_dongle:
|
|
||||||
form.find_field('H',odd_page,1).set("Partners"); break;
|
str = active ? TR("*ATTIVO*") : "";
|
||||||
default: //case _aga_dongle:
|
codice.set(str);
|
||||||
form.find_field('H',odd_page,1).set("A.G.A."); break;
|
|
||||||
}
|
str = _im->get_name(module);
|
||||||
form.update_serno(_msk->get(F_SN));
|
real full, assist;
|
||||||
form.update_dongle(::dongle());
|
ini.prices(str, users, full, assist);
|
||||||
form.update_os();
|
if (active)
|
||||||
}
|
{
|
||||||
|
real old_full, old_assist;
|
||||||
|
ini.prices(str, ::dongle().max_users(), old_full, old_assist);
|
||||||
|
full -= old_full;
|
||||||
|
assist -= old_assist;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
assist = 0.0;
|
||||||
|
|
||||||
|
price.set(full.string());
|
||||||
|
manut.set(assist.string());
|
||||||
|
|
||||||
|
form.print(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (special && found > 0)
|
||||||
|
{
|
||||||
|
codice.set("");
|
||||||
|
price.set("");
|
||||||
|
manut.set("");
|
||||||
|
if (_wanted_users != 0)
|
||||||
|
{
|
||||||
str.format("%3d", ++found);
|
str.format("%3d", ++found);
|
||||||
num.set(str);
|
num.set(str);
|
||||||
|
|
||||||
str = row->get(0);
|
str.format(FR("Variazione del numero utenti da %u a %u"),
|
||||||
|
::dongle().max_users(), _wanted_users);
|
||||||
descr.set(str);
|
descr.set(str);
|
||||||
|
|
||||||
str = active ? TR("*ATTIVO*") : "";
|
|
||||||
codice.set(str);
|
|
||||||
|
|
||||||
str = _im->get_name(module);
|
|
||||||
real full, assist;
|
|
||||||
ini.prices(str, users, full, assist);
|
|
||||||
if (active)
|
|
||||||
{
|
|
||||||
real old_full, old_assist;
|
|
||||||
ini.prices(str, ::dongle().max_users(), old_full, old_assist);
|
|
||||||
full -= old_full;
|
|
||||||
assist -= old_assist;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
assist = 0.0;
|
|
||||||
|
|
||||||
price.set(full.string());
|
|
||||||
manut.set(assist.string());
|
|
||||||
|
|
||||||
form.print(-1);
|
form.print(-1);
|
||||||
}
|
|
||||||
|
|
||||||
if (special && found > 0)
|
|
||||||
{
|
|
||||||
codice.set("");
|
|
||||||
price.set("");
|
|
||||||
manut.set("");
|
|
||||||
if (_wanted_users != 0)
|
|
||||||
{
|
|
||||||
str.format("%3d", ++found);
|
|
||||||
num.set(str);
|
|
||||||
|
|
||||||
str.format(FR("Variazione del numero utenti da %u a %u"),
|
|
||||||
::dongle().max_users(), _wanted_users);
|
|
||||||
descr.set(str);
|
|
||||||
form.print(-1);
|
|
||||||
}
|
|
||||||
if (_wanted_assist > ::dongle().year_assist())
|
|
||||||
{
|
|
||||||
str.format("%3d", ++found);
|
|
||||||
num.set(str);
|
|
||||||
str.format(FR("Contratto di assistenza per l'anno %u"), _wanted_assist);
|
|
||||||
descr.set(str);
|
|
||||||
form.print(-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (_wanted_assist > ::dongle().year_assist())
|
||||||
if (found)
|
|
||||||
{
|
{
|
||||||
form.print_footer();
|
str.format("%3d", ++found);
|
||||||
printer().close();
|
num.set(str);
|
||||||
}
|
str.format(FR("Contratto di assistenza per l'anno %u"), _wanted_assist);
|
||||||
|
descr.set(str);
|
||||||
|
form.print(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
form.print_footer();
|
||||||
|
printer().close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAttivazione_moduli::print_status()
|
void TAttivazione_moduli::print_status()
|
||||||
@ -1191,9 +1134,9 @@ void TAttivazione_moduli::print_status()
|
|||||||
TForm_item& descr = form.find_field('B', odd_page, 102);
|
TForm_item& descr = form.find_field('B', odd_page, 102);
|
||||||
TForm_item& codice = form.find_field('B', odd_page, 103);
|
TForm_item& codice = form.find_field('B', odd_page, 103);
|
||||||
|
|
||||||
form.find_field('H',odd_page,1).set("PR.A.S.S.I.");
|
form.find_field('H',odd_page,1).set(dongle().reseller());
|
||||||
form.update_serno(_msk->get(F_SN));
|
form.update_serno(_msk->get(F_SN));
|
||||||
form.update_dongle(::dongle());
|
form.update_dongle();
|
||||||
form.update_os();
|
form.update_os();
|
||||||
|
|
||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
@ -1202,7 +1145,6 @@ void TAttivazione_moduli::print_status()
|
|||||||
TSheet_field& sheet = _msk->sfield(F_MODULI);
|
TSheet_field& sheet = _msk->sfield(F_MODULI);
|
||||||
FOR_EACH_SHEET_ROW(sheet, r, row)
|
FOR_EACH_SHEET_ROW(sheet, r, row)
|
||||||
{
|
{
|
||||||
//const int module = _im->get_module_by_order(r);
|
|
||||||
const int module = row->get_int(2) ;
|
const int module = row->get_int(2) ;
|
||||||
const bool active = ::dongle().active(module);
|
const bool active = ::dongle().active(module);
|
||||||
|
|
||||||
@ -1237,7 +1179,7 @@ void TAttivazione_moduli::print_answer()
|
|||||||
{
|
{
|
||||||
printer().open();
|
printer().open();
|
||||||
form.update_serno(_msk->get(F_SN));
|
form.update_serno(_msk->get(F_SN));
|
||||||
form.update_dongle(::dongle());
|
form.update_dongle();
|
||||||
form.update_os();
|
form.update_os();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1260,7 +1202,7 @@ void TAttivazione_moduli::print_answer()
|
|||||||
{
|
{
|
||||||
printer().open();
|
printer().open();
|
||||||
form.update_serno(_msk->get(F_SN));
|
form.update_serno(_msk->get(F_SN));
|
||||||
form.update_dongle(::dongle());
|
form.update_dongle();
|
||||||
}
|
}
|
||||||
if (_wanted_users != 0)
|
if (_wanted_users != 0)
|
||||||
{
|
{
|
||||||
@ -1292,7 +1234,7 @@ void TAttivazione_moduli::print_answer()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void TAttivazione_moduli::print_listino()
|
void TAttivazione_moduli::print_listino()
|
||||||
{
|
{
|
||||||
TRequest_form form("ba1500a");
|
TRequest_form form("ba1500a");
|
||||||
@ -1321,7 +1263,7 @@ void TAttivazione_moduli::print_listino()
|
|||||||
const bool active = ::dongle().active(module);
|
const bool active = ::dongle().active(module);
|
||||||
|
|
||||||
str = _im->get_name(module);
|
str = _im->get_name(module);
|
||||||
ini.prices(str, users, full, assist, FALSE);
|
ini.prices(str, users, full, assist, false);
|
||||||
if (!full.is_zero() || ! assist.is_zero())
|
if (!full.is_zero() || ! assist.is_zero())
|
||||||
{
|
{
|
||||||
if (found++ == 0)
|
if (found++ == 0)
|
||||||
@ -1358,11 +1300,12 @@ void TAttivazione_moduli::print_listino()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool TAttivazione_moduli::new_module_requested()
|
bool TAttivazione_moduli::new_module_requested()
|
||||||
{
|
{
|
||||||
TSheet_field& sheet = _msk->sfield(F_MODULI);
|
TSheet_field& sheet = _msk->sfield(F_MODULI);
|
||||||
bool found = FALSE;
|
bool found = false;
|
||||||
FOR_EACH_SHEET_ROW(sheet, r, row)
|
FOR_EACH_SHEET_ROW(sheet, r, row)
|
||||||
{
|
{
|
||||||
if (*row->get(1) > ' ') // Wanted!
|
if (*row->get(1) > ' ') // Wanted!
|
||||||
@ -1370,7 +1313,7 @@ bool TAttivazione_moduli::new_module_requested()
|
|||||||
const int module = row->get_int(2);
|
const int module = row->get_int(2);
|
||||||
if (!::dongle().active(module)) // Not active yet?
|
if (!::dongle().active(module)) // Not active yet?
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1394,12 +1337,12 @@ void TAttivazione_moduli::print()
|
|||||||
// Questo programma non deve bloccarsi per l'anno di assistenza!
|
// Questo programma non deve bloccarsi per l'anno di assistenza!
|
||||||
bool TAttivazione_moduli::test_assistance_year() const
|
bool TAttivazione_moduli::test_assistance_year() const
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TAttivazione_moduli::create()
|
bool TAttivazione_moduli::create()
|
||||||
{
|
{
|
||||||
bool ok = ::dongle().login(TRUE);
|
bool ok = ::dongle().login(true);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1412,7 +1355,7 @@ bool TAttivazione_moduli::create()
|
|||||||
{
|
{
|
||||||
ok = update_assistance_year();
|
ok = update_assistance_year();
|
||||||
if (ok)
|
if (ok)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_im = new TInformazione_moduli;
|
_im = new TInformazione_moduli;
|
||||||
@ -1425,78 +1368,65 @@ bool TAttivazione_moduli::create()
|
|||||||
_msk->set_handler(F_CHANGEUSERS, change_users_handler);
|
_msk->set_handler(F_CHANGEUSERS, change_users_handler);
|
||||||
_msk->set_handler(F_CHANGEASSIST, change_assist_handler);
|
_msk->set_handler(F_CHANGEASSIST, change_assist_handler);
|
||||||
_msk->set_handler(F_PRINT, print_handler);
|
_msk->set_handler(F_PRINT, print_handler);
|
||||||
|
/*
|
||||||
_msk->set_handler(F_PRINTLIST, printlist_handler);
|
_msk->set_handler(F_PRINTLIST, printlist_handler);
|
||||||
_msk->set_handler(F_AGGLISTINO, aggiorna_listino_handler);
|
_msk->set_handler(F_AGGLISTINO, aggiorna_listino_handler);
|
||||||
|
*/
|
||||||
const TDongleType mydongle = ::dongle().type();
|
const TDongleType mydongle = ::dongle().type();
|
||||||
#ifdef DBG
|
|
||||||
if (::dongle().number() == 0)
|
|
||||||
#else
|
|
||||||
if (mydongle == _aga_dongle)
|
if (mydongle == _aga_dongle)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
_msk->show(F_AGA);
|
_msk->show(F_AGA);
|
||||||
_msk->set_handler(F_AGA, aga_handler);
|
_msk->set_handler(F_AGA, aga_handler);
|
||||||
|
/*
|
||||||
_msk->show(F_MODLISTINO);
|
_msk->show(F_MODLISTINO);
|
||||||
_msk->set_handler(F_MODLISTINO, modifica_listino_handler);
|
_msk->set_handler(F_MODLISTINO, modifica_listino_handler);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
TSheet_field& sf = _msk->sfield(F_MODULI);
|
TSheet_field& sf = _msk->sfield(F_MODULI);
|
||||||
sf.set_notify(k_notify);
|
sf.set_notify(k_notify);
|
||||||
|
|
||||||
//const int un = _im->unassigned();
|
|
||||||
switch (mydongle)
|
switch (mydongle)
|
||||||
{
|
{
|
||||||
case _user_dongle:
|
case _user_dongle:
|
||||||
_msk->enable(F_DT);
|
_msk->enable(F_DT);
|
||||||
_msk->set_handler(F_DT, date_hnd);
|
_msk->set_handler(F_DT, date_hnd);
|
||||||
case _developer_dongle:
|
case _developer_dongle:
|
||||||
{
|
/*
|
||||||
if (::dongle().hardware() == _dongle_hardlock)
|
if (::dongle().hardware() == _dongle_hardlock)
|
||||||
{
|
{
|
||||||
_msk->disable(F_K1);
|
_msk->disable(F_K1);
|
||||||
_msk->disable(F_K2);
|
_msk->disable(F_K2);
|
||||||
_msk->set_handler(F_K4, user_hnd);
|
_msk->set_handler(F_K4, user_hnd);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
init_mask();
|
init_mask();
|
||||||
|
|
||||||
_serno=_msk->get_int(F_SN);
|
_serno=_msk->get_int(F_SN);
|
||||||
sf.enable_column(F_ENABLE, serno() != 0);
|
sf.enable_column(F_ENABLE, serno() != 0);
|
||||||
sf.enable_column(F_KEY, serno() != 0);
|
sf.enable_column(F_KEY, serno() != 0);
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
case _prassi_dongle:
|
|
||||||
case _aga_dongle:
|
case _aga_dongle:
|
||||||
{
|
/*
|
||||||
if (::dongle().hardware() == _dongle_hardlock)
|
if (::dongle().hardware() == _dongle_hardlock)
|
||||||
{
|
{
|
||||||
_msk->set_handler(F_K2, decode_hnd);
|
_msk->set_handler(F_K2, decode_hnd);
|
||||||
_msk->disable(F_K3);
|
_msk->disable(F_K3);
|
||||||
_msk->disable(F_K4);
|
_msk->disable(F_K4);
|
||||||
}
|
sf.sheet_mask().field(F_ENABLE).set_handler(activate_hnd);
|
||||||
|
}*/
|
||||||
_msk->set_handler(F_SN, serno_hnd);
|
_msk->set_handler(F_SN, serno_hnd);
|
||||||
_msk->enable(F_SN);
|
_msk->enable(F_SN);
|
||||||
init_mask();
|
init_mask();
|
||||||
_serno=_msk->get_int(F_SN);
|
_serno=_msk->get_int(F_SN);
|
||||||
|
|
||||||
sf.sheet_mask().field(F_ENABLE).set_handler(activate_hnd);
|
build_sheet(false);
|
||||||
build_sheet(FALSE);
|
sf.enable_column(1);
|
||||||
|
|
||||||
for (int i = 0; i < MAX_AUT; i++)
|
|
||||||
{
|
|
||||||
const int af = _im->get_module_by_order(i);
|
|
||||||
if (af == 0)
|
|
||||||
sf.disable_cell(i,1);
|
|
||||||
else
|
|
||||||
sf.enable_cell(i,1,_im->test_owner(af, mydongle));
|
|
||||||
}
|
|
||||||
|
|
||||||
build_key_column();
|
build_key_column();
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_menu_item(M_FILE_PG_SETUP);
|
enable_menu_item(M_FILE_PG_SETUP);
|
||||||
@ -1508,15 +1438,13 @@ bool TAttivazione_moduli::destroy()
|
|||||||
{
|
{
|
||||||
if (_msk != NULL) delete _msk;
|
if (_msk != NULL) delete _msk;
|
||||||
if (_im != NULL) delete _im;
|
if (_im != NULL) delete _im;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAttivazione_moduli::main_loop()
|
void TAttivazione_moduli::main_loop()
|
||||||
{
|
{
|
||||||
KEY res = _msk->run();
|
if (_msk->run() == K_ENTER)
|
||||||
if (res == K_ENTER)
|
|
||||||
burn_dongle();
|
burn_dongle();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ba1500(int argc, char** argv)
|
int ba1500(int argc, char** argv)
|
||||||
@ -1530,4 +1458,4 @@ int ba1500(int argc, char** argv)
|
|||||||
else
|
else
|
||||||
error_box(FR("L'utente %s non e' abilitato all'esecuzione di questo programma"), (const char*)user());
|
error_box(FR("L'utente %s non e' abilitato all'esecuzione di questo programma"), (const char*)user());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -25,8 +25,6 @@ public:
|
|||||||
int get_index(int module) const;
|
int get_index(int module) const;
|
||||||
int get_index_by_name(const char* name) const;
|
int get_index_by_name(const char* name) const;
|
||||||
|
|
||||||
TDongleType get_owner(int module) const;
|
|
||||||
bool test_owner(int module, TDongleType owner) const;
|
|
||||||
int unassigned() const { return _unassigned_modules; }
|
int unassigned() const { return _unassigned_modules; }
|
||||||
int items() const { return _infos.items(); }
|
int items() const { return _infos.items(); }
|
||||||
TInformazione_moduli();
|
TInformazione_moduli();
|
||||||
|
17
ba/ba1500a.h
17
ba/ba1500a.h
@ -1,25 +1,24 @@
|
|||||||
|
/*
|
||||||
#define F_K1 201
|
#define F_K1 201
|
||||||
#define F_K2 202
|
#define F_K2 202
|
||||||
//#define F_K2A 203
|
|
||||||
//#define F_K2B 204
|
|
||||||
//#define F_K2C 205
|
|
||||||
#define F_K3 206
|
#define F_K3 206
|
||||||
#define F_K4 207
|
#define F_K4 207
|
||||||
//#define F_K4A 208
|
*/
|
||||||
//#define F_K4B 209
|
#define F_SN 211
|
||||||
//#define F_K4C 210
|
#define F_DT 212
|
||||||
#define F_SN 211
|
#define F_MODULI 213
|
||||||
#define F_DT 212
|
|
||||||
#define F_MODULI 213
|
|
||||||
#define F_USERS 214
|
#define F_USERS 214
|
||||||
#define F_CHANGEUSERS 215
|
#define F_CHANGEUSERS 215
|
||||||
#define F_ASSIST 216
|
#define F_ASSIST 216
|
||||||
#define F_CHANGEASSIST 217
|
#define F_CHANGEASSIST 217
|
||||||
#define F_PRINT 218
|
#define F_PRINT 218
|
||||||
#define F_AGA 219
|
#define F_AGA 219
|
||||||
|
|
||||||
|
/*
|
||||||
#define F_AGGLISTINO 220
|
#define F_AGGLISTINO 220
|
||||||
#define F_MODLISTINO 221
|
#define F_MODLISTINO 221
|
||||||
#define F_PRINTLIST 222
|
#define F_PRINTLIST 222
|
||||||
|
*/
|
||||||
|
|
||||||
#define F_NOMEMOD 101
|
#define F_NOMEMOD 101
|
||||||
#define F_ENABLE 102
|
#define F_ENABLE 102
|
||||||
|
@ -1,26 +1,28 @@
|
|||||||
#include "ba1500a.h"
|
#include "ba1500a.h"
|
||||||
|
|
||||||
TOOLBAR "" 0 20 0 2
|
TOOLBAR "" 0 -2 0 2
|
||||||
|
|
||||||
BUTTON DLG_OK 10 2
|
BUTTON DLG_OK 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -13 -1 ""
|
PROMPT -13 -11 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_PRINT 22 2
|
BUTTON F_PRINT 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -11 -1 "~Stampa Attivazioni"
|
PROMPT -23 -11 "~Stampa"
|
||||||
|
PICTURE BMP_PRINT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 10 2
|
BUTTON DLG_QUIT 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -33 -1 ""
|
PROMPT -33 -11 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Attivazione Moduli" -1 -1 79 21
|
PAGE "Attivazione Moduli" -1 -1 79 21
|
||||||
|
|
||||||
|
/*
|
||||||
STRING F_K1 16
|
STRING F_K1 16
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Attivazione 1 "
|
PROMPT 1 1 "Attivazione 1 "
|
||||||
@ -32,6 +34,7 @@ BEGIN
|
|||||||
PROMPT 35 1 ""
|
PROMPT 35 1 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
*/
|
||||||
|
|
||||||
STRING F_SN 5
|
STRING F_SN 5
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -67,6 +70,7 @@ BEGIN
|
|||||||
PROMPT 71 4 "Cambia"
|
PROMPT 71 4 "Cambia"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
/*
|
||||||
STRING F_K3 16
|
STRING F_K3 16
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 2 "Attivazione 2 "
|
PROMPT 1 2 "Attivazione 2 "
|
||||||
@ -79,6 +83,7 @@ BEGIN
|
|||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
BUTTON F_AGGLISTINO 18
|
BUTTON F_AGGLISTINO 18
|
||||||
BEGID
|
BEGID
|
||||||
PROMPT 1 3 "Aggiorna listino"
|
PROMPT 1 3 "Aggiorna listino"
|
||||||
@ -94,6 +99,7 @@ BEGID
|
|||||||
PROMPT 1 4 "Modifica listino"
|
PROMPT 1 4 "Modifica listino"
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
*/
|
||||||
|
|
||||||
BUTTON F_AGA 18
|
BUTTON F_AGA 18
|
||||||
BEGID
|
BEGID
|
||||||
@ -101,9 +107,7 @@ BEGID
|
|||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
SPREADSHEET F_MODULI 78
|
||||||
|
|
||||||
SPREADSHEET F_MODULI
|
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Moduli"
|
PROMPT 1 5 "Moduli"
|
||||||
ITEM "Modulo@40"
|
ITEM "Modulo@40"
|
||||||
|
118
ba/ba1501.cpp
118
ba/ba1501.cpp
@ -1,6 +1,5 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <dongle.h>
|
|
||||||
#include <scanner.h>
|
#include <scanner.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
@ -44,70 +43,37 @@ HIDDEN bool build_dninst()
|
|||||||
|
|
||||||
ofstream ouf("dninst.zip", ios::out | ios::binary);
|
ofstream ouf("dninst.zip", ios::out | ios::binary);
|
||||||
char line[256];
|
char line[256];
|
||||||
int year = 0;
|
inf.getline(line, sizeof(line));
|
||||||
|
const int year = atoi(line);
|
||||||
|
CHECKD(year >= 2006 && year <= 3000, "Anno errato:", year);
|
||||||
|
srand(883); // Inizializza generatore numeri casuali per l'anno
|
||||||
|
encode_string(dninst_key, line);
|
||||||
|
ouf << line << '\n';
|
||||||
|
srand(year); // Inizializza generatore numeri casuali per i moduli
|
||||||
|
|
||||||
while (!inf.eof())
|
while (!inf.eof())
|
||||||
{
|
{
|
||||||
inf.getline(line, sizeof(line));
|
inf.getline(line, sizeof(line));
|
||||||
if (year == 0)
|
|
||||||
{
|
|
||||||
srand(883);
|
|
||||||
year = atoi(line);
|
|
||||||
CHECKD(year >= 2005 && year <= 3000, "Anno errato:", year);
|
|
||||||
}
|
|
||||||
encode_string(dninst_key, line);
|
encode_string(dninst_key, line);
|
||||||
ouf << line << '\n';
|
ouf << line << '\n';
|
||||||
|
|
||||||
if (year > 0)
|
|
||||||
{
|
|
||||||
srand(year);
|
|
||||||
year = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HIDDEN bool show_error(const char* str)
|
HIDDEN bool show_error(const char* str, int anno)
|
||||||
{
|
{
|
||||||
int app_year, dum1, dum2, dum3;
|
|
||||||
TApplication::get_version_info(app_year, dum1, dum2, dum3);
|
|
||||||
|
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << TR("Impossibile aggiornare automaticamente l'assistenza ")
|
msg << TR("Impossibile aggiornare automaticamente l'anno d'assistenza") ;
|
||||||
<< app_year << ":\n" << str << '.';
|
if (anno > 0) msg << ' ' << anno;
|
||||||
|
msg << ":\n" << str << '.';
|
||||||
return error_box(msg);
|
return error_box(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Copia il file dninst.zip dal CD/server alla cartella corrente
|
||||||
HIDDEN int module2number(const TString& mod)
|
|
||||||
{
|
|
||||||
static TAssoc_array* ass = NULL;
|
|
||||||
if (ass == NULL)
|
|
||||||
{
|
|
||||||
TString8 num;
|
|
||||||
TScanner scanner(AUT_FILE);
|
|
||||||
ass = new TAssoc_array;
|
|
||||||
for (int aut = 0; scanner.line() != ""; aut++)
|
|
||||||
{
|
|
||||||
num.format("%d", aut);
|
|
||||||
const char* cod = scanner.token().left(2);
|
|
||||||
ass->add(cod, num);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int n = 0;
|
|
||||||
if (mod.len() == 2)
|
|
||||||
{
|
|
||||||
const TString* num = (const TString*)ass->objptr(mod);
|
|
||||||
if (num)
|
|
||||||
n = atoi(*num);
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool update_dninst(bool force)
|
bool update_dninst(bool force)
|
||||||
{
|
{
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
@ -118,22 +84,38 @@ bool update_dninst(bool force)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const TFilename keys_name = "dninst.zip";
|
//legge dal diskpath di install.ini la directory da cui aggiornarsi;se il dninst.zip di tale..
|
||||||
if (force || !keys_name.exist())
|
//..directory e' piu' nuovo di quello in locale -> lo copia in locale
|
||||||
{
|
const TFilename local_name = "dninst.zip";
|
||||||
TConfig ini("install.ini", "Main");
|
TConfig ini("install.ini", "Main");
|
||||||
TFilename remote_name = ini.get("DiskPath");
|
TFilename remote_name = ini.get("DiskPath");
|
||||||
if (xvt_fsys_is_removable_drive(remote_name))
|
remote_name.add(local_name);
|
||||||
message_box(FR("Assicuratevi che il CD di installazione sia nel lettore %c:"), remote_name[0]);
|
if (remote_name.exist())
|
||||||
remote_name.add(keys_name);
|
{
|
||||||
if (remote_name.exist())
|
if (!force)
|
||||||
fcopy(remote_name, keys_name);
|
{
|
||||||
}
|
force = !local_name.exist();
|
||||||
|
if (!force)
|
||||||
|
{
|
||||||
|
const long local_date = xvt_fsys_file_attr(local_name, XVT_FILE_ATTR_MTIME);
|
||||||
|
const long remote_date = xvt_fsys_file_attr(remote_name, XVT_FILE_ATTR_MTIME);
|
||||||
|
force = remote_date > local_date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (force)
|
||||||
|
fcopy(remote_name, local_name);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool update_assistance_year()
|
bool update_assistance_year()
|
||||||
{
|
{
|
||||||
|
if (dongle().hardware() == _dongle_network)
|
||||||
|
{
|
||||||
|
show_error(TR("Il server di autorizzazioni deve essere disattivato"), 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
update_dninst(true);
|
update_dninst(true);
|
||||||
|
|
||||||
const TFilename dninst = "dninst.zip";
|
const TFilename dninst = "dninst.zip";
|
||||||
@ -163,21 +145,21 @@ bool update_assistance_year()
|
|||||||
if (dongle().burn())
|
if (dongle().burn())
|
||||||
{
|
{
|
||||||
message_box(FR("Il contratto %d è stato attivato automaticamente"), ass_year);
|
message_box(FR("Il contratto %d è stato attivato automaticamente"), ass_year);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
show_error(FR("Errore di scrittura sulla chiave di protezione"));
|
show_error(FR("Errore di scrittura sulla chiave di protezione"), ass_year);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
show_error(TR("Il numero di serie di questa postazione non è presente sul database"));
|
show_error(TR("Il numero di serie di questa postazione non è presente sul database"), ass_year);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
show_error(TR("L'anno di assistenza sul database e' inferiore a quello registrato sulla chiave di protezione"));
|
show_error(TR("L'anno di assistenza sul database e' inferiore a quello registrato sulla chiave di protezione"), ass_year);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
show_error(TR("Il database dei numeri di serie non è accessibile"));
|
show_error(TR("Il database dei numeri di serie non è accessibile"), 0);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -441,14 +441,7 @@ void TInstall_ini::prices(const char* module, word users, real& full, real& assi
|
|||||||
|
|
||||||
void TFconv_ini::export_module(const char* module, const char* summary)
|
void TFconv_ini::export_module(const char* module, const char* summary)
|
||||||
{
|
{
|
||||||
TScanner scanner(AUT_FILE);
|
const word module_code = dongle().module_name2code(module);
|
||||||
int module_code;
|
|
||||||
for (module_code = 0; scanner.line().not_empty(); module_code++)
|
|
||||||
{
|
|
||||||
if (scanner.token().compare(module, 2, TRUE) == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
scanner.close();
|
|
||||||
|
|
||||||
TConfig sommario(summary);
|
TConfig sommario(summary);
|
||||||
|
|
||||||
|
140
ba/ba1700.cpp
140
ba/ba1700.cpp
@ -1,7 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <cfiles.h>
|
|
||||||
|
|
||||||
#include <agasys.h>
|
#include <agasys.h>
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
@ -86,8 +82,11 @@ class TInstaller_mask : public TArray_sheet
|
|||||||
static TInstaller_mask* _curr_mask;
|
static TInstaller_mask* _curr_mask;
|
||||||
bool _installed; // Flag per verificare se almeno un modulo e' stato installato
|
bool _installed; // Flag per verificare se almeno un modulo e' stato installato
|
||||||
bool _sys_installed; //Flag per controllare l'installazione del modulo di sistema SY
|
bool _sys_installed; //Flag per controllare l'installazione del modulo di sistema SY
|
||||||
|
bool _modules_pending; //Flag per controllare se ci sono altri moduli da installare oltre a sy
|
||||||
|
|
||||||
enum { NONE = 0, NEW_MENU = 1, NEW_MENUPRG = 2, NEW_INSTALLER = 4, NEW_DLL = 8 };
|
enum { NONE=0, NEW_MENU=1,
|
||||||
|
NEW_MENUPRG=2, NEW_INSTALLER=4, NEW_DLL=8, NEW_SYS=14,
|
||||||
|
NEW_TRR=16 };
|
||||||
int _reboot_program;
|
int _reboot_program;
|
||||||
|
|
||||||
protected: // TSheet
|
protected: // TSheet
|
||||||
@ -129,9 +128,15 @@ protected:
|
|||||||
public:
|
public:
|
||||||
bool installed() const { return _installed;}
|
bool installed() const { return _installed;}
|
||||||
bool sys_installed() const { return _sys_installed;}
|
bool sys_installed() const { return _sys_installed;}
|
||||||
|
bool modules_pending() const { return _modules_pending;}
|
||||||
bool autoload();
|
bool autoload();
|
||||||
bool install(const TString& module, int patch);
|
bool install(const TString& module, int patch);
|
||||||
bool run_ba0close() const { return _reboot_program >= NEW_MENUPRG; }
|
|
||||||
|
bool run_ba0close() const
|
||||||
|
{ return (_reboot_program & NEW_SYS) != 0; }
|
||||||
|
|
||||||
|
bool run_conversion() const
|
||||||
|
{ return installed() && !sys_installed() && (_reboot_program & NEW_TRR) != 0; }
|
||||||
|
|
||||||
TInstaller_mask();
|
TInstaller_mask();
|
||||||
virtual ~TInstaller_mask();
|
virtual ~TInstaller_mask();
|
||||||
@ -143,28 +148,33 @@ TInstaller_mask* TInstaller_mask::_curr_mask = NULL;
|
|||||||
bool TInstaller_mask::add_module(TConfig& ini, const TString& module, bool patch, int pos)
|
bool TInstaller_mask::add_module(TConfig& ini, const TString& module, bool patch, int pos)
|
||||||
{
|
{
|
||||||
ini.write_protect();
|
ini.write_protect();
|
||||||
bool ok = ini.set_paragraph(module);
|
if (!ini.set_paragraph(module))
|
||||||
if (ok)
|
return false;
|
||||||
{
|
|
||||||
const int numpatch = ini.get_int("Patch");
|
|
||||||
TString16 strpatch;
|
|
||||||
if (numpatch > 0)
|
|
||||||
strpatch.format("%03d", numpatch);
|
|
||||||
|
|
||||||
TToken_string row;
|
// Nasconde i moduli Enterprise Edition ad occhi indiscreti
|
||||||
row = " "; // Not selected
|
const bool ee = ini.get_bool("Ee");
|
||||||
row.add(ini.get("Descrizione"));
|
if (ee && !dongle().active(EEAUT))
|
||||||
row.add(module);
|
return false;
|
||||||
row.add(ini.get("Versione"));
|
|
||||||
row.add(strpatch);
|
const int numpatch = ini.get_int("Patch");
|
||||||
row.add(ini.get("Data"));
|
TString4 strpatch;
|
||||||
row.add(patch ? "X" : " ", C_ISPATCH);
|
if (numpatch > 0)
|
||||||
if (pos==-1)
|
strpatch.format("%03d", numpatch);
|
||||||
add(row);
|
|
||||||
else
|
TToken_string row;
|
||||||
insert(row,pos);
|
row = " "; // Not selected
|
||||||
}
|
row.add(ini.get("Descrizione"));
|
||||||
return ok;
|
row.add(module);
|
||||||
|
row.add(ini.get("Versione"));
|
||||||
|
row.add(strpatch);
|
||||||
|
row.add(ini.get("Data"));
|
||||||
|
row.add(patch ? "X" : " ", C_ISPATCH);
|
||||||
|
if (pos==-1)
|
||||||
|
add(row);
|
||||||
|
else
|
||||||
|
insert(row,pos);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copia nello sheet i dati di un modulo prendendoli da un .ini
|
// Copia nello sheet i dati di un modulo prendendoli da un .ini
|
||||||
@ -215,6 +225,9 @@ int TInstaller_mask::precheck_modules(bool only_newer)
|
|||||||
TString4 cod_module;
|
TString4 cod_module;
|
||||||
int patchlevel,modnumber,currpatch;
|
int patchlevel,modnumber,currpatch;
|
||||||
|
|
||||||
|
bool check_enabled = true;
|
||||||
|
_modules_pending = false;
|
||||||
|
|
||||||
TString_array& array = rows_array();
|
TString_array& array = rows_array();
|
||||||
FOR_EACH_ARRAY_ROW(array, r, row)
|
FOR_EACH_ARRAY_ROW(array, r, row)
|
||||||
{
|
{
|
||||||
@ -233,13 +246,19 @@ int TInstaller_mask::precheck_modules(bool only_newer)
|
|||||||
{
|
{
|
||||||
// checca il modulo o la patch se ho installata la stessa versione
|
// checca il modulo o la patch se ho installata la stessa versione
|
||||||
const bool chk = rigar.get_char(C_ISPATCH) != 'X' || release == currrelease;
|
const bool chk = rigar.get_char(C_ISPATCH) != 'X' || release == currrelease;
|
||||||
check(r, chk);
|
if (check_enabled)
|
||||||
|
check(r, chk);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (chk)
|
||||||
|
_modules_pending = true;
|
||||||
|
}
|
||||||
if (chk && only_newer && cod_module == "sy") //se viene checkato il modulo sy (sistema) deve togliere..
|
if (chk && only_newer && cod_module == "sy") //se viene checkato il modulo sy (sistema) deve togliere..
|
||||||
{ //..la possibilita' di installare altri moduli..
|
{ //..la possibilita' di installare altri moduli..
|
||||||
for (int i = 0; i < array.items(); i++)
|
for (int i = 0; i < array.items(); i++)
|
||||||
disable_row(i); //disabilita tutte le righe dello sheet
|
disable_row(i); //disabilita tutte le righe dello sheet
|
||||||
disable(DLG_USER);
|
disable(DLG_USER);
|
||||||
break; //..ed uscire
|
check_enabled = false; //..ed uscire
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -257,10 +276,8 @@ int TInstaller_mask::get_module_number(const TString& module) const
|
|||||||
if (module == "ba" || module == "sy") //moduli base e sistema: deve ritornare 0;
|
if (module == "ba" || module == "sy") //moduli base e sistema: deve ritornare 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
TScanner scanner(AUT_FILE);
|
aut = dongle().module_name2code(module);
|
||||||
for (aut = 0; scanner.line() != ""; aut++)
|
ok = aut < ENDAUT;
|
||||||
if (scanner.token().starts_with(module))
|
|
||||||
{ ok = true; break; }
|
|
||||||
}
|
}
|
||||||
return ok ? aut : -1;
|
return ok ? aut : -1;
|
||||||
}
|
}
|
||||||
@ -359,7 +376,6 @@ bool TInstaller_mask::autoload()
|
|||||||
const TString& module = *row;
|
const TString& module = *row;
|
||||||
if (module[0] == '_' || module.len() == 2)
|
if (module[0] == '_' || module.len() == 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (module[0] == '_')
|
if (module[0] == '_')
|
||||||
add_header(ini, module, false);
|
add_header(ini, module, false);
|
||||||
else
|
else
|
||||||
@ -390,7 +406,7 @@ bool TInstaller_mask::autoload()
|
|||||||
ininame.lower();
|
ininame.lower();
|
||||||
const int pos = ininame.find("inst.ini");
|
const int pos = ininame.find("inst.ini");
|
||||||
CHECKS(pos >= 2, "Invalid installation configuration: ", (const char*)ininame);
|
CHECKS(pos >= 2, "Invalid installation configuration: ", (const char*)ininame);
|
||||||
const TString16 module = ininame.mid(pos-2, 2);
|
const TString4 module = ininame.mid(pos-2, 2);
|
||||||
TConfig ini(ininame, module);
|
TConfig ini(ininame, module);
|
||||||
add_module(ini, module, false);
|
add_module(ini, module, false);
|
||||||
}
|
}
|
||||||
@ -540,14 +556,17 @@ bool TInstaller_mask::can_install(const char* module, TInstall_ini& ini)
|
|||||||
|
|
||||||
const TString& version = ini.version(module);
|
const TString& version = ini.version(module);
|
||||||
const word year = version2year(version);
|
const word year = version2year(version);
|
||||||
if (year < 1997)
|
if (year < 2006)
|
||||||
return error_box(FR("Il modulo '%s' non ha una versione valida."), module);
|
return error_box(FR("Il modulo '%s' non ha una versione valida."), module);
|
||||||
|
|
||||||
#ifndef _DEMO_
|
#ifndef _DEMO_
|
||||||
if (year > dongle().year_assist())
|
if (year > dongle().year_assist())
|
||||||
return error_box(FR("Per installare la versione %s del modulo '%s'\noccorre il contratto di assistenza per l'anno %d."),
|
{
|
||||||
|
warning_box(FR("Per installare la versione %s del modulo '%s'\noccorre il contratto di assistenza per l'anno %d."),
|
||||||
(const char*)version, module, year);
|
(const char*)version, module, year);
|
||||||
|
if (!update_assistance_year())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TAuto_token_string altri(ini.get("Moduli", module));
|
TAuto_token_string altri(ini.get("Moduli", module));
|
||||||
@ -596,7 +615,9 @@ int TInstaller_mask::needs_reboot(const TFilename& file) const
|
|||||||
if (xvt_str_compare_ignoring_case(ext, "dll") == 0)
|
if (xvt_str_compare_ignoring_case(ext, "dll") == 0)
|
||||||
underscore = NEW_DLL; else
|
underscore = NEW_DLL; else
|
||||||
if (xvt_str_compare_ignoring_case(ext, "men") == 0)
|
if (xvt_str_compare_ignoring_case(ext, "men") == 0)
|
||||||
underscore = NEW_MENU;
|
underscore = NEW_MENU; else
|
||||||
|
if (xvt_str_compare_ignoring_case(ext, "trr") == 0 || xvt_str_compare_ignoring_case(ext, "dir") == 0)
|
||||||
|
underscore = NEW_TRR;
|
||||||
return underscore;
|
return underscore;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -632,7 +653,7 @@ bool TInstaller_mask::move_file(const TFilename& src, const TFilename& dst) cons
|
|||||||
{
|
{
|
||||||
TFilename dest = dst;
|
TFilename dest = dst;
|
||||||
const int reboot = needs_reboot(dest);
|
const int reboot = needs_reboot(dest);
|
||||||
if (reboot > NEW_MENU && dst.exist())
|
if ((reboot & NEW_SYS)!=0 && dst.exist())
|
||||||
{
|
{
|
||||||
dest.rtrim(1);
|
dest.rtrim(1);
|
||||||
dest << '_';
|
dest << '_';
|
||||||
@ -978,7 +999,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
src = path;
|
src = path;
|
||||||
src.add(dst);
|
src.add(dst);
|
||||||
const int reboot = needs_reboot(dst);
|
const int reboot = needs_reboot(dst);
|
||||||
if (reboot > NEW_MENU && dst.exist())
|
if ((reboot & NEW_SYS)!=0 && dst.exist())
|
||||||
{
|
{
|
||||||
dst.rtrim(1);
|
dst.rtrim(1);
|
||||||
dst << '_';
|
dst << '_';
|
||||||
@ -1230,7 +1251,11 @@ void TInstaller_mask::install_selection()
|
|||||||
{
|
{
|
||||||
if (_sys_installed)
|
if (_sys_installed)
|
||||||
{
|
{
|
||||||
warning_box("Modulo SY installato: altri moduli presenti dovranno essere installati successivamente");
|
if (_modules_pending)
|
||||||
|
warning_box(TR("Modulo SY installato: gli altri moduli verranno installati successivamente"));
|
||||||
|
else
|
||||||
|
message_box(TR("Modulo SY installato: il programma si riavviera' automaticamente"));
|
||||||
|
|
||||||
send_key(K_SPACE, DLG_QUIT);
|
send_key(K_SPACE, DLG_QUIT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1353,9 +1378,10 @@ TInstaller_mask::~TInstaller_mask()
|
|||||||
msg << TR("installatore;");
|
msg << TR("installatore;");
|
||||||
if (_reboot_program & NEW_DLL)
|
if (_reboot_program & NEW_DLL)
|
||||||
msg << TR("librerie di base;");
|
msg << TR("librerie di base;");
|
||||||
|
if (_reboot_program & NEW_TRR)
|
||||||
|
msg << TR("tracciati record;");
|
||||||
|
|
||||||
msg.rtrim(1);
|
msg.rtrim(1);
|
||||||
msg << '\n' << TR("E' necessario uscire e rientrare dal programma.");
|
|
||||||
warning_box(msg);
|
warning_box(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1439,7 +1465,7 @@ void TInstaller::convert_archives()
|
|||||||
void TInstaller::main_loop()
|
void TInstaller::main_loop()
|
||||||
{
|
{
|
||||||
_m->run();
|
_m->run();
|
||||||
if (_m->installed() && !_m->sys_installed() && testdatabase()) // Almeno 1 modulo installato ?
|
if (_m->run_conversion() && testdatabase()) // Almeno 1 trr installato ?
|
||||||
{
|
{
|
||||||
convert_archives();
|
convert_archives();
|
||||||
}
|
}
|
||||||
@ -1471,17 +1497,23 @@ bool TExtendedInstaller::create()
|
|||||||
void TExtendedInstaller::main_loop()
|
void TExtendedInstaller::main_loop()
|
||||||
{
|
{
|
||||||
_m->run();
|
_m->run();
|
||||||
if (_m->installed() && !_m->sys_installed() && testdatabase()) // Almeno 1 modulo installato ?
|
if (_m->run_conversion() && testdatabase()) // Almeno 1 modulo installato ?
|
||||||
convert_archives();
|
|
||||||
|
|
||||||
const bool reboot = _m->run_ba0close();
|
|
||||||
delete _m; _m = NULL;
|
|
||||||
|
|
||||||
if (reboot && !fexist("ba3.exe")) //e' una prima installazione (non ha ancora installato la base)
|
|
||||||
{
|
{
|
||||||
TExternal_app ba0close("ba0close.exe");
|
// Lancia conversione: ba1 -0 -C -uADMIN
|
||||||
ba0close.run(true,true,true); // run asynchronous...
|
TExternal_app conversion("ba1 -0 -C");
|
||||||
|
conversion.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool pending = _m->modules_pending();
|
||||||
|
delete _m; _m = NULL;
|
||||||
|
//le graffe servono per salvare il file campo.ini!! NON eliminarle
|
||||||
|
{
|
||||||
|
TConfig campo(CONFIG_INSTALL, "ba0close");
|
||||||
|
campo.set("ModulesPending", pending ? "1" : "0");
|
||||||
|
}
|
||||||
|
TExternal_app ba0close("ba0close.exe");
|
||||||
|
|
||||||
|
ba0close.run(true,true,true); // run asynchronous...
|
||||||
}
|
}
|
||||||
|
|
||||||
int ba1700(int argc, char* argv[])
|
int ba1700(int argc, char* argv[])
|
||||||
|
@ -687,7 +687,7 @@ bool TMailer_mask::file2app(const TString& file, TString& app) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
app = *run;
|
app = *run;
|
||||||
ok = app.not_empty();
|
ok = app.full();
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -1463,30 +1463,32 @@ bool TSQL_recordset_app::create()
|
|||||||
{
|
{
|
||||||
_msk->set(F_CODICE, argv(2));
|
_msk->set(F_CODICE, argv(2));
|
||||||
_msk->load_query();
|
_msk->load_query();
|
||||||
|
|
||||||
|
|
||||||
if (argc() > 3)
|
if (argc() > 3)
|
||||||
|
{
|
||||||
switch (argv(3)[0])
|
switch (argv(3)[0])
|
||||||
{
|
{
|
||||||
case 'H' :
|
case 'H':
|
||||||
_msk->save_as(fmt_html);
|
_msk->save_as(fmt_html);
|
||||||
break;
|
break;
|
||||||
case 'T' :
|
case 'T':
|
||||||
_msk->save_as(fmt_text);
|
_msk->save_as(fmt_text);
|
||||||
break;
|
break;
|
||||||
case 'X' :
|
case 'X':
|
||||||
_msk->save_as(fmt_silk);
|
_msk->save_as(fmt_silk);
|
||||||
break;
|
break;
|
||||||
case 'C' :
|
case 'C':
|
||||||
_msk->save_as(fmt_campo);
|
_msk->save_as(fmt_campo);
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
_msk->save_as(fmt_html);
|
_msk->save_as(fmt_html);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
_msk->edit_query();
|
else
|
||||||
return FALSE;
|
_msk->edit_query();
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSkeleton_application::create();
|
return TSkeleton_application::create();
|
||||||
|
@ -42,6 +42,7 @@ Item_07 = "Codici statistici", "ba3 -0 %stt", ""
|
|||||||
Item_08 = "Cariche sociali", "ba3 -0 %crs", ""
|
Item_08 = "Cariche sociali", "ba3 -0 %crs", ""
|
||||||
Item_09 = "Vecchi cod.Attivita'", "ba3 -0 %ois", ""
|
Item_09 = "Vecchi cod.Attivita'", "ba3 -0 %ois", ""
|
||||||
Item_10 = "Stati", "ba3 -0 %sta", ""
|
Item_10 = "Stati", "ba3 -0 %sta", ""
|
||||||
|
Item_11 = "Indetraibiltà", "ba3 -0 %det", ""
|
||||||
|
|
||||||
[MENU_003]
|
[MENU_003]
|
||||||
Caption = "Stampa tabelle"
|
Caption = "Stampa tabelle"
|
||||||
@ -71,6 +72,7 @@ Item_04 = "Uffici imposte dirette", "ba3 -0 %uid", ""
|
|||||||
Item_05 = "Uffici IVA", "ba3 -0 %uiv", ""
|
Item_05 = "Uffici IVA", "ba3 -0 %uiv", ""
|
||||||
Item_06 = "Uffici registro", "ba3 -0 %ure", ""
|
Item_06 = "Uffici registro", "ba3 -0 %ure", ""
|
||||||
Item_07 = "Centri servizio", "ba3 -0 %ucs", ""
|
Item_07 = "Centri servizio", "ba3 -0 %ucs", ""
|
||||||
|
Item_08 = "Codici tributo", "ba3 -0 %trb", ""
|
||||||
|
|
||||||
[MENU_012]
|
[MENU_012]
|
||||||
Caption = "Stampa tabelle ministeriali"
|
Caption = "Stampa tabelle ministeriali"
|
||||||
@ -83,6 +85,7 @@ Item_03 = "Uffici imposte dirette", "ba3 -1 %uid", ""
|
|||||||
Item_04 = "Uffici IVA", "ba3 -1 %uiv", ""
|
Item_04 = "Uffici IVA", "ba3 -1 %uiv", ""
|
||||||
Item_05 = "Uffici registro", "ba3 -1 %ure", ""
|
Item_05 = "Uffici registro", "ba3 -1 %ure", ""
|
||||||
Item_06 = "Centri servizio", "ba3 -1 %ucs", ""
|
Item_06 = "Centri servizio", "ba3 -1 %ucs", ""
|
||||||
|
Item_07 = "Codici tributo", "ba3 -1 %trb", ""
|
||||||
|
|
||||||
[MENU_014]
|
[MENU_014]
|
||||||
Caption = "Query e Report"
|
Caption = "Query e Report"
|
||||||
|
40
ba/basttrb.rep
Executable file
40
ba/basttrb.rep
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
<report name="basttrb" lpi="6">
|
||||||
|
<description>Stampa Codici Tributo</description>
|
||||||
|
<font face="Courier New" size="10" />
|
||||||
|
<section type="Head">
|
||||||
|
<field type="Testo" valign="center" align="center" width="96" height="2" text="Tabella Codici Tributo">
|
||||||
|
<font face="Courier New" bold="1" size="14" />
|
||||||
|
</field>
|
||||||
|
<field border="2" x="1" y="2.5" type="Linea" width="93" height="0" />
|
||||||
|
<field x="2" y="3" type="Testo" width="10" text="Codice">
|
||||||
|
<font face="Courier New" bold="1" size="10" />
|
||||||
|
</field>
|
||||||
|
<field x="15" y="3" type="Testo" width="12" text="Descrizione">
|
||||||
|
<font face="Courier New" bold="1" size="10" />
|
||||||
|
</field>
|
||||||
|
<field border="2" x="1" y="4.5" type="Linea" width="93" height="0" />
|
||||||
|
</section>
|
||||||
|
<section type="Head" level="1" />
|
||||||
|
<section type="Body" />
|
||||||
|
<section type="Body" level="1">
|
||||||
|
<field x="2" type="Stringa" link="%TRB.CODTAB" width="4">
|
||||||
|
<source>CODTAB</source>
|
||||||
|
</field>
|
||||||
|
<field x="15" type="Stringa" width="50">
|
||||||
|
<source>S0</source>
|
||||||
|
</field>
|
||||||
|
</section>
|
||||||
|
<section type="Foot" height="3">
|
||||||
|
<field border="2" x="1" y="0.5" type="Linea" width="93" height="0" />
|
||||||
|
<field x="2" y="1" type="Data" width="10">
|
||||||
|
<source>#SYSTEM.DATE</source>
|
||||||
|
</field>
|
||||||
|
<field x="90" y="1" type="Numero" align="right" width="3">
|
||||||
|
<source>#PAGE</source>
|
||||||
|
</field>
|
||||||
|
<field border="2" x="1" y="2.5" type="Linea" width="93" height="0" />
|
||||||
|
</section>
|
||||||
|
<section type="Foot" level="1" />
|
||||||
|
<sql>USE %TRB</sql>
|
||||||
|
</report>
|
38
ba/basttrb.uml
Executable file
38
ba/basttrb.uml
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#include "ba3200.h"
|
||||||
|
|
||||||
|
PAGE "Stampa Codici Tributo" -1 -1 50 8
|
||||||
|
STRING F_INIZIO1 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 1 "Da codice "
|
||||||
|
FLAGS "U"
|
||||||
|
USE %TRB
|
||||||
|
INPUT CODTAB F_INIZIO1
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione@50" S0
|
||||||
|
OUTPUT F_INIZIO1 CODTAB
|
||||||
|
GROUP 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_FINE1 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 3 "A codice "
|
||||||
|
FLAGS "U"
|
||||||
|
COPY USE F_INIZIO1
|
||||||
|
INPUT CODTAB F_FINE1
|
||||||
|
COPY DISPLAY F_INIZIO1
|
||||||
|
OUTPUT F_FINE1 CODTAB
|
||||||
|
GROUP 2
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_OK 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
@ -1,20 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Agenti
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
1|@68g%s|Provvigione vendite da
|
|
||||||
1|@107g%s|Provvigione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@5s
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
1|S6|@68g@35t
|
|
||||||
1|R0|@107g@5,rpn|##,@@
|
|
||||||
|
|
||||||
[Translations]
|
|
||||||
5|S6| |Configurazione ditta
|
|
||||||
5|S6|V|Categoria vendita
|
|
||||||
5|S6|A|Agenti
|
|
||||||
5|S6|C|Clienti
|
|
||||||
5|S6|L|Condizioni di vendita
|
|
@ -1,14 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella attivita'
|
|
||||||
1|%s|Codice attivita'
|
|
||||||
1|@22g%s|Descrizione attivita'
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@8g@16,ls
|
|
||||||
1|S0|@22g@40,ls
|
|
||||||
|
|
||||||
[Footers]
|
|
||||||
|
|
||||||
[Translations]
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Classi fiscali articoli
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
[Relations]
|
|
||||||
LF_COMUNI;COM==S5
|
|
||||||
|
|
||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Banche
|
|
||||||
1|@2g%s|Codice ABI
|
|
||||||
1|@14g%s|Codice CAB
|
|
||||||
1|@26g%s|Istituto
|
|
||||||
1|@78g%s|Dipendenza
|
|
||||||
2|@26g%s|Indirizzo
|
|
||||||
4|@26g%s|CAP
|
|
||||||
4|@32g%s|Comune
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,5]|@7g@5s
|
|
||||||
1|CODTAB[6,10]|@19g@5s
|
|
||||||
1|S0|@26g@50,ls
|
|
||||||
1|I0|@78g@4n
|
|
||||||
2|S2+", "+S7|@26g#-40t
|
|
||||||
3|S3|@26g@10,ls
|
|
||||||
3|LF_COMUNI->DENCOM+" ("+LF_COMUNI->PROVCOM+")"|@32g#-55t
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
[Relations]
|
|
||||||
%VAL;CODTAB==(TRIM(CODTAB[1,3]));1;0;200
|
|
||||||
|
|
||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Cambi Giornalieri
|
|
||||||
1|@2g%s|Cod. Valuta
|
|
||||||
1|@16g%s|Data
|
|
||||||
1|@30g%s|Descrizione
|
|
||||||
1|@80g%s|Cambio
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,3]|@2g@3s
|
|
||||||
1|D0|@15g@ld
|
|
||||||
1|-200->S0|@30g@50,ls
|
|
||||||
1|S4|@82g@15,rpn|#.###.###,@@@@@@
|
|
@ -1,18 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Categorie contabili
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
1|@68g%s|Conto di vendita
|
|
||||||
1|@88g%s|Conto di acquisto
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
1|I3|@68g@3n
|
|
||||||
1|I4|@73g@3n
|
|
||||||
1|I5|@78g@6n
|
|
||||||
1|I0|@88g@3n
|
|
||||||
1|I1|@93g@3n
|
|
||||||
1|I2|@98g@6n
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Categorie Finanziarie
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Classificazione pagamenti
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,1]|@3g@1,ls
|
|
||||||
1|CODTAB[2,2]|@5g@1,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
[Relations]
|
|
||||||
LF_CLIFO;TIPOCF="C"|CODCF=I0
|
|
||||||
|
|
||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Commesse
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@24g%s|Descrizione
|
|
||||||
1|@72g%s|Da rend.
|
|
||||||
2|@3g%s|Cliente
|
|
||||||
2|@62g%s|Regime iva
|
|
||||||
2|@72g%s|Prorata
|
|
||||||
3|@3g%s|Data ini.
|
|
||||||
3|@14g%s|Data fine
|
|
||||||
3|@26g%s|Pubblica
|
|
||||||
3|@35g%s|Prorogata
|
|
||||||
3|@45g%s|Chiusa
|
|
||||||
3|@52g%s|Responsabile
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@20,ls
|
|
||||||
1|S0|@24g@50,ls
|
|
||||||
1|B1|@78g@f
|
|
||||||
2|I0|@3g@6n
|
|
||||||
2|20->RAGSOC|@10g@50,ls
|
|
||||||
2|S7|@62g@17t
|
|
||||||
2|B4|@79g@6f
|
|
||||||
3|D0|@3g@ld
|
|
||||||
3|D1|@14g@ld
|
|
||||||
3|B0|@26g@8f
|
|
||||||
3|B2|@35g@9f
|
|
||||||
3|B3|@45g@6f
|
|
||||||
3|S4|@52g@8,ls
|
|
||||||
|
|
||||||
[Translations]
|
|
||||||
5|S7| |IVA normale
|
|
||||||
5|S7|NR|Non rilevante
|
|
||||||
5|S7|ES|Operazioni esenti
|
|
||||||
5|S7|NI|Non imponibili
|
|
||||||
5|S7|NS|Non soggetti
|
|
||||||
5|S7|FC|Fuori campo
|
|
@ -1,19 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella dei codici di pagamento
|
|
||||||
1|@2g%s|Codice pagamento
|
|
||||||
1|@20g%s|Descrizione codice pagamento
|
|
||||||
1|@72g%s|Tipo
|
|
||||||
1|@78g%s|Inizio scadenze
|
|
||||||
1|@95g%s|Mese Commerciale
|
|
||||||
1|@113g%s|Rate Differenziate
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@16,ls
|
|
||||||
1|S0|@20g@50,ls
|
|
||||||
1|I0|@72g@4n
|
|
||||||
1|CODTAB[11,12]|@78g@15,ls
|
|
||||||
1|B0|@95g@16f
|
|
||||||
1|B1|@113g@18f
|
|
||||||
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella delle cariche sociali
|
|
||||||
1|@2g%s|Cod.
|
|
||||||
1|@7g%s|Carica sociale
|
|
||||||
1|@58g%s|Stampa su modulo RAD ?
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@5,ls
|
|
||||||
1|S0|@7g@50,ls
|
|
||||||
1|S6|@58g@f
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Causali di Trasporto
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@3,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Categorie Vendita
|
|
||||||
1|@78g%s|Conto cliente
|
|
||||||
1|@93g%s|Conto di vendita
|
|
||||||
2|@3g%s|Codice
|
|
||||||
2|@14g%s|Descrizione
|
|
||||||
2|@66g%s|Provvigione
|
|
||||||
2|@78g%s|Gruppo
|
|
||||||
2|@85g%s|Conto
|
|
||||||
2|@93g%s|Gruppo
|
|
||||||
2|@100g%s|Conto
|
|
||||||
2|@106g%s|Sottoconto
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
1|R0|@66g@5,rpn|##,@@
|
|
||||||
1|I1|@78g@3n
|
|
||||||
1|I2|@85g@3n
|
|
||||||
1|I3|@93g@3n
|
|
||||||
1|I4|@100g@3n
|
|
||||||
1|I5|@106g@6n
|
|
@ -6,14 +6,14 @@ TOOLBAR "" 0 -3 0 3
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "@bCodici Indetrabilita'" -1 -1 78 15
|
PAGE "Codici Indetrabilita'" -1 -1 78 15
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 3
|
GROUPBOX DLG_NULL 78 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Codice Indetrabilita'"
|
PROMPT 1 1 "Codice Indetrabilita'"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_CODICE 2
|
STRING F_CODICE 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 ""
|
PROMPT 2 2 ""
|
||||||
FIELD CODTAB
|
FIELD CODTAB
|
||||||
@ -26,6 +26,7 @@ BEGIN
|
|||||||
OUTPUT F_DESC S0
|
OUTPUT F_DESC S0
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
KEY 1
|
KEY 1
|
||||||
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESC 50
|
STRING F_DESC 50
|
||||||
@ -67,9 +68,9 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_PERC 3
|
NUMBER F_PERC 6 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 7 "Indetraibilita' "
|
PROMPT 2 7 "% d'indetraibilita' "
|
||||||
NUM_EXPR #F_PERC<=100
|
NUM_EXPR #F_PERC<=100
|
||||||
WARNING "Percentuale non valida"
|
WARNING "Percentuale non valida"
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella descrizioni di prima nota
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Denominazione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@5,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella esercizi
|
|
||||||
1|@2g%s|Anno
|
|
||||||
1|@7g%s|Data inizio esercizio
|
|
||||||
1|@30g%s|Data fine esercizio
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@4n
|
|
||||||
1|D0|@7g@21d
|
|
||||||
1|D1|@30g@21d
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Fasi commesse
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@10,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
@ -1,9 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella dei libri sociali
|
|
||||||
1|@2g%s|Cod.
|
|
||||||
1|@8g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@5,ls
|
|
||||||
1|S0|@8g@50,ls
|
|
@ -1,46 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella codici IVA
|
|
||||||
1|@54g%s|Tipo
|
|
||||||
1|@59g%s|C.IVA
|
|
||||||
1|@66g%s|%IVA
|
|
||||||
1|@73g%s|Riga IVA11
|
|
||||||
1|@84g%s|Riga prosp.
|
|
||||||
1|@96g%s|Rimb.
|
|
||||||
1|@110g%s|Reg.
|
|
||||||
1|@117g%s|Ag.
|
|
||||||
1|@123g%s|Esc.
|
|
||||||
2|%s|Cod.
|
|
||||||
2|@6g%s|Descrizione
|
|
||||||
2|@47g%s|Aliq.
|
|
||||||
2|@54g%s|Cod.
|
|
||||||
2|@59g%s|Vent.
|
|
||||||
2|@65g%s|Teorica
|
|
||||||
2|@73g%s|Vend.
|
|
||||||
2|@79g%s|Acq.
|
|
||||||
2|@84g%s|Vend.
|
|
||||||
2|@90g%s|Acq.
|
|
||||||
2|@96g%s|Infr.
|
|
||||||
2|@102g%s|Plafond
|
|
||||||
2|@110g%s|Agr.
|
|
||||||
2|@115g%s|Viaggio
|
|
||||||
2|@123g%s|Rim.
|
|
||||||
2|@128g%s|Sos.
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@g@4,cs
|
|
||||||
1|S0|@6g@40,ls
|
|
||||||
1|R0|@47g@6n
|
|
||||||
1|S1|@55g@2s
|
|
||||||
1|S6|@59g@4s
|
|
||||||
1|I0|@67g@2n
|
|
||||||
1|S2|@73g@3s
|
|
||||||
1|S9|@79g@3s
|
|
||||||
1|S10|@85g@4s
|
|
||||||
1|S11|@90g@4s
|
|
||||||
1|B3|@97g@f
|
|
||||||
1|S3|@105g@1s
|
|
||||||
1|S4|@111g@1s
|
|
||||||
1|S5|@118g@1s
|
|
||||||
1|B4|@123g@f
|
|
||||||
1|B2|@128g@f
|
|
||||||
[Footers]
|
|
@ -1,15 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella dei codici IV direttiva
|
|
||||||
1|@2g%s|Sezione
|
|
||||||
1|@11g%s|Lettera
|
|
||||||
1|@20g%s|Classe
|
|
||||||
1|@30g%s|Numero
|
|
||||||
1|@38g%s|Descrizione IV direttiva CEE
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,1]|@2g@7,ls
|
|
||||||
1|CODTAB[2,2]|@11g@7,ls
|
|
||||||
1|CODTAB[3,6]|@20g@m
|
|
||||||
1|CODTAB[7,]|@30g@2s
|
|
||||||
1|S0|@38g@50,ls
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Legali per contenzioso
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Listini
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@5,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella lingue
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Denominazione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@1,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Modalita' di spedizione
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Note Documento
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Nomenclatura combinata
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@17g%s|Denominazione
|
|
||||||
1|@69g%s|Obbl.
|
|
||||||
1|@75g%s|Um.S.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,4]|@3g@4,ls
|
|
||||||
1|CODTAB[5,6]|@10g@2,ls
|
|
||||||
1|CODTAB[7,8]|@14g@2,ls
|
|
||||||
1|S0|@17g@50,ls
|
|
||||||
1|S4|@69g@1,ls
|
|
||||||
1|S5|@75g@2,ls
|
|
@ -1,12 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Note cliente
|
|
||||||
1|@0g%s|Codice
|
|
||||||
1|@35g%s|Descrizione
|
|
||||||
1|@63g%s|Blocca immissione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@0g@2s
|
|
||||||
1|S0+S1|@3g#-75t
|
|
||||||
1|B0|@79g@1f
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella vecchi codici attivita'
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Subcodice
|
|
||||||
1|@22g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,4]|@2g@6,ls
|
|
||||||
1|CODTAB[5,]|@10g@9,ls
|
|
||||||
1|S0|@22g@40,ls
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Modalita' di consegna
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@3,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella dei registri
|
|
||||||
1|@2g%s|Registro
|
|
||||||
1|@43g%s|Cod. Ultimo Ultima Ultima stampa
|
|
||||||
1|@122g%s|Pag. Pag.
|
|
||||||
2|%s|Anno Co.Ti.Descrizione
|
|
||||||
2|@43g%s|att. prot. regis. pagina data
|
|
||||||
2|@90g%s|Luogo conservazione
|
|
||||||
2|@122g%s|reg. res.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,4]|@4s
|
|
||||||
1|CODTAB[5,7]|@5g@3s
|
|
||||||
1|I0|@9g@1s
|
|
||||||
1|S0|@11g@30s
|
|
||||||
1|S8|@42g@5s
|
|
||||||
1|I5|@48g@6,rn
|
|
||||||
1|D2|@55g@d
|
|
||||||
1|I1|@64g@4,rn
|
|
||||||
1|D3|@71g@d
|
|
||||||
1|S1|@80g@40s
|
|
||||||
1|I2|@122g@4,rn
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Spese da addebitare
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@20,ls
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Sconti cliente
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
1|@70g%s|Sconto
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
1|S1|@70g@20,ls
|
|
@ -1,9 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella STati CEE
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@10g%s|Denominazione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@4,ls
|
|
||||||
1|S0|@10g@50,ls
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella degli stati
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Denominazione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@6,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella codici statistici
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@12g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@17,ls
|
|
||||||
1|S0|@12g@40,ls
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Stampa Tabella Gestione Subagenti
|
|
||||||
1|@2g%s|Agente
|
|
||||||
1|@10g%s|Subagente
|
|
||||||
1|@21g%s|Descrizione
|
|
||||||
1|@73g%s|Prov. fissa
|
|
||||||
2|@21g%s|Prov. variabile
|
|
||||||
2|@73g%s|Cod. fornitore
|
|
||||||
2|@90g%s|Ragione sociale
|
|
||||||
2|@107g%s|Liquid. prov. sul pagato
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,5]|@2g@5s
|
|
||||||
1|CODTAB[6,7]|@10g@2s
|
|
||||||
1|S0|@21g@50s
|
|
||||||
1|R0|@73g@6,rpn|####,@@
|
|
||||||
2|R1|@21g@6,rpn|####,@@
|
|
||||||
2|S1|@73g@6,ls
|
|
||||||
2|S2|@90g@50,ls
|
|
||||||
2|B0|@107g@1,ls
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Titoli onorifici
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@30,ls
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Tipi documenti
|
|
||||||
1|@3g%s|Tipo
|
|
||||||
1|@8g%s|Descrizione
|
|
||||||
1|@59g%s|Natura
|
|
||||||
1|@74g%s|Corrisp.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@8g@50,ls
|
|
||||||
1|I0|@59g@13t
|
|
||||||
1|B0|@74g@f
|
|
||||||
|
|
||||||
[Translations]
|
|
||||||
4|I0| |Altro
|
|
||||||
4|I0|1|Vendite
|
|
||||||
4|I0|2|Acquisti
|
|
||||||
4|I0|9|IVA in genere
|
|
21
ba/batbtrb.h
Executable file
21
ba/batbtrb.h
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// campi maschera batb%trb.msk
|
||||||
|
|
||||||
|
#define F_CODICE 101
|
||||||
|
#define F_DESCR 102
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
50
ba/batbtrb.uml
Executable file
50
ba/batbtrb.uml
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#include "batbtrb.h"
|
||||||
|
|
||||||
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
|
#include <toolbar.h>
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Tabella Codici Tributo" -1 -1 78 8
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 75 7
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 0 ""
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_CODICE 4
|
||||||
|
BEGIN
|
||||||
|
PROMPT 4 2 "Codice "
|
||||||
|
HELP "Codice tributo"
|
||||||
|
FIELD CODTAB
|
||||||
|
KEY 1
|
||||||
|
USE %TRB
|
||||||
|
INPUT CODTAB F_CODICE
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
DISPLAY "Descrizione @50" S0
|
||||||
|
OUTPUT F_CODICE CODTAB
|
||||||
|
OUTPUT F_DESCR S0
|
||||||
|
FLAGS "Z"
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCR 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 4 4 "Descrizione "
|
||||||
|
HELP "Descrizione del codice tributo"
|
||||||
|
FIELD LF_TABCOM->S0
|
||||||
|
KEY 2
|
||||||
|
USE %TRB KEY 2
|
||||||
|
INPUT CODTAB F_CODICE
|
||||||
|
INPUT S0 F_DESCR
|
||||||
|
DISPLAY "Descrizione @50" S0
|
||||||
|
DISPLAY "Codice" CODTAB
|
||||||
|
OUTPUT F_CODICE CODTAB
|
||||||
|
OUTPUT F_DESCR S0
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
@ -1,21 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella concessioni
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione ufficio concessioni
|
|
||||||
1|@62g%s|Indirizzo ufficio
|
|
||||||
1|@99g%s|N. civico
|
|
||||||
1|@111g%s|Comune
|
|
||||||
1|@119g%s|C.C.P.
|
|
||||||
2|@10g%s|Dizione della concessione
|
|
||||||
2|@62g%s|C.C.P. I.C.I.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@6,ls
|
|
||||||
1|S0|@10g@50,ls
|
|
||||||
1|S1|@62g@35,ls
|
|
||||||
1|S3|@99g@10,ls
|
|
||||||
1|S7|@111g@6,ls
|
|
||||||
1|S5|@119g@8,ls
|
|
||||||
2|S2|@10g@50,ls
|
|
||||||
2|S4|@62g@13,ls
|
|
@ -1,17 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella centri servizio
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione centri servizio
|
|
||||||
1|@52g%s|Indirizzo
|
|
||||||
1|@89g%s|N. civico
|
|
||||||
1|@101g%s|Comune
|
|
||||||
1|@109g%s|C.C.P.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@6,ls
|
|
||||||
1|S0|@10g@40,ls
|
|
||||||
1|S1|@52g@35,ls
|
|
||||||
1|S3|@89g@10,ls
|
|
||||||
1|S6|@101g@6,ls
|
|
||||||
1|S4|@109g@8,ls
|
|
@ -1,17 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella uffici esattoria
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione ufficio esattoria
|
|
||||||
1|@42g%s|Indirizzo
|
|
||||||
1|@79g%s|N. civico
|
|
||||||
1|@91g%s|Codice comune
|
|
||||||
1|@106g%s|C.C.P. ufficio
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@6,ls
|
|
||||||
1|S0|@10g@30,ls
|
|
||||||
1|S1|@42g@35,ls
|
|
||||||
1|S3|@79g@10,ls
|
|
||||||
1|S6|@91g@13,ls
|
|
||||||
1|S4|@106g@14,ls
|
|
@ -1,17 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella uffici imposta diretta
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione ufficio imposta diretta
|
|
||||||
1|@52g%s|Indirizzo
|
|
||||||
1|@99g%s|N. civico
|
|
||||||
1|@111g%s|Comune
|
|
||||||
1|@119g%s|C.C.P.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@6,ls
|
|
||||||
1|S0|@10g@40,ls
|
|
||||||
1|S1|@52g@45,ls
|
|
||||||
1|S3|@99g@10,ls
|
|
||||||
1|S6|@111g@6,ls
|
|
||||||
1|S4|@119g@8,ls
|
|
@ -1,17 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella uffici IVA
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione ufficio IVA
|
|
||||||
1|@52g%s|Indirizzo
|
|
||||||
1|@99g%s|N. civico
|
|
||||||
1|@111g%s|Comune
|
|
||||||
1|@119g%s|C.C.P.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB| @2g@6,ls
|
|
||||||
1|S0| @10g@40,ls
|
|
||||||
1|S1| @52g@45,ls
|
|
||||||
1|S3| @99g@10,ls
|
|
||||||
1|S6| @111g@6,ls
|
|
||||||
1|S4| @119g@8,ls
|
|
@ -1,17 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella uffici registro
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione ufficio registro
|
|
||||||
1|@42g%s|Indirizzo
|
|
||||||
1|@79g%s|N. civico
|
|
||||||
1|@91g%s|Comune
|
|
||||||
1|@99g%s|C.C.P.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@6,ls
|
|
||||||
1|S0|@10g@30,ls
|
|
||||||
1|S1|@42g@35,ls
|
|
||||||
1|S3|@79g@10,ls
|
|
||||||
1|S6|@91g@6,ls
|
|
||||||
1|S4|@99g@10,ls
|
|
@ -1,15 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella concessioni
|
|
||||||
1|@2g%s|Codice
|
|
||||||
1|@10g%s|Descrizione ufficio concessioni
|
|
||||||
1|@62g%s|Indirizzo ufficio
|
|
||||||
1|@99g%s|N. civico
|
|
||||||
1|@111g%s|Comune
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@6,ls
|
|
||||||
1|S0|@10g@50,ls
|
|
||||||
1|S1|@62g@35,ls
|
|
||||||
1|S3|@99g@10,ls
|
|
||||||
1|S7|@111g@6,ls
|
|
@ -1,14 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella valute
|
|
||||||
1|@2g%s|Codice valuta
|
|
||||||
1|@17g%s|Nome
|
|
||||||
1|@49g%s|Cambio
|
|
||||||
1|@65g%s|Data
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@13,ls
|
|
||||||
1|S0|@17g@25,ls
|
|
||||||
1|S4|@44g@pn|###.###.##@,@@@@@
|
|
||||||
1|D0|@65g@d
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella versamenti ed interessi IVA
|
|
||||||
1|@2g%s|Anno
|
|
||||||
1|@7g%s|Mese
|
|
||||||
1|@14g%s|% I trim.
|
|
||||||
1|@27g%s|% II trim.
|
|
||||||
1|@40g%s|% III trim.
|
|
||||||
1|@53g%s|% IV trim.
|
|
||||||
1|@66g%s|% annuale
|
|
||||||
2|@14g%s|% liq. diff.
|
|
||||||
2|@40g%s|% liq. ann.
|
|
||||||
3|@19g%s|I. period.
|
|
||||||
3|@40g%s|I. annuale
|
|
||||||
3|@67g%s|I. art.74
|
|
||||||
4|@19g%s|I. cessaz.
|
|
||||||
4|@40g%s|I. integr.
|
|
||||||
4|@67g%s|I. acconto
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
2|CODTAB[1,4]|@2g@4s
|
|
||||||
2|CODTAB[5,6]|@7g@2s
|
|
||||||
2|R0|@14g@pn|###,@@
|
|
||||||
2|R1|@29g@pn|###,@@
|
|
||||||
2|R2|@44g@pn|###,@@
|
|
||||||
2|R3|@56g@pn|###,@@
|
|
||||||
2|R4|@70g@pn|###,@@
|
|
||||||
3|R11|@15g@pn|###,@@
|
|
||||||
3|R12|@44g@pn|###,@@
|
|
||||||
4|R5|@14g@pn|###.###.###,@@
|
|
||||||
4|R6|@34g@pn|###.###.###,@@
|
|
||||||
4|R7|@60g@pn|###.###.###,@@
|
|
||||||
5|R8|@14g@pn|###.###.###,@@
|
|
||||||
5|R9|@34g@pn|###.###.###,@@
|
|
||||||
5|R10|@60g@pn|###.###.###,@@
|
|
@ -1,37 +0,0 @@
|
|||||||
[Relations]
|
|
||||||
LF_COMUNI;STATO=S8|COM=S9
|
|
||||||
%STA;CODTAB=S8;1;0;200
|
|
||||||
|
|
||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella vettori
|
|
||||||
1|@2g%s|Codice vettore
|
|
||||||
1|@18g%s|Ragione sociale
|
|
||||||
1|@70g%s|Indirizzo
|
|
||||||
1|@110g%s|N.civico
|
|
||||||
2|@2g%s|C.A.P.
|
|
||||||
2|@10g%s|Localita'
|
|
||||||
2|@47g%s|Comune
|
|
||||||
2|@99g%s|Pr.
|
|
||||||
2|@103g%s|Stato
|
|
||||||
3|@2g%s|Telefono
|
|
||||||
3|@40g%s|Fax
|
|
||||||
3|@80g%s|Telex
|
|
||||||
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@2g@8s
|
|
||||||
1|S0|@18g@50,ls
|
|
||||||
1|S1[1,35]|@70g@35,ls
|
|
||||||
1|S1[36,45]|@110g@10,ls
|
|
||||||
2|S7|@2g@5,ls
|
|
||||||
2|S1[46,70]|@10g@35,ls
|
|
||||||
2|13->DENCOM|@47g@50,ls
|
|
||||||
2|13->PROVCOM|@99g@2,ls
|
|
||||||
2|-200->S0|@103g@25,ls
|
|
||||||
3|S5[1,10]|@2g@10,ls
|
|
||||||
3|S3|@12g@20,ls
|
|
||||||
3|S5[11,20]|@40g@10,ls
|
|
||||||
3|S4|@51g@20,ls
|
|
||||||
3|S2[1,10]|@80g@10,ls
|
|
||||||
3|S2[11,30]|@91g@20,ls
|
|
@ -1,10 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Zone
|
|
||||||
1|@3g%s|Codice
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@3g@2,ls
|
|
||||||
1|S0|@14g@50,ls
|
|
||||||
|
|
@ -8,6 +8,7 @@ Descrizione = Sistema
|
|||||||
Versione = 20070400
|
Versione = 20070400
|
||||||
Patch = 502
|
Patch = 502
|
||||||
|
|
||||||
|
|
||||||
[ba]
|
[ba]
|
||||||
Descrizione = Base
|
Descrizione = Base
|
||||||
|
|
||||||
@ -56,6 +57,9 @@ Descrizione=AREA ACQUISTI E VENDITE
|
|||||||
[ve]
|
[ve]
|
||||||
Descrizione = Vendite
|
Descrizione = Vendite
|
||||||
|
|
||||||
|
[vd]
|
||||||
|
Descrizione = Vendita al dettaglio
|
||||||
|
|
||||||
[or]
|
[or]
|
||||||
Descrizione = Ordini
|
Descrizione = Ordini
|
||||||
|
|
||||||
@ -71,8 +75,8 @@ Descrizione = Provvigioni Agenti
|
|||||||
[sv]
|
[sv]
|
||||||
Descrizione = Statistiche di Vendita
|
Descrizione = Statistiche di Vendita
|
||||||
|
|
||||||
[tp]
|
[vd]
|
||||||
Descrizione = Trasferimento PACK
|
Descrizione = Vendita al dettaglio
|
||||||
|
|
||||||
[_area_magazzino_produzione]
|
[_area_magazzino_produzione]
|
||||||
Descrizione=AREA MAGAZZINO E PRODUZIONE
|
Descrizione=AREA MAGAZZINO E PRODUZIONE
|
||||||
|
@ -299,8 +299,8 @@ void TCEtables::init_query_mode(TMask& m)
|
|||||||
m.disable(DLG_ATTIV);
|
m.disable(DLG_ATTIV);
|
||||||
if (get_tabname() == "CCB")
|
if (get_tabname() == "CCB")
|
||||||
{
|
{
|
||||||
m.show(F_CODSP_CCB,TRUE);
|
m.show(F_CODSP_CCB);
|
||||||
m.show(F_CODATT_CCB,FALSE);
|
m.hide(F_CODATT_CCB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,8 +308,8 @@ void TCEtables::init_query_insert_mode(TMask& m)
|
|||||||
{
|
{
|
||||||
if (get_tabname() == "CCB")
|
if (get_tabname() == "CCB")
|
||||||
{
|
{
|
||||||
m.show(F_CODSP_CCB,FALSE);
|
m.hide(F_CODSP_CCB);
|
||||||
m.show(F_CODATT_CCB,TRUE);
|
m.show(F_CODATT_CCB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ private:
|
|||||||
void show_plus_minus(TMask& m);
|
void show_plus_minus(TMask& m);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool changing_mask(int mode) { return TRUE; }
|
virtual bool changing_mask(int mode) { return true; }
|
||||||
virtual TMask* get_mask(int mode);
|
virtual TMask* get_mask(int mode);
|
||||||
virtual const char* get_next_key();
|
virtual const char* get_next_key();
|
||||||
virtual bool protected_record(TRelation &r);
|
virtual bool protected_record(TRelation &r);
|
||||||
@ -122,7 +122,7 @@ void TMov_qmask::on_user_search(TOperable_field& o)
|
|||||||
if (sht.run() == K_ENTER)
|
if (sht.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
TToken_string& row = sht.row();
|
TToken_string& row = sht.row();
|
||||||
set(F_IDMOV, row.get(1), TRUE);
|
set(F_IDMOV, row.get(1), true);
|
||||||
stop_run(K_AUTO_ENTER);
|
stop_run(K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ bool TMov_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
break;
|
break;
|
||||||
case F_CGROWS:
|
case F_CGROWS:
|
||||||
if (e == se_query_add || e == se_query_del)
|
if (e == se_query_add || e == se_query_del)
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
case DLG_QUIT:
|
case DLG_QUIT:
|
||||||
if (e == fe_button)
|
if (e == fe_button)
|
||||||
@ -222,7 +222,7 @@ bool TMov_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMov_qmask::can_be_closed() const
|
bool TMov_qmask::can_be_closed() const
|
||||||
@ -381,7 +381,7 @@ void TMov_emask::super_polish()
|
|||||||
for (int f = fields()-1; f >= 0; f--)
|
for (int f = fields()-1; f >= 0; f--)
|
||||||
{
|
{
|
||||||
TMask_field& c = fld(f);
|
TMask_field& c = fld(f);
|
||||||
c.set_dirty(FALSE);
|
c.set_dirty(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,7 +415,7 @@ bool TMov_emask::test_inputability(const short* id, char flag)
|
|||||||
{
|
{
|
||||||
if (!field(id[i]).empty())
|
if (!field(id[i]).empty())
|
||||||
{
|
{
|
||||||
ok = TRUE;
|
ok = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -497,9 +497,9 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
if (id.not_empty())
|
if (id.not_empty())
|
||||||
{
|
{
|
||||||
const TRectype& cat = _cespite.categoria();
|
const TRectype& cat = _cespite.categoria();
|
||||||
set(F_CATEGORIA, _cespite.get(CESPI_CODCAT), TRUE);
|
set(F_CATEGORIA, _cespite.get(CESPI_CODCAT), true);
|
||||||
set(F_DESC_CAT, cat.get("S0"), TRUE);
|
set(F_DESC_CAT, cat.get("S0"), true);
|
||||||
if (e != fe_init && o.enabled())
|
if (o.enabled())
|
||||||
{
|
{
|
||||||
const TRectype& tpmov = cache().get("%TMC", get(F_CODMOV));
|
const TRectype& tpmov = cache().get("%TMC", get(F_CODMOV));
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
get_currency(F_COSTO, csto);
|
get_currency(F_COSTO, csto);
|
||||||
get_currency(F_VNONAMM, vnon);
|
get_currency(F_VNONAMM, vnon);
|
||||||
if (vnon > csto)
|
if (vnon > csto)
|
||||||
return error_box(FR("Il valore non ammortizzabile non puo' superare %s"), csto.string(TRUE));
|
return error_box(FR("Il valore non ammortizzabile non puo' superare %s"), csto.string(true));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_PLUSREIN:
|
case F_PLUSREIN:
|
||||||
@ -613,14 +613,14 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
get_currency(F_PLUSREIN, plus);
|
get_currency(F_PLUSREIN, plus);
|
||||||
const TCurrency val = csto-vnon;
|
const TCurrency val = csto-vnon;
|
||||||
if (plus > val)
|
if (plus > val)
|
||||||
return error_box(FR("La plusvalenza reinvestita non puo' superare %s"), val.string(TRUE));
|
return error_box(FR("La plusvalenza reinvestita non puo' superare %s"), val.string(true));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_NORMALE:
|
case F_NORMALE:
|
||||||
if (e == fe_close)
|
if (e == fe_close)
|
||||||
{
|
{
|
||||||
if (!test_inputability(fis_ids, _s5[10]))
|
if (!test_inputability(fis_ids, _s5[10]))
|
||||||
return FALSE;
|
return false;
|
||||||
const short fv[] = { F_COSTO, -F_VNONAMM, F_RIV75, F_RIV83, F_RIV90, F_RIV91, F_RIVGF, 0 };
|
const short fv[] = { F_COSTO, -F_VNONAMM, F_RIV75, F_RIV83, F_RIV90, F_RIV91, F_RIVGF, 0 };
|
||||||
const short fa[] = { F_NORMALE, F_ACCELERATO, F_ANTICIPATO, F_QPERSE, F_FPRIVATO, F_QPERSEPRIV, 0 };
|
const short fa[] = { F_NORMALE, F_ACCELERATO, F_ANTICIPATO, F_QPERSE, F_FPRIVATO, F_QPERSEPRIV, 0 };
|
||||||
const TCurrency val_amm = sum_fields(fv);
|
const TCurrency val_amm = sum_fields(fv);
|
||||||
@ -628,8 +628,8 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
if (fon_amm > val_amm)
|
if (fon_amm > val_amm)
|
||||||
{
|
{
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << TR("Il fondo ammortamento fiscale (") << fon_amm.string(TRUE) << ')';
|
msg << TR("Il fondo ammortamento fiscale (") << fon_amm.string(true) << ')';
|
||||||
msg << TR("non puo' superare il valore da ammortizzare (") << val_amm.string(TRUE) << ')';
|
msg << TR("non puo' superare il valore da ammortizzare (") << val_amm.string(true) << ')';
|
||||||
return error_box(msg);
|
return error_box(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -638,7 +638,7 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
if (e == fe_close)
|
if (e == fe_close)
|
||||||
{
|
{
|
||||||
if (!test_inputability(civ_ids, _s5[11]))
|
if (!test_inputability(civ_ids, _s5[11]))
|
||||||
return FALSE;
|
return false;
|
||||||
const short fv[] = { F_COSTO, F_RIV75, F_RIV83, F_RIV90, F_RIV91, F_RIVGC, 0 };
|
const short fv[] = { F_COSTO, F_RIV75, F_RIV83, F_RIV90, F_RIV91, F_RIVGC, 0 };
|
||||||
const short fa[] = { F_NORMALE2, F_ACCELERATO2, F_ANTICIPATO2, 0 };
|
const short fa[] = { F_NORMALE2, F_ACCELERATO2, F_ANTICIPATO2, 0 };
|
||||||
const TCurrency val_amm = sum_fields(fv);
|
const TCurrency val_amm = sum_fields(fv);
|
||||||
@ -646,8 +646,8 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
if (fon_amm > val_amm)
|
if (fon_amm > val_amm)
|
||||||
{
|
{
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << TR("Il fondo ammortamento civilistico (") << fon_amm.string(TRUE) << ')';
|
msg << TR("Il fondo ammortamento civilistico (") << fon_amm.string(true) << ')';
|
||||||
msg << TR("non puo' superare il valore da ammortizzare (") << val_amm.string(TRUE) << ')';
|
msg << TR("non puo' superare il valore da ammortizzare (") << val_amm.string(true) << ')';
|
||||||
return error_box(msg);
|
return error_box(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -659,7 +659,7 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
real TMov_emask::calc_riv(const TRectype& salpro, int tipo) const
|
real TMov_emask::calc_riv(const TRectype& salpro, int tipo) const
|
||||||
@ -683,11 +683,7 @@ void TMov_emask::calc_plus_minus(int tipo, real& plus, real& minus) const
|
|||||||
const TDate dtlim(get(F_DTMOV));
|
const TDate dtlim(get(F_DTMOV));
|
||||||
|
|
||||||
TRelation rel(LF_MOVCE);
|
TRelation rel(LF_MOVCE);
|
||||||
TString expr; expr << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==\"" << tipo << '"';
|
|
||||||
rel.add(LF_AMMMV, expr);
|
|
||||||
|
|
||||||
TRectype& movsem = rel.curr();
|
TRectype& movsem = rel.curr();
|
||||||
TRectype& ammmv = rel.curr(LF_AMMMV);
|
|
||||||
const TString& idcespite = get(F_IDCESPITE);
|
const TString& idcespite = get(F_IDCESPITE);
|
||||||
movsem.put(MOVCE_IDCESPITE, idcespite);
|
movsem.put(MOVCE_IDCESPITE, idcespite);
|
||||||
TString filtro;
|
TString filtro;
|
||||||
@ -699,6 +695,12 @@ void TMov_emask::calc_plus_minus(int tipo, real& plus, real& minus) const
|
|||||||
if (items > 0) // Continua solo se esistono movimenti
|
if (items > 0) // Continua solo se esistono movimenti
|
||||||
{
|
{
|
||||||
cur.freeze();
|
cur.freeze();
|
||||||
|
|
||||||
|
// Astutamente aggiungo solo ora il file collegato
|
||||||
|
TString expr; expr << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==\"" << tipo << '"';
|
||||||
|
rel.add(LF_AMMMV, expr);
|
||||||
|
const TRectype& ammmv = rel.curr(LF_AMMMV);
|
||||||
|
|
||||||
for (cur = 0L; cur.pos() < items; ++cur)
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
plus += ammmv.get_real(AMMMV_PLUS);
|
plus += ammmv.get_real(AMMMV_PLUS);
|
||||||
@ -711,7 +713,7 @@ bool TMov_emask::calc_amm(int tipo)
|
|||||||
{
|
{
|
||||||
const TString& idcespite = _cespite.get(CESPI_IDCESPITE);
|
const TString& idcespite = _cespite.get(CESPI_IDCESPITE);
|
||||||
if (idcespite.empty())
|
if (idcespite.empty())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
const TDate dtlim(get(F_DTMOV));
|
const TDate dtlim(get(F_DTMOV));
|
||||||
_cespite.calc_amm(tipo, dtlim);
|
_cespite.calc_amm(tipo, dtlim);
|
||||||
@ -749,7 +751,7 @@ bool TMov_emask::calc_amm(int tipo)
|
|||||||
set(S_PLUS, plus);
|
set(S_PLUS, plus);
|
||||||
set(S_MINUS, minus);
|
set(S_MINUS, minus);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMov_emask::set_fondi_inputability()
|
void TMov_emask::set_fondi_inputability()
|
||||||
@ -801,7 +803,7 @@ bool TMov_emask::on_key(KEY k)
|
|||||||
app().save_if_dirty();
|
app().save_if_dirty();
|
||||||
super_polish();
|
super_polish();
|
||||||
}
|
}
|
||||||
set(S_TIPO, 1, TRUE);
|
set(S_TIPO, 1, true);
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
@ -857,7 +859,7 @@ bool TMovicespi::user_create()
|
|||||||
_prima_nota.cut(0);
|
_prima_nota.cut(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMovicespi::user_destroy()
|
bool TMovicespi::user_destroy()
|
||||||
@ -865,7 +867,7 @@ bool TMovicespi::user_destroy()
|
|||||||
delete _emask;
|
delete _emask;
|
||||||
delete _qmask;
|
delete _qmask;
|
||||||
delete _rel;
|
delete _rel;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TMovicespi::get_next_key()
|
const char* TMovicespi::get_next_key()
|
||||||
@ -1001,12 +1003,12 @@ void TMovicespi::show_plus_minus(TMask& m)
|
|||||||
{
|
{
|
||||||
if (!plus.is_zero())
|
if (!plus.is_zero())
|
||||||
{
|
{
|
||||||
set_prompt(m.field(id_txt), TRUE);
|
set_prompt(m.field(id_txt), true);
|
||||||
m.set(id_fld, plus);
|
m.set(id_fld, plus);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_prompt(m.field(id_txt), FALSE);
|
set_prompt(m.field(id_txt), false);
|
||||||
m.set(id_fld, minus);
|
m.set(id_fld, minus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1027,7 +1029,7 @@ void TMovicespi::cg_mode()
|
|||||||
_qmask->set(F_NUMREG, numreg);
|
_qmask->set(F_NUMREG, numreg);
|
||||||
|
|
||||||
// Al primo inserimento devo impostare anche l'anno
|
// Al primo inserimento devo impostare anche l'anno
|
||||||
_qmask->set(F_ESERCIZIO, ini.get(MOV_ANNOES), TRUE);
|
_qmask->set(F_ESERCIZIO, ini.get(MOV_ANNOES), true);
|
||||||
|
|
||||||
if (action != 'I' && action != 'M')
|
if (action != 'I' && action != 'M')
|
||||||
{
|
{
|
||||||
@ -1102,19 +1104,19 @@ void TMovicespi::init_insert_mode(TMask& m)
|
|||||||
TConfig ini(_prima_nota, para);
|
TConfig ini(_prima_nota, para);
|
||||||
|
|
||||||
const TRectype& cau = cache().get(LF_CAUSALI, ini.get(MOV_CODCAUS));
|
const TRectype& cau = cache().get(LF_CAUSALI, ini.get(MOV_CODCAUS));
|
||||||
m.set(F_CODMOV, cau.get(CAU_COLLCESP), TRUE);
|
m.set(F_CODMOV, cau.get(CAU_COLLCESP), true);
|
||||||
if (m.field(F_TPDOC).active())
|
if (m.field(F_TPDOC).active())
|
||||||
m.set(F_TPDOC, ini.get(MOV_TIPODOC), TRUE);
|
m.set(F_TPDOC, ini.get(MOV_TIPODOC), true);
|
||||||
if (m.field(F_NDOC).active())
|
if (m.field(F_NDOC).active())
|
||||||
m.set(F_NDOC, ini.get(MOV_NUMDOC), TRUE);
|
m.set(F_NDOC, ini.get(MOV_NUMDOC), true);
|
||||||
if (m.field(F_DTDOC).active())
|
if (m.field(F_DTDOC).active())
|
||||||
m.set(F_DTDOC, ini.get(MOV_DATADOC), TRUE);
|
m.set(F_DTDOC, ini.get(MOV_DATADOC), true);
|
||||||
|
|
||||||
TString desc = ini.get(MOV_DESCR);
|
TString desc = ini.get(MOV_DESCR);
|
||||||
desc.strip("\"");
|
desc.strip("\"");
|
||||||
if (desc.empty())
|
if (desc.empty())
|
||||||
desc = cau.get(CAU_DESCR);
|
desc = cau.get(CAU_DESCR);
|
||||||
m.set(F_DESC_MOV, desc, TRUE);
|
m.set(F_DESC_MOV, desc, true);
|
||||||
|
|
||||||
TString16 codreg = ini.get(MOV_REG);
|
TString16 codreg = ini.get(MOV_REG);
|
||||||
if (codreg.not_empty())
|
if (codreg.not_empty())
|
||||||
@ -1125,7 +1127,7 @@ void TMovicespi::init_insert_mode(TMask& m)
|
|||||||
for (int r = 0; r < s.items(); r++)
|
for (int r = 0; r < s.items(); r++)
|
||||||
{
|
{
|
||||||
const real res = s.row(r).get(1);
|
const real res = s.row(r).get(1);
|
||||||
if (res > 0)
|
if (res > ZERO)
|
||||||
{
|
{
|
||||||
m.set(iva==1 ? F_IMPVEN : F_COSTO, res);
|
m.set(iva==1 ? F_IMPVEN : F_COSTO, res);
|
||||||
break;
|
break;
|
||||||
@ -1245,7 +1247,7 @@ int TMovicespi::rewrite(const TMask& m)
|
|||||||
|
|
||||||
void TMovicespi::save_if_dirty()
|
void TMovicespi::save_if_dirty()
|
||||||
{
|
{
|
||||||
if (save(TRUE))
|
if (save(true))
|
||||||
set_mode(MODE_MOD);
|
set_mode(MODE_MOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1262,7 +1264,7 @@ bool TMovicespi::remove()
|
|||||||
|
|
||||||
_emask->recalc_amm();
|
_emask->recalc_amm();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ce1500(int argc, char* argv[])
|
int ce1500(int argc, char* argv[])
|
||||||
|
@ -176,7 +176,7 @@ void TCespite::read_amm(int esercizio)
|
|||||||
AMMCE_MSG05, AMMCE_MSGD05, AMMCE_MSG06, NULL);
|
AMMCE_MSG05, AMMCE_MSGD05, AMMCE_MSG06, NULL);
|
||||||
|
|
||||||
const real cde = ditta_cespiti().coefficiente_durata_esercizio();
|
const real cde = ditta_cespiti().coefficiente_durata_esercizio();
|
||||||
if (cde != 1.0)
|
if (cde != UNO)
|
||||||
_ammpro.put(AMMCE_MSG02, "X");
|
_ammpro.put(AMMCE_MSG02, "X");
|
||||||
|
|
||||||
const int uso_promiscuo = get_int(CESPI_USOPROM);
|
const int uso_promiscuo = get_int(CESPI_USOPROM);
|
||||||
@ -363,7 +363,7 @@ TRectype& date2limit(const TDate& d)
|
|||||||
{
|
{
|
||||||
static TAssoc_array limits;
|
static TAssoc_array limits;
|
||||||
// const TString16 key = d.string(ANSI); // Non serve l'intera data: tabella del c....
|
// const TString16 key = d.string(ANSI); // Non serve l'intera data: tabella del c....
|
||||||
TString16 key; key.format("%04d", d.year());
|
TString4 key; key.format("%04d", d.year());
|
||||||
TRectype* lim = (TRectype*)limits.objptr(key);
|
TRectype* lim = (TRectype*)limits.objptr(key);
|
||||||
if (lim == NULL)
|
if (lim == NULL)
|
||||||
{
|
{
|
||||||
@ -437,7 +437,7 @@ real TCespite::calcola_spese_manutenzione(const real& valamm)
|
|||||||
{
|
{
|
||||||
const real coeff = cce.coefficiente_durata_esercizio();
|
const real coeff = cce.coefficiente_durata_esercizio();
|
||||||
real limite = get_limit();
|
real limite = get_limit();
|
||||||
if (vspmanu < limite || limite < ZERO)
|
if (vspmanu < limite || limite < ZERO) // Limite < 0 = nessun limite
|
||||||
limite = vspmanu;
|
limite = vspmanu;
|
||||||
vspmanu = coeff * limite;
|
vspmanu = coeff * limite;
|
||||||
}
|
}
|
||||||
@ -634,8 +634,12 @@ void TCespite::rip_jolly(TRelation& rel, const real& num, const real& den, int m
|
|||||||
MOVCE_RIV90, MOVCE_RIV91, MOVCE_RIVGF, MOVCE_RIVGC, NULL };
|
MOVCE_RIV90, MOVCE_RIV91, MOVCE_RIVGF, MOVCE_RIVGC, NULL };
|
||||||
for (int i = 0; flm[i]; i++)
|
for (int i = 0; flm[i]; i++)
|
||||||
{
|
{
|
||||||
real n = _salpro.get_real(flm[i]) * num / den;
|
real n = _salpro.get_real(flm[i]);
|
||||||
cce.arrotonda(n);
|
if (!n.is_zero() && num != den)
|
||||||
|
{
|
||||||
|
n = n * num / den;
|
||||||
|
cce.arrotonda(n);
|
||||||
|
}
|
||||||
movsem.put(flm[i], n);
|
movsem.put(flm[i], n);
|
||||||
}
|
}
|
||||||
rel.lfile(LF_MOVCE).rewrite();
|
rel.lfile(LF_MOVCE).rewrite();
|
||||||
@ -649,9 +653,13 @@ void TCespite::rip_jolly(TRelation& rel, const real& num, const real& den, int m
|
|||||||
TString16 afl;
|
TString16 afl;
|
||||||
for (int i = 0; fla[i]; i++)
|
for (int i = 0; fla[i]; i++)
|
||||||
{
|
{
|
||||||
afl = fla[i]; afl << "P";
|
afl = fla[i]; afl << 'P';
|
||||||
real n = _ammpro.get_real(afl) * num / den;
|
real n = _ammpro.get_real(afl);
|
||||||
cce.arrotonda(n);
|
if (!n.is_zero() && num != den)
|
||||||
|
{
|
||||||
|
n = n * num / den;
|
||||||
|
cce.arrotonda(n);
|
||||||
|
}
|
||||||
movam.put(fla[i], n);
|
movam.put(fla[i], n);
|
||||||
}
|
}
|
||||||
rel.lfile(LF_MOVAM).rewrite();
|
rel.lfile(LF_MOVAM).rewrite();
|
||||||
@ -663,10 +671,12 @@ void TCespite::rip_jolly(TRelation& rel, const real& num, const real& den, int m
|
|||||||
void TCespite::rip_elem(TRelation& rel, int mode)
|
void TCespite::rip_elem(TRelation& rel, int mode)
|
||||||
{
|
{
|
||||||
log(TR("# Ripartizionamento importi in base agli elementi"));
|
log(TR("# Ripartizionamento importi in base agli elementi"));
|
||||||
const real num = rel.curr(LF_MOVCE).get_real(MOVCE_NUMELE);
|
|
||||||
const real den = _salpro.get_real(SALCE_NUMELE);
|
const real den = _salpro.get_real(SALCE_NUMELE);
|
||||||
if (den > ZERO)
|
if (den > ZERO)
|
||||||
|
{
|
||||||
|
const real num = rel.curr(LF_MOVCE).get_real(MOVCE_NUMELE);
|
||||||
rip_jolly(rel, num, den, mode);
|
rip_jolly(rel, num, den, mode);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
log(FR("! - Numero elementi non valido: %s"), den.string());
|
log(FR("! - Numero elementi non valido: %s"), den.string());
|
||||||
}
|
}
|
||||||
@ -676,10 +686,12 @@ void TCespite::rip_elem(TRelation& rel, int mode)
|
|||||||
void TCespite::rip_costo(TRelation& rel, int mode)
|
void TCespite::rip_costo(TRelation& rel, int mode)
|
||||||
{
|
{
|
||||||
log(TR("# Ripartizionamento importi in base al costo storico"));
|
log(TR("# Ripartizionamento importi in base al costo storico"));
|
||||||
const real num = rel.curr(LF_MOVCE).get_real(MOVCE_CSTO);
|
|
||||||
const real den = _salpro.get_real(SALCE_CSTO);
|
const real den = _salpro.get_real(SALCE_CSTO);
|
||||||
if (den > ZERO)
|
if (den > ZERO)
|
||||||
|
{
|
||||||
|
const real num = rel.curr(LF_MOVCE).get_real(MOVCE_CSTO);
|
||||||
rip_jolly(rel, num, den, mode);
|
rip_jolly(rel, num, den, mode);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
log(FR("! - Costo non valido: %s"), den.string());
|
log(FR("! - Costo non valido: %s"), den.string());
|
||||||
}
|
}
|
||||||
@ -747,7 +759,7 @@ real TCespite::calc_quota(const real& valamm, const real& perric,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Caso normale
|
// Caso normale
|
||||||
quota = valamm * perric / 100.0;
|
quota = valamm * perric / CENTO;
|
||||||
pereff = perric;
|
pereff = perric;
|
||||||
|
|
||||||
const TDitta_cespiti& cce = ditta_cespiti();
|
const TDitta_cespiti& cce = ditta_cespiti();
|
||||||
@ -778,7 +790,7 @@ real TCespite::calc_quota(const real& valamm, const real& perric,
|
|||||||
{
|
{
|
||||||
quota = residuo;
|
quota = residuo;
|
||||||
if (valamm > ZERO)
|
if (valamm > ZERO)
|
||||||
pereff = (quota * 100.0) / (coeff_durata * valamm);
|
pereff = (quota * CENTO) / (coeff_durata * valamm);
|
||||||
else
|
else
|
||||||
pereff = ZERO;
|
pereff = ZERO;
|
||||||
}
|
}
|
||||||
@ -794,7 +806,7 @@ real TCespite::calc_quote_perse(const real& valamm, const real& peric, const rea
|
|||||||
const TDitta_cespiti& cce = ditta_cespiti();
|
const TDitta_cespiti& cce = ditta_cespiti();
|
||||||
const real coeff_durata = cce.coefficiente_durata_esercizio();
|
const real coeff_durata = cce.coefficiente_durata_esercizio();
|
||||||
|
|
||||||
real quota = valamm * peric / 100.0 * coeff_durata;
|
real quota = valamm * peric / CENTO * coeff_durata;
|
||||||
if (mov_vend)
|
if (mov_vend)
|
||||||
{
|
{
|
||||||
TDate inies, fines;
|
TDate inies, fines;
|
||||||
@ -1328,8 +1340,6 @@ real TCespite::mov_val_ven(const TRectype& tmv)
|
|||||||
// Calcolo plusvalenza o minusvalenza
|
// Calcolo plusvalenza o minusvalenza
|
||||||
void TCespite::cal_valenza(const TRectype& tmv, const TRectype& tmvam, TRectype& ammmv)
|
void TCespite::cal_valenza(const TRectype& tmv, const TRectype& tmvam, TRectype& ammmv)
|
||||||
{
|
{
|
||||||
const TDitta_cespiti& dc = ditta_cespiti();
|
|
||||||
|
|
||||||
const real fondo = sum_fields(ammmv, AMMMV_QNOR, AMMMV_QACC, AMMMV_QANT) +
|
const real fondo = sum_fields(ammmv, AMMMV_QNOR, AMMMV_QACC, AMMMV_QANT) +
|
||||||
sum_fields(tmvam, MOVAM_QNOR, MOVAM_QACC, MOVAM_QANT);
|
sum_fields(tmvam, MOVAM_QNOR, MOVAM_QACC, MOVAM_QANT);
|
||||||
|
|
||||||
@ -1348,6 +1358,7 @@ void TCespite::cal_valenza(const TRectype& tmv, const TRectype& tmvam, TRectype&
|
|||||||
real plusminus = prezzo - resparven;
|
real plusminus = prezzo - resparven;
|
||||||
if (ratio > ZERO)
|
if (ratio > ZERO)
|
||||||
{
|
{
|
||||||
|
const TDitta_cespiti& dc = ditta_cespiti();
|
||||||
plusminus *= ratio;
|
plusminus *= ratio;
|
||||||
dc.arrotonda(plusminus);
|
dc.arrotonda(plusminus);
|
||||||
}
|
}
|
||||||
@ -1393,18 +1404,11 @@ void TCespite::scansione_movimenti(const TDate& data_limite, bool is_valid)
|
|||||||
|
|
||||||
TRelation rel(LF_MOVCE);
|
TRelation rel(LF_MOVCE);
|
||||||
|
|
||||||
TString expr; expr << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==\"" << _tipo_sit << '"';
|
|
||||||
rel.add(LF_MOVAM, expr);
|
|
||||||
rel.add(LF_AMMMV, expr);
|
|
||||||
|
|
||||||
TRectype& movsem = rel.curr();
|
TRectype& movsem = rel.curr();
|
||||||
TRectype& movam = rel.curr(LF_MOVAM);
|
const TString16 idcespite = get(CESPI_IDCESPITE);
|
||||||
TRectype& ammmv = rel.curr(LF_AMMMV);
|
|
||||||
const TString idcespite = get(CESPI_IDCESPITE);
|
|
||||||
movsem.put(MOVCE_IDCESPITE, idcespite);
|
movsem.put(MOVCE_IDCESPITE, idcespite);
|
||||||
TString filtro;
|
TString filtro;
|
||||||
filtro << "(IDRET==\"\")";
|
filtro << "(IDRET==\"\")&&(ANSI(DTMOV)>=\"" << inies.string(ANSI) << "\")";
|
||||||
filtro << "&&(ANSI(DTMOV)>=\"" << inies.string(ANSI) << "\")";
|
|
||||||
if (data_limite.ok())
|
if (data_limite.ok())
|
||||||
filtro << "&&(ANSI(DTMOV)<=\"" << data_limite.string(ANSI) << "\")";
|
filtro << "&&(ANSI(DTMOV)<=\"" << data_limite.string(ANSI) << "\")";
|
||||||
TCursor cur(&rel, filtro, 2, &movsem, &movsem);
|
TCursor cur(&rel, filtro, 2, &movsem, &movsem);
|
||||||
@ -1412,7 +1416,14 @@ void TCespite::scansione_movimenti(const TDate& data_limite, bool is_valid)
|
|||||||
if (items > 0) // Continua solo se esistono movimenti
|
if (items > 0) // Continua solo se esistono movimenti
|
||||||
{
|
{
|
||||||
cur.freeze();
|
cur.freeze();
|
||||||
|
|
||||||
|
// Aggiungo astutamente solo ora i file alla relazione
|
||||||
|
TString expr; expr << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==\"" << _tipo_sit << '"';
|
||||||
|
rel.add(LF_MOVAM, expr);
|
||||||
|
rel.add(LF_AMMMV, expr);
|
||||||
|
TRectype& movam = rel.curr(LF_MOVAM);
|
||||||
|
TRectype& ammmv = rel.curr(LF_AMMMV);
|
||||||
|
|
||||||
// Creo record campione per totale movimento + relative rettifiche
|
// Creo record campione per totale movimento + relative rettifiche
|
||||||
TVariable_rectype tmv(LF_MOVCE);
|
TVariable_rectype tmv(LF_MOVCE);
|
||||||
tmv.add_field(new TVariable_field("VSPMANU"));
|
tmv.add_field(new TVariable_field("VSPMANU"));
|
||||||
@ -1828,7 +1839,7 @@ bool TCespite::calc_amm(int tipo_sit, const TDate& data_limite, bool recalc_spe_
|
|||||||
log(FR("* Inizio calcolo situazione %d cespite %s"), tipo_sit, (const char*)idcespite);
|
log(FR("* Inizio calcolo situazione %d cespite %s"), tipo_sit, (const char*)idcespite);
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
if (tipo_sit == 1 && atol(idcespite) == 229L)
|
if (tipo_sit == 1 && atol(idcespite) == 1L)
|
||||||
{
|
{
|
||||||
tipo_sit = 1; // Put your breakpoint here
|
tipo_sit = 1; // Put your breakpoint here
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,12 @@ bool TOpenesc_mask::check_oldes()
|
|||||||
msg << TR("è già stata effettuata la chiusura");
|
msg << TR("è già stata effettuata la chiusura");
|
||||||
const TString8 codatt = ccb.get("CODTAB").mid(4);
|
const TString8 codatt = ccb.get("CODTAB").mid(4);
|
||||||
msg << TR("\ndell'attività ") << cache().get("%CAT", codatt, "S0");
|
msg << TR("\ndell'attività ") << cache().get("%CAT", codatt, "S0");
|
||||||
|
#ifdef DBG
|
||||||
|
msg << "\nSi desidera forzare la riapertura?";
|
||||||
|
ok = yesno_box(msg);
|
||||||
|
#else
|
||||||
ok = error_box(msg);
|
ok = error_box(msg);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +86,11 @@ bool TOpenesc_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
|||||||
if (e == fe_init || e == fe_modify)
|
if (e == fe_init || e == fe_modify)
|
||||||
{
|
{
|
||||||
TEsercizi_contabili esc;
|
TEsercizi_contabili esc;
|
||||||
const int nes = get_int(F_OLDES)+1;
|
const int oldes = get_int(F_OLDES);
|
||||||
|
int nes = esc.next(oldes);
|
||||||
|
if (nes < 0)
|
||||||
|
nes = oldes+1;
|
||||||
|
|
||||||
set(F_NEWES, nes, TRUE);
|
set(F_NEWES, nes, TRUE);
|
||||||
if (esc.exist(nes))
|
if (esc.exist(nes))
|
||||||
{
|
{
|
||||||
@ -168,37 +177,35 @@ bool TOpenesc::crea_esercizio(int oldes, int newes, const TDate& ies, const TDat
|
|||||||
{
|
{
|
||||||
// Crea l'esercizio contabile se necessario
|
// Crea l'esercizio contabile se necessario
|
||||||
TTable esc("ESC");
|
TTable esc("ESC");
|
||||||
esc.put("CODTAB", newes);
|
TString4 key_new;
|
||||||
|
key_new.format("%04d",newes);
|
||||||
|
esc.put("CODTAB", key_new);
|
||||||
if (esc.read() != NOERR)
|
if (esc.read() != NOERR)
|
||||||
{
|
{
|
||||||
if (!has_module(CGAUT))
|
if (!has_module(CGAUT))
|
||||||
{
|
{
|
||||||
TTable esc("ESC");
|
esc.zero();
|
||||||
esc.put("CODTAB", newes);
|
esc.put("CODTAB", key_new);
|
||||||
if (esc.read() != NOERR)
|
esc.put("D0", ies);
|
||||||
{
|
esc.put("D1", fes);
|
||||||
esc.zero();
|
esc.write();
|
||||||
esc.put("CODTAB", newes);
|
|
||||||
esc.put("D0", ies);
|
|
||||||
esc.put("D1", fes);
|
|
||||||
esc.write();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return error_box(TR("Attenzione: non esiste ancora l'esercizio contabile %04d"), newes);
|
return error_box(TR("Attenzione: non esiste ancora l'esercizio contabile %04d"), newes);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crea l'esercizio cespiti se necessario
|
// Crea l'esercizio cespiti se necessario
|
||||||
TTable cce("CCE");
|
TString4 key_old;
|
||||||
TString8 key; key.format("%04d", oldes);
|
key_old.format("%04d", oldes);
|
||||||
const TRectype& oldrec = cache().get("CCE", key);
|
const TRectype& oldrec = cache().get("CCE", key_old);
|
||||||
cce.put("CODTAB", newes);
|
|
||||||
|
TTable cce("CCE");
|
||||||
|
cce.put("CODTAB", key_new);
|
||||||
const bool found = cce.read() == NOERR;
|
const bool found = cce.read() == NOERR;
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
cce.zero();
|
cce.zero();
|
||||||
cce.put("CODTAB", newes);
|
cce.put("CODTAB", key_new);
|
||||||
}
|
}
|
||||||
cce.put("S5", calc_coeff(ies, fes)); // Calcola coefficiente durata esercizio
|
cce.put("S5", calc_coeff(ies, fes)); // Calcola coefficiente durata esercizio
|
||||||
cce.put("S6", oldrec.get("S6")); // Copia tipo arrotondamento
|
cce.put("S6", oldrec.get("S6")); // Copia tipo arrotondamento
|
||||||
@ -353,7 +360,9 @@ void TOpenesc::crea_saldi(int oldes, int newes) const
|
|||||||
|
|
||||||
const int err = rel.write();
|
const int err = rel.write();
|
||||||
if (err != NOERR) // Should never happen!
|
if (err != NOERR) // Should never happen!
|
||||||
|
{
|
||||||
rel.rewrite();
|
rel.rewrite();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,9 +377,11 @@ void TOpenesc::incr_zero(TRectype& rec, const char* val, const char* valp) const
|
|||||||
void TOpenesc::crea_ammortamenti(int oldes, int newes) const
|
void TOpenesc::crea_ammortamenti(int oldes, int newes) const
|
||||||
{
|
{
|
||||||
TRelation rel(LF_AMMCE);
|
TRelation rel(LF_AMMCE);
|
||||||
|
|
||||||
rel.add(LF_AMMCE, "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==1|TPAMM==TPAMM", 1, 0, 883);
|
rel.add(LF_AMMCE, "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==1|TPAMM==TPAMM", 1, 0, 883);
|
||||||
TRectype& rec = rel.curr();
|
|
||||||
const TRectype& ammce1 = rel.curr(-883);
|
const TRectype& ammce1 = rel.curr(-883);
|
||||||
|
|
||||||
|
TRectype& rec = rel.curr();
|
||||||
TString str;
|
TString str;
|
||||||
str << '(' << SALCE_CODES << "==" << oldes << ")&&(" << SALCE_TPSALDO << "==2)";
|
str << '(' << SALCE_CODES << "==" << oldes << ")&&(" << SALCE_TPSALDO << "==2)";
|
||||||
TCursor cur(&rel, str);
|
TCursor cur(&rel, str);
|
||||||
@ -386,7 +397,9 @@ void TOpenesc::crea_ammortamenti(int oldes, int newes) const
|
|||||||
rec.zero(AMMCE_CSCEN);
|
rec.zero(AMMCE_CSCEN);
|
||||||
rec.zero(AMMCE_FZPER);
|
rec.zero(AMMCE_FZPER);
|
||||||
rec.zero(AMMCE_FZQUO);
|
rec.zero(AMMCE_FZQUO);
|
||||||
rec.put(AMMCE_PNOR, ammce1.get(AMMCE_PNOR));
|
// Le percentuali del nuovo esercizio devono essere uguali a quelle FINALI dell'esercizio precedente
|
||||||
|
// Purtroppo sono sempre a zero per cui prendo quelle INIZIALI
|
||||||
|
rec.put(AMMCE_PNOR, ammce1.get(AMMCE_PNOR));
|
||||||
rec.put(AMMCE_PACC, ammce1.get(AMMCE_PACC));
|
rec.put(AMMCE_PACC, ammce1.get(AMMCE_PACC));
|
||||||
rec.put(AMMCE_PANT, ammce1.get(AMMCE_PANT));
|
rec.put(AMMCE_PANT, ammce1.get(AMMCE_PANT));
|
||||||
incr_zero(rec, AMMCE_QNOR, AMMCE_QNORP);
|
incr_zero(rec, AMMCE_QNOR, AMMCE_QNORP);
|
||||||
@ -428,4 +441,4 @@ int ce2200(int argc, char* argv[])
|
|||||||
TOpenesc a;
|
TOpenesc a;
|
||||||
a.run(argc, argv, TR("Cambio esercizio"));
|
a.run(argc, argv, TR("Cambio esercizio"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -26,6 +26,7 @@ END
|
|||||||
NUMBER F_OLDES 4
|
NUMBER F_OLDES 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Esercizio corrente "
|
PROMPT 2 3 "Esercizio corrente "
|
||||||
|
FLAGS "Z"
|
||||||
USE CCE
|
USE CCE
|
||||||
JOIN ESC ALIAS 2 INTO CODTAB==CODTAB
|
JOIN ESC ALIAS 2 INTO CODTAB==CODTAB
|
||||||
INPUT CODTAB F_OLDES
|
INPUT CODTAB F_OLDES
|
||||||
@ -36,6 +37,7 @@ BEGIN
|
|||||||
OUTPUT F_OLDINIZIO 2@->D0
|
OUTPUT F_OLDINIZIO 2@->D0
|
||||||
OUTPUT F_OLDFINE 2@->D1
|
OUTPUT F_OLDFINE 2@->D1
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
|
FLAGS "Z"
|
||||||
WARNING "Inserire un esercizio valido"
|
WARNING "Inserire un esercizio valido"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -54,6 +56,7 @@ END
|
|||||||
NUMBER F_NEWES 4
|
NUMBER F_NEWES 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Nuovo esercizio "
|
PROMPT 2 4 "Nuovo esercizio "
|
||||||
|
FLAGS "Z"
|
||||||
USE ESC
|
USE ESC
|
||||||
INPUT CODTAB F_OLDES
|
INPUT CODTAB F_OLDES
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
@ -63,6 +66,7 @@ BEGIN
|
|||||||
OUTPUT F_NEWINIZIO D0
|
OUTPUT F_NEWINIZIO D0
|
||||||
OUTPUT F_NEWFINE D1
|
OUTPUT F_NEWFINE D1
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
|
FLAGS "Z"
|
||||||
GROUP 2
|
GROUP 2
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -349,16 +349,17 @@ void TStampa_prospetto::aggiorna_totali(TCursor& cur, const int tipo, TTipo_cesp
|
|||||||
real riv83 = recsalce.get_real(SALCE_RIV83);
|
real riv83 = recsalce.get_real(SALCE_RIV83);
|
||||||
real riv90 = recsalce.get_real(SALCE_RIV90);
|
real riv90 = recsalce.get_real(SALCE_RIV90);
|
||||||
real riv91 = recsalce.get_real(SALCE_RIV91);
|
real riv91 = recsalce.get_real(SALCE_RIV91);
|
||||||
|
real riv = riv75+riv83+riv90+riv91;
|
||||||
|
|
||||||
if (tipo == 1)
|
if (tipo == 1)
|
||||||
{
|
{
|
||||||
real rivgf = recsalce.get_real(SALCE_RIVGF);
|
const real rivgf = recsalce.get_real(SALCE_RIVGF);
|
||||||
_cat._tot_riv += riv75 + riv83 + riv90 + riv91 + rivgf;
|
_cat._tot_riv += riv + rivgf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
real rivgc = recsalce.get_real(SALCE_RIVGC);
|
const real rivgc = recsalce.get_real(SALCE_RIVGC);
|
||||||
_cat._tot_riv += riv75 + riv83 + riv90 + riv91 + rivgc;
|
_cat._tot_riv += riv + rivgc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// valori della riga 2 (e, giá che si fa la scansione dei movimenti, anche i valori dei movam della riga 3)
|
// valori della riga 2 (e, giá che si fa la scansione dei movimenti, anche i valori dei movam della riga 3)
|
||||||
@ -400,6 +401,7 @@ void TStampa_prospetto::aggiorna_totali(TCursor& cur, const int tipo, TTipo_cesp
|
|||||||
riv83 = mov.get_real(MOVCE_RIV83);
|
riv83 = mov.get_real(MOVCE_RIV83);
|
||||||
riv90 = mov.get_real(MOVCE_RIV90);
|
riv90 = mov.get_real(MOVCE_RIV90);
|
||||||
riv91 = mov.get_real(MOVCE_RIV91);
|
riv91 = mov.get_real(MOVCE_RIV91);
|
||||||
|
riv = riv75+riv83+riv90+riv91;
|
||||||
csto = mov.get_real(MOVCE_CSTO);
|
csto = mov.get_real(MOVCE_CSTO);
|
||||||
// inquietante modo di selezionare la rivg (rivgf o rivgc) in base al tipo senza usare una if else!
|
// inquietante modo di selezionare la rivg (rivgf o rivgc) in base al tipo senza usare una if else!
|
||||||
real rivg = mov.get_real(tipo == 1 ? MOVCE_RIVGF : MOVCE_RIVGC);
|
real rivg = mov.get_real(tipo == 1 ? MOVCE_RIVGF : MOVCE_RIVGC);
|
||||||
@ -409,15 +411,15 @@ void TStampa_prospetto::aggiorna_totali(TCursor& cur, const int tipo, TTipo_cesp
|
|||||||
real qant = amm.get_real(MOVAM_QANT);
|
real qant = amm.get_real(MOVAM_QANT);
|
||||||
|
|
||||||
if (tmc == 'R')
|
if (tmc == 'R')
|
||||||
_cat._tot_riveser += (riv75 + riv83 + riv90 + riv91 + rivg) * signum;
|
_cat._tot_riveser += (riv + rivg) * signum;
|
||||||
if (tmc == 'I' || (tmc <= ' ' && segno == '+'))
|
if (tmc == 'I' || (tmc <= ' ' && segno == '+'))
|
||||||
{
|
{
|
||||||
_cat._tot_acqincr += (csto - vnonamm2 + riv75 + riv83 + riv90 + riv91 + rivg) * signum;
|
_cat._tot_acqincr += (csto - vnonamm2 + riv + rivg) * signum;
|
||||||
_cat._tot_incr += (qnor + qacc + qant) * signum;
|
_cat._tot_incr += (qnor + qacc + qant) * signum;
|
||||||
}
|
}
|
||||||
if (tmc == 'E' || (tmc <= ' ' && segno == '-'))
|
if (tmc == 'E' || (tmc <= ' ' && segno == '-'))
|
||||||
{
|
{
|
||||||
_cat._tot_cesselim2 += (csto - vnonamm2 + riv75 + riv83 + riv90 + riv91 + rivg) * (-signum);
|
_cat._tot_cesselim2 += (csto - vnonamm2 + riv + rivg) * (-signum);
|
||||||
_cat._tot_cesselim3 += (qnor + qant + qacc) * (-signum);
|
_cat._tot_cesselim3 += (qnor + qant + qacc) * (-signum);
|
||||||
}
|
}
|
||||||
if (tmc == 'P')
|
if (tmc == 'P')
|
||||||
|
21
ce/celib.cpp
21
ce/celib.cpp
@ -170,13 +170,16 @@ void TDitta_cespiti::init_mask(TMask& m)
|
|||||||
// Arrotonda un numero in base ai parametri ditta
|
// Arrotonda un numero in base ai parametri ditta
|
||||||
void TDitta_cespiti::arrotonda(real& n) const
|
void TDitta_cespiti::arrotonda(real& n) const
|
||||||
{
|
{
|
||||||
const char tipo = _cce.get_char("S6");
|
if (!n.is_zero())
|
||||||
const int dec = TCurrency::get_firm_dec();
|
|
||||||
switch (tipo)
|
|
||||||
{
|
{
|
||||||
case '+': n.ceil(dec); break;
|
const char tipo = _cce.get_char("S6");
|
||||||
case '-': n.floor(dec); break;
|
const int dec = TCurrency::get_firm_dec();
|
||||||
default : n.round(dec); break;
|
switch (tipo)
|
||||||
|
{
|
||||||
|
case '+': n.ceil(dec); break;
|
||||||
|
case '-': n.floor(dec); break;
|
||||||
|
default : n.round(dec); break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,14 +241,14 @@ static bool cac_filter_func(const TRelation* rel)
|
|||||||
{
|
{
|
||||||
const TString& grsp = rel->curr().get("CODTAB");
|
const TString& grsp = rel->curr().get("CODTAB");
|
||||||
if (grsp[0] == ' ')
|
if (grsp[0] == ' ')
|
||||||
return TRUE;
|
return true;
|
||||||
return _cac_filter.compare(grsp, 6) == 0;
|
return _cac_filter.compare(grsp, 6) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TDitta_cespiti::on_category_event(TOperable_field& o, TField_event e, long jolly)
|
bool TDitta_cespiti::on_category_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
{
|
{
|
||||||
if (e != fe_init && e != fe_modify && e != fe_button && e != fe_close)
|
if (e != fe_init && e != fe_modify && e != fe_button && e != fe_close)
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
TEdit_field& fld = (TEdit_field&)o;
|
TEdit_field& fld = (TEdit_field&)o;
|
||||||
const bool by_code = fld.is_kind_of(CLASS_REAL_FIELD);
|
const bool by_code = fld.is_kind_of(CLASS_REAL_FIELD);
|
||||||
@ -326,7 +329,7 @@ bool TDitta_cespiti::on_category_event(TOperable_field& o, TField_event e, long
|
|||||||
return fld.error_box(fld.get_warning());
|
return fld.error_box(fld.get_warning());
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inizializza una ditta cespiti vuota
|
// Inizializza una ditta cespiti vuota
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Categorie cespiti
|
|
||||||
1|@0g%s|Gruppo
|
|
||||||
1|@7g%s|Specie
|
|
||||||
1|@14g%s|Cat.
|
|
||||||
1|@19g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,2]|@0g@2s
|
|
||||||
1|CODTAB[3,6]|@7g@4s
|
|
||||||
1|CODTAB[7,8]|@14g@2s
|
|
||||||
1|S0|@19g@60,ls
|
|
@ -1,11 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Attivita' cespiti
|
|
||||||
1|@0g%s|Gruppo
|
|
||||||
1|@7g%s|Specie
|
|
||||||
1|@14g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,2]|@0g@2s
|
|
||||||
1|CODTAB[3,6]|@7g@4s
|
|
||||||
1|S0|@14g@60,ls
|
|
28
ce/cetbccb.h
28
ce/cetbccb.h
@ -1,20 +1,20 @@
|
|||||||
// campi maschera cetbccb.msk
|
// campi maschera cetbccb.msk
|
||||||
|
|
||||||
#define F_CODESER_CCB 101
|
#define F_CODESER_CCB 101
|
||||||
#define F_DATAINI_CCB 102
|
#define F_DATAINI_CCB 102
|
||||||
#define F_DATAFINE_CCB 103
|
#define F_DATAFINE_CCB 103
|
||||||
#define F_DESCRSP_CCB 104
|
#define F_DESCRSP_CCB 104
|
||||||
#define F_CODGR_CCB 105
|
#define F_CODGR_CCB 105
|
||||||
#define F_DESCRGR_CCB 106
|
#define F_DESCRGR_CCB 106
|
||||||
#define F_CODSP_CCB 107
|
#define F_CODSP_CCB 107
|
||||||
#define F_CODATT_CCB 108
|
#define F_CODATT_CCB 108
|
||||||
|
|
||||||
#define F_LEASING 110
|
#define F_LEASING 110
|
||||||
#define F_BOLLATO 111
|
#define F_BOLLATO 111
|
||||||
#define F_MOV_GEN 112
|
#define F_MOV_GEN 112
|
||||||
#define F_CHIUSO 113
|
#define F_CHIUSO 113
|
||||||
|
|
||||||
#define F_ANNOREG 115
|
#define F_ANNOREG 115
|
||||||
#define F_CODREG 116
|
#define F_CODREG 116
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Esercizi/Gruppi/Specie
|
|
||||||
1|@0g%s|Es.
|
|
||||||
1|@5g%s|Gruppo
|
|
||||||
1|@12g%s|Specie
|
|
||||||
1|@19g%s|Leasing
|
|
||||||
1|@28g%s|Boll.st.
|
|
||||||
1|@37g%s|Mov.gen.
|
|
||||||
1|@46g%s|Chiuso
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[1,4]|@0g@4s
|
|
||||||
1|CODTAB[5,6]|@5g@2s
|
|
||||||
1|CODTAB[7,10]|@12g@4s
|
|
||||||
1|B0|@19g@f
|
|
||||||
1|B1|@28g@f
|
|
||||||
1|B3|@37g@f
|
|
||||||
1|B2|@46g@f
|
|
@ -1,38 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Esercizi cespiti
|
|
||||||
1|@0g%s|Eser.
|
|
||||||
1|@6g%s|Tipo cont.
|
|
||||||
1|@19g%s|Es.corr.
|
|
||||||
1|@28g%s|Prof.
|
|
||||||
1|@34g%s|Es.di cost.
|
|
||||||
1|@46g%s|Rinvio
|
|
||||||
1|@53g%s|Art.14
|
|
||||||
1|@60g%s|Arrotond.
|
|
||||||
1|@73g%s|Tipo rip.
|
|
||||||
2|@6g%s|Amm.parti vend.
|
|
||||||
2|@22g%s|Ragguaglio
|
|
||||||
2|@33g%s|Esposizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@0g@4s
|
|
||||||
1|I0|@7g@12t
|
|
||||||
1|B6|@19g@f
|
|
||||||
1|B0|@28g@f
|
|
||||||
1|B1|@34g@f
|
|
||||||
1|B2|@46g@f
|
|
||||||
1|B7|@53g@f
|
|
||||||
1|S6|@60g@12t
|
|
||||||
1|I1|@73g@8t
|
|
||||||
2|B3|@6g@f
|
|
||||||
2|B4|@22g@f
|
|
||||||
2|B5|@33g@f
|
|
||||||
|
|
||||||
[Translations]
|
|
||||||
5|I0|1|Ordinaria
|
|
||||||
5|I0|2|Semplificata
|
|
||||||
5|S6|/|alla lira
|
|
||||||
5|S6|+|per eccesso
|
|
||||||
5|S6|-|per difetto
|
|
||||||
5|I1|1|a mesi
|
|
||||||
5|I1|2|a giorni
|
|
@ -1,9 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Gruppi cespiti
|
|
||||||
1|@0g%s|Cod.
|
|
||||||
1|@4g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@0g@2s
|
|
||||||
1|S0|@4g@60,ls
|
|
@ -1,9 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Impianti cespiti
|
|
||||||
1|@0g%s|Codice
|
|
||||||
1|@11g%s|Descrizione
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@0g@10s
|
|
||||||
1|S0|@11g@60,ls
|
|
@ -1,19 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Limiti cespiti
|
|
||||||
1|@0g%s|G.
|
|
||||||
1|@3g%s|M.
|
|
||||||
1|@6g%s|Anno
|
|
||||||
1|@11g%s| Autovetture
|
|
||||||
1|@27g%s| Autocaravan
|
|
||||||
1|@43g%s| Motocicli
|
|
||||||
1|@59g%s| Ciclomotori
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB[7,8]|@0g@2s
|
|
||||||
1|CODTAB[5,6]|@3g@2s
|
|
||||||
1|CODTAB[1,4]|@6g@4s
|
|
||||||
1|R0|@11g@15,rn
|
|
||||||
1|R1|@27g@15,rn
|
|
||||||
1|R2|@43g@15,rn
|
|
||||||
1|R3|@59g@15,rn
|
|
@ -1,20 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
132
|
|
||||||
Tabella Localizzazioni cespiti
|
|
||||||
1|@0g%s|Codice
|
|
||||||
1|@11g%s|Stabilimento
|
|
||||||
1|@62g%s|Reparto
|
|
||||||
1|@113g%s|U.loc.
|
|
||||||
2|@11g%s|Ufficio
|
|
||||||
2|@62g%s|Persona di riferimento
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@0g@10s
|
|
||||||
1|S0|@11g@50,ls
|
|
||||||
1|S1|@62g@50,ls
|
|
||||||
1|I0|@113g@3n
|
|
||||||
2|S2|@11g@50,ls
|
|
||||||
2|S3|@62g@50,ls
|
|
||||||
|
|
||||||
[Footers]
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
[Headers]
|
|
||||||
80
|
|
||||||
Tabella Tipi movimento cespiti
|
|
||||||
2|@0g%s|Cod.
|
|
||||||
2|@4g%s|Descrizione
|
|
||||||
2|@55g%s|Tipo gen.
|
|
||||||
1|@66g%s|Applicabile a
|
|
||||||
2|@65g%s|B.m.
|
|
||||||
2|@70g%s|B.i.
|
|
||||||
2|@75g%s|C.p.
|
|
||||||
3|@4g%s|Segni
|
|
||||||
3|@10g%s|Tipo mov. da rett.
|
|
||||||
3|@29g%s|Gen.nuovo ce.
|
|
||||||
3|@43g%s|Amm.sul mov.
|
|
||||||
3|@56g%s|Gen.plus/min
|
|
||||||
3|@69g%s|Tot.pr.bil.
|
|
||||||
4|@4g%s|Doc.
|
|
||||||
4|@9g%s|I.ven.
|
|
||||||
4|@16g%s|El.
|
|
||||||
4|@20g%s|C.st.
|
|
||||||
4|@26g%s|V.non a.
|
|
||||||
4|@35g%s|Pl.re.
|
|
||||||
4|@42g%s|R.leg.
|
|
||||||
4|@49g%s|R.g.f.
|
|
||||||
4|@56g%s|R.g.c.
|
|
||||||
4|@63g%s|F.a.f.
|
|
||||||
4|@70g%s|F.a.c.
|
|
||||||
4|@77g%s|Q.p.
|
|
||||||
|
|
||||||
[Rows]
|
|
||||||
1|CODTAB|@0g@1s
|
|
||||||
1|S0|@4g@50,ls
|
|
||||||
1|I0|@55g@9t
|
|
||||||
1|B0|@65g@f
|
|
||||||
1|B1|@70g@f
|
|
||||||
1|B2|@75g@f
|
|
||||||
2|S7|@4g@1t
|
|
||||||
2|S8|@10g@1s
|
|
||||||
2|B3|@29g@f
|
|
||||||
2|B4|@43g@f
|
|
||||||
2|B5|@56g@f
|
|
||||||
2|S6|@56g@15t
|
|
||||||
3|S5[1,1]|@4g@1s
|
|
||||||
3|S5[3,3]|@9g@1s
|
|
||||||
3|S5[4,4]|@16g@1s
|
|
||||||
3|S5[5,5]|@20g@1s
|
|
||||||
3|S5[6,6]|@26g@1s
|
|
||||||
3|S5[7,7]|@35g@1s
|
|
||||||
3|S5[8,8]|@42g@1s
|
|
||||||
3|S5[9,9]|@49g@1s
|
|
||||||
3|S5[10,10]|@56g@1s
|
|
||||||
3|S5[11,11]|@63g@1s
|
|
||||||
3|S5[12,12]|@70g@1s
|
|
||||||
3|S5[13,13]|@77g@1s
|
|
||||||
|
|
||||||
[Translations]
|
|
||||||
4|I0|1|Movimento
|
|
||||||
4|I0|2|Rettifica
|
|
||||||
4|S7|0|+
|
|
||||||
4|S7|1|-
|
|
||||||
4|S7|2|=
|
|
||||||
4|S6| |Nessuno"
|
|
||||||
4|S6|I|Incremento"
|
|
||||||
4|S6|E|Eliminazione"
|
|
||||||
4|S6|P|Plusvalenza"
|
|
||||||
4|S6|R|Rivalutazione"
|
|
@ -766,11 +766,11 @@ void TClifo_application::indsp_sheet_rebuilder()
|
|||||||
{
|
{
|
||||||
TClifo_application& a = app();
|
TClifo_application& a = app();
|
||||||
TString_array& righe = a.indsp_sheet().rows_array();
|
TString_array& righe = a.indsp_sheet().rows_array();
|
||||||
const int n=righe.items();
|
const int n = righe.items();
|
||||||
a.reset_sheet();
|
a.reset_sheet();
|
||||||
// Rebuild Sheets
|
// Rebuild Sheets
|
||||||
TToken_string rigav;
|
TToken_string rigav;
|
||||||
for (int i=0; i<n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
TToken_string& riga= righe.row(i);
|
TToken_string& riga= righe.row(i);
|
||||||
rigav.format("%d", i+1);
|
rigav.format("%d", i+1);
|
||||||
@ -788,24 +788,24 @@ bool TClifo_application::indsp_notify(TSheet_field& indsp, int r, KEY key)
|
|||||||
{
|
{
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case K_INS:
|
case K_CTRL + K_INS:
|
||||||
// request to add the row #r
|
// request to add the row #r
|
||||||
// To avoid rewriting of existing record.
|
// To avoid rewriting of existing record.
|
||||||
// To avoid inserts in the middle of the sheet
|
// To avoid inserts in the middle of the sheet
|
||||||
if (r != -1 && indsp.items() > (r+1))
|
if (r != -1 && indsp.items() > (r+1))
|
||||||
{
|
return error_box(TR("Si possono aggiungere indirizzi solo alla fine!"));
|
||||||
error_box(TR("Si possono aggiungere indirizzi solo alla fine"));
|
break;
|
||||||
return FALSE; //Refuse permission
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
case K_DEL:
|
|
||||||
indsp_sheet_rebuilder();
|
indsp_sheet_rebuilder();
|
||||||
break;
|
break;
|
||||||
default:
|
case K_DEL:
|
||||||
break;
|
if (r < indsp.items() - 1)
|
||||||
}
|
return error_box(TR("Si puo' eliminare solo l'ultimo indirizzo!"));
|
||||||
return TRUE;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TClifo_application::effetti_notify(TSheet_field& pnae, int r, KEY key)
|
bool TClifo_application::effetti_notify(TSheet_field& pnae, int r, KEY key)
|
||||||
|
@ -90,8 +90,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata
|
// @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata
|
||||||
virtual bool check_autorization() const
|
virtual bool check_autorization() const { return false; }
|
||||||
{return FALSE;}
|
|
||||||
tipo_descr _tipo_des; // Il tipo di causale corrente
|
tipo_descr _tipo_des; // Il tipo di causale corrente
|
||||||
|
|
||||||
void compila_array (const TString&, int, int, int);
|
void compila_array (const TString&, int, int, int);
|
||||||
@ -99,7 +98,7 @@ public:
|
|||||||
TSheet_field& ss() const { return *_sheet; }
|
TSheet_field& ss() const { return *_sheet; }
|
||||||
TMask& ss_mask() const { return _sheet->sheet_mask(); }
|
TMask& ss_mask() const { return _sheet->sheet_mask(); }
|
||||||
|
|
||||||
void add_riga (int numrig, char sz, TBill& tc, const TString& d, const TString& da);
|
void add_riga (int numrig, char sz, const TBill& tc, const TString& d, const TString& da);
|
||||||
bool mostra_campi();
|
bool mostra_campi();
|
||||||
|
|
||||||
bool valuta() const { return _valuta; }
|
bool valuta() const { return _valuta; }
|
||||||
@ -113,7 +112,7 @@ HIDDEN TCaus_app& app() { return (TCaus_app&) main_app(); }
|
|||||||
|
|
||||||
bool TCaus_app::filtra_reg(const TRelation * r)
|
bool TCaus_app::filtra_reg(const TRelation * r)
|
||||||
{
|
{
|
||||||
const TRectype& rec = r->lfile().curr();
|
const TRectype& rec = r->curr();
|
||||||
const int anno = atoi(rec.get("CODTAB").left(4));
|
const int anno = atoi(rec.get("CODTAB").left(4));
|
||||||
|
|
||||||
bool ok = anno == app().anno_iva();
|
bool ok = anno == app().anno_iva();
|
||||||
@ -178,10 +177,10 @@ void TCaus_app::clear_descr()
|
|||||||
{
|
{
|
||||||
if (_tipo_des != no_descr)
|
if (_tipo_des != no_descr)
|
||||||
{
|
{
|
||||||
TArray& a = ss().rows_array();
|
TString_array& a = ss().rows_array();
|
||||||
for (int i = 0; i < a.items(); i++)
|
for (int i = 0; i < a.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string& r = (TToken_string&)a[i];
|
TToken_string& r = a.row(i);
|
||||||
r.add("", 0);
|
r.add("", 0);
|
||||||
}
|
}
|
||||||
_tipo_des = no_descr;
|
_tipo_des = no_descr;
|
||||||
@ -676,7 +675,7 @@ int TCaus_app::read(TMask& m)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCaus_app::add_riga(int numrig, char sz, TBill& tc, const TString& d, const TString& da)
|
void TCaus_app::add_riga(int numrig, char sz, const TBill& tc, const TString& d, const TString& da)
|
||||||
{
|
{
|
||||||
TToken_string& riga = ss().row(numrig);
|
TToken_string& riga = ss().row(numrig);
|
||||||
riga = riga.get(0); // Lascia invariata la descrizione ...
|
riga = riga.get(0); // Lascia invariata la descrizione ...
|
||||||
@ -689,26 +688,21 @@ void TCaus_app::add_riga(int numrig, char sz, TBill& tc, const TString& d, const
|
|||||||
|
|
||||||
void TCaus_app::load_rcaus(TMask& m)
|
void TCaus_app::load_rcaus(TMask& m)
|
||||||
{
|
{
|
||||||
const TString16 cod(_rel->lfile().get(RCA_CODCAUS));
|
|
||||||
TString d, da(50);
|
|
||||||
|
|
||||||
ss().destroy();
|
ss().destroy();
|
||||||
|
|
||||||
const int last = _rcaus_rec->last_row();
|
const int last = _rcaus_rec->last_row();
|
||||||
for (int i = 1; i <= last; i++)
|
for (int i = 1; i <= last; i++)
|
||||||
{
|
{
|
||||||
TRectype & r = _rcaus_rec->row(i, TRUE);
|
const TRectype & r = _rcaus_rec->row(i, TRUE);
|
||||||
const char sz = r.get_char(RCA_SEZIONE);
|
const char sz = r.get_char(RCA_SEZIONE);
|
||||||
const char cf = r.get_char(RCA_TIPOCF);
|
const char cf = r.get_char(RCA_TIPOCF);
|
||||||
const int g = r.get_int(RCA_GRUPPO);
|
const int g = r.get_int(RCA_GRUPPO);
|
||||||
const int c = r.get_int(RCA_CONTO);
|
const int c = r.get_int(RCA_CONTO);
|
||||||
const long s = r.get_long(RCA_SOTTOCONTO);
|
const long s = r.get_long(RCA_SOTTOCONTO);
|
||||||
d = r.get(RCA_CODDESC);
|
const TString8 d = r.get(RCA_CODDESC);
|
||||||
da.cut(0);
|
const TString& da = cache().get("%DPN", d, "S0");
|
||||||
if (d.not_empty())
|
|
||||||
da = cache().get("%DPN", d, "S0");
|
|
||||||
|
|
||||||
TBill tc(g,c,s,cf);
|
const TBill tc(g,c,s,cf);
|
||||||
add_riga(i-1, sz, tc, d, da);
|
add_riga(i-1, sz, tc, d, da);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
#define F_DES_DOC 128
|
#define F_DES_DOC 128
|
||||||
#define F_DES_REG 129
|
#define F_DES_REG 129
|
||||||
#define F_MOVIND 130
|
#define F_MOVIND 130
|
||||||
#define F_SOLAIVA 131
|
#define F_SOLAIVA 131
|
||||||
|
#define F_PROVV 132
|
||||||
|
|
||||||
#define SS_SEZIONE 102
|
#define SS_SEZIONE 102
|
||||||
#define SS_TIPOCF 103
|
#define SS_TIPOCF 103
|
||||||
|
@ -70,8 +70,8 @@ BEGIN
|
|||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
ADD NONE
|
ADD NONE
|
||||||
MESSAGE EMPTY CLEAR,F_SOLAIVA
|
MESSAGE EMPTY CLEAR,F_SOLAIVA|ENABLE,F_PROVV
|
||||||
MESSAGE ENABLE,F_SOLAIVA
|
MESSAGE ENABLE,F_SOLAIVA|CLEAR,F_PROVV
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DES_DOC 50
|
STRING F_DES_DOC 50
|
||||||
@ -158,11 +158,11 @@ LISTBOX F_TIPO_MOV_2 1 20
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Tipo movimento "
|
PROMPT 2 5 "Tipo movimento "
|
||||||
FIELD TIPOMOV
|
FIELD TIPOMOV
|
||||||
ITEM " |Nessuno" MESSAGE COPY,F_TIPO_MOV
|
ITEM " |Nessuno" MESSAGE COPY,F_TIPO_MOV|ENABLE,F_PROVV
|
||||||
ITEM "1|Fattura" MESSAGE COPY,F_TIPO_MOV
|
ITEM "1|Fattura" MESSAGE COPY,F_TIPO_MOV|CLEAR,F_PROVV
|
||||||
ITEM "3|Incasso/pagamento " MESSAGE COPY,F_TIPO_MOV
|
ITEM "3|Incasso/pagamento " MESSAGE COPY,F_TIPO_MOV|CLEAR,F_PROVV
|
||||||
ITEM "5|Insoluto" MESSAGE COPY,F_TIPO_MOV
|
ITEM "5|Insoluto" MESSAGE COPY,F_TIPO_MOV|CLEAR,F_PROVV
|
||||||
ITEM "6|Pagamento insoluto" MESSAGE COPY,F_TIPO_MOV
|
ITEM "6|Pagamento insoluto" MESSAGE COPY,F_TIPO_MOV|CLEAR,F_PROVV
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -294,6 +294,17 @@ BEGIN
|
|||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
LIST F_PROVV 1 26
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 13 "Movimento provvisorio "
|
||||||
|
FIELD PROVV
|
||||||
|
ITEM " |No (movimento normale)"
|
||||||
|
ITEM "P|Si (cancellabile)"
|
||||||
|
ITEM "C|Cespiti"
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LIST F_OP_FINE_ANNO 1 11
|
LIST F_OP_FINE_ANNO 1 11
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 14 "Operazioni di fine anno "
|
PROMPT 2 14 "Operazioni di fine anno "
|
||||||
|
@ -30,6 +30,7 @@ class TElimina_zoppi : public TSkeleton_application
|
|||||||
TArray _decoders;
|
TArray _decoders;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
static bool test_riga_partita(const TRectype& pagsca);
|
||||||
static bool test_row_file(int rmov, TString_array& arr);
|
static bool test_row_file(int rmov, TString_array& arr);
|
||||||
static bool test_scrow_file(int rmov, TString_array& arr);
|
static bool test_scrow_file(int rmov, TString_array& arr);
|
||||||
static bool test_head_file(TString_array& arr);
|
static bool test_head_file(TString_array& arr);
|
||||||
@ -51,7 +52,7 @@ inline TElimina_zoppi& app() { return (TElimina_zoppi&)main_app(); }
|
|||||||
|
|
||||||
bool TElimina_zoppi::firm_handler(TMask_field& f, KEY k)
|
bool TElimina_zoppi::firm_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (k == K_F9)
|
if (k == K_F9)
|
||||||
{
|
{
|
||||||
TArray_sheet sheet(-1, -1, 70, 20, TR("Scelta ditta"), HR("Codice|Ragione Sociale@50"));
|
TArray_sheet sheet(-1, -1, 70, 20, TR("Scelta ditta"), HR("Codice|Ragione Sociale@50"));
|
||||||
@ -104,7 +105,7 @@ const char* TElimina_zoppi::decode(int num, const char* key, const char* field)
|
|||||||
|
|
||||||
bool TElimina_zoppi::test_row_file(int lf_rmov, TString_array& arr)
|
bool TElimina_zoppi::test_row_file(int lf_rmov, TString_array& arr)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
TLocalisamfile mov(LF_MOV);
|
TLocalisamfile mov(LF_MOV);
|
||||||
TLocalisamfile row(lf_rmov);
|
TLocalisamfile row(lf_rmov);
|
||||||
|
|
||||||
@ -118,11 +119,11 @@ bool TElimina_zoppi::test_row_file(int lf_rmov, TString_array& arr)
|
|||||||
}
|
}
|
||||||
msg << ": 0";
|
msg << ": 0";
|
||||||
|
|
||||||
TProgind pi(row.items(), msg, TRUE, TRUE);
|
TProgind pi(row.items(), msg, true, true);
|
||||||
TToken_string riga, descr;
|
TToken_string riga, descr;
|
||||||
|
|
||||||
long reg, last_reg = 0, found = 0;
|
long reg, last_reg = 0, found = 0;
|
||||||
bool reg_killed = FALSE;
|
bool reg_killed = false;
|
||||||
|
|
||||||
char tipo;
|
char tipo;
|
||||||
int gruppo, conto;
|
int gruppo, conto;
|
||||||
@ -130,12 +131,12 @@ bool TElimina_zoppi::test_row_file(int lf_rmov, TString_array& arr)
|
|||||||
|
|
||||||
FOR_EACH_FILE_RECORD(row)
|
FOR_EACH_FILE_RECORD(row)
|
||||||
{
|
{
|
||||||
if (pi.iscancelled())
|
if (!pi.addstatus(1))
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pi.addstatus(1);
|
|
||||||
|
|
||||||
if (lf_rmov == LF_PARTITE)
|
if (lf_rmov == LF_PARTITE)
|
||||||
reg = row.get_long(PART_NREG);
|
reg = row.get_long(PART_NREG);
|
||||||
@ -227,9 +228,32 @@ bool TElimina_zoppi::test_row_file(int lf_rmov, TString_array& arr)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TElimina_zoppi::test_riga_partita(const TRectype& pagsca)
|
||||||
|
{
|
||||||
|
const int nriga = pagsca.get_int(PART_NRIGA);
|
||||||
|
bool ok = nriga > 0;
|
||||||
|
|
||||||
|
if (nriga < 9999)
|
||||||
|
{
|
||||||
|
TToken_string k;
|
||||||
|
k = pagsca.get(PART_TIPOCF);
|
||||||
|
k.add(pagsca.get(PART_GRUPPO), 1);
|
||||||
|
k.add(pagsca.get(PART_CONTO), 2);
|
||||||
|
k.add(pagsca.get(PART_SOTTOCONTO), 3);
|
||||||
|
k.add(pagsca.get(PART_ANNO));
|
||||||
|
k.add(pagsca.get(PART_NUMPART));
|
||||||
|
k.add(nriga);
|
||||||
|
const TRectype& part = cache().get(LF_PARTITE, k);
|
||||||
|
const int tipomov = part.get_int(PART_TIPOMOV);
|
||||||
|
ok = tipomov == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
bool TElimina_zoppi::test_scrow_file(int lf_pagsca, TString_array& arr)
|
bool TElimina_zoppi::test_scrow_file(int lf_pagsca, TString_array& arr)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
TLocalisamfile pagsca(lf_pagsca);
|
TLocalisamfile pagsca(lf_pagsca);
|
||||||
long found = 0;
|
long found = 0;
|
||||||
|
|
||||||
@ -244,24 +268,36 @@ bool TElimina_zoppi::test_scrow_file(int lf_pagsca, TString_array& arr)
|
|||||||
msg << ": 0";
|
msg << ": 0";
|
||||||
msg.center_just(50);
|
msg.center_just(50);
|
||||||
|
|
||||||
TProgind pi(pagsca.items(), msg, TRUE, TRUE, 50);
|
TProgind pi(pagsca.items(), msg, true, true);
|
||||||
TToken_string riga, descr;
|
TToken_string riga, descr;
|
||||||
|
|
||||||
FOR_EACH_FILE_RECORD(pagsca)
|
FOR_EACH_FILE_RECORD(pagsca)
|
||||||
{
|
{
|
||||||
if (pi.iscancelled())
|
if (!pi.addstatus(1))
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pi.addstatus(1);
|
|
||||||
|
|
||||||
bool to_kill = FALSE;
|
bool to_kill = false;
|
||||||
if (pagsca.get_int(SCAD_NRIGA) <= 0 ||
|
if (pagsca.get_int(SCAD_NRIGA) <= 0 || pagsca.get_int(SCAD_NRATA) <= 0)
|
||||||
pagsca.get_int(SCAD_NRATA) <= 0)
|
to_kill = true;
|
||||||
to_kill = TRUE;
|
|
||||||
if (lf_pagsca == LF_PAGSCA && pagsca.get_int(PAGSCA_NRIGP) <= 0)
|
switch (lf_pagsca)
|
||||||
to_kill = TRUE;
|
{
|
||||||
|
case LF_PAGSCA:
|
||||||
|
if (pagsca.get_int(PAGSCA_NRIGP) <= 0)
|
||||||
|
to_kill = true;
|
||||||
|
if (!test_riga_partita(pagsca.curr()))
|
||||||
|
to_kill = true;
|
||||||
|
break;
|
||||||
|
case LF_SCADENZE:
|
||||||
|
if (!test_riga_partita(pagsca.curr()))
|
||||||
|
to_kill = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (to_kill)
|
if (to_kill)
|
||||||
{
|
{
|
||||||
@ -296,7 +332,7 @@ bool TElimina_zoppi::test_scrow_file(int lf_pagsca, TString_array& arr)
|
|||||||
|
|
||||||
bool TElimina_zoppi::test_head_file(TString_array& arr)
|
bool TElimina_zoppi::test_head_file(TString_array& arr)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
TLocalisamfile mov(LF_MOV);
|
TLocalisamfile mov(LF_MOV);
|
||||||
TLocalisamfile rmov(LF_RMOV);
|
TLocalisamfile rmov(LF_RMOV);
|
||||||
TLocalisamfile rmoviva(LF_RMOVIVA);
|
TLocalisamfile rmoviva(LF_RMOVIVA);
|
||||||
@ -305,14 +341,14 @@ bool TElimina_zoppi::test_head_file(TString_array& arr)
|
|||||||
msg << TR("Controllo testate di prima nota: 0");
|
msg << TR("Controllo testate di prima nota: 0");
|
||||||
msg.center_just(50);
|
msg.center_just(50);
|
||||||
|
|
||||||
TProgind pi(mov.items(), msg, TRUE, TRUE, 50);
|
TProgind pi(mov.items(), msg, true, true, 50);
|
||||||
TToken_string riga, descr;
|
TToken_string riga, descr;
|
||||||
|
|
||||||
FOR_EACH_FILE_RECORD(mov)
|
FOR_EACH_FILE_RECORD(mov)
|
||||||
{
|
{
|
||||||
if (pi.iscancelled())
|
if (pi.iscancelled())
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pi.addstatus(1);
|
pi.addstatus(1);
|
||||||
@ -360,13 +396,13 @@ int TElimina_zoppi::kill_game(long numreg, int numrig)
|
|||||||
games.add_numreg(numreg);
|
games.add_numreg(numreg);
|
||||||
for (TPartita* game = games.first(); game; game = games.next())
|
for (TPartita* game = games.first(); game; game = games.next())
|
||||||
{
|
{
|
||||||
bool update = FALSE;
|
bool update = false;
|
||||||
const int fattura = game->prima_fattura(numreg);
|
const int fattura = game->prima_fattura(numreg);
|
||||||
if (fattura > 0)
|
if (fattura > 0)
|
||||||
{
|
{
|
||||||
game->scollega_pagamenti(fattura, 1);
|
game->scollega_pagamenti(fattura, 1);
|
||||||
game->rimuovi_riga(fattura);
|
game->rimuovi_riga(fattura);
|
||||||
update = TRUE;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int rigapag = game->primo_pagamento(numreg);
|
const int rigapag = game->primo_pagamento(numreg);
|
||||||
@ -388,7 +424,7 @@ int TElimina_zoppi::kill_game(long numreg, int numrig)
|
|||||||
if (sum.get_long(PART_NREG) == numreg)
|
if (sum.get_long(PART_NREG) == numreg)
|
||||||
{
|
{
|
||||||
game->elimina_pagamento(p, r, s);
|
game->elimina_pagamento(p, r, s);
|
||||||
update = TRUE;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -401,7 +437,7 @@ int TElimina_zoppi::kill_game(long numreg, int numrig)
|
|||||||
if (sum.get_long(PART_NREG) == numreg)
|
if (sum.get_long(PART_NREG) == numreg)
|
||||||
{
|
{
|
||||||
game->elimina_pagamento(TPartita::UNASSIGNED, 0, u);
|
game->elimina_pagamento(TPartita::UNASSIGNED, 0, u);
|
||||||
update = TRUE;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -412,7 +448,7 @@ int TElimina_zoppi::kill_game(long numreg, int numrig)
|
|||||||
if (part.get_long(PART_NREG) == numreg)
|
if (part.get_long(PART_NREG) == numreg)
|
||||||
{
|
{
|
||||||
game->rimuovi_riga(p);
|
game->rimuovi_riga(p);
|
||||||
update = TRUE;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,7 +494,7 @@ int TElimina_zoppi::kill_row(long numreg, char tipor, int numrig)
|
|||||||
|
|
||||||
bool TElimina_zoppi::select_handler(TMask_field& f, KEY k)
|
bool TElimina_zoppi::select_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
TArray_sheet sheet(-1, -1, 76, 20, app().app_name(), HR("@1|Codice@6|Riga@5|Anno@R|Importo@20R|Grp@R|Cnt@R|Sottoc@R|Descrizione@50"));
|
TArray_sheet sheet(-1, -1, 76, 20, app().app_name(), HR("@1|Codice@6|Riga@5|Anno@R|Importo@20R|Grp@R|Cnt@R|Sottoc@R|Descrizione@50"));
|
||||||
@ -482,7 +518,7 @@ bool TElimina_zoppi::select_handler(TMask_field& f, KEY k)
|
|||||||
if (total > 0 &&
|
if (total > 0 &&
|
||||||
yesno_box(FR("Confermare l'eliminazione di %ld righe."), total))
|
yesno_box(FR("Confermare l'eliminazione di %ld righe."), total))
|
||||||
{
|
{
|
||||||
TProgind pi(total, TR("Eliminazione righe..."), TRUE, TRUE);
|
TProgind pi(total, TR("Eliminazione righe..."), true, true);
|
||||||
FOR_EACH_ARRAY_ROW(arr, i, riga)
|
FOR_EACH_ARRAY_ROW(arr, i, riga)
|
||||||
{
|
{
|
||||||
if (sheet.checked(i))
|
if (sheet.checked(i))
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user