Patch level : 4.0 451

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Riportata la versione 3.1 patch 650


git-svn-id: svn://10.65.10.50/trunk@14148 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2006-07-11 13:10:51 +00:00
parent 060a1c3f6c
commit c434cad322
443 changed files with 20145 additions and 3560 deletions

View File

@ -1,6 +1,6 @@
[AVIS_000]
Caption = "Menu principale"
Picture = <at00.bmp>
Picture = <at00>
Module = 0
Flags = ""
Item_01 = "Archiviazione", [AVIS_001]
@ -9,12 +9,13 @@ Item_03 = "Benemerenze", [AVIS_003]
Item_04 = "Stampe", [AVIS_004]
Item_05 = "Statistiche", [AVIS_005]
Item_06 = "Procedure personalizzate", [AVIS_006]
Item_07 = "Anagrafiche EUROCAMPO", [PRASSI_001]
Item_08 = "Manutenzione", [PRASSI_015]
Item_07 = "Anagrafiche EUROCAMPO", [AGA_001]
Item_08 = "Manutenzione", [AGA_015]
Item_09 = "Preferiti", [MENU_PREFERITI], "", 10216
[AVIS_001]
Caption = "Archiviazione"
Picture = <at01.bmp>
Picture = <at00>
Module = 17
Flags = ""
Item_01 = "Soggetti", "at0 -0", ""
@ -29,7 +30,7 @@ Item_08 = "Tabelle", [AVIS_0012]
[AVIS_0011]
Caption = "Operazioni periodiche"
Picture = <at01.bmp>
Picture = <at00>
Module = 17
Flags = ""
Item_01 = "Chiusura", "at0 -5", ""
@ -39,7 +40,7 @@ Item_04 = "Verifica integrita' dati", "at8 -4", ""
[AVIS_0012]
Caption = "Tabelle"
Picture = <ba23.bmp>
Picture = <at04>
Module = 17
Flags = ""
Item_01 = "Sezioni", "ba3 -3 batbsez 96", ""
@ -59,7 +60,7 @@ Item_14 = "Tipi/Esiti controlli sanitari", "ba3 -0 tcs", ""
[AVIS_002]
Caption = "Convocazioni"
Picture = <at01.bmp>
Picture = <at01>
Module = 17
Flags = ""
Item_01 = "Scadenze di donazione", "at4 -0", ""
@ -69,7 +70,7 @@ Item_04 = "Convocazioni su punto di prelievo", [AVIS_0021]
[AVIS_0021]
Caption = "Convocazioni su punto di prelievo"
Picture = <at01.bmp>
Picture = <at01>
Module = 17
Flags = ""
Item_01 = "Gestione", "at4 -4", ""
@ -78,7 +79,7 @@ Item_03 = "Stampa", "at4 -3", ""
[AVIS_003]
Caption = "Benemerenze"
Picture = <at02.bmp>
Picture = <at02>
Module = 17
Flags = ""
Item_01 = "Proposta benemerenza singola", "at1 -0", ""
@ -90,7 +91,7 @@ Item_06 = "Inserimento veloce", "at1 -5", ""
[AVIS_004]
Caption = "Stampe"
Picture = <at02.bmp>
Picture = <at03>
Module = 17
Flags = ""
Item_04 = "Segreteria", [AVIS_0041]
@ -99,7 +100,7 @@ Item_06 = "Di controllo", [AVIS_0043]
[AVIS_0041]
Caption = "Stampe segreteria"
Picture = <at02.bmp>
Picture = <at03>
Module = 17
Flags = ""
Item_01 = "Per categorie", "at2 -6", ""
@ -117,7 +118,7 @@ Item_12 = "Tessere associative singole", "at7 -1", ""
[AVIS_0042]
Caption = "Stampe sanitarie"
Picture = <at02.bmp>
Picture = <at03>
Module = 17
Flags = ""
Item_01 = "Sospesi", "at2 -0", ""
@ -130,7 +131,7 @@ Item_07 = "Turni per controlli sanitari", "at5 -2", ""
[AVIS_0043]
Caption = "Stampe di controllo"
Picture = <ba25.bmp>
Picture = <at03>
Module = 17
Flags = ""
Item_01 = "Donazioni", "at6 -2", ""
@ -142,7 +143,7 @@ Item_05 = "Tabelle", [AVIS_00431]
[AVIS_00431]
Caption = "Stampe di controllo tabelle"
Picture = <ba25.bmp>
Picture = <at03>
Module = 17
Flags = ""
Item_01 = "Sezioni", "at6 -1", ""
@ -159,7 +160,7 @@ Item_11 = "Professioni", "ba3 -1 prf", ""
[AVIS_005]
Caption = "Statistiche"
Picture = <at02.bmp>
Picture = <at01>
Module = 17
Flags = ""
Item_01 = "Mensile donazioni per tipo", "at3 -3"
@ -174,7 +175,7 @@ Item_09 = "Soggetti per comune domicilio", "at3 -8"
[AVIS_006]
Caption = "Procedure personalizzate"
Picture = <ba04.bmp>
Picture = <ba04>
Module = 17
Flags = ""
Item_01 = "Rimini", [AVIS_0061]
@ -183,7 +184,7 @@ Item_03 = "Parma", [AVIS_0063]
[AVIS_0061]
Caption = "Rimini: procedure personalizzate"
Picture = <ba04.bmp>
Picture = <ba04>
Module = 0
Flags = ""
Item_01 = "Acquisizione dati da CT", "at8 -2", ""
@ -192,7 +193,7 @@ Item_03 = "Estrazione dati per aggiornamento", "at9 -1", ""
[AVIS_0062]
Caption = "Bologna: procedure personalizzate"
Picture = <ba04.bmp>
Picture = <ba04>
Module = 0
Flags = ""
Item_01 = "Trasferimento dati a CT", "at8 -6", ""
@ -200,7 +201,7 @@ Item_02 = "Acquisizione dati da CT", "at8 -7", ""
[AVIS_0063]
Caption = "Parma: procedure personalizzate"
Picture = <ba04.bmp>
Picture = <ba04>
Module = 0
Flags = ""
Item_01 = "Aggiornamento dati da SIT", "at8 -8", ""
@ -210,25 +211,25 @@ Item_04 = "Conversione tipi donazione", "ba3 -0 pr2", ""
Item_04 = "Estrazione dati per aggiornamento", "at9 -1", ""
Item_04 = "Aggiornamento dati da estrazione", "at9 -2", ""
[PRASSI_001]
[AGA_001]
Caption = "Gestione Anagrafiche"
Picture = <ba01.bmp>
Picture = <ba01>
Module = 0
Flags = ""
Item_01 = "Persone fisiche", "ba4 -1 F", ""
Item_02 = "Persone giuridiche", "ba4 -1 G", ""
Item_03 = "Ditte", "ba4 -2", ""
Item_04 = "Ricerca Soci", "ba5", ""
Item_05 = "Tabelle ministeriali", [PRASSI_011]
Item_06 = "Tabelle", [PRASSI_002]
Item_05 = "Tabelle ministeriali", [AGA_011]
Item_06 = "Tabelle", [AGA_002]
Item_07 = "Stampa anagrafiche", "ba6 -0", ""
Item_08 = "Stampa tabelle", [PRASSI_003]
Item_09 = "Stampa tabelle ministeriali", [PRASSI_012]
Item_08 = "Stampa tabelle", [AGA_003]
Item_09 = "Stampa tabelle ministeriali", [AGA_012]
Item_10 = "Stampa fogli libri bollati", "ba3 -2", ""
[PRASSI_002]
[AGA_002]
Caption = "Tabelle"
Picture = <ba02.bmp>
Picture = <ba02>
Module = 0
Flags = ""
Item_01 = "Codici IVA", "ba3 -0 %iva", ""
@ -243,25 +244,25 @@ Item_09 = "Vecchi cod.Attivita'", "ba3 -0 %ois", ""
Item_10 = "Stati esteri", "ba3 -0 %sta", ""
Item_11 = "Gestione profili deleghe e distinte", "ba2 -0", ""
[PRASSI_003]
[AGA_003]
Caption = "Stampa tabelle"
Picture = <ba03.bmp>
Picture = <ba03>
Module = 0
Flags = ""
Item_01 = "Codici IVA", "ba3 -1 %iva", ""
Item_02 = "Codici Attivita'", "ba3 -1 %ais", ""
Item_01 = "Codici IVA", "ba8 -5 %iva", ""
Item_02 = "Codici Attivita'", "ba8 -5 %ais", ""
Item_03 = "Condizioni di pagamento", "ba3 -9", ""
Item_04 = "Classificazione pagamenti", "ba3 -1 %clr", ""
Item_05 = "Libri sociali", "ba3 -1 %itl", ""
Item_06 = "Banche", "ba3 -1 %ban", ""
Item_07 = "Codici statistici", "ba3 -1 %stt", ""
Item_08 = "Cariche sociali", "ba3 -1 %crs", ""
Item_09 = "Vecchi cod.Attivita'", "ba3 -1 %ois", ""
Item_10 = "Stati esteri", "ba3 -1 %sta", ""
Item_04 = "Classificazione pagamenti", "ba8 -5 %clr", ""
Item_05 = "Libri sociali", "ba8 -5 %itl", ""
Item_06 = "Banche", "ba8 -5 %ban", ""
Item_07 = "Codici statistici", "ba8 -5 %stt", ""
Item_08 = "Cariche sociali", "ba8 -5 %crs", ""
Item_09 = "Vecchi cod.Attivita'", "ba8 -5 %ois", ""
Item_10 = "Stati esteri", "ba8 -5 %sta", ""
[PRASSI_011]
[AGA_011]
Caption = "Tabelle ministeriali"
Picture = <ba02.bmp>
Picture = <ba02>
Module = 0
Flags = ""
Item_01 = "Comuni", "ba4 -0", ""
@ -272,27 +273,36 @@ Item_05 = "Uffici IVA", "ba3 -0 %uiv", ""
Item_06 = "Uffici registro", "ba3 -0 %ure", ""
Item_07 = "Centri servizio", "ba3 -0 %ucs", ""
[PRASSI_012]
[AGA_012]
Caption = "Stampa tabelle ministeriali"
Picture = <ba03.bmp>
Picture = <ba03>
Module = 0
Flags = ""
Item_01 = "Comuni", "ba6 -1", ""
Item_02 = "Uffici concessioni", "ba3 -1 %ucc", ""
Item_03 = "Uffici imposte dirette", "ba3 -1 %uid", ""
Item_04 = "Uffici IVA", "ba3 -1 %uiv", ""
Item_05 = "Uffici registro", "ba3 -1 %ure", ""
Item_06 = "Centri servizio", "ba3 -1 %ucs", ""
Item_02 = "Uffici concessioni", "ba8 -5 %ucc", ""
Item_03 = "Uffici imposte dirette", "ba8 -5 %uid", ""
Item_04 = "Uffici IVA", "ba8 -5 %uiv", ""
Item_05 = "Uffici registro", "ba8 -5 %ure", ""
Item_06 = "Centri servizio", "ba8 -5 %ucs", ""
[PRASSI_015]
[AGA_015]
Caption = "Manutenzione"
Picture = <ba04.bmp>
Picture = <ba04>
Module = 0
Flags = ""
Item_01 = "Archivi", "ba1", ""
Item_01 = "Archivi", "ba1 -0", ""
Item_02 = "Compatta tutti i files", "ba1 -2", ""
Item_03 = "Utenti", "ba1 -3 agaat.men", ""
Item_04 = "Attivazione moduli", "ba1 -4", ""
Item_05 = "Installazione moduli", "ba1 -6", ""
Item_06 = "Backup", "ba2 -1", ""
Item_06 = "Creazione dischi di installazione", "ba1 -5", ""
Item_07 = "Backup", "ba2 -1", "", 10213
Item_08 = "Generatore query", "ba8 -1", ""
Item_09 = "Generatore report", "ba8 -2", ""
Item_10 = "Convertitore da form a report", "ba8 -3", ""
[MENU_PREFERITI]
Caption = "Preferiti"
Picture = <ba04>
Module = 0
Flags = ""

BIN
at/at00.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
at/at01.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
at/at02.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
at/at03.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
at/at04.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -7,7 +7,6 @@
#include "sezioni.h"
#include <comuni.h>
#include "at2.h"
#include "at2600a.h"
#include "atlib.h"
@ -489,7 +488,6 @@ bool TStampaIscritti::user_create()
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMDOM);
add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at2600a");
@ -505,13 +503,13 @@ bool TStampaIscritti::user_create()
if (iscrtrr.exist())
_fileiscr = new TExternisamfile(iscrname, iscrtrr, false);
return TRUE;
}
bool TStampaIscritti::user_destroy()
{
if (_fileiscr != NULL)
delete _fileiscr;
delete _fileiscr;
delete _form_eti;
delete _msk;
delete _rel;

BIN
at/ba00.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
at/ba01.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
at/ba02.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
at/ba03.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
at/ba04.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
at/logo.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -3,19 +3,19 @@
#include <applicat.h>
#include <automask.h>
#include <colors.h>
#include <controls.h>
#include <dongle.h>
#include <execp.h>
#include <isam.h>
#include <msksheet.h>
#include <progind.h>
#include <sheet.h>
#include <utility.h>
#include <urldefid.h>
#include <agasys.h>
#include <nditte.h>
#include <user.h>
#include "ba0.h"
#include "ba0101.h"
@ -31,19 +31,13 @@
#define DLG_TREE 301
#define DLG_LIST 302
#ifdef XVAGA
#define MEN_FILE "bamenu.men"
#else
#define MEN_FILE "baprassi.men"
#endif
///////////////////////////////////////////////////////////
// TMenu_application declaration
///////////////////////////////////////////////////////////
class TMenu_application : public TSkeleton_application
{
const char* _name;
TFilename _menuname;
TMenu _menu;
int _tree_view;
@ -51,9 +45,6 @@ class TMenu_application : public TSkeleton_application
TMask* _mask;
static int _last_button;
static bool _find_button;
protected: // TApplication
virtual bool user_create();
virtual bool destroy();
@ -62,6 +53,8 @@ protected: // TApplication
virtual void on_firm_change();
virtual bool test_assistance_year() const;
const TString& ask_user_password();
protected:
void deconnect_user();
virtual void main_loop();
@ -101,7 +94,7 @@ public:
void reload_images();
TMenu& main_menu() { return _menu; }
TMenu_application(const char* name) : _name(name), _mask(NULL) { }
TMenu_application(const char* name) : _menuname(name), _mask(NULL) { }
virtual ~TMenu_application() { }
};
@ -262,21 +255,21 @@ TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
{
set_current(submenu);
TFilename logoname;
const char* ext[3] = { "jpg", "gif", "bmp" };
for (int i = 0; i < 3; i++)
const char* const ext[] = { "jpg", "png", "gif", "bmp", NULL };
for (int i = 0; ext[i]; i++)
{
logoname = "logo";
logoname << '.' << ext[i];
if (logoname.custom_path())
break;
}
TImage logo(logoname);
if(logo.ok())
if (logo.ok())
{
if (can_be_transparent(logo))
logo.convert_transparent_color(MASK_BACK_COLOR);
_logo = new TImage(logo);
}
}
@ -788,8 +781,9 @@ COLOR TColor_mask::cid2color(short cid) const
// Menu application
///////////////////////////////////////////////////////////
int TMenu_application::_last_button = 0;
bool TMenu_application::_find_button = false;
//int TMenu_application::_last_button = 0;
//bool TMenu_application::_find_button = false;
bool TMenu_application::test_assistance_year() const
{
@ -930,12 +924,12 @@ HIDDEN bool pwd_handler(TMask_field& fld, KEY key)
if (key == K_F8)
{
TMask& m = fld.mask();
TString16 pwd;
TString16 usr = dongle().administrator(&pwd);
TString pwd;
TString usr = dongle().administrator(&pwd);
TLocalisamfile users(LF_USER);
users.put("USERNAME", usr);
users.put(USR_USERNAME, usr);
users.read();
pwd = decode(users.get("PASSWORD"));
pwd = decode(users.get(USR_PASSWORD));
m.set(F_USER, usr);
m.set(F_PASSWORD, pwd);
m.stop_run(K_ENTER);
@ -948,30 +942,34 @@ void TMenu_application::reload_images()
_menu.reload_images();
}
bool TMenu_application::check_user()
{
const TString& TMenu_application::ask_user_password()
{
TString& utente = get_tmp_string();
utente = user();
#ifndef _DEMO_
// Disabilita le voci di personalizzazione
for (int mi = 2; mi <= 6; mi++)
int mi;
for (mi = 2; mi <= 7; mi++)
disable_menu_item(MENU_ITEM(mi));
TString utente(user());
#ifdef _DEMO_
user() = utente = dongle().administrator();
const bool ok = TRUE;
#else
TMask m("ba0100a");
if (is_power_station())
{
m.set_handler(F_USER, pwd_handler);
m.set_handler(F_PASSWORD, pwd_handler);
}
m.set(F_USER, utente);
m.first_focus(F_PASSWORD);
TEdit_field& e = m.efield(F_USER);
e.browse()->set_filter("ISGROUP!=\"X\"");
TLocalisamfile& users = e.browse()->cursor()->file();
TString pwd;
bool ok = false;
for (int i = 0; i < 3 && !ok; i++)
@ -982,103 +980,164 @@ bool TMenu_application::check_user()
m.first_focus(F_PASSWORD);
}
if (m.run() == K_ESC)
break;
utente = m.get(F_USER);
const TString& pass = m.get(F_PASSWORD);
pwd = "";
TString pwd;
TLocalisamfile users(LF_USER);
users.put("USERNAME", utente);
users.put(USR_USERNAME, utente);
if (users.read() == NOERR)
{
pwd = decode(users.get("PASSWORD"));
pwd = decode(users.get(USR_PASSWORD));
}
else
{
// Creo l'amministratore se necessario
users.zero();
if (utente == dongle().administrator(&pwd))
if (utente == dongle().administrator(&pwd))
{
users.put("USERNAME", utente);
users.put("USERDESC", "Amministratore");
users.put("PASSWORD", encode(pwd));
users.put(USR_USERNAME, utente);
users.put(USR_USERDESC, "Amministratore");
users.put(USR_PASSWORD, encode(pwd));
users.write();
}
else
utente.cut(0);
}
ok = utente.not_empty() && pwd.not_empty() && pwd == pass;
if (ok)
const TString& pass = m.get(F_PASSWORD);
ok = utente.full() && pwd == pass;
if (ok)
{
ok = !users.get_bool("CONNECTED");
if (!ok)
if (users.get_bool("CONNECTED"))
{
ok = yesno_box("%s\n%s",
TR("L'utente risulta essere già collegato"),
TR("Si desidera continuare ugualmente?"));
TR("L'utente risulta essere già collegato"),
TR("Si desidera continuare ugualmente?"));
}
if (ok)
{
users.put("USERNAME", dongle().administrator());
users.read();
if (users.get("AUTSTR") == "CONVERTING")
{
TString msg; msg << TR("E' in corso una conversione archivi") << ":\n";
if (utente == dongle().administrator())
{
msg << TR("Si desidera continuare ugualmente?");
ok = yesno_box(msg);
}
else
{
msg << TR("Accesso negato.");
ok = error_box(msg);
}
}
}
if (ok)
{
dongle().logout();
user() = utente;
ok = get_serial_number() >= 0;
if (!ok)
error_box(TR("Probabilmente è stato superato il numero massimo di utenti"));
}
}
else
}
else
{
error_box(TR("Utente e/o password errata: fare attenzione alle maiuscole"));
m.set(F_PASSWORD,"");
m.reset(F_PASSWORD);
}
}
if (ok && utente != dongle().administrator() && users.curr().exist(USR_DATAPWD))
{
TConfig studio_ini(CONFIG_STUDIO, "Main");
const long expiration = studio_ini.get_long("PasswordExpiration");
bool runba = expiration > 0;
while (runba)
{
runba = users.get(USR_PASSWORD).empty();
if (!runba)
{
const TDate oggi(TODAY);
const TDate datapwd = users.get_date(USR_DATAPWD);
if (datapwd.ok())
runba = expiration < (oggi-datapwd); // Password scaduta
else
{
// Scrivi la data se necessario
users.put(USR_DATAPWD, oggi);
users.rewrite();
}
}
if (runba)
{
warning_box(TR("La password e' scaduta o vuota:\ne' necessario inserirne una nuova"));
user() = utente;
TExternal_app app("ba1 -3");
app.run();
users.reread();
}
}
}
if (!ok)
utente.cut(0);
// Abilita le voci di personalizzazione
for (mi = 2; mi <= 7; mi++)
enable_menu_item(MENU_ITEM(mi));
#endif
return utente;
}
bool TMenu_application::check_user()
{
bool ok = false;
#ifndef _DEMO_
TString utente = user();
if (_mask == NULL) // Primo login della sessione;
{
TConfig campo_ini(CONFIG_INSTALL, "Main");
const use_system_user = campo_ini.get_bool("AutoLogin");
if (use_system_user)
ok = !cache().get(LF_USER, utente).empty();
}
if (!ok)
{
utente = ask_user_password();
ok = utente.full();
}
if (ok)
{
const TString& autstr = cache().get(LF_USER, dongle().administrator(), USR_AUTSTR);
if (autstr == "CONVERTING")
{
TString msg; msg << TR("E' in corso una conversione archivi") << ":\n";
if (user() == dongle().administrator())
{
msg << TR("Si desidera continuare ugualmente?");
ok = yesno_box(msg);
}
else
{
msg << TR("Accesso negato.");
ok = error_box(msg);
}
}
if (ok)
{
dongle().logout();
user() = utente;
ok = get_serial_number() >= 0;
if (!ok)
error_box(TR("Probabilmente è stato superato il numero massimo di utenti"));
}
if (ok)
{
TLocalisamfile users(LF_USER);
users.put("USERNAME", utente);
users.read(_isequal, _lock);
users.put("CONNECTED", "X");
users.rewrite();
if (users.read(_isequal, _lock) == NOERR)
{
users.put("CONNECTED", "X");
users.rewrite();
}
// Memorizza l'ultimo utente per riproporlo la prossima volta
TConfig campo_ini(CONFIG_INSTALL, "Main");
campo_ini.set("User", utente);
}
}
#endif // _DEMO_
}
#else
ok = true;
#endif
if (ok)
{
if (utente != dongle().administrator())
{
TConfig prawin(CONFIG_INSTALL, "Main");
prawin.set("User", utente);
}
// Abilita le voci di personalizzazione
for (int mi = 2; mi <= 6; mi++)
enable_menu_item(MENU_ITEM(mi));
customize_colors(); // Aggiorna set di colori
reload_images(); // Ritrasparentizza immagini
xvt_dwin_invalidate_rect(TASK_WIN, NULL); // Ridisegna sfondo
@ -1161,7 +1220,7 @@ bool TMenu_application::test_programs()
TString msg = TR("I seguenti moduli devono essere aggiornati prima dell'utilizzo:");
int update_needed = 0;
for (int module = 0; scan.line().not_empty(); module++)
for (int module = 0; scan.line().full(); module++)
{
if (dongle().active(module))
{
@ -1206,18 +1265,18 @@ bool TMenu_application::test_programs()
(!more && !yesno_box(TR("Si desidera aggiornare i moduli adesso?"))))
break;
const TString16 old_user = user();
const TString old_user = user();
user() = dongle().administrator(); // Divento temporaneamente amministratore
TExternal_app app("ba1 -6");
app.run();
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
return false;
}
_menu.set_dangerous_modules(dangerous);
return TRUE;
return true;
}
bool TMenu_application::user_create()
@ -1258,7 +1317,7 @@ bool TMenu_application::user_create()
if (!_menu.ok())
{
TWait_cursor hourglass;
TFilename menu = _name;
TFilename menu = _menuname;
menu.ext("men");
_menu.read(menu);
update_preferred_tree();
@ -1496,6 +1555,7 @@ bool TMenu_application::choose_study()
{
disable_menu_item(MENU_ITEM(4));
TMask m(TR("Scelta studio"), 1, 62, 4);
m.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
m.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
@ -1519,6 +1579,7 @@ bool TMenu_application::choose_study()
enable_menu_item(MENU_ITEM(4));
return ok;
}
@ -1677,8 +1738,9 @@ void TMenu_application::update_preferred_tree()
if (sm != NULL)
{
const int num = node.get_int(1);
if (num < sm->items())
if (num >= 0 && num < sm->items())
pref->add(new TMenuitem(sm->item(num)));
}
}
}
@ -1937,6 +1999,10 @@ bool TMenu_application::menu(MENU_TAG mt)
case MENU_ITEM(4): choose_study(); break;
case MENU_ITEM(5): add_to_preferred(); break;
case MENU_ITEM(6): manage_preferred(); break;
case MENU_ITEM(7):
if (check_user())
_mask->stop_run(K_CTRL + 'R'); // Ricarica maschera
break;
default:
if (mt >= MENU_ITEM(50) && mt < MENU_ITEM(50+_preferred.items()))
{
@ -1972,18 +2038,29 @@ bool TMenu_application::menu(MENU_TAG mt)
int ba0100(int argc, char** argv)
{
TApplication::check_parameters(argc, argv);
if (user().blank())
TString& u = user();
if (u.blank())
{
TConfig prawin(CONFIG_INSTALL, "Main");
TString16 u = prawin.get("User");
if (u.blank())
u = dongle().administrator();
user() = u;
TConfig campo_ini(CONFIG_INSTALL, "Main");
const bool su = campo_ini.get_bool("AutoLogin");
if (su) // usa utente di windows
{
xvt_sys_get_user_name(u.get_buffer(), u.size()+1);
u.upper();
if (u == "ADMINISTRATOR") // Converti amministratore
u = dongle().administrator();
}
if (u.blank())
u = campo_ini.get("User"); // Ultimo utente usato
if (u.blank())
u = dongle().administrator(); // Usa amministratore come extrema ratio
}
TFilename menu = (argc < 2) ? MEN_FILE : argv[1];
if (menu.custom_path())
{
TMenu_application *ma = new TMenu_application(menu);
ma->run(argc, argv, TR("Menu Principale"));
@ -1993,4 +2070,4 @@ int ba0100(int argc, char** argv)
error_box(FR("Non esiste il menu %s"), (const char*)menu);
return 0;
}
}

View File

@ -674,6 +674,7 @@ TImage& TMenu::image(const char* name)
const char* ext[4] = { "jpg", "gif", "bmp", "png" };
bool bFound = false;
for (int i = 0; i < 4 && !bFound; i++)
{
realname = name;
realname.ext(ext[i]);
@ -762,4 +763,4 @@ TMenu::TMenu() : _current(NULL), _item(0)
{ }
TMenu::~TMenu()
{ }
{ }

View File

@ -157,7 +157,7 @@ protected:
virtual bool user_create();
virtual bool user_destroy();
virtual TMask* get_mask(int mode) { return _msk; }
virtual bool changing_mask(int mode) { return FALSE; }
virtual bool changing_mask(int mode) { return false; }
virtual TRelation* get_relation() const { return _rel; }
virtual int read(TMask& m);
@ -190,7 +190,7 @@ protected:
virtual bool user_create();
virtual bool user_destroy();
virtual TMask* get_mask(int mode) { return _msk;}
virtual bool changing_mask(int mode) { return FALSE;}
virtual bool changing_mask(int mode) { return false;}
virtual TRelation* get_relation() const { return _rel;}
virtual int read(TMask& m);
virtual bool remove();
@ -297,7 +297,6 @@ TSubmenu& TMenu::get_submenu(const char* name)
return *sub;
}
void TMenu::import(const char* filename, TString& first)
{
TFilename fname(filename); fname.custom_path();
@ -313,7 +312,7 @@ void TMenu::import(const char* filename, TString& first)
first = line;
sub = &get_submenu(line);
} else
if (line.compare("Caption", 7, TRUE) == 0)
if (line.compare("Caption", 7, true) == 0)
{
CHECK(sub, "Invalid menu file");
const int equal = line.find('=');
@ -322,14 +321,14 @@ void TMenu::import(const char* filename, TString& first)
line.strip("\"");
*sub = line;
} else
if (line.compare("Module", 6, TRUE) == 0)
if (line.compare("Module", 6, true) == 0)
{
CHECK(sub, "Invalid menu file");
const int equal = line.find('=');
CHECK(equal > 0, "Invalid menu Module");
sub->set_module(atoi(line.mid(equal+1)));
} else
if (line.compare("Item", 4, TRUE) == 0)
if (line.compare("Item", 4, true) == 0)
{
CHECK(sub, "Invalid menu file");
const int equal = line.find('=');
@ -388,7 +387,7 @@ TMenu::TMenu(const char* menuname)
bool TSet_users::user_handler(TMask_field& f, KEY key)
{
if (!f.mask().query_mode() || !f.to_check(key))
return TRUE;
return true;
const bool ok = f.get().find(' ') < 0;
if (!ok)
return f.error_box(TR("Il nome dell'utente non deve contenere spazi"));
@ -410,16 +409,45 @@ bool TSet_users::group_handler(TMask_field& f, KEY key)
}
app().build_sheet(&rec);
}
return TRUE;
return true;
}
bool TSet_user_passwd::password_handler(TMask_field& f, KEY key)
{
if (f.mask().query_mode() || key != K_ENTER) return TRUE;
const bool ok = f.get().len() > 3 && f.get().find(' ') < 0;
bool ok = true;
if (!ok)
return f.error_box(TR("La password deve essere lunga almeno 4 caratteri e non contenere spazi"));
if (key == K_ENTER && !f.mask().query_mode())
{
const TString& pwd = f.get();
const int pwdlen = pwd.len();
for (int i = pwdlen-1; i >= 0; i--)
{
if (pwd[i] >= 0 && pwd[i] <= ' ')
{
ok = error_box("La password contiene un carattere non valido.");
break;
}
}
if (ok)
{
TConfig ini(CONFIG_STUDIO, "Main");
const int minlen = ini.get_int("MinPwdLen", NULL, -1, 4);
if (pwdlen < minlen)
{
TString msg; msg.format(TR("La password deve essere lunga almeno %d caratteri."), minlen);
if (pwdlen == 0 && user() == dongle().administrator())
{
msg << '\n' << TR("Si desidera continuare ugualmente?");
ok = yesno_box(msg);
}
else
ok = f.error_box(msg);
}
}
}
return ok;
}
@ -440,7 +468,7 @@ bool TSet_users::tree_handler(TMask_field& f, KEY key)
{
menu->properties(old) = sf.rows_array();
const TString16 mod = old.left(2);
const TString4 mod = old.left(2);
TString_array& mprop = menu->properties(mod);
if (m.get_bool(F_NOWRITE))
{
@ -473,16 +501,16 @@ bool TSet_users::tree_handler(TMask_field& f, KEY key)
sf.check_row(r);
sf.force_update();
}
const TString16 mod = cmd.left(2);
const TString4 mod = cmd.left(2);
const TString_array* mprop = menu->find_properties(mod);
m.enable(F_NOWRITE);
m.set(F_NOWRITE, mprop && mprop->items() ? "X" : "");
m.field(F_NOWRITE).set_dirty(FALSE);
m.field(F_NOWRITE).set_dirty(false);
}
}
}
}
return TRUE;
return true;
}
bool TSet_users::p_notify(TSheet_field& f, int r, KEY k)
@ -498,7 +526,7 @@ bool TSet_users::p_notify(TSheet_field& f, int r, KEY k)
default:
break;
}
return TRUE;
return true;
}
void TSet_user_passwd::build_sheet(const TRectype* r)
@ -600,14 +628,14 @@ bool TSet_user_passwd::user_has_module(int mod)
bool TSet_users::k_notify(TSheet_field& f, int r, KEY k)
{
if (k == K_INS || k == K_DEL)
return FALSE;
return false;
if (k == K_TAB)
{
TMask& m = f.sheet_mask();
m.enable(F_ENABLE, f.cell_enabled(r, f.cid2index(F_ENABLE)));
}
return TRUE;
return true;
}
bool TSet_user_passwd::user_create()
@ -625,7 +653,7 @@ bool TSet_user_passwd::user_create()
_msk->enable_page(1, superuser);
_msk->enable(-G_SUPERUSER, superuser);
return TRUE;
return true;
}
bool TSet_users::user_create()
@ -646,7 +674,7 @@ bool TSet_users::user_create()
_msk->tfield(F_PERMESSI).set_tree(_tree);
_msk->sfield(F_PROPERTIES).set_notify(p_notify);
return TRUE;
return true;
}
int TSet_users::read(TMask& m)
@ -655,7 +683,7 @@ int TSet_users::read(TMask& m)
const TRectype& r = get_relation()->curr();
build_sheet(&r);
const TString16 pwd = decode(r.get("PASSWORD"));
const char* pwd = decode(r.get("PASSWORD"));
m.set(F_PASSWORD, pwd);
m.set(F_PROVA, pwd);
@ -664,19 +692,22 @@ int TSet_users::read(TMask& m)
return NOERR;
}
void TSet_user_passwd::put_in_record(const TMask& m)
{
const TString16 s = encode(m.get(F_PASSWORD));
TRectype& r = get_relation()->curr();
if (_msk->get(F_USER) == user())
const char* s = encode(m.get(F_PASSWORD));
if (r.get("PASSWORD") != s)
{
r.put("PASSWORD", s);
else
error_box(TR("Impossibile cambiare la password di altri utenti"));
if (r.exist("DATAPWD"))
r.put("DATAPWD", TDate(TODAY));
}
}
void TSet_users::put_in_record(const TMask& m)
{
TSet_user_passwd::put_in_record(m);
TString autstr(ENDAUT, ' ');
TSheet_field& sf = sheet_field();
FOR_EACH_SHEET_ROW(sf, i, riga)
@ -687,9 +718,7 @@ void TSet_users::put_in_record(const TMask& m)
autstr[module] = c;
}
const TString16 s = encode(m.get(F_PASSWORD));
TRectype& r = get_relation()->curr();
r.put("PASSWORD", s);
r.put("AUTSTR", autstr);
TToken_string prop_field(256, '\n');
@ -726,10 +755,9 @@ bool TSet_users::remove()
const bool ok = TRelation_application::remove();
if (ok)
{
const TString16 u = get_relation()->curr().get("USERNAME");
TFilename file = firm2dir(-1); // Directory dati
file.add("config"); // Directory configurazioni
file.add(u); // Nome utente
file.add(get_relation()->curr().get("USERNAME")); // Nome utente
file.ext("ini"); // Estensione
::remove(file);
}
@ -738,16 +766,18 @@ bool TSet_users::remove()
bool TSet_user_passwd::user_destroy()
{
if (_msk != NULL) delete _msk;
if (_rel != NULL) delete _rel;
if (_im != NULL) delete _im;
return TRUE;
if (_msk != NULL) delete _msk;
if (_rel != NULL) delete _rel;
if (_im != NULL) delete _im;
return true;
}
bool TSet_users::user_destroy()
{
TSet_user_passwd::user_destroy();
if (_tree != NULL) delete _tree;
return TRUE;
if (_tree != NULL)
delete _tree;
return true;
}
@ -757,7 +787,7 @@ int TSet_user_passwd::read(TMask& m)
const TRectype& r = get_relation()->curr();
build_sheet(&r);
const TString16 pwd =decode(r.get("PASSWORD"));
const char* pwd = decode(r.get("PASSWORD"));
m.set(F_PASSWORD, pwd);
m.set(F_PROVA, pwd);
@ -769,6 +799,7 @@ void TSet_user_passwd::init_query_mode(TMask& m)
enable_aut();
_msk->set(F_USER,user());
_msk->send_key(K_AUTO_ENTER,0);
_msk->disable(DLG_NEWREC);
_msk->disable(DLG_FINDREC);
_msk->disable(DLG_DELREC);
}
@ -776,8 +807,10 @@ void TSet_user_passwd::init_query_mode(TMask& m)
void TSet_user_passwd::init_modify_mode(TMask& m)
{
enable_aut();
_msk->disable(DLG_NEWREC);
_msk->disable(DLG_FINDREC);
_msk->disable(DLG_DELREC);
_msk->enable_page(1, false);
}
int ba1400(int argc, char** argv)

View File

@ -8,7 +8,7 @@
#include <odbcrset.h>
#include <prefix.h>
#include <progind.h>
#include <recset.h>
#include <odbcrset.h>
#include <relation.h>
#include <sheet.h>
#include <tree.h>
@ -917,6 +917,7 @@ void TQuery_mask::save_as(TRecordsetExportFormat fmt)
return;
}
xvt_fsys_save_dir();
TFilename path; path.tempdir();
@ -1519,4 +1520,4 @@ int ba8200(int argc, char* argv[])
TSQL_recordset_app app;
app.run(argc, argv, TR("Query Generator"));
return 0;
}
}

View File

@ -21,6 +21,7 @@
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// TReport_sheet
///////////////////////////////////////////////////////////
@ -167,6 +168,7 @@ void TSection_properties_mask::vedo_non_vedo()
show(F_CONDITION, /*type == 'B' &&*/ level > 0 && level < 10);
show(F_GROUP_BY, type == 'H' && level > 1 && level < 10);
show(F_SQL, type == 'B' && level > 10);
show(F_KEEP_WITH_NEXT, level > 1 && type == 'H');
show(F_CAN_BREAK, level > 0 && type == 'B');
show(F_HIDE_IF_NEEDED, level == 0 && type != 'B');
@ -314,6 +316,7 @@ void TReport_properties_mask::set_report(const TReport& r)
set(F_FONT_AUTO, r.use_printer_font());
set(F_ORIENTATION, r.orientation());
set(F_DX, r.user_defined_cpi());
set(F_DY, r.lpi());
set_font_info(r.font());
set(F_CLASS, r.get_class());
@ -341,6 +344,7 @@ void TReport_properties_mask::get_report(TReport& r) const
r.set_orientation(get_int(F_ORIENTATION));
r.set_class(get(F_CLASS));
r.set_command_line(get(F_COMMAND));
const TString& oldlib = r.get_libraries();
if (oldlib != get(F_INCLUDE))
@ -973,7 +977,6 @@ bool TReport_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
warning_box(TR("Nessuna riga risultato"));
}
delete rex;
}
}
break;

View File

@ -56,9 +56,9 @@
#define F_ORIENTATION 169
#define F_CLASS 170
#define F_COMMAND 171
#define F_SQL 201
#define F_IMPORT_QRY 202
#define F_NEW_QRY 203
#define F_SHOW_QRY 204

View File

@ -49,6 +49,7 @@ END
BOOLEAN F_DISABLED
BEGIN
PROMPT 24 4 "Disattivata"
END
BOOLEAN F_PAGE_BREAK
@ -94,9 +95,18 @@ MEMO F_CONDITION 58 6
BEGIN
// Visibile sezioni con livello > 0
PROMPT 1 8 "Condizione"
FLAGS "H"
END
MEMO F_SQL 56 6
BEGIN
// Visibile sezioni con livello > 10
PROMPT 1 6 "Query"
FLAGS "H"
CHECKTYPE REQUIRED
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
@ -231,4 +241,3 @@ END
ENDPAGE
ENDMASK

View File

@ -24,6 +24,14 @@ BEGIN
CHECKTYPE NORMAL
END
RADIO F_ORIENTATION 1 24
BEGIN
PROMPT 1 1 "@bOrientamento della carta"
ITEM "0|Impostazioni Stampante"
ITEM "1|Ritratto (Verticale)"
ITEM "2|Paesaggio (Orizzontale)"
END
NUMBER F_DY 2
BEGIN
PROMPT 1 6 "Linee per pollice "
@ -54,11 +62,14 @@ END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
@ -68,6 +79,7 @@ PAGE "Parametri" -1 -1 60 16
SPREADSHEET F_PARAMS 0 -3
BEGIN
PROMPT 1 1 ""
ITEM "Parametro@16"
ITEM "Valore@50"
END
@ -128,6 +140,26 @@ END
ENDPAGE
PAGE "Allegati" -1 -1 60 16
SPREADSHEET F_LINK 0 -3
BEGIN
PROMPT 1 1 ""
ITEM "Allegato@50"
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK
PAGE "Parametro" -1 -1 60 5

View File

@ -1700,7 +1700,9 @@ void TReport_window::draw_field(const TReport_field& rf)
advanced_draw_rect(r, rf.pattern(), rf.border(), rf.fore_color(), rf.back_color(), rad, off);
xvt_dwin_set_font(win(), rf.font().get_xvt_font(*this));
set_color(rf.fore_color(), rf.back_color());
advanced_draw_text_line(*this, rf.picture(), r, rf.horizontal_alignment(), rf.vertical_alignment());
TString str = rf.picture();
advanced_draw_paragraph(*this, str, r, rf.horizontal_alignment(), rf.vertical_alignment(), _default_row_height);
}
break;
default :
@ -1734,7 +1736,7 @@ void TReport_window::draw_field(const TReport_field& rf)
str << rf.id();
else
str = rf.field();
advanced_draw_text_line(*this, str, r, rf.horizontal_alignment(), rf.vertical_alignment());
advanced_draw_paragraph(*this, str, r, rf.horizontal_alignment(), rf.vertical_alignment(), _default_row_height);
break;
}
@ -1801,7 +1803,6 @@ void TReport_window::update()
draw_grid(); // Disegna griglia
draw_bg();
const TRectangle rect_riga(0,0,1000,100);
RCT rct_riga; TWindow::log2dev(rect_riga, rct_riga);
_default_row_height = rct_riga.bottom - rct_riga.top;

3
ba/f155.dir Executable file
View File

@ -0,0 +1,3 @@
155
0
$multirel|0|0|96|0|Relazione molti a molti|||

9
ba/f155.trr Executable file
View File

@ -0,0 +1,9 @@
155
4
COD|1|5|0|Codice relazione
FIRST|1|20|0|Primo elemento
SECOND|1|20|0|Secondo elemento
DATA|1|50|0|Dati
2
COD+FIRST+SECOND|
COD+SECOND+FIRST|

View File

@ -92,6 +92,7 @@ bool TCesp2cg_qmask::on_field_event(TOperable_field& o, TField_event e, long jol
}
break;
case F_CODCAT2:
case F_DESCAT:
return ditta_cespiti().on_category_event(o, e, jolly);
case F_IDCESPITE:
if (e == fe_close)
@ -303,7 +304,7 @@ void TCesp2cg::init_insert_mode(TMask& m)
init_mask(m);
// Valori preimpostati "quasi" sempre buoni :-)
m.set(F_TIPO, 1); m.set(F_TIPOTRAS, "T");
m.set(F_TIPO, 1);
const TString& idcespite = m.get(F_IDCESPITE);
if (!idcespite.blank())

View File

@ -16,9 +16,7 @@
#define F_CODCAT2 116
#define F_DESCAT2 117
#define F_IDCESPITE2 118
#define F_TIPOTRAS 119
#define F_CENTRO_COS 120
#define F_COMPL 121
#define F_COMPL 119
#define F_IMM_G 201
#define F_IMM_C 202

View File

@ -139,9 +139,9 @@ RADIOBUTTON F_TIPO 1 14
BEGIN
PROMPT 0 6 "Selezione"
ITEM "1|Categorie"
MESSAGE ENABLE,F_CODCAT|CLEAR,F_IDCESPITE|REQUIRED,F_CODCAT|NORMAL,F_IDCESPITE|"1",F_TIPO2
MESSAGE ENABLE,F_CODCAT|CLEAR,F_DESCES|ENABLE,F_DESCAT|CLEAR,F_IDCESPITE|REQUIRED,F_CODCAT,NORMAL,F_IDCESPITE,NORMAL,F_DESCES|"1",F_TIPO2
ITEM "2|Cespiti"
MESSAGE ENABLE,F_IDCESPITE|CLEAR,F_CODCAT|NORMAL,F_CODCAT|REQUIRED,F_IDCESPITE|"2",F_TIPO2
MESSAGE ENABLE,F_IDCESPITE|ENABLE,F_DESCES|CLEAR,F_DESCAT|CLEAR,F_CODCAT|NORMAL,F_CODCAT,REQUIRED,F_IDCESPITE,REQUIRED,F_DESCES|"2",F_TIPO2
GROUP 1
END
@ -150,10 +150,11 @@ BEGIN
PROMPT 0 6 "Selezione"
FLAGS "P"
ITEM "1|Categorie"
MESSAGE ENABLE,F_CODCAT2|CLEAR,F_IDCESPITE2|REQUIRED,F_CODCAT2,NORMAL,F_IDCESPITE2
MESSAGE ENABLE,F_CODCAT2|CLEAR,F_DESCES|ENABLE,F_DESCAT|CLEAR,F_IDCESPITE2|REQUIRED,F_CODCAT2,NORMAL,F_IDCESPITE2,NORMAL,F_DESCES
ITEM "2|Cespiti"
MESSAGE ENABLE,F_IDCESPITE2|CLEAR,F_CODCAT2|NORMAL,F_CODCAT2,REQUIRED,F_IDCESPITE2
MESSAGE ENABLE,F_IDCESPITE2|ENABLE,F_DESCES|CLEAR,F_DESCAT|CLEAR,F_CODCAT2|NORMAL,F_CODCAT2,REQUIRED,F_IDCESPITE2,REQUIRED,F_DESCES
GROUP 2
FLAGS "G"
END
@ -184,7 +185,8 @@ END
STRING F_DESCAT 70 54
BEGIN
PROMPT 22 7 ""
FLAGS "D"
KEY 2
FLAGS "B"
END
STRING F_IDCESPITE 10
@ -218,16 +220,22 @@ BEGIN
COPY OUTPUT F_IDCESPITE
CHECKTYPE REQUIRED
FIELD IDCESPITE
MESSAGE COPY,F_IDCESPITE
KEY 1
GROUP 2
WARNING "Inserire un cespite valido"
GROUP 1
END
STRING F_DESCES 50 47
BEGIN
PROMPT 29 8 ""
FLAGS "D"
USE LF_CESPI KEY 2
INPUT DESC F_DESCES
DISPLAY "Descrizione@50" DESC
DISPLAY "Cespite@10" IDCESPITE
DISPLAY "Categoria" CODCAT
COPY OUTPUT F_IDCESPITE
CHECKTYPE REQUIRED
KEY 2
GROUP 1
END
ENDPAGE

687
ce/ce2300b.uml Executable file
View File

@ -0,0 +1,687 @@
#include "ce2300a.h"
TOOLBAR "Toolbar" 0 -3 0 3
BUTTON DLG_SAVEREC 10 2
BEGIN
PROMPT -16 -11 "~Registra"
MESSAGE EXIT,K_SAVE
PICTURE BMP_SAVEREC
PICTURE BMP_SAVERECDN
END
BUTTON DLG_NEWREC 10 2
BEGIN
PROMPT -26 -11 "~Nuovo"
MESSAGE EXIT,K_INS
PICTURE BMP_NEWREC
PICTURE BMP_NEWRECDN
END
BUTTON DLG_DELREC 10 2
BEGIN
PROMPT -36 -11 "~Elimina"
MESSAGE EXIT,K_DEL
PICTURE BMP_DELREC
PICTURE BMP_DELRECDN
END
BUTTON DLG_FINDREC 10 2
BEGIN
PROMPT -46 -11 "Ri~cerca"
MESSAGE EXIT,K_F9
PICTURE 126
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -56 -11 "~Annulla"
MESSAGE EXIT,K_ESC
PICTURE 102
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -66 -11 "~Fine"
MESSAGE EXIT,K_QUIT
PICTURE BMP_QUIT
PICTURE BMP_QUITDN
END
ENDPAGE
PAGE "Collegamento Contabilità" -1 -1 78 10
GROUPBOX DLG_NULL 78 10
BEGIN
PROMPT 0 1 "@bParametri ditta"
END
NUMBER F_DITTA 5
BEGIN
PROMPT 1 2 "Ditta "
FLAGS "DF"
END
STRING F_RAGSOC 50
BEGIN
PROMPT 26 2 ""
USE LF_NDITTE
INPUT CODDITTA F_DITTA
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE NORMAL
FLAGS "D"
END
NUMBER F_ESERCIZIO 4
BEGIN
PROMPT 1 3 "Esercizio "
FLAGS "AZD"
USE CCE
JOIN ESC ALIAS 104 INTO CODTAB==CODTAB
INPUT CODTAB F_ESERCIZIO
DISPLAY "Codice esercizio" CODTAB
DISPLAY "Inizio esercizio" 104@->D0
DISPLAY "Fine esercizio" 104@->D1
OUTPUT F_ESERCIZIO CODTAB
OUTPUT F_INIZIO_ES 104@->D0
OUTPUT F_FINE_ES 104@->D1
END
DATE F_INIZIO_ES
BEGIN
PROMPT 26 3 "Inizio "
FLAGS "D"
END
DATE F_FINE_ES
BEGIN
PROMPT 50 3 "Fine "
FLAGS "D"
END
NUMBER F_GRUPPO 2
BEGIN
PROMPT 1 4 "Gruppo "
FLAGS "PZD"
FIELD CODGRUPPO
KEY 1
END
STRING F_SPECIE 4
BEGIN
PROMPT 16 4 "Specie "
FLAGS "_PD"
USE CCB
JOIN %CAT ALIAS 400 INTO CODTAB=CODTAB[5,10]
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
INPUT CODTAB[5,6] F_GRUPPO
INPUT CODTAB[7,10] F_SPECIE
DISPLAY "Gruppo" CODTAB[5,6]
DISPLAY "Specie" CODTAB[7,10]
DISPLAY "Descrizione@50" 400@->S0
OUTPUT F_GRUPPO CODTAB[5,6]
OUTPUT F_SPECIE CODTAB[7,10]
OUTPUT F_DESC_GRSP 400@->S0
FIELD CODSPECIE
END
STRING F_DESC_GRSP 60 45
BEGIN
PROMPT 31 4 ""
FLAGS "D"
END
RADIOBUTTON F_TIPO 1 14
BEGIN
PROMPT 0 6 "Selezione"
ITEM "1|Categorie"
ITEM "2|Cespiti"
FLAGS "DG"
END
NUMBER F_CODCAT 2
BEGIN
PROMPT 16 7 ""
FLAGS "BZD"
CHECKTYPE REQUIRED
FIELD CODCAT
MESSAGE COPY,F_CODCAT2
END
STRING F_DESCAT 70 54
BEGIN
PROMPT 22 7 ""
FLAGS "D"
END
STRING F_IDCESPITE 10
BEGIN
PROMPT 16 8 ""
FLAGS "UZD"
USE LF_COLLCES SELECT IDCESPITE!=""
JOIN LF_CESPI INTO IDCESPITE==IDCESPITE
INPUT CODGRUPPO F_GRUPPO SELECT
INPUT CODSPECIE F_SPECIE SELECT
INPUT IDCESPITE F_IDCESPITE
DISPLAY "Cespite@10" IDCESPITE
DISPLAY "Categoria" LF_CESPI->CODCAT
DISPLAY "Descrizione@50" LF_CESPI->DESC
OUTPUT F_IDCESPITE IDCESPITE
OUTPUT F_DESCES LF_CESPI->DESC
FIELD IDCESPITE
END
BOOLEAN F_COMPL
BEGIN
PROMPT 18 8 "Chiave completa "
FLAGS "H"
END
STRING F_DESCES 50 47
BEGIN
PROMPT 29 8 ""
FLAGS "D"
END
GROUPBOX DLG_NULL 78 9
BEGIN
PROMPT 1 12 ""
FLAGS "R"
END
TEXT DLG_NULL
BEGIN
PROMPT 25 11 "Gruppo"
END
TEXT DLG_NULL
BEGIN
PROMPT 31 11 "Conto"
END
TEXT DLG_NULL
BEGIN
PROMPT 37 11 "Sottoc."
END
TEXT DLG_NULL
BEGIN
PROMPT 46 11 "Descrizione"
END
NUMBER F_IMM_G 3
BEGIN
PROMPT 2 13 "Immobilizzazione "
FIELD GRUPPO
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_IMM_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_IMM_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_IMM_C 3
BEGIN
PROMPT 31 13 ""
FIELD CONTO
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT F_IMM_G
INPUT CONTO F_IMM_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_IMM_G GRUPPO
OUTPUT F_IMM_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_IMM_S 6
BEGIN
PROMPT 37 13 ""
FIELD SOTTOC
FLAGS "R"
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT F_IMM_C
INPUT SOTTOCONTO F_IMM_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Sosp." SOSPESO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_IMM_S SOTTOCONTO
OUTPUT F_IMM_G GRUPPO
OUTPUT F_IMM_C CONTO
OUTPUT F_IMM_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_IMM_D 50 29
BEGIN
PROMPT 46 13 ""
USE LF_PCON KEY 2
INPUT DESCR F_IMM_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_IMM_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QNOR_G 3
BEGIN
PROMPT 2 14 "Quote amm.to normale "
FIELD GRUPPOQNO
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_QNOR_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QNOR_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QNOR_C 3
BEGIN
PROMPT 31 14 ""
FIELD CONTOQNO
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT F_QNOR_G
INPUT CONTO F_QNOR_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QNOR_G GRUPPO
OUTPUT F_QNOR_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QNOR_S 6
BEGIN
PROMPT 37 14 ""
FIELD SOTTOCQNO
FLAGS "R"
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT F_QNOR_C
INPUT SOTTOCONTO F_QNOR_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Sosp." SOSPESO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QNOR_S SOTTOCONTO
OUTPUT F_QNOR_G GRUPPO
OUTPUT F_QNOR_C CONTO
OUTPUT F_QNOR_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_QNOR_D 50 29
BEGIN
PROMPT 46 14 ""
USE LF_PCON KEY 2
INPUT DESCR F_QNOR_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_QNOR_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QANT_G 3
BEGIN
PROMPT 2 15 "Quote amm.to anticipato"
FIELD GRUPPOQAN
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_QANT_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QANT_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QANT_C 3
BEGIN
PROMPT 31 15 ""
FIELD CONTOQAN
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT F_QANT_G
INPUT CONTO F_QANT_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QANT_G GRUPPO
OUTPUT F_QANT_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QANT_S 6
BEGIN
PROMPT 37 15 ""
FIELD SOTTOCQAN
FLAGS "R"
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT F_QANT_C
INPUT SOTTOCONTO F_QANT_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Sosp." SOSPESO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QANT_S SOTTOCONTO
OUTPUT F_QANT_G GRUPPO
OUTPUT F_QANT_C CONTO
OUTPUT F_QANT_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_QANT_D 50 29
BEGIN
PROMPT 46 15 ""
USE LF_PCON KEY 2
INPUT DESCR F_QANT_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_QANT_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QACC_G 3
BEGIN
PROMPT 2 16 "Quote amm.to accelerato"
FIELD GRUPPOQAC
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_QACC_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QACC_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QACC_C 3
BEGIN
PROMPT 31 16 ""
FIELD CONTOQAC
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT F_QACC_G
INPUT CONTO F_QACC_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QACC_G GRUPPO
OUTPUT F_QACC_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_QACC_S 6
BEGIN
PROMPT 37 16 ""
FIELD SOTTOCQAC
FLAGS "R"
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
COPY INPUT F_QACC_C
INPUT SOTTOCONTO F_QACC_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Sosp." SOSPESO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_QACC_S SOTTOCONTO
OUTPUT F_QACC_G GRUPPO
OUTPUT F_QACC_C CONTO
OUTPUT F_QACC_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_QACC_D 50 29
BEGIN
PROMPT 46 16 ""
USE LF_PCON KEY 2
INPUT DESCR F_QACC_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_QACC_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FNOR_G 3
BEGIN
PROMPT 2 17 "Fondo amm.to normale "
FIELD GRUPPOFN
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_FNOR_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FNOR_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FNOR_C 3
BEGIN
PROMPT 31 17 ""
FIELD CONTOFN
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==4))
COPY INPUT F_FNOR_G
INPUT CONTO F_FNOR_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FNOR_G GRUPPO
OUTPUT F_FNOR_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FNOR_S 6
BEGIN
PROMPT 37 17 ""
FIELD SOTTOCFN
FLAGS "R"
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
INPUT GRUPPO F_FNOR_G SELECT
INPUT CONTO F_FNOR_C SELECT
INPUT SOTTOCONTO F_FNOR_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Sosp." SOSPESO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FNOR_S SOTTOCONTO
OUTPUT F_FNOR_G GRUPPO
OUTPUT F_FNOR_C CONTO
OUTPUT F_FNOR_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_FNOR_D 50 29
BEGIN
PROMPT 46 17 ""
USE LF_PCON KEY 2
INPUT DESCR F_FNOR_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_FNOR_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FANT_G 3
BEGIN
PROMPT 2 18 "Fondo amm.to anticipato"
FIELD GRUPPOFA
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_FANT_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FANT_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FANT_C 3
BEGIN
PROMPT 31 18 ""
FIELD CONTOFA
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==3))
COPY INPUT F_FANT_G
INPUT CONTO F_FANT_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FANT_G GRUPPO
OUTPUT F_FANT_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FANT_S 6
BEGIN
PROMPT 37 18 ""
FIELD SOTTOCFA
FLAGS "R"
USE LF_PCON KEY 1 SELECT SOTTOCONTO!=""
INPUT GRUPPO F_FANT_G SELECT
INPUT CONTO F_FANT_C SELECT
INPUT SOTTOCONTO F_FANT_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Sosp." SOSPESO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FANT_S SOTTOCONTO
OUTPUT F_FANT_G GRUPPO
OUTPUT F_FANT_C CONTO
OUTPUT F_FANT_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_FANT_D 50 29
BEGIN
PROMPT 46 18 ""
USE LF_PCON KEY 2
INPUT DESCR F_FANT_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_FANT_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FACC_G 3
BEGIN
PROMPT 2 19 "Fondo amm.to accelerato"
FIELD GRUPPOACC
FLAGS "R"
USE LF_PCON KEY 1 SELECT CONTO=""
INPUT GRUPPO F_FACC_G
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FACC_G GRUPPO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FACC_C 3
BEGIN
PROMPT 31 19 ""
FIELD CONTOACC
FLAGS "R"
USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT F_FACC_G
INPUT CONTO F_FACC_C
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_FACC_G GRUPPO
OUTPUT F_FACC_C CONTO
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
NUMBER F_FACC_S 6
BEGIN
PROMPT 37 19 ""
FIELD SOTTOCACC
FLAGS "R"
USE LF_PCON SELECT SOTTOCONTO!=""
COPY INPUT F_FACC_C
INPUT SOTTOCONTO F_FACC_S
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sospeso" SOSPESO
OUTPUT F_FACC_S SOTTOCONTO
OUTPUT F_FACC_G GRUPPO
OUTPUT F_FACC_C CONTO
OUTPUT F_FACC_D DESCR
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
STRING F_FACC_D 50 29
BEGIN
PROMPT 46 19 ""
USE LF_PCON KEY 2
INPUT DESCR F_FACC_D
DISPLAY "Descrizione@50" DESCR
DISPLAY "Sosp." SOSPESO
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO
COPY OUTPUT F_FACC_S
ADD RUN CG0 -0
CHECKTYPE REQUIRED
END
ENDPAGE
ENDMASK

View File

@ -240,6 +240,7 @@ void TStampa_storico::print_percespite( const int tipo)
TEsercizi_contabili esc;
const TDate& inies = esc[esercizio].inizio();
if (!errore) do //se non c'é incongruenza di date procede alla stampa righe 2
{
@ -579,4 +580,4 @@ int ce3200(int argc, char* argv[])
TStampa_storico a;
a.run(argc,argv,TR("Stampa schede cespiti"));
return 0;
}
}

View File

@ -1,3 +1,3 @@
140
0
$collces|0|0|110|0|Collegamento contabile cespiti|||
$collces|0|0|106|0|Collegamento contabile cespiti|||

View File

@ -1,13 +1,11 @@
140
30
28
CODGRUPPO|2|2|0|Codice gruppo (CGCDGR)
CODSPECIE|1|4|0|Codice specie (CGCDSP)
TIPO|2|1|0|Tipo collegamento ("1" per categoria, "2" per cespite) (CGTIPO)
IDCESPITE|1|10|0|Codice cespite (CGCESP)
CODCAT|2|2|0|Codice categoria (CGCDCT)
COMPL|8|1|0|Riferimenti completati per collegamento (CGCOMP)
TIPOTRAS|1|1|0|Tipo trasferimento (<M>ovimenti, <T>otali per sottoconto) (CGTRAS)
CODCC|2|3|0|Codice centro di costo (CGCCCE)
GRUPPO|2|3|0|Gruppo cespite (CGRCES)
CONTO|2|3|0|Conto cespite
SOTTOC|3|6|0|Sottoconto cespite
@ -31,4 +29,4 @@ CONTOACC|2|3|0|Conto fondi acccelerati
SOTTOCACC|3|6|0|Sottoconto fondi accelerati
TRASF|8|1|0|Giá trasferito (CGMOVI)
1
CODGRUPPO+CODSPECIE+CODCAT+IDCESPITE|
CODGRUPPO+CODSPECIE+TIPO+CODCAT+IDCESPITE|

View File

@ -250,6 +250,26 @@ BEGIN
PROMPT 64 7 ""
FLAGS "HD"
GROUP 1 5
ITEM " |"
ITEM "02|Bis"
ITEM "03|Ter"
ITEM "04|Quater"
ITEM "05|Quinquies"
ITEM "06|Sexies"
END
LIST F_SUBH 9
BEGIN
PROMPT 69 7 ""
GROUP 1 5
ITEM " |"
ITEM "02|Bis"
ITEM "03|Ter"
ITEM "04|Quater"
ITEM "05|Quinquies"
ITEM "06|Sexies"
KEY 1
END
LIST F_SUBH 9
@ -509,4 +529,3 @@ END
ENDPAGE
ENDMASK

View File

@ -200,6 +200,7 @@ bool TPrimanota_application::user_create()
if (get_mask_swap_file(tmp))
xvt_fsys_removefile(tmp);
load_mask(0);
load_colors();
@ -724,6 +725,7 @@ void TPrimanota_application::init_insert_mode(TMask& m)
xvt_fsys_removefile(tmp);
}
}
@ -1184,6 +1186,7 @@ int TPrimanota_application::write(const TMask& m)
{
const TString4 causimm(causale().causale_inc_imm());
if (causimm.not_empty())
genera_incasso(causimm);
}
}
@ -1810,6 +1813,8 @@ bool TPrimanota_application::link_intra(const TMask& m, const char* action)
const bool bModify = xvt_str_compare_ignoring_case(action, "Modify") == 0;
const bool bModify = xvt_str_compare_ignoring_case(action, "Modify") == 0;
TFilename intrini;
intrini.tempdir();
intrini.add("ActIntra.ini");
@ -1918,6 +1923,7 @@ bool TPrimanota_application::link_intra(const TMask& m, const char* action)
appname << "in0 -4 /i" << intrini;
}
bool ok = false;
if (!appname.empty())
{
@ -1965,11 +1971,13 @@ bool TPrimanota_application::link_anal(const TMask& msk, const char* action)
long nExist = 0L;
if (action[0] == 'I')
{
// Cerco se c'e' almeno un conto interessato all'analitica
// Se non ci sono conti analitici e' inutile inserire
if (!bAnalBill)
return false;
}
else
{
@ -2011,6 +2019,7 @@ bool TPrimanota_application::link_anal(const TMask& msk, const char* action)
app.run();
return true;
}
bool TPrimanota_application::protected_record(TRectype& mov)

View File

@ -76,8 +76,12 @@
#define CG_CONTO 105
#define CG_SOTTOCONTO 106
#define CG_DESCR 109
#define CG_ROWTYPE 115
#define CG_MASTRINO 199
#define CG_COMMESSA 115
#define CG_FASE 116
#define CG_DESC_CDC 117
#define CG_DESC_FASE 118
#define CG_ROWTYPE 119
#define CG_MASTRINO 200
// Campi ripetuti sulla seconda pagina
#define H_DATAREG 201

View File

@ -16,6 +16,7 @@
#include <doc.h>
///////////////////////////////////////////////////////////
// Funzioni di decodifica/calcolo
///////////////////////////////////////////////////////////
@ -705,6 +706,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
}
}
}
}
}
@ -1889,6 +1891,73 @@ bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
return true;
}
void TPrimanota_application::link_mastrino(const TBill& bill) const
{
if (bill.ok())
{
TPrimanota_application& a = app();
const TMask& cm = a.curr_mask();
int anno = cm.get_int(F_ANNOES);
if (anno <= 0)
{
TDate date = cm.get(F_DATACOMP);
if (!date.ok())
{
date = cm.get_date(F_DATAREG);
if (!date.ok())
date = TDate(TODAY);
}
anno = a._esercizi.date2esc(date);
}
TFilename ininame; ininame.tempdir(); ininame.add("mastrino.ini");
if (anno > 0)
{
TConfig ini(ininame, "Transaction");
ini.set("Action", "Modify");
ini.set_paragraph("24");
ini.set(RMV_ANNOES, anno);
ini.set(RMV_TIPOC, bill.tipo());
ini.set(RMV_GRUPPO, bill.gruppo());
ini.set(RMV_CONTO, bill.conto());
ini.set(RMV_SOTTOCONTO, bill.sottoconto());
}
if (ininame.exist())
{
TString cmd;
cmd << "cg3 -5 -i" << ininame;
TExternal_app app(cmd);
app.run();
xvt_fsys_removefile(ininame);
}
}
}
bool TPrimanota_application::mastrino_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TMask& m = f.mask();
TBill bill; bill.get(m, F_GRUPPO, F_CONTO, F_SOTTOCONTO);
app().link_mastrino(bill);
}
return true;
}
bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TMask& m = f.mask();
const char tipo = m.get(CG_TIPO)[0];
const short id_sotto = CG_SOTTOCONTO + (tipo <= ' ' ? 0 : (tipo == 'C' ? 100 : 200));
TBill bill; bill.get(m, CG_GRUPPO, CG_CONTO, id_sotto, CG_TIPO);
app().link_mastrino(bill);
}
return true;
}
///////////////////////////////////////////////////////////
// Handlers dei campi della testata
///////////////////////////////////////////////////////////
@ -1937,6 +2006,7 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
{
// Riempie a mano i campi necessari nel caso non sia stato usata la ricerca F9
m.set(F_DATAREG, mov.get(MOV_DATAREG), true);
m.set(F_CODCAUS, mov.get(MOV_CODCAUS));
f.set_focusdirty(false);
@ -1991,10 +2061,12 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
const TMask& m = f.mask();
const int ann = m.get_int(F_ANNOIVA);
const TString& cau = f.get();
const TCausale c(cau, ann);
if (!c.ok()) return false;
if (!c.ok())
return false;
const TCausale& k = app().causale();
const TCausale& k = app().causale();
const TString& msg = c.compatible(k);
if (msg.not_empty()) // La causale non e' compatibile
{

View File

@ -206,7 +206,6 @@ protected:
void init_mask(TMask& m);
static TipoIVA reg2IVA(const char* registro, int anno);
static int type2pos(char tipo);
static const real& cod2IVA(const TMask& m);
static real scorpora(real& imponibile, const real& percentuale);
static bool detraibile(TToken_string& row);
@ -283,6 +282,7 @@ protected:
bool link_anal(const TMask& msk, const char* action);
public:
static int type2pos(char tipo);
static char row_type(const TToken_string& s);
void type2colors(char tipor, COLOR& back, COLOR& fore);

View File

@ -206,13 +206,16 @@ char TCausale::sezione_ritsoc() const
}
char TCausale::sezione_ritfis()
{
if (_sezione_ritfis == ' ')
{
if (_rec.get_int(CAU_TIPOMOV) <= 2)
_sezione_ritfis = sezione(8); // Fatture
else
_sezione_ritfis = sezione(12); // Pagamenti
}
return _sezione_ritfis;
}
@ -271,9 +274,7 @@ const TString& TCausale::compatible(const TCausale& c) const
return msg;
}
return EMPTY_STRING;
}
bool TCausale::IVA2bill(const TCodiceIVA& iva, TBill& c) const

View File

@ -347,12 +347,12 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
{
const tipo_movimento tm = sum.tipo();
_can_solder = !(tm == tm_nota_credito || tm == tm_insoluto);
if (_can_solder)
/* if (_can_solder)
{
const TDate datasca(fatt.get(PART_DATADOC));
const TDate datapag(sum.get(PART_DATADOC));
_can_solder = datapag >= datasca;
}
} */
}
// Mostra saldo solo se non e' ne' un acconto, ne' una nota di credito
@ -1339,6 +1339,16 @@ int TGame_mask::nuovo_pagamento(TPartita& partita, int nriga, int rata, tipo_mov
TBill contro; causale.bill(caus, contro); // Legge conto contropartita
if (caus != 2 && contro.empty()) // Se non specificato ...
causale.bill(caus = 2, contro); // ... prende il primo
if (contro.sottoconto() == 0L)
{
const int nrow = app().type2pos('I');
if (nrow >= 0)
{
TSheet_field & cgs = app().cgs();
contro.get(cgs.row(nrow), 3);
}
}
contro.put(pagamento, TRUE); // Scrive conto contropartita
}
#endif

View File

@ -346,7 +346,6 @@ void TMastrino::read(const TBill& conto,
caption.format(FR("Caricamento mastrino %03d.%03d.%06ld"),
_conto.gruppo(), _conto.conto(), _conto.sottoconto());
TProgind pi(totrows, caption, false, true);
for (cur = 0L; cur.pos() < totrows; ++cur)
{
@ -2251,30 +2250,14 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep)
if (_last_grid)
{
TGrid_field& sht = (TGrid_field&)*_last_grid;
#if (XVT_PTK_VERSION_MAJOR > 4) || (XVT_PTK_VERSION_MAJOR == 4 && XVT_PTK_VERSION_MINOR >= 50)
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
if (menu)
if (menu != NULL)
{
const PNT& p = ep->v.mouse.where;
RCT cr; xvt_vobj_get_client_rect(win, &cr);
XVT_POPUP_ALIGNMENT pa = XVT_POPUP_CENTER;
if (p.h < cr.right / 3)
pa = XVT_POPUP_LEFT_ALIGN;
else
if (p.h > 2 * cr.right / 3)
pa = XVT_POPUP_RIGHT_ALIGN;
xvt_menu_popup(menu->child, win, p, pa, NULL);
xvt_menu_popup(menu->child, win, p, XVT_POPUP_CENTER, 0);
xvt_res_free_menu_tree(menu);
}
#else
ASK_RESPONSE r = xvt_dm_post_ask(TR("Annulla"), TR("Ripristina"), TR("Salva"),
TR("Ordinamento delle colonne"));
if (r == RESP_2)
sht.reset_columns_order();
if (r == RESP_2 || r == RESP_3)
sht.save_columns_order();
#endif
return;
}
}
@ -2284,16 +2267,10 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep)
{
switch (ep->v.cmd.tag)
{
case M_EDIT_UNDO:
_last_grid->reset_columns_order();
case M_EDIT_COPY:
_last_grid->save_columns_order();
break;
case M_EDIT_SEARCH:
_last_grid->on_key(K_F11);
break;
default:
break;
case BROWSE_BAR+1: _last_grid->save_columns_order(); break;
case BROWSE_BAR+2: _last_grid->reset_columns_order(); break;
case BROWSE_BAR+3: _last_grid->on_key(K_F11); break;
default: break;
}
return;
}
@ -2456,8 +2433,6 @@ public:
bool TMastrini_video::create()
{
xvtil_statbar_set("", TRUE);
open_files(LF_RMOV, LF_MOV, LF_CAUSALI, 0);
open_files(LF_SALDI, LF_PCON, 0);
@ -2507,7 +2482,6 @@ bool TMastrini_video::menu(MENU_TAG mt)
{
const TEsercizio& esercizio = esercizi.esercizio(codesc);
qm.set(F_ESERCIZIO, codesc);
qm.set(F_DADATA, esercizio.inizio());
qm.set(F_ADATA, esercizio.fine());
}
@ -2515,13 +2489,6 @@ bool TMastrini_video::menu(MENU_TAG mt)
KEY key = 0;
while (key != K_QUIT)
{
/* Ca$$ata tipica della Prassi
qm.reset(F_SOTTOCONTO); // Azzera sottoconto
qm.reset(F_CLIENTE); // Azzera cliente
qm.reset(F_FORNITORE); // Azzera fornitore
qm.reset(-5); // Azzera causali
*/
key = qm.run();
switch (key)
{
@ -2555,4 +2522,3 @@ int cg3600(int argc, char* argv[])
mv.run(argc, argv, TR("Mastrini"));
return 0;
}

View File

@ -636,23 +636,22 @@ bool TInv_cont::leggi_header()
return TRUE;
}
bool TInv_cont::record_controllo()
bool TInv_cont::record_controllo() const
{
/*
TString tiporecord = _control_rec.sub(0,2);
if (tiporecord != " 1")
return FALSE;
return TRUE;
*/
const TString& tiporecord = _control_rec.sub(0,2);
return atoi(tiporecord) == 1;
}
bool TInv_cont::esegui_controlli()
{
_esiste_record = leggi_header();
if (!controlli())
return FALSE;
return TRUE;
return controlli();
}
void TInv_cont::setta_parametri_record(TMask& m,const TString& flag)
@ -683,7 +682,7 @@ bool TInv_cont::controlli()
bool TInv_cont::sub_controlli()
{
long ditta_trasfer = _tras_file.ditta();
const long ditta_trasfer = _tras_file.ditta();
if (_ditta == ditta_trasfer)
{
@ -972,24 +971,20 @@ void TInv_cont::setta_tabella_studio(TMask& m,bool flag_ditta)
void TInv_cont::setta_tabella_ditta(TMask& m,const char* flag, bool comp)
{
TTable ind ("%IND");
TString dep;
long ditta = m.get_long(F_DITTAINV);
TString8 dep;
const long ditta = m.get_long(F_DITTAINV);
dep.format("%05ld", ditta);
ind.zero();
ind.put("CODTAB", dep);
if (ind.read() == NOERR)
{
int num = m.get_int(F_NUMULINV);
num++;
TDate data (m.get(F_DATALIM));
ind.put("S6", flag);
if (comp)
{
ind.put("I0", (long)num);
const long num = m.get_int(F_NUMULINV)+1;
const TDate data (m.get(F_DATALIM));
ind.put("I0", num);
ind.put("D0", data);
}
ind.rewrite();
@ -1060,6 +1055,7 @@ const char* TInv_cont::cerca_provincia(const TString& comcf) const
{
TString8 k; k << " |" << comcf;
return cache().get(LF_COMUNI, k, COM_PROVCOM);
}
bool TInv_cont::invio_tempfile(TMask& m)
@ -1954,9 +1950,8 @@ int cg6900 (int argc, char* argv[])
break;
case 'C':
{
TCanc_file_invio* a = new TCanc_file_invio;
a->run(argc, argv,"Eliminazione file invio");
delete a;
TCanc_file_invio a;
a.run(argc, argv,"Eliminazione file invio");
}
break;
@ -1965,4 +1960,4 @@ int cg6900 (int argc, char* argv[])
}
return TRUE;
}
}

View File

@ -46,7 +46,8 @@ class TInv_cont : public TSkeleton_application
TString _ocfpi, _ragsococc, _indocc, _capocc, _localocc, _provocc, _codvali, _codval;
bool _esiste_ditta, _esiste_record, _inviato, _flag_provvis, _flag_bollato;
long _ditta, _protiva, _uprotiva, _codcf, _numrec, _tot_rec;
long _dim_tot, _dim_disk,_dittaAS;
long _dittaAS;
unsigned long _dim_tot, _dim_disk;
long _numrec_cau,_numrec_clifo,_numrec_pcon,_numrec_pn,_numrec_iva,_numrec_sc;
int _num,_annoes;
TDate _data, _datadoc, _data74ter,_datalimsk,_dataregiva,_datareg;
@ -64,7 +65,7 @@ public:
{return FALSE;}
bool esiste_tabella_studio();
bool record_controllo();
bool record_controllo() const;
bool esegui_controlli();
bool leggi_header();
bool controlli();
@ -136,15 +137,15 @@ public:
void calcola_totale_record();
void scrivi_telefono(TString& app);
const char* cerca_provincia(const TString& comcf) const;
void cerca_dencom(const TString& comcf, TString& dencom) const;
const TString& cerca_provincia(const TString& comcf) const;
void cerca_dencom(TString& comcf,TString& dencom);
static bool setta_maschera_hnd(TMask_field& f, KEY k);
static bool messaggio_hnd (TMask_field& f, KEY k);
int calcola_numero_dischi(TMask& m,TString& floppy);
FILE* chiedi_disco(const char* name, int disk, TString& floppy, bool lettura);
bool scrivi_disco(TString& floppy, int disk, const char* work, FILE* i, TProgind& w);
int calcola_numero_dischi(TMask& m, const TString& floppy);
FILE* chiedi_disco(const char* name, int disk, const TString& floppy, bool lettura);
bool scrivi_disco(const TString& floppy, int disk, const char* work, FILE* i, TProgind& w);
bool invio_contabilita_PC();
void invio_testata_causali();
@ -164,4 +165,3 @@ public:
};
HIDDEN TInv_cont& app() { return (TInv_cont &) main_app(); }

View File

@ -4,14 +4,13 @@
#include "cg6900.h"
#include "cg6900a.h"
FILE* TInv_cont::chiedi_disco(const char* name, int disk, TString& floppy, bool lettura)
FILE* TInv_cont::chiedi_disco(const char* name, int disk, const TString& floppy, bool lettura)
{
FILE* f = NULL;
if (!xvt_fsys_is_removable_drive(floppy))
return f;
char flop = floppy[0];
if (flop != 'A' && flop != 'B') return f;
message_box("Inserire il disco %d nel drive %c:", disk, flop);
message_box("Inserire il disco %d nel drive %c:", disk, floppy[0]);
// name.ext(format("%03d", disk));
@ -31,19 +30,25 @@ FILE* TInv_cont::chiedi_disco(const char* name, int disk, TString& floppy, bool
return f;
}
bool TInv_cont::scrivi_disco(TString& floppy, int disk, const char* work,
bool TInv_cont::scrivi_disco(const TString& floppy, int disk, const char* work,
FILE* i, TProgind& w)
{
FILE* file = chiedi_disco(work, disk, floppy, FALSE);
if (floppy == "A" || floppy == "B")
if (file == NULL) return FALSE;
if (floppy[0] != 'A' && floppy[0] != 'B')
const bool is_floppy = xvt_fsys_is_removable_drive(floppy) != 0;
if (is_floppy)
{
if (file == NULL)
return FALSE;
}
else
{
if (_dim_disk < _dim_tot)
{
warning_box("Lo spazio su disco non e' sufficiente");
warning_box(FR("Occorrono almeno %d Kb di spazio su disco"), int(_dim_tot/1024+1));
return FALSE;
}
}
TString str;
str.format("%02d", disk);
@ -54,7 +59,6 @@ bool TInv_cont::scrivi_disco(TString& floppy, int disk, const char* work,
TFilename path_m = floppy; path_m.add("marker");
TFilename path_t = floppy; path_t.add("trasfer");
if (!fcopy(_marker,path_m)) // Copia il marker su disco
return FALSE;
@ -63,7 +67,7 @@ bool TInv_cont::scrivi_disco(TString& floppy, int disk, const char* work,
TString buffer(BUFSIZE);
long tot_scritti = BUFSIZE;
unsigned long tot_scritti = BUFSIZE;
while (tot_scritti <= _dim_disk)
{
@ -83,7 +87,7 @@ bool TInv_cont::scrivi_disco(TString& floppy, int disk, const char* work,
return TRUE;
}
int TInv_cont::calcola_numero_dischi(TMask& msk,TString& floppy)
int TInv_cont::calcola_numero_dischi(TMask& msk, const TString& floppy)
{
int numdisc = 1;
@ -107,7 +111,7 @@ int TInv_cont::calcola_numero_dischi(TMask& msk,TString& floppy)
_dim_tot = dim_t + dim_m; //+dim_h; // Determina la dimensione totale
if (floppy[0] == 'A' || floppy[0] == 'B')
if (xvt_fsys_is_removable_drive(floppy))
{
int item = msk.get_int(F_DIM);
@ -140,12 +144,7 @@ int TInv_cont::calcola_numero_dischi(TMask& msk,TString& floppy)
}
else
{
_dim_disk = 16L*1024L*1024L; // 16 mega
for (; _dim_disk > 0; _dim_disk -= 1024L*1024L)
{
if (xvt_fsys_test_disk_free_space("", _dim_disk))
break;
}
_dim_disk = xvt_fsys_get_disk_free_space(floppy, 'b');
}
return numdisc;
@ -703,6 +702,7 @@ bool TInv_cont::invio_clifo()
record.overwrite(str,133); //Localita'
const TString4 provincia = cerca_provincia(comcf);
str.format("%-2s", (const char*) provincia);
record.overwrite(str,153); //Provincia
@ -2043,4 +2043,4 @@ void TInv_cont::write_AS_imp(const real& importo, TString& record, int pos, int
negPC2negAS(numero);
numero.right_just(len, '0');
record.overwrite(numero, pos);
}
}

View File

@ -1,40 +1,18 @@
#include <prefix.h>
#include "cg6905.h"
#include "cglib04.h"
bool TCanc_file_invio::create()
{
TApplication::create();
dispatch_e_menu (BAR_ITEM(1));
return TRUE;
}
bool TCanc_file_invio::destroy()
{
return TApplication::destroy();
}
bool TCanc_file_invio::set()
void TCanc_file_invio::main_loop()
{
TString marker;
_tras_file.remove_all(FALSE);
TTransfer_file tras_file;
tras_file.remove_all(false);
TFilename marker;
marker = firm2dir(0);
marker << "\\marker";
::remove(marker);
xvt_fsys_removefile(marker);
message_box("Eliminazione file di lavoro dell' invio terminata");
return FALSE;
message_box("Eliminazione file di lavoro dell'invio terminata");
}
bool TCanc_file_invio::menu(MENU_TAG m)
{
if (m == BAR_ITEM(1))
return set();
return FALSE;
}

View File

@ -1,23 +1,10 @@
// Ripristino flag invio PN e IVA
#include <applicat.h>
#include <isam.h>
#include <urldefid.h>
#include <applicat.h>
#include "cglib04.h"
class TCanc_file_invio : public TApplication
class TCanc_file_invio : public TSkeleton_application
{
TTransfer_file _tras_file;
public:
virtual bool check_autorization() const
{return FALSE;}
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG m);
bool set();
TCanc_file_invio() {}
virtual bool check_autorization() const { return false; }
virtual void main_loop();
};

View File

@ -226,6 +226,7 @@ bool TEsercizi_contabili::code2range(int codice, TDate& dal, TDate& al) const
/////////////////////////////////////////////////////////
const char* iva2name(TipoIVA iva)
{
const char* i;
@ -982,6 +983,7 @@ int TBill::indicatore_bilancio() const
return ib;
}
bool TBill::sospeso() const
{
if (_tipo_cr < 0) tipo_cr(); // trick to load _sospeso

View File

@ -247,4 +247,3 @@ public:
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
#endif

View File

@ -452,6 +452,7 @@ bool TSaldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil
const real& TSaldo::saldo_periodo(int g, int c, long s, const TDate& dal, const TDate& al,
int indbil, bool provv)
{
_saldo_iniziale = ZERO;
_saldo = ZERO;
@ -467,7 +468,7 @@ const real& TSaldo::saldo_periodo(int g, int c, long s, const TDate& dal, const
const TDate inizio = es.esercizio(codes).inizio();
_annoes = codes;
TString80 key; key.format("%04d| |%d|%d|%ld", _annoes, g, c, s);
TString80 key; key.format("%04d| |%d|%d|%ld", _annoes, g, c, s);
const TRectype& saldo = cache().get(LF_SALDI, key);
_saldo_iniziale = saldo.get_real(SLD_SALDO);
@ -543,6 +544,7 @@ const real& TSaldo::saldo_periodo(int g, int c, long s, const TDate& dal, const
}
}
if (p != NULL)
delete p;
}
@ -1082,4 +1084,3 @@ TImporto TBalance::saldo_finale_chiusura() const
{
return saldo_finale(TRUE);
}

View File

@ -8,16 +8,14 @@ int main(int argc,char** argv)
switch (s)
{
case 1 :
cgp4100(argc,argv) ; break; // Importa stipendi in prima nota (OMASA)
cgp4200(argc,argv) ; break; // Importa stipendi in prima nota (OMASA)
default: cgp4100(argc,argv) ; break; // Importazione clienti (GSA/CODFIDI)
}
exit(0);
return 0;
}

View File

@ -502,6 +502,7 @@ TImporto TRiga_scadenze::esposto(bool valuta, const TDate & data_scad, const TDa
}
bool TRiga_scadenze::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta,
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
char& new_ap, TImporto& new_abb, TImporto& new_diffcam,
@ -2165,4 +2166,4 @@ TRiga_partite* TPartite_array::mov2rig(long numreg, int numrig)
return &game->riga(r);
}
return NULL;
}
}

View File

@ -901,6 +901,7 @@ void TPag_per_cms::find_commesse(const long nreg, const TRectype& riga_pag)
const TBill conto(rmoviva);
if (cms_in_range(codcms, codfase) && conto.indicatore_bilancio() != 5)
{
TToken_string cms_fsc = codcms;
if (codfase.not_empty())
@ -968,6 +969,7 @@ void TPag_per_cms::find_commesse(const long nreg, const TRectype& riga_pag)
const TString& codcms = rmov.get("CODCMS");
const TString& codfase = rmov.get("FASCMS");
if (cms_in_range(codcms,codfase) && conto.indicatore_bilancio() != 5)
{
TToken_string cms_fsc = codcms;
@ -1068,6 +1070,7 @@ void TPag_per_cms::add_importo(TAssoc_array& assoc, const TRectype& rmov) const
chiave.add(rmov.get("FASCMS"));
chiave.add(rmov.get(RMV_NUMREG));
TImporto* importo = (TImporto*)assoc.objptr(chiave);
if (importo == NULL)
{
@ -1094,6 +1097,7 @@ void TPag_per_cms::find_commesse_cg(const long nreg)
const TString& codcms = rmov.get("CODCMS");
const TString& codfase = rmov.get("FASCMS");
if (cms_in_range(codcms,codfase))
{
const TBill conto(rmov);
@ -1384,4 +1388,4 @@ int cm1100(int argc, char* argv[])
TPag_per_cms a;
a.run(argc,argv,TR("Stampa pagato per commessa"));
return 0;
}
}

View File

@ -97,10 +97,12 @@ protected:
TObject* dup() const { return new TLavorazione(*this); }
public:
const char* codice() const { return get("CODTAB"); }
const char* descr() const { return get("S0"); }
const char* um() const { return get("S6"); }
const char * codice() const { return get("CODTAB"); }
const char * descr() const { return get("S0"); }
const char * um() const { return get("S6"); }
TUm_tempo um_temporale() const {return (TUm_tempo)get_char("I7");}
bool lavorazione_non_rilevata() const { return get_bool("B3");}
real percentuale_minima() const { return get_real("R0"); }
real prezzo() const;
void reset_linee();

View File

@ -13,6 +13,8 @@
#define F_DESUNTEMPO 113
#define F_UNMIS2 114
#define F_LINEESTD 115
#define F_PERCMIN 116
#define F_PRODNRIL 117
#define F_CODLIN 101

View File

@ -108,6 +108,18 @@ BEGIN
FIELD B0
END
NUMBER F_PERCMIN 6 2
BEGIN
PROMPT 2 10 "Tempo minimo "
FIELD R1
END
BOOLEAN F_PRODNRIL
BEGIN
PROMPT 51 10 "Produzione non rilevata"
FIELD B3
END
ENDPAGE
PAGE "Parametri di MRP" -1 -1 65 15

View File

@ -65,6 +65,8 @@ bool TConf_dt::load_mask_ditte(TMask* mask)
row.add(workstring.get(1), 1);
row.add(workstring.get(2), 2);
row.add(workstring.get(3), 3);
row.add(workstring.get(4), 4);
row.add(workstring.get(5), 5);
sf_ditte.check_row(sf_ditte.items()-1);
}
return TRUE;
@ -119,6 +121,8 @@ bool TConf_dt::save_mask_ditte(TMask* mask)
workstring.add(line->get(1));
workstring.add(line->get(2));
workstring.add(line->get(3));
workstring.add(line->get(4));
workstring.add(line->get(5));
config_studio->set("ConfDitte", workstring, NULL, true, c++);
}
}
@ -178,4 +182,4 @@ int dt0300(int argc, char* argv[])
app.run(argc, argv, TR("Configurazione modulo"));
return 0;
}
}

View File

@ -1,12 +1,16 @@
// definizione campi maschera dt0300a - configurazione modulo DTECH
#define F_CONF_DOC 201 // configurazione causali/documenti
#define F_CONF_CODPAG 202 // condizione pagamento standard
#define F_CONF_NETTO 203 // contabilizzazione al netto dello sconto
#define F_CONF_DOC 201 // configurazione causali/documenti
#define F_CONF_CODPAG 202 // condizione pagamento standard
#define F_CONF_NETTO 203 // contabilizzazione al netto dello sconto
#define F_CONF_SPESEACC1 204 // codice spese accessorie 1
#define F_CONF_SPESEACC2 205 // codice spese accessorie 2
#define F_CONF_SCONTOFIN 206 // codice spesa sconto finanziario
#define F_S_NEGOZIO 101
#define F_S_CAUS 102
#define F_S_TIPODOCDT 103
#define F_S_TIPODOC 104
#define F_S_STATO 105
#define F_S_D_TIPODOC 106
#define F_S_D_STATO 107
#define F_S_NEGOZIO 101
#define F_S_CAUS 102
#define F_S_TIPODOCDT 103
#define F_S_TIPODOC 104
#define F_S_STATO 105
#define F_S_D_TIPODOC 106
#define F_S_D_STATO 107

View File

@ -33,7 +33,7 @@ END
STRING F_CONF_CODPAG 4
BEGIN
PROMPT 1 12 "Codice pagamento standard "
PROMPT 1 12 "Codice pagamento standard "
HELP "Codice di pagamento"
FIELD CondPag
FLAGS "U"
@ -47,11 +47,49 @@ END
BOOLEAN F_CONF_NETTO
BEGIN
PROMPT 1 13 "Contabilizzazione al netto sconto"
PROMPT 40 12 "Contabilizzazione al netto sconto"
HELP "Indicare se trasferire i documenti al netto dello sconto"
FIELD ContNettoSconto
END
STRING F_CONF_SPESEACC1 8
BEGIN
PROMPT 1 13 "Cod. spese acc. 1 "
FIELD SpeseAcc1
FLAGS "U"
USE SPP
INPUT CODTAB F_CONF_SPESEACC1
DISPLAY "Codice " CODTAB
DISPLAY "Descrizione@50 " S0
OUTPUT F_CONF_SPESEACC1 CODTAB
CHECKTYPE NORMAL
END
STRING F_CONF_SPESEACC2 8
BEGIN
PROMPT 1 14 "Cod. spese acc. 2 "
FIELD SpeseAcc2
FLAGS "U"
USE SPP
INPUT CODTAB F_CONF_SPESEACC2
DISPLAY "Codice " CODTAB
DISPLAY "Descrizione@50 " S0
OUTPUT F_CONF_SPESEACC2 CODTAB
CHECKTYPE NORMAL
END
STRING F_CONF_SCONTOFIN 8
BEGIN
PROMPT 1 15 "Cod. spesa per sconto fin. "
FIELD ScontoFin
FLAGS "U"
USE SPP SELECT S9 != " "
INPUT CODTAB F_CONF_SCONTOFIN
DISPLAY "Codice " CODTAB
DISPLAY "Descrizione@50 " S0
OUTPUT F_CONF_SCONTOFIN CODTAB
CHECKTYPE NORMAL
END
ENDPAGE
@ -59,7 +97,7 @@ ENDMASK
PAGE "" -1 -1 75 10
STRING F_S_NEGOZIO 6
STRING F_S_CODNEG 6
BEGIN
PROMPT 1 1 "Negozio "
END
@ -141,4 +179,4 @@ END
ENDPAGE
ENDMASK
ENDMASK

File diff suppressed because it is too large Load Diff

514
dt/dt0400b.ini Executable file
View File

@ -0,0 +1,514 @@
[MAIN]
DECSEP = ,
RECORDSEP = \n
TYPEFIELD = 1
TYPEPOS = 6
TYPELEN = 2
[TYPE STRINGA]
DATA = S
[TYPE DATA]
DATA = D
LENGTH=10
[TYPE NUMERO]
DATA = N
[TYPE IMPORTO]
DATA = N
LENGTH=10
DECIMAL=2
[TYPE QTA]
DATA = N
LENGTH=11
DECIMAL=3
[RECORD 01]
NAME(0) = CODICE NEGOZIO
TYPE(0) = STRINGA
POSITION(0) = 0
LENGTH(0) = 6
NAME(1) = TIPO RECORD
TYPE(1) = STRINGA
POSITION(1) = 6
LENGTH(1) = 2
NAME(2) = TIPO DOCUMENTO
TYPE(2) = STRINGA
POSITION(2) = 8
LENGTH(2) = 3
NAME(3) = NUMERO DOCUMENTO
TYPE(3) = NUMERO
POSITION(3) = 11
LENGTH(3) = 10
NAME(4) = DATA DOCUMENTO
TYPE(4) = DATA
POSITION(4) = 21
LENGTH(4) = 10
NAME(5) = CODICE CLIENTE
TYPE(5) = STRINGA
POSITION(5) = 31
LENGTH(5) = 8
NAME(6) = CODICE PAGAMENTO
TYPE(6) = STRINGA
POSITION(6) = 39
LENGTH(6) = 3
NAME(7) = CODICE DILAZIONE PAGAMENTO
TYPE(7) = STRINGA
POSITION(7) = 42
LENGTH(7) = 2
NAME(8) = DATA DI ESTRAZIONE
TYPE(8) = DATA
POSITION(8) = 44
LENGTH(8) = 10
NAME(9) = FLAG DI DOCUMENTO RECUPERATO
TYPE(9) = STRINGA
POSITION(9) = 54
LENGTH(9) = 1
NAME(10) = CAUSALE
TYPE(10) = STRINGA
POSITION(10) = 55
LENGTH(10) = 3
[RECORD 02]
NAME(0) = CODICE NEGOZIO
TYPE(0) = STRINGA
POSITION(0) = 0
LENGTH(0) = 6
NAME(1) = TIPO RECORD
TYPE(1) = STRINGA
POSITION(1) = 6
LENGTH(1) = 2
NAME(2) = TIPO DOCUMENTO
TYPE(2) = STRINGA
POSITION(2) = 8
LENGTH(2) = 3
NAME(3) = NUMERO DOCUMENTO
TYPE(3) = NUMERO
POSITION(3) = 11
LENGTH(3) = 10
NAME(4) = DATA DOCUMENTO
TYPE(4) = DATA
POSITION(4) = 21
LENGTH(4) = 10
NAME(5) = ALIQUOTA IVA
TYPE(5) = STRINGA
POSITION(5) = 31
LENGTH(5) = 4
NAME(6) = ARTICOLO LEGGE IVA
TYPE(6) = STRINGA
POSITION(6) = 35
LENGTH(6) = 3
NAME(7) = COMMA LEGGE IVA
TYPE(7) = STRINGA
POSITION(7) = 38
LENGTH(7) = 2
NAME(8) = SEGNO IMPORTO
TYPE(8) = STRINGA
POSITION(8) = 40
LENGTH(8) = 1
NAME(9) = IMPONIBILE
TYPE(9) = IMPORTO
POSITION(9) = 41
LENGTH(9) = 10
NAME(10) = IMPOSTA
TYPE(10) = IMPORTO
POSITION(10) = 51
LENGTH(10) = 10
[RECORD 03]
NAME(0) = CODICE NEGOZIO
TYPE(0) = STRINGA
POSITION(0) = 0
LENGTH(0) = 6
NAME(1) = TIPO RECORD
TYPE(1) = STRINGA
POSITION(1) = 6
LENGTH(1) = 2
NAME(2) = TIPO DOCUMENTO
TYPE(2) = STRINGA
POSITION(2) = 8
LENGTH(2) = 3
NAME(3) = NUMERO DOCUMENTO
TYPE(3) = NUMERO
POSITION(3) = 11
LENGTH(3) = 10
NAME(4) = DATA DOCUMENTO
TYPE(4) = DATA
POSITION(4) = 21
LENGTH(4) = 10
NAME(5) = TOTALE DOCUMENTO
TYPE(5) = IMPORTO
POSITION(5) = 31
LENGTH(5) = 10
NAME(6) = TOTALE SCONTI
TYPE(6) = IMPORTO
POSITION(6) = 41
LENGTH(6) = 10
NAME(7) = TOTALE A PAGARE
TYPE(7) = IMPORTO
POSITION(7) = 51
LENGTH(7) = 10
NAME(8) = CODICE STATO PAGAMENTO
TYPE(8) = STRINGA
POSITION(8) = 61
LENGTH(8) = 1
NAME(9) = SCONTO FINANZIARIO
TYPE(9) = IMPORTO
POSITION(9) = 62
LENGTH(9) = 10
NAME(10) = SEGNO SPESE ACC. 1
TYPE(10) = STRINGA
POSITION(10) = 72
LENGTH(10) = 1
NAME(11) = IMPONIBILE SPESE ACC. 1
TYPE(11) = IMPORTO
POSITION(11) = 73
LENGTH(11) = 10
NAME(12) = ALIQUOTA SPESE ACC. 1
TYPE(12) = STRINGA
POSITION(12) = 83
LENGTH(12) = 4
NAME(13) = ARTICOLO SPESE ACC. 1
TYPE(13) = STRINGA
POSITION(13) = 87
LENGTH(13) = 3
NAME(14) = COMMA SPESE ACC. 1
TYPE(14) = STRINGA
POSITION(14) = 90
LENGTH(14) = 2
NAME(15) = SEGNO SPESE ACC. 2
TYPE(15) = STRINGA
POSITION(15) = 92
LENGTH(15) = 1
NAME(16) = IMPONIBILE SPESE ACC. 2
TYPE(16) = IMPORTO
POSITION(16) = 93
LENGTH(16) = 10
NAME(17) = ALIQUOTA SPESE ACC. 2
TYPE(17) = STRINGA
POSITION(17) = 103
LENGTH(17) = 4
NAME(18) = ARTICOLO SPESE ACC. 2
TYPE(18) = STRINGA
POSITION(18) = 107
LENGTH(18) = 3
NAME(19) = COMMA SPESE ACC. 2
TYPE(19) = STRINGA
POSITION(19) = 110
LENGTH(19) = 2
[RECORD 04]
NAME(0) = CODICE NEGOZIO
TYPE(0) = STRINGA
POSITION(0) = 0
LENGTH(0) = 6
NAME(1) = TIPO RECORD
TYPE(1) = STRINGA
POSITION(1) = 6
LENGTH(1) = 2
NAME(2) = TIPO DOCUMENTO
TYPE(2) = STRINGA
POSITION(2) = 8
LENGTH(2) = 3
NAME(3) = NUMERO DOCUMENTO
TYPE(3) = NUMERO
POSITION(3) = 11
LENGTH(3) = 6
NAME(4) = DATA DOCUMENTO
TYPE(4) = DATA
POSITION(4) = 17
LENGTH(4) = 10
NAME(5) = CAUSALE
TYPE(5) = STRINGA
POSITION(5) = 27
LENGTH(5) = 5
NAME(6) = CODICE ARTICOLO
TYPE(6) = STRINGA
POSITION(6) = 32
LENGTH(6) = 15
NAME(7) = DESCRIZIONE ARTICOLO
TYPE(7) = STRINGA
POSITION(7) = 47
LENGTH(7) = 35
NAME(8) = QUANTITA
TYPE(8) = QTA
POSITION(8) = 82
LENGTH(8) = 11
NAME(9) = UNITA DI MISURA
TYPE(9) = STRINGA
POSITION(9) = 93
LENGTH(9) = 2
NAME(10) = PREZZO UNITARIO
TYPE(10) = IMPORTO
POSITION(10) = 95
LENGTH(10) = 10
NAME(11) = ALIQUOTA IVA
TYPE(11) = STRINGA
POSITION(11) = 105
LENGTH(11) = 4
NAME(12) = ARTICOLO LEGGE IVA
TYPE(12) = STRINGA
POSITION(12) = 109
LENGTH(12) = 3
NAME(19) = COMMA LEGGE IVA
TYPE(19) = STRINGA
POSITION(19) = 112
LENGTH(19) = 2
NAME(13) = SCONTO A VALORE
TYPE(13) = IMPORTO
POSITION(13) = 114
LENGTH(13) = 10
NAME(14) = IMPORTO TOTALE RIGA
TYPE(14) = IMPORTO
POSITION(14) = 114
LENGTH(14) = 10
NAME(15) = CODICE FORNITORE
TYPE(15) = STRINGA
POSITION(15) = 134
LENGTH(15) = 8
NAME(16) = NUMERO RIFERIMENTO BOLLA
TYPE(16) = NUMERO
POSITION(16) = 142
LENGTH(16) = 6
NAME(17) = DATA RIFERIMENTO BOLLA
TYPE(17) = DATA
POSITION(17) = 148
LENGTH(17) = 10
NAME(18) = CODICE REPARTO CASSA
TYPE(18) = STRINGA
POSITION(18) = 158
LENGTH(18) = 3
[RECORD 05]
NAME(0) = CODICE NEGOZIO
TYPE(0) = STRINGA
POSITION(0) = 0
LENGTH(0) = 6
NAME(1) = TIPO RECORD
TYPE(1) = STRINGA
POSITION(1) = 6
LENGTH(1) = 2
NAME(2) = TIPO DOCUMENTO
TYPE(2) = STRINGA
POSITION(2) = 8
LENGTH(2) = 3
NAME(3) = NUMERO DOCUMENTO
TYPE(3) = NUMERO
POSITION(3) = 11
LENGTH(3) = 6
NAME(4) = DATA DOCUMENTO
TYPE(4) = DATA
POSITION(4) = 17
LENGTH(4) = 10
NAME(5) = CAUSALE
TYPE(5) = STRINGA
POSITION(5) = 27
LENGTH(5) = 5
NAME(6) = CODICE ARTICOLO
TYPE(6) = STRINGA
POSITION(6) = 32
LENGTH(6) = 15
NAME(7) = DESCRIZIONE ARTICOLO
TYPE(7) = STRINGA
POSITION(7) = 47
LENGTH(7) = 35
NAME(8) = QUANTITA
TYPE(8) = QTA
POSITION(8) = 82
LENGTH(8) = 11
NAME(9) = UNITA DI MISURA
TYPE(9) = STRINGA
POSITION(9) = 93
LENGTH(9) = 2
NAME(10) = PREZZO UNITARIO
TYPE(10) = IMPORTO
POSITION(10) = 95
LENGTH(10) = 10
NAME(11) = ALIQUOTA IVA
TYPE(11) = STRINGA
POSITION(11) = 105
LENGTH(11) = 4
NAME(12) = ARTICOLO LEGGE IVA
TYPE(12) = STRINGA
POSITION(12) = 109
LENGTH(12) = 5
NAME(19) = COMMA LEGGE IVA
TYPE(19) = STRINGA
POSITION(19) = 112
LENGTH(19) = 2
NAME(13) = SCONTO A VALORE
TYPE(13) = IMPORTO
POSITION(13) = 114
LENGTH(13) = 10
NAME(14) = IMPORTO TOTALE RIGA
TYPE(14) = IMPORTO
POSITION(14) = 114
LENGTH(14) = 10
NAME(15) = CODICE FORNITORE
TYPE(15) = STRINGA
POSITION(15) = 134
LENGTH(15) = 8
NAME(16) = NUMERO RIFERIMENTO BOLLA
TYPE(16) = NUMERO
POSITION(16) = 142
LENGTH(16) = 6
NAME(17) = DATA RIFERIMENTO BOLLA
TYPE(17) = DATA
POSITION(17) = 148
LENGTH(17) = 10
NAME(18) = CODICE REPARTO CASSA
TYPE(18) = STRINGA
POSITION(18) = 158
LENGTH(18) = 3
[RECORD 06]
NAME(0) = CODICE NEGOZIO
TYPE(0) = STRINGA
POSITION(0) = 0
LENGTH(0) = 6
NAME(1) = TIPO RECORD
TYPE(1) = STRINGA
POSITION(1) = 6
LENGTH(1) = 2
NAME(2) = TIPO DOCUMENTO
TYPE(2) = STRINGA
POSITION(2) = 8
LENGTH(2) = 3
NAME(3) = CODICE FORNITORE
TYPE(3) = STRINGA
POSITION(3) = 11
LENGTH(3) = 8
NAME(4) = RAGIONE SOCIALE 1
TYPE(4) = STRINGA
POSITION(4) = 19
LENGTH(4) = 30
NAME(5) = RAGIONE SOCIALE 2
TYPE(5) = STRINGA
POSITION(5) = 49
LENGTH(5) = 30
NAME(6) = INDIRIZZO
TYPE(6) = STRINGA
LENGTH(6) = 40
POSITION(6) = 79
FIELD(6) = 20->INDCF
NAME(7) = CAP
TYPE(7) = STRINGA
LENGTH(7) = 5
POSITION(7) = 119
FIELD(7) = 20->CAPCF
NAME(8) = LOCALITA
TYPE(8) = STRINGA
LENGTH(8) = 20
POSITION(8) = 124
FIELD(8) = 20->LOCALITACF
NAME(9) = COMUNE
TYPE(9) = STRINGA
POSITION(9) = 144
LENGTH(9) = 30
NAME(10) = PROVINCIA
TYPE(10) = STRINGA
POSITION(10) = 174
LENGTH(10) = 2
NAME(11) = PARTITA IVA
TYPE(11) = STRINGA
POSITION(11) = 176
LENGTH(11) = 11
FIELD(11) = 20->PAIV
NAME(12) = CODICE FISCALE
TYPE(12) = STRINGA
POSITION(12) = 187
LENGTH(12) = 16
FIELD(12) = 20->COFI

View File

@ -834,6 +834,17 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
cf.set(valore);
} else
if (in == "CFPI")
{
valore = _firmrel->curr(LF_ANAG).get("PAIV");
valore.trim();
if (valore.empty())
{
valore = _firmrel->curr(LF_ANAG).get("COFI");
valore.trim();
}
cf.set(valore);
} else
if (in == "CFPI")
{
valore = _firmrel->curr(LF_ANAG).get("PAIV");
valore.trim();

View File

@ -1,7 +1,6 @@
<html>
<head>
<title>OneRed by DoubleOne</title>
<title>Campo</title>
</head>
</html>
@ -12,4 +11,4 @@
<!-- <frame name="alto" src="" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"> -->
<!-- SE LA PAGINA E' DENTRO PAGES <frame name="centro" src="index.asp" marginwidth="10" marginheight="0" scrolling="auto" frameborder="0"> -->
<frame name="centro" src="pages/home.html" marginwidth="10" marginheight="0" scrolling="auto" frameborder="0">
</frameset>
</frameset>

View File

@ -1,7 +1,7 @@
<html>
<head>
<title>DoubleOne</title>
<title>Campo</title>
<link rel="stylesheet" href="../stili/stile.css">
</head>
@ -21,4 +21,4 @@
</table>
</body>
</html>
</html>

View File

@ -1,6 +1,6 @@
<HTML>
<HEAD>
<TITLE>OneRed by DoubleOne</TITLE>
<TITLE>Campo</TITLE>
<link rel="stylesheet" href="../stili/stile.css">
<SCRIPT language=JavaScript>
@ -34,6 +34,7 @@ function flipImage(theButton, theAction)
</td>
<!-- <td colspan=4 height=60>OneRed by DoubleOne<BR></td> -->
<td colspan=4 height=60 align="right"><img src="../images/titolo.gif"></td>
</TR>
<table><tr><td><br></td></tr></table>
@ -74,4 +75,4 @@ function flipImage(theButton, theAction)
</TABLE>
</BODY>
</HTML>
</HTML>

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>DoubleOne</title>
<title></title>
<link rel="stylesheet" href="../stili/stile.css">
</head>
@ -933,4 +933,3 @@ CAMPO

View File

@ -1,7 +1,7 @@
<html>
<head>
<title>DoubleOne</title>
<title></title>
<link rel="stylesheet" href="../stili/stile.css">
</head>
@ -932,4 +932,3 @@ CAMPO

View File

@ -1,7 +1,7 @@
<html>
<head>
<title>DoubleOne</title>
<title></title>
<link rel="stylesheet" href="../stili/stile.css">
</head>
@ -294,4 +294,3 @@ CAMPO

View File

@ -1,7 +1,7 @@
<html>
<head>
<title>DoubleOne</title>
<title></title>
<link rel="stylesheet" href="../stili/stile.css">
</head>
@ -332,4 +332,3 @@ CAMPO

View File

@ -1,7 +1,8 @@
<html>
<head>
<title>DoubleOne</title>
<title></title>
<link rel="stylesheet" href="../stili/stile.css">
</head>
@ -339,4 +340,3 @@ CAMPO

View File

@ -7,9 +7,16 @@ BEGIN
MESSAGE EXIT,K_ENTER
END
BUTTON DLG_PDF 10 2
BEGIN
PROMPT -25 -1 "~PDF"
PICTURE BMP_PDF
MESSAGE EXIT,80
END
BUTTON DLG_EDIT 10 2
BEGIN
PROMPT -25 -1 "~Edit"
PROMPT -35 -1 "~Edit"
PICTURE BMP_EDIT
END

7
include/bagn009.h Executable file
View File

@ -0,0 +1,7 @@
#define F_FNAMEPDF 110
#define F_DNAMEPDF 111
#define F_FONT 102
#define F_SIZE 103
#define F_FROMPAGE 106
#define F_TOPAGE 107
#define F_FORM 108

64
include/bagn009.uml Executable file
View File

@ -0,0 +1,64 @@
#include <bagn009.h>
PAGE "Stampa su PDF" -1 -1 66 10
GROUPBOX DLG_NULL 64 5
BEGIN
PROMPT 1 0 "@bFile di Output"
END
STRING F_DNAMEPDF 80 48
BEGIN
PROMPT 2 1 "Cartella "
DSELECT
END
STRING F_FNAMEPDF 80 50
BEGIN
PROMPT 2 2 "File "
CHECKTYPE REQUIRED
END
STRING F_FONT 80 28
BEGIN
PROMPT 2 3 "Font "
FLAGS "D"
END
NUMBER F_SIZE 4
BEGIN
PROMPT 48 3 "Carattere "
FLAGS "D"
END
GROUPBOX DLG_NULL 64 4
BEGIN
PROMPT 1 5 "@bSelezione"
END
NUMBER F_FROMPAGE 4
BEGIN
PROMPT 2 6 "Da pagina "
CHECKTYPE REQUIRED
FLAGS "U"
END
NUMBER F_TOPAGE 4
BEGIN
PROMPT 2 7 "a pagina "
FLAGS "U"
END
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

28
include/bagnerrlog.rep Executable file
View File

@ -0,0 +1,28 @@
<report name="errlog" lpi="6">
<description>Log errori</description>
<font face="Verdana" size="12" />
<section type="Head" />
<section type="Head" level="1">
<field type="Stringa" valign="center" align="center" width="80" height="3" pattern="1">
<font face="Verdana" bold="1" size="24" />
<source>#HEADER</source>
</field>
</section>
<section type="Body" />
<section type="Body" level="1">
<field type="Array" width="10" pattern="1">
<source>SEVERITY</source>
<list>
<li Value=" " Code="0" />
<li Value="-" Code="1" />
<li Value="!" Code="2" />
</list>
</field>
<field x="4" type="Stringa" dynamic_height="1" width="80" height="4" pattern="1">
<source>MESSAGE</source>
</field>
</section>
<section type="Foot" />
<section type="Foot" level="1" />
</report>

View File

@ -1628,6 +1628,14 @@ void TPushbutton_control::set_caption(const char* c)
}
}
void TPushbutton_control::set_central_icon(unsigned int hicon)
{
xi_set_icon(_obj, hicon, hicon);
_obj->v.btn->icon_x = (_obj->v.btn->rct.right - _obj->v.btn->rct.left - 32) / 2 - 5;
_obj->v.btn->icon_y = (_obj->v.btn->rct.bottom - _obj->v.btn->rct.top - 32) / 2 - 5;
_obj->v.btn->drawable = false;
}
void TPushbutton_control::set_bmp(short bmp_up, short bmp_dn)
{
if (bmp_up > 0)
@ -2488,4 +2496,4 @@ TListbox_control::TListbox_control(WINDOW win, short cid,
TListbox_control::~TListbox_control()
{
delete _ddl; _ddl = NULL;
}
}

View File

@ -151,6 +151,7 @@ image BMP_DIRDN QRESDIR"dirdn.bmp"
image BMP_FILE QRESDIR"file.bmp"
image BMP_STOP QRESDIR"stop.bmp"
image BMP_FILECHK QRESDIR"filechk.bmp"
image BMP_PDF QRESDIR"pdf.bmp"
#scan <xil.h>
#transparent $$$

View File

@ -32,6 +32,7 @@
#define DLG_ELABORA 27 /* TAG del bottone <Elabora> */
#define DLG_EMAIL 29 /* TAG del bottone <Posta> */
#define DLG_PROFILE 30 /* TAG del campo <Profilo> */
#define DLG_PDF 31 /* TAG del bottone Stampa PDF */
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
/* @M

View File

@ -192,13 +192,15 @@ void TFile_text::set_gen_parm(TConfig& config, const TString& section)
_decsep = config.get_char("DECSEP",section);
_recordsize = config.get_int("RECORDSIZE",section); // solo se a lung. fissa
TString tmpstring = config.get("FIELDSEP",section); // solo se a lung. variabile
if (tmpstring[0] == '\\')
if (tmpstring[0] == '\\')
{
if (tmpstring = "\t")
_fieldsep = '\t';
}
else
_fieldsep = tmpstring[0]; // solo se a lung. variabile
_recordsep = config.get("RECORDSEP",section); // solo se a lung. variabile
if (_recordsize <= 0 && _recordsep.empty()) // separatore di record standard
_recordsep = "\r\n";
@ -529,7 +531,7 @@ int TFile_text::read(TRecord_text& rec)
}
}
if (_fieldsep != ' ')
if (_fieldsep != '\0')
{
buffer.separator(_fieldsep);
@ -1074,4 +1076,3 @@ int TFile_text::close()
if (_write_file) _write_file->close();
return 0;
}

View File

@ -1113,30 +1113,31 @@ void TForm_string::put_paragraph(const char* s)
void TForm_string::apply_format(TString& s) const
{
TString tmp(s);
if (!picture().blank())
const TString& strpic = picture();
if (strpic.full())
{
TToken_string delim(4, ','); // Stringa con i due delimitatori
const char * pic = picture(); // Picture senza delimitatori
TToken_string* delim = NULL; // Stringa con i due delimitatori
const char* pic = strpic; // Picture senza delimitatori
if (pic[0] == '(') // Se ci sono i delimitatori ...
{
const int bra = picture().find(')');
if (bra > 0) // ... cerca la parentesi chiusa
const int bra = strpic.find(')');
if (bra > 1) // ... cerca la parentesi chiusa
{
delim = picture().sub(1, bra); // memorizza delimitatori
pic += bra+1; // toglili dalla picture
delim = new TToken_string(strpic.sub(1, bra), ','); // memorizza delimitatori
pic += bra+1; // toglili dalla picture
}
}
if (strcmp(class_name(),"DATA")==0 && s.empty())
tmp ="";
TString80 tmp;
if (s.blank() && strcmp(class_name(),"DATA")==0)
tmp.cut(0);
else
tmp.picture(pic, s); // riempi la stringa col valore pitturato
if (!delim.empty_items()) // Aggiungi delimitatori
if (delim != NULL) // Aggiungi delimitatori
{
TString16 d(delim.get(0));
TString16 d(delim->get(0));
const int ld = d.len();
if (ld > 0) // Se il primo delimitatore e' valido ...
@ -1152,9 +1153,11 @@ void TForm_string::apply_format(TString& s) const
}
tmp.overwrite(d,spc - ld);
}
d = delim.get();
d = delim->get();
if (d.not_empty()) // Se il secondo delimitatore e' valido ...
tmp << d; // ... aggiungilo alla fine
tmp << d; // ... aggiungilo alla fine
delete delim;
}
s = tmp;
}
@ -1182,7 +1185,7 @@ const char* TForm_string::example() const
prova = "XXXXXXXXXXXXXXXXXXXXXXXXXX";
apply_format(prova);
const int w = width();
if (prova.size() > w && w > 0)
if (w > 0 && prova.size() > w)
prova.cut(w);
return prova;
}
@ -1193,12 +1196,10 @@ const char* TForm_string::example() const
class TForm_number : public TForm_string
{
protected: // TForm_string
virtual const char* class_name() const { return "NUMERO"; }
virtual bool parse_head(TScanner& scanner);
virtual bool update();
//virtual int height() const { return 0; }
protected:
int decimals() const { return _height; }
@ -1324,7 +1325,7 @@ bool TForm_number::update()
void TForm_number::apply_format(TString& s) const
{
if (!picture().blank())
if (picture().full())
{
real n(s);
TToken_string delim(4, ','); // Stringa con i due delimitatori
@ -1624,7 +1625,6 @@ protected:
virtual void print_on(TRectype& rform);
public:
virtual TObject* dup() const;
void set_format(const char* f) { _format = f; }
virtual bool edit(TMask& m);
@ -1690,7 +1690,6 @@ void TForm_date::print_on(TRectype& prof)
prof.put("DATEFORM", _format);
}
bool TForm_date::set(const char* s)
{
const TDate da(s);
@ -4504,7 +4503,7 @@ void TForm::init()
void TForm::read(
const char* name, // @parm Nome del profilo di stampa da leggere
const char* code, // @parm Codice del profilo di stampa da leggere
int lev, // @parm Permessi di stampa
int lev, // @parm Permessi di stampa
const char* desc) // @parm Descrizione del formato da leggere
{
_name= name;
@ -4718,6 +4717,7 @@ bool TForm::last_match_result(int file)
return ((TForm_skip_info &)_skip_info[file])._match_result;
return fatal_box("Tryed to get result of a never executed skip in file %d",file);
}
// @mfunc Memorizza l'avvenuto next_match sul file passato
bool TForm::next_match_done(int file)
{

142
include/log.cpp Executable file
View File

@ -0,0 +1,142 @@
#include <xvt.h>
#include <log.h>
#include <reprint.h>
class TError_set : public TRecordset
{
struct TError_row : public TObject
{
TVariant _sev, _msg;
};
TRecnotype _cur;
TArray _log;
TRecordset_column_info _info[2];
public:
virtual TRecnotype items() const;
virtual bool move_to(TRecnotype pos);
virtual TRecnotype current_row() const;
virtual void requery();
virtual unsigned int columns() const;
virtual const TRecordset_column_info& column_info(unsigned int column) const;
virtual const TVariant& get(unsigned int column) const;
void reset(const char* header);
void log(long sev, const char* msg);
TError_set();
virtual ~TError_set();
};
///////////////////////////////////////////////////////////
// TError_set
///////////////////////////////////////////////////////////
TRecnotype TError_set::items() const
{ return _log.items(); }
bool TError_set::move_to(TRecnotype pos)
{
_cur = pos;
return pos >= 0 && pos < items();
}
TRecnotype TError_set::current_row() const
{ return _cur; }
void TError_set::requery()
{ _cur = -1; }
unsigned int TError_set::columns() const
{ return 2; }
const TRecordset_column_info& TError_set::column_info(unsigned int i) const
{ return _info[i % columns()]; }
const TVariant& TError_set::get(unsigned int column) const
{
if (_cur >= 0 && _cur < items())
{
const TError_row& row = (const TError_row&)_log[_cur];
switch(column)
{
case 0: return row._sev;
case 1: return row._msg;
default: return NULL_VARIANT;
}
}
return NULL_VARIANT;
}
void TError_set::reset(const char* header)
{
set_var("#HEADER", header, true);
_log.destroy();
}
void TError_set::log(long sev, const char* msg)
{
TError_row* row = new TError_row;
row->_sev = sev;
row->_msg = msg;
_log.add(row);
}
TError_set::TError_set() : _log(NULL)
{
_info[0]._name = "SEVERITY";
_info[0]._width = 1;
_info[0]._type = _intfld;
_info[1]._name = "MESSAGE";
_info[1]._width = 80;
_info[1]._type = _alfafld;
}
TError_set::~TError_set()
{
}
void TError_log::log(long sev, const char* msg)
{
if (_log == NULL)
_log = new TError_set;
((TError_set*)_log)->log(sev, msg);
}
void TError_log::set_header(const char* header)
{
if (_log == NULL)
_log = new TError_set;
((TError_set*)_log)->reset(header);
}
bool TError_log::show()
{
bool ok = _log != NULL && _log->items() > 0 ;
if (ok)
{
TReport rep;
ok = rep.load(_rep);
if (ok)
{
rep.set_recordset(_log);
_log = NULL;
TReport_book book;
book.add(rep);
book.preview();
}
}
return ok;
}
TError_log::TError_log() : _rep("bagnerrlog"), _log(NULL)
{
}
TError_log::~TError_log()
{
if (_log != NULL)
delete _log;
}

26
include/log.h Executable file
View File

@ -0,0 +1,26 @@
#ifndef __LOG_H
#define __LOG_H
#ifndef __STRINGS_H
#include <strings.h>
#endif
class TRecordset;
class TError_log : public TObject
{
TString _rep;
TRecordset* _log;
public:
void set_rep(const char* rep) { _rep = rep; }
void set_header(const char* header);
void log(long sev, const char* msg);
bool show();
TError_log();
~TError_log();
};
#endif

View File

@ -191,32 +191,33 @@ void TMask::read_mask(
TFilename prof;
if (make_profile_name(prof))
{
TConfig ini(prof);
TString16 para(user()); para << "_Locks";
TConfig ini(prof, para);
TAuto_token_string str = ini.get("Lock");
if (!str.empty_items())
if (ini.set_paragraph(para))
{
const int items = fields();
TBit_array read_only(items); // Crea un opportuno array di bit
TBit_array read_only(items);
TAuto_token_string fields(ini.get("Lock"));
if (str == "*")
if (fields == "*")
read_only.set();
else
set_locking(read_only, str, true);
str = ini.get("Unlock");
if (!str.empty_items())
set_locking(read_only, str, false);
set_locking(read_only, fields);
fields = ini.get("Unlock");
set_locking(read_only, fields, false);
for (int j = 0; j < items; j++) if (read_only[j])
{
TMask_field& f = fld(j);
if (f.is_loadable())
if (f.is_loadable())
f.set_read_only(true);
}
}
}
}
}
void TMask::add_field(TMask_field* f)
@ -1464,6 +1465,7 @@ bool TMask::key_valid(word key) const
const int maxflds = fields();
bool full = false;
for (int f = 0; f < maxflds; f++)
{
TMask_field& c = fld(f);
if (c.is_editable() && c.shown() && c.in_key(key))
@ -1472,12 +1474,14 @@ bool TMask::key_valid(word key) const
{
if (c.required())
return false;
}
else
full = true;
}
}
return full;
}
// @doc EXTERNAL
@ -2085,6 +2089,7 @@ bool TMask::load(
char* buffer = t.get_buffer();
while (fgets(buffer, t.size(), f) != NULL && t != "[EOM]")
{
if (t.not_empty())
{
@ -2259,6 +2264,23 @@ bool TMask::kill_profile(int num)
return ok;
}
bool TMask::kill_profile(int num)
{
TFilename prof;
make_profile_name(prof);
TConfig ini(prof, "Main");
if (num <= 0)
num = ini.get_int(user());
TString16 name; name << num;
const bool ok = ini.set_paragraph(name);
if (ok)
ini.remove_all();
return ok;
}
const char* TMask::get_caption(TString& str) const
{
char* title = str.get_buffer(128);

View File

@ -256,22 +256,17 @@ public:
bool column_enabled(int col) const { return !column_disabled(col); }
// @cmember Ritorna il contenuto della riga <p n>-esima
TToken_string& row(int n)
{ return _str.row(n); }
TToken_string& row(int n) { return _str.row(n); }
// @cmember Aggiunge una riga allo spreadsheet passata come puntatore
// (vedi <mf TArray::add>)
int add(const TToken_string& s)
{ return _str.add(s); }
int add(const TToken_string& s) { return _str.add(s); }
// @cmember Aggiunge una riga allo spreadsheet (vedi <mf TArray::add>)
int add(TToken_string* s)
{ return _str.add(s); }
int add(TToken_string* s) { return _str.add(s); }
// @cmember Inserisce un record in una posizione stabilita
int insert(int rec, bool update_sheet, bool call_notify);
// @cmember Elimina il record <p rec>
bool destroy(int rec = -1, bool update_sheet = TRUE);
// @cmember Ritorna l'array di tutte le stringhe delle righe
TString_array& rows_array()
{ return _str; }
TString_array& rows_array() { return _str; }
// @cmember Trova una colonna abilitata a partire da colonna
int find_enabled_column(int rec, int colonna, int direction) const;
@ -381,7 +376,7 @@ public:
virtual ~TSpreadsheet();
};
int TSpreadsheet::NUMBER_WIDTH = 3;
int TSpreadsheet::ROW_NUMBER_WIDTH = 3;
KEY TSpreadsheet::barcode_newline() const
{
@ -426,7 +421,7 @@ TSpreadsheet::TSpreadsheet(
// Calcolo larghezza massima tabella
TToken_string header(head);
TToken_string new_header(256);
int i = 0, tot_width = NUMBER_WIDTH+1;
int i = 0, tot_width = ROW_NUMBER_WIDTH+1;
int max_width = tot_width<<1; // Stima larghezza della colonna piu' grande
unsigned char f_width[MAX_COL]; // Larghezza colonne fisse
const char * h;
@ -537,7 +532,7 @@ TSpreadsheet::TSpreadsheet(
attr |= XI_ATR_SELECTABLE;
XI_OBJ_DEF* coldef = xi_add_column_def(listdef, 0, attr, 0,
NUMBER_WIDTH * XI_FU_MULTIPLE, NUMBER_WIDTH+1,
ROW_NUMBER_WIDTH * XI_FU_MULTIPLE, ROW_NUMBER_WIDTH+1,
(char *)((attr & XI_ATR_SELECTABLE) ? "X" : ""));
coldef->app_data = (long)this;
@ -1767,16 +1762,13 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
const int next_rec = find_enabled_record(_cur_rec, k == K_ENTER ? +1 : -1);
if (next_rec >= 0)
{
dispatch_e_char(parent(), K_TAB);
dispatch_e_char(parent(), k == K_ENTER ? K_DOWN : K_UP);
refused = TRUE;
}
else
{
// if (xi_move_focus(get_interface())) // Test di uscita dalla cella corrente
// {
// xi_set_focus(_obj); // Riporta il focus sullo sheet
dispatch_e_char(parent(), k == K_ENTER ? K_F3 : K_F4);
// }
refused = TRUE;
}
}
@ -2150,8 +2142,8 @@ void TSpreadsheet::swap_rows( const int fromindex, const int toindex)
int TSpreadsheet::set_line_number_width(int digits)
{
const int old = NUMBER_WIDTH;
NUMBER_WIDTH = digits;
const int old = ROW_NUMBER_WIDTH;
ROW_NUMBER_WIDTH = digits;
return old;
}
@ -2393,6 +2385,7 @@ bool TSpreadsheet::notify(int rec, KEY k)
set_dirty(ok ? 1 : 3);
_cell_dirty = cell_dirty;
}
return ok;
}
@ -2843,10 +2836,10 @@ static int default_rows_compare(TSheet_field &s, int i, int j)
void TSheet_field::sort(ROWS_COMPARE_FUNCTION compare)
{
if (compare == NULL) compare = default_rows_compare;
if (compare == NULL)
compare = default_rows_compare;
const long last = items()-1;
for (int i = 0; i < last; i++)
{
for (int j = i+1; j <= last; j++)
@ -3299,4 +3292,4 @@ void TSheet_field::set_userget(SHEET_USERGETPUT handler)
void TSheet_field::set_userput(SHEET_USERGETPUT handler)
{
_userput = handler;
}
}

View File

@ -12,6 +12,7 @@
#include <bagn001a.h>
#include <bagn003.h>
#include <bagn009.h>
HIDDEN TPrinter* _printer = NULL;
@ -401,13 +402,15 @@ void TPrint_intersector::clear()
struct TPrint_txt_info
{
TTextfile* _txt;
TTextfile* _txt;
TFilename _pdf_file;
word _copies;
word _pagefrom;
word _pageto;
word _lastpage;
bool edit();
bool editpdf();
TPrint_txt_info(TTextfile& txt);
};
@ -435,6 +438,29 @@ bool TPrint_txt_info::edit()
return ok;
}
bool TPrint_txt_info::editpdf()
{
TPrinter& p = printer();
TMask msk("bagn009");
msk.set(F_FNAMEPDF, "");
msk.set(F_FONT, p.fontname());
msk.set(F_SIZE, p.get_char_size());
msk.set(F_FROMPAGE, 1);
msk.set(F_TOPAGE, _lastpage);
const bool ok = msk.run() == K_ENTER;
if (ok)
{
_copies = 1;
_pagefrom = msk.get_int(F_FROMPAGE);
_pageto = msk.get_int(F_TOPAGE);
_pdf_file = msk.get(F_DNAMEPDF);
_pdf_file.add(msk.get(F_FNAMEPDF));
_pdf_file.ext(".pdf");
}
return ok;
}
TPrint_txt_info::TPrint_txt_info(TTextfile& txt)
: _txt(&txt), _copies(1), _pagefrom(1), _pageto(0)
{
@ -529,6 +555,17 @@ BOOLEAN TPrinter::start_print(long data)
}
}
BOOLEAN TPrinter::start_print_pdf(long data)
{
const TPrint_txt_info *pd = (TPrint_txt_info *) data;
TTextfile& txt = *(pd->_txt);
TPrintwin pw(txt, pd->_pdf_file);
if (pw.win() != NULL_WIN)
pw.do_print(pd->_pagefrom, pd->_pageto, pd->_copies);
return pw.aborted();
}
// utils del caz
HIDDEN int read_int (const char *s, int &n, int &cnt)
{
@ -1834,6 +1871,26 @@ void TPrinter::print_txt(TTextfile& txt)
}
void TPrinter::print_pdf(TTextfile& txt)
{
if (txt.lines() > 0)
{
TPrint_txt_info what(txt);
if (what.editpdf())
{
TString256 s;
xvt_print_open();
xvt_print_get_name(_print_rcd, s.get_buffer(), s.size());
xvt_print_set_name(_print_rcd, XVT_PDF_PRINTER_NAME);
xvt_print_start_thread(start_print_pdf, long(&what));
xvt_print_set_name(_print_rcd, s);
xvt_print_close();
}
}
}
void TPrinter::close ()
{
if (isopen() && // la stampante era aperta e
@ -1861,6 +1918,13 @@ void TPrinter::close ()
print_txt(_vf->text());
}
if (key == K_CTRL+'P')
{
_isopen = FALSE;
_currentrow = _currentpage = 1;
print_pdf(_vf->text());
}
delete _vf; _vf = NULL;
}
else if (_printertype == exportprinter)
@ -2074,7 +2138,6 @@ HIDDEN BOOLEAN calc_cols_callback(long data)
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, pr.get_printrcd(), &ph, &pw, &pvr, &phr);
xvtil_set_font(win, printer().fontname(), XVT_FS_NONE, pr.get_char_size());
// Compute maximum number of chars per line
int mincol = 1, maxcol=MAX_PR_WIDTH;
const TString spc(maxcol,'M');

View File

@ -332,6 +332,8 @@ public:
// @cmember Inizia una nuova sessione di stampa. Viene passata alla <mf TPrintwin::do_print>
static BOOLEAN start_print(long data);
// @cmember Inizia una nuova sessione di stampa PDF. Viene passata alla <mf TPrintwin::do_print>
static BOOLEAN start_print_pdf(long data);
// @cmember Setta il numero della prima pagina da stampare
void set_from_page (word from)
@ -426,6 +428,8 @@ public:
{ return _txt; }
// @cmember Stampa il testo
void print_txt(TTextfile& txt);
// @cmember Stampa il testo su pdf
void print_pdf(TTextfile& txt);
// @cmember Setta l'handle dell'header
void setheaderhandler(PRINTSECTIONHANDLER h)

View File

@ -222,7 +222,6 @@ void TPrintwin::paint_row(long j)
_txt.read_line(j);
int pos = 0;
int curr_style = -1;
for (const char* cp = _txt.piece(); cp; cp = _txt.piece())
@ -342,7 +341,7 @@ bool TPrintwin::do_print(word page_from, word page_to, word copies)
}
TPrintwin::TPrintwin(TTextfile& txt)
TPrintwin::TPrintwin(TTextfile& txt, const char* title)
: _aborted(FALSE), _txt(txt), _inited(FALSE)
{
TPrinter& p = printer();
@ -353,23 +352,34 @@ TPrintwin::TPrintwin(TTextfile& txt)
_aborted = TRUE;
return;
}
if (title == NULL)
title = main_app().title();
WINDOW prwin = xvt_print_create_win(_printrcd, main_app().title());
WINDOW prwin = xvt_print_create_win(_printrcd, title);
if (prwin == NULL_WIN)
{
_aborted = TRUE;
return;
}
set_win(prwin);
set_win(prwin);
const bool ispdf = (xvt_print_is_pdf(_printrcd) != 0);
if (ispdf)
{
if (_aborted = (xvt_print_open_page(_printrcd) == 0))
return;
}
_char_size = p.get_char_size();
set_font(p.fontname(), XVT_FS_NONE, _char_size);
LEN_SPACES(win(), -1); // force update
_pagelen = p.formlen();
p.init_formlen(prwin); // Calcola offset e altre misure pagina
if (!ispdf) p.init_formlen(prwin); // Calcola offset e altre misure pagina
int abs_column=p.get_column_offset();
int segno = abs_column>=0 ? 1 : -1;
abs_column*=segno;
@ -378,12 +388,13 @@ TPrintwin::TPrintwin(TTextfile& txt)
_chary = p.get_dots_per_line();
_hofs = p.get_horz_offset() + segno*LEN_SPACES(prwin,abs_column);
_vofs = p.get_vert_offset() + p.get_line_offset()*_chary;
_formlen = p.formlen();
p.formlen(_pagelen);
_formwidth = p.formwidth();
_inited = TRUE;
}
@ -394,4 +405,3 @@ TPrintwin::~TPrintwin()
set_win(NULL_WIN);
}

View File

@ -84,7 +84,7 @@ public:
bool do_print(word page_from, word page_to, word copies);
// @cmember Costruttore
TPrintwin(TTextfile& txt);
TPrintwin(TTextfile& txt, const char* title = NULL);
// @cmember Distruttore
virtual ~TPrintwin();
};

View File

@ -87,6 +87,7 @@ const TRectype& TRecord_array::key() const
{
const TRectype* r = (const TRectype*)_data.objptr(0);
CHECK(r != NULL, "TRecord_array lost its key");
return *r;
}
@ -560,12 +561,6 @@ void TFile_cache::test_firm()
}
}
/*
if (_limit > 0 && items() > _limit)
flush_needed = TRUE; // Perche' buttare via tutto?
*/
//
if (_limit > 0 && items() > _limit)
{
const THash_object* rand = _cache.random_hash_object();
@ -790,7 +785,10 @@ TRecord_cache& TDB_cache::rec_cache(int file)
if (rc == NULL)
{
rc = new TRecord_cache(file);
rc->set_items_limit(file==LF_TAB || file==LF_TABCOM ? 1024 : 256);
const int reclen = prefix().get_reclen(file);
int limit = (1024*1024)/reclen; // Al massimo dedico un mega ad ogni cache
if (limit > 1024) limit = 1024;
rc->set_items_limit(limit);
rc->test_file_changes();
add(rc, file);
}
@ -875,4 +873,4 @@ TDB_cache& cache()
}
TRecord_cache& rec_cache(int file)
{ return cache().rec_cache(file); }
{ return cache().rec_cache(file); }

View File

@ -502,7 +502,7 @@ void TRecordset::find_and_reset_vars()
if (is_var_separator(sql[diesis-1])) // Controllo che ci sia un separatore prima del #
{
int i = diesis+1;
for ( ; sql[i] && (isalnum(sql[i]) || sql[i] == '_' || sql[i] == '.' || sql[i] == '#'); i++);
for ( ; sql[i] && (isalnum(sql[i]) || strchr("@_.#", sql[i]) != NULL); i++);
if (i > diesis+1)
{
const TString& name = sql.sub(diesis, i);
@ -669,7 +669,6 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
TString_array lista;
TFilename path;
{
TWait_cursor hourglass;
@ -724,7 +723,6 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files
}
}
}
return !files.empty();
}
@ -732,7 +730,6 @@ bool select_custom_file(TFilename& path, const char* ext, const char* library)
{
TArray_sheet sheet(-1, -1, 80, 20, TR("Selezione"), HR("Nome@8|Classe|Descrizione@50|Custom"));
TString_array& files = sheet.rows_array();
bool ok = list_custom_files(ext, library, files);
if (ok)
@ -1883,6 +1880,7 @@ const TVariant& TISAM_recordset::get(int logic, const char* fldname) const
}
const int colon = name.find(':');
if (colon > 0)
{
subfield = name.mid(colon+1);
@ -2004,6 +2002,7 @@ TCursor* TISAM_recordset::cursor() const
{
set_custom_filter(*_cursor);
const TRecnotype items = _cursor->items();
_cursor->freeze();
if (items > 0)
*_cursor = 0L;
@ -2118,4 +2117,4 @@ long TRecordset_sheet::get_items() const
TRecordset_sheet::TRecordset_sheet(TRecordset& query)
: TSheet(-1, -1, -2, -4, "Query", query.sheet_head()), _query(query)
{
}
}

View File

@ -5,13 +5,12 @@
#include <relation.h>
#include <reprint.h>
#include <xml.h>
#include <anagr.h>
#include <comuni.h>
#include <nditte.h>
#include <unloc.h>
#define MAX_STRING " "
static const char MAX_STRING[2] = {255, 0};
///////////////////////////////////////////////////////////
// TReport_font
@ -1100,6 +1099,22 @@ void TReport_field::set_dynamic_height(bool dh)
bool TReport_field::dynamic_height() const
{ return _dynamic_height; }
const TRectangle& TReport_field::get_draw_rect() const
{
TRectangle& rct = ((TReport_field*)this)->_draw_rct;
if (dynamic_height())
{
TParagraph_string str(formatted_text(), rct.width()/100-1); // Sto un po' scarso
int h = str.items() * 100;
if (h <= 0)
h = 100;
if (h > _rct.height())
h = _rct.height();
rct.set_height(h);
}
return rct;
}
const TReport_font& TReport_field::font() const
{
return _font != NULL ? *_font : _section->font();
@ -1970,8 +1985,8 @@ int TReport::parse_field(const char* code, char& type, int& level, int& id) cons
TReport_section* sec = find_section(type, level);
if (sec == NULL)
return 1;
const int dot = code[2] == '.' ? 2 : (code[3] == '.' ? 3 : -1);
const char* pdot = strchr(code, '.');
const int dot = pdot ? int(pdot-code) : -1;
if (dot <= 0)
return 2;
id = atoi((const char*)code + dot + 1);
@ -2757,6 +2772,7 @@ void TReport::msg_firm(TVariant_stack& stack)
if (in=="FAX")
{
TString valore(16);
valore = ditta.get(NDT_PFAX);
if (valore.not_empty())
valore << '-';
@ -2797,6 +2813,7 @@ void TReport::msg_firm(TVariant_stack& stack)
}
key.cut(0) << anag.get(ANA_STATORES) << '|' << anag.get(is_fisc ? ANA_COMRF : ANA_COMRES);
const TRectype& comune = cache().get(LF_COMUNI, key);
if (in=="COM")

View File

@ -10,6 +10,7 @@
#include <urldefid.h>
#include <bagn003.h>
#include <bagn009.h>
static bool _print_aborted = false;
@ -96,6 +97,7 @@ void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char
}
else
xvt_dwin_set_clip(w, (RCT*)&r);
if (halign == 'J')
advanced_draw_justified_text_line(win, text, x, y, dx);
@ -106,9 +108,11 @@ void advanced_draw_text_line(TWindow& win, const char* text, const RCT& r, char
xvt_dwin_set_clip(w, &orig);
else
xvt_dwin_set_clip(w, NULL);
}
bool finisce_per_punto(const TString& str)
{
bool yes = false;
const int len = str.len();
@ -123,18 +127,27 @@ bool finisce_per_punto(const TString& str)
void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT& rct,
char halign, char valign, int default_10row_height)
{
const int rows = para.items();
if (rows > 1) // Devo scrivere piu' righe?
{
int leading, ascent, descent;
xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
int ky10 = (leading + ascent + descent) * 10;
// Aggiusta l'altezza di una riga standard, se necessario
if (ky10 < default_10row_height && ky10 > 80*default_10row_height/100)
ky10 = default_10row_height;
const bool acapo = para.find('\n') >= 0;
const int rct_height = rct.bottom - rct.top;
int leading, ascent, descent;
xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
int ky10 = (leading + ascent + descent) * 10;
// Aggiusta l'altezza di una riga standard, se necessario
if (ky10 < default_10row_height && ky10 > 80*default_10row_height/100)
ky10 = default_10row_height;
const int rct_height = rct.bottom - rct.top;
int rows = (rct_height * 11) / ky10; // Sto abbondante del 10% (*11/10) altrimenti risulta spesso 0
if (acapo || rows > 1) // Devo scrivere piu' righe?
{
const int kx10 = xvt_dwin_get_text_width(win.win(), "MMMMMMMMMM", 10);
const unsigned columns = (rct.right - rct.left) * 10 / kx10;
TParagraph_string str(para, columns);
if (str.items() < rows)
rows = str.items();
int ybase = rct.top;
switch (valign)
@ -146,30 +159,17 @@ void advanced_draw_paragraph(TWindow& win, const TString_array& para, const RCT&
for (int row = 0; row < rows; row++)
{
const int top = ybase + (ky10 * row) / 10;
if (top < rct.bottom)
{
const TString& line = para.row(row);
if (!line.blank())
{
RCT rctline = rct;
rctline.top = top;
rctline.bottom = top + ky10 / 10;
char ha = halign;
if (ha == 'J' && (row == rows-1 || finisce_per_punto(line)))
ha = 'L';
advanced_draw_text_line(win, line, rctline, ha, 'T');
}
}
else
break;
RCT rctline = rct;
rctline.top = ybase + (ky10 * row) / 10;
rctline.bottom = rctline.top + ky10 / 10;
const char* line = str.get();
if (halign == 'J' && (row == rows-1 || strlen(line) < columns/2))
halign = 'L';
advanced_draw_text_line(win, line, rctline, halign, 'T');
}
}
else
{
if (halign == 'J') halign = 'L';
advanced_draw_text_line(win, para.row(0), rct, halign, valign);
}
advanced_draw_text_line(win, para, rct, halign, valign);
}
///////////////////////////////////////////////////////////
@ -735,16 +735,29 @@ TPreview_mask::TPreview_mask(TBook* book) : _book(book)
class TWindow_printer : public TWindow
{
long _pvr, _phr;
protected:
bool is_ok() const { return win() != NULL_WIN; }
virtual PNT log2dev(long x, long y) const;
public:
bool print_doc(const TFilename& name);
TWindow_printer(PRINT_RCD* rcd);
TWindow_printer(PRINT_RCD* rcd, const char* title);
~TWindow_printer();
};
PNT TWindow_printer::log2dev(long x, long y) const
{
PNT ptdev;
ptdev.h = (x * _phr) / BOOKDPI;
ptdev.v = (y * _pvr) / BOOKDPI;
return ptdev;
}
bool TWindow_printer::print_doc(const TFilename& name)
{
bool ok = name.exist();
@ -760,12 +773,14 @@ bool TWindow_printer::print_doc(const TFilename& name)
return ok;
}
TWindow_printer::TWindow_printer(PRINT_RCD* rcd)
{
WINDOW prwin = xvt_print_create_win(rcd, "Stampa");
TWindow_printer::TWindow_printer(PRINT_RCD* rcd, const char* title)
{
long ph, pw;
WINDOW prwin = xvt_print_create_win(rcd, title);
set_win(prwin);
_pixmap = true;
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, rcd, &ph, &pw, &_pvr, &_phr);
}
TWindow_printer::~TWindow_printer()
@ -777,6 +792,7 @@ TWindow_printer::~TWindow_printer()
}
}
///////////////////////////////////////////////////////////
// Writing a page
///////////////////////////////////////////////////////////
@ -1147,6 +1163,7 @@ void TBook::print_doc(TWindow& win, const TFilename& name)
}
}
bool TBook::print_page(TWindow& win, size_t page)
{
if (page <= 0 || page > pages())
@ -1276,11 +1293,13 @@ bool TBook::print_page(TWindow& win, size_t page)
xvt_dwin_set_clip(w, &rct);
} else
if (str.starts_with("</clip"))
{
xvt_dwin_set_clip(w, NULL);
} else
if (str == "<ellipse/>")
{
xvt_dwin_draw_oval(w, &rct);
@ -1305,14 +1324,24 @@ bool TBook::print_page(TWindow& win, size_t page)
else
xvt_dwin_set_font(w, font.get_xvt_font(win));
continue;
}
if (str.starts_with("<image "))
{
TString name; get_xml_string(str, "src", name);
TFilename name; get_xml_string(str, "src", name);
TImage* img = _images.image(name);
if (img != NULL)
img->draw(w, rct);
{
if (is_pdf())
{
name.custom_path();
xvt_dwin_draw_image_on_pdf(w, name, &rct);
}
else
img->draw(w, rct);
}
continue;
}
if (str == "<line/>")
@ -1375,6 +1404,7 @@ bool TBook::print_page(TWindow& win, size_t page)
advanced_draw_paragraph(win, paragrafo, rct,
_horizontal_alignment, _vertical_alignment,
default_10row_height);
continue;
}
if (str.starts_with("<text_align "))
@ -1554,7 +1584,16 @@ bool TBook::export_text(const TFilename& fname) const
bool TBook::init()
{
_rcd = printer().get_printrcd();
if (!is_pdf())
{
_rcd = printer().get_printrcd();
}
else
{
int intSize;
_rcd = xvt_print_create_by_name(&intSize, XVT_PDF_PRINTER_NAME);
}
if (!xvt_print_is_valid(_rcd))
return error_box(TR("Stampante non valida"));
@ -1563,7 +1602,12 @@ bool TBook::init()
if (_pw <= 0 || _ph <= 0)
return error_box(TR("Dimensioni pagina NULLE"));
_ph = _ph * BOOKDPI / _pvr;
_pw = _pw * BOOKDPI / _phr;
_pvr = _phr = BOOKDPI;
bool ok = true;
if (_pvr < 96 || _phr < 96) // Risoluzione minima di Acrobat Writer
{
ok = yesno_box(FR("Stampante obsoleta o non adeguatamente configurata:\n"
@ -1574,10 +1618,11 @@ bool TBook::init()
{
if (_printwin != NULL)
delete _printwin;
_printwin = new TWindow_printer(_rcd);
_printwin = new TWindow_printer(_rcd, _pdf_file);
}
return ok;
}
bool TBook::main_loop()
@ -1594,11 +1639,17 @@ bool TBook::main_loop()
{
for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++)
{
if (!print_page(*_printwin, page))
if (!print_page( *_printwin, page))
_print_aborted = true;
}
}
if (is_pdf())
{
xvt_print_destroy(_rcd);
_rcd = NULL;
}
return !_print_aborted;
}
@ -1642,6 +1693,46 @@ bool TBook::print(size_t pagefrom, size_t pageto, size_t copies)
_copies = copies;
}
_pdf_file.cut(0);
xvt_print_start_thread(main_loop_callback, (long)this);
return true;
}
bool TBook::print_to_pdf(size_t pagefrom, size_t pageto, size_t copies)
{
if (pages() <= 0)
return false;
if (pagefrom == 0)
{
TPrinter& p = printer();
TMask msk("bagn009");
msk.set(F_FNAMEPDF, "");
msk.set(F_FONT, p.fontname());
msk.set(F_SIZE, p.get_char_size());
msk.set(F_FROMPAGE, 1);
msk.set(F_TOPAGE, pages());
if (msk.run() == K_ENTER)
{
_copies = 1;
_pagefrom = msk.get_int(F_FROMPAGE);
_pageto = msk.get_int(F_TOPAGE);
_pdf_file = msk.get(F_DNAMEPDF);
_pdf_file.add(msk.get(F_FNAMEPDF));
_pdf_file.ext(".pdf");
}
else
return false;
}
else
{
_pagefrom = pagefrom;
_pageto = pageto;
_copies = copies;
_pdf_file = "campo.pdf";
}
xvt_print_start_thread(main_loop_callback, (long)this);
return true;
}
@ -1650,8 +1741,17 @@ bool TBook::preview()
{
TPreview_mask msk(this);
const KEY k = msk.run();
if (k != K_QUIT)
switch (k)
{
case K_QUIT:
break;
case 'P':
print_to_pdf();
break;
default:
print();
break;
}
return true;
}
@ -1678,6 +1778,7 @@ TBook::TBook(const char* name)
_pw(0), _ph(0), _pvr(0), _phr(0),
_pages(0), _page(0), _rcd(NULL), _printwin(NULL), _page_is_open(false)
{
_file = name;
if (_file.blank())
@ -1730,6 +1831,7 @@ void TPrintind::update_bar()
}
TPrintind::TPrintind(long n, const char* msg) : TProgind(n, msg, true, true)
{
if (ADVANCED_GRAPHICS)
{

View File

@ -5,12 +5,15 @@
#include <report.h>
#endif
enum {BOOKDPI = 720};
class TBook : public TObject
{
size_t _page, _pages;
TPointer_array _index;
TFilename _file;
TFilename _pdf_file;
ofstream* _out;
bool _is_temporary;
@ -31,7 +34,7 @@ protected:
virtual void define_frame(const TRectangle& rect);
virtual bool init();
TPoint log2dev(const TPoint& ptlog) const;
bool is_pdf() const { return _pdf_file.full(); }
public:
virtual bool open_page();
@ -70,6 +73,7 @@ public:
virtual bool on_link(const TReport_link&) { return false; }
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
virtual bool print_to_pdf(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
virtual bool preview();
virtual bool export_text(const TFilename& fname) const;
bool print_or_preview(); // Calls one of the above

View File

@ -98,7 +98,8 @@
#define BMP_FILECHK 171
#define BMP_DIRSEL 172
#define BMP_DIRDNSEL 173
#define BMP_PDF 174
#endif
/* @END */

View File

@ -37,6 +37,7 @@ int PRINT_HEIGHT = 10;
#define CTRL_E (K_CTRL + 'E')
#define CTRL_S (K_CTRL + 'S')
#define CTRL_R (K_CTRL + 'R')
#define CTRL_P (K_CTRL + 'P')
HIDDEN bool in_update;
@ -1314,6 +1315,11 @@ void TViswin::on_button(short dlg)
case DLG_PRINT:
dispatch_e_menu(win(), M_VISWIN_PRINT);
break;
case DLG_PDF:
xvt_statbar_set ("");
xvt_statbar_refresh ();
stop_run(CTRL_P);
break;
case DLG_EDIT:
check_link();
call_editor();
@ -1904,6 +1910,10 @@ bool TViswin::on_key(KEY key)
if (_isprint)
stop_run(CTRL_S);
break;
case CTRL_P:
if (_isprint)
stop_run(CTRL_P);
break;
case CTRL_R:
check_link ();
force_update ();
@ -2330,7 +2340,9 @@ void TViswin::close_print ()
enable_menu_item(M_VISWIN_STOP, FALSE);
if (_print_button)
_print_button->enable();
enable_menu_item(M_VISWIN_PRINT, TRUE);
enable_menu_item(M_VISWIN_PRINT, TRUE);
if (_pdf_button)
_pdf_button->enable();
// build bookmark menu tree
_bookmarks = &(printer().get_bookmarks());
@ -2528,7 +2540,7 @@ TViswin::TViswin(const char *fname,
_isbar (FALSE), _scrolling (FALSE), _istimer (FALSE), _selflag (FALSE), _sel_displayed (FALSE),
_link_displayed (FALSE), _cross_displayed (FALSE),
_point_displayed (FALSE), _need_scroll (none),
_link_button(NULL), _print_button(NULL), _txt (fname, BUFFERSIZE), _txt_to_find(64),
_link_button(NULL), _print_button(NULL), _pdf_button(NULL), _txt (fname, BUFFERSIZE), _txt_to_find(64),
_down_dir(TRUE), _case_sensitive(FALSE), _regexp(FALSE), _multiple (FALSE),
_frozen (FALSE), _rulers(rulers), _showbuts(FALSE), _menu_present(FALSE), _brwfld(brwfld)
{
@ -2633,6 +2645,8 @@ TViswin::TViswin(const char *fname,
_print_button = add_button (DLG_PRINT, "", BMP_PRINT);
_print_button->disable();
enable_menu_item(M_VISWIN_PRINT, FALSE);
_pdf_button = add_button (DLG_PDF, "", BMP_PDF);
_pdf_button->disable();
}
}

View File

@ -88,6 +88,8 @@ class TViswin : public TField_window
TPushbutton_control* _link_button;
// @cmember:(INTERNAL) Bottone Stampa
TPushbutton_control* _print_button;
// @cmember:(INTERNAL) Bottone Stampa su PDF
TPushbutton_control* _pdf_button;
// @cmember:(INTERNAL) Numero di righe di testo
long _textrows;

View File

@ -4,6 +4,7 @@
#define ANAMAG_CODART "CODART"
#define ANAMAG_DESCR "DESCR"
#define ANAMAG_DESCRAGG "DESCRAGG"
#define ANAMAG_CODARTALT "CODARTALT"
#define ANAMAG_GRMERC "GRMERC"
#define ANAMAG_RAGGFIS "RAGGFIS"
#define ANAMAG_CLASSEFIS "CLASSEFIS"

View File

@ -40,6 +40,7 @@
#define H_DEFAULTMAG 147
#define F_STOP_PROD 148
#define F_MOV_SOSP 149
#define F_SCAR_ALT 150
#define G_SGNVAL 20
#define G_SGNQTA 21

View File

@ -231,10 +231,15 @@ END
BOOLEAN F_MOV_SOSP
BEGIN
PROMPT 2 20 "Movimenta gli articoli sospesi"
PROMPT 2 20 "Movimenta : Gli articoli sospesi"
FIELD B5
END
BOOLEAN F_SCAR_ALT
BEGIN
PROMPT 32 20 "Gli articoli alternativi nei documenti"
FIELD B6
END
ENDPAGE
PAGE "Movimentazione campi" 11 60 14

View File

@ -9,12 +9,15 @@
class TForm_giacprezzi : public TForm_stampemg
{
TConfig *conf_ditta;
TCondizione_vendita * listino;
TCondizione_vendita* _listino;
TString16 _user1;
public:
void set_codlistino(const char * codcm,const char * cod);
void set_codlistino(const char * codcm,const char* cod);
bool validate(TForm_item &cf, TToken_string &s);
void set_description_field(const char* u) { _user1 = u; }
TForm_giacprezzi(const char *name,const char *code);
virtual ~TForm_giacprezzi();
};
@ -25,12 +28,20 @@ bool TForm_giacprezzi::validate(TForm_item &cf, TToken_string &s)
if (code == "_USER")
{
const TFixed_string subcode = s.get();
if (subcode=="PREZZO")
if (subcode == "PREZZO")
{
const TString80 codart = relation()->lfile(LF_ANAMAG).get("CODART");
const bool found = listino->ricerca(codart, ZERO);
cf.set(found ? listino->get_prezzo().string() : "");
return TRUE;
const TString80 codart = relation()->curr(LF_ANAMAG).get(ANAMAG_CODART);
const bool found = _listino->ricerca(codart, ZERO);
cf.set(found ? _listino->get_prezzo().string() : "");
return true;
}
if (subcode == "DESCR")
{
if (_user1.blank())
_user1 = ANAMAG_DESCR;
const TString& desc = relation()->curr(LF_ANAMAG).get(_user1);
cf.set(desc);
return true;
}
}
return TForm_stampemg::validate(cf, s);
@ -38,93 +49,73 @@ bool TForm_giacprezzi::validate(TForm_item &cf, TToken_string &s)
void TForm_giacprezzi::set_codlistino(const char * codcatv,const char * codlist)
{
listino->put_listino(codlist,codcatv);
_listino->put_listino(codlist,codcatv);
}
TForm_giacprezzi::TForm_giacprezzi(const char *name,const char *code) :
TForm_stampemg(name,code)
TForm_giacprezzi::TForm_giacprezzi(const char *name,const char *code)
: TForm_stampemg(name,code), _user1(false)
{
listino=new TCondizione_vendita(new TConfig(CONFIG_DITTA,""));
listino->set_anamag(relation()->lfile(LF_ANAMAG));
listino->set_umart(relation()->lfile(LF_UMART));
_listino=new TCondizione_vendita(new TConfig(CONFIG_DITTA,""));
_listino->set_anamag(relation()->lfile(LF_ANAMAG));
_listino->set_umart(relation()->lfile(LF_UMART));
}
TForm_giacprezzi::~TForm_giacprezzi()
{
delete &(listino->config_ditta());
delete listino;
delete &(_listino->config_ditta());
delete _listino;
}
class TStampadatist_mask: public TStampemg_mask
{
protected:
static bool handle_ragg(TMask_field &fld, KEY k); // handler
static bool handle_liv(TMask_field &fld, KEY k); // handler
static bool handle_subord(TMask_field &fld, KEY k); // handler
static bool handle_filt(TMask_field &fld, KEY k); // handler
public:
TStampadatist_mask();
virtual ~TStampadatist_mask(){};
virtual ~TStampadatist_mask() {}
};
TStampadatist_mask::TStampadatist_mask():
TStampemg_mask("mg3100")
TStampadatist_mask::TStampadatist_mask() : TStampemg_mask("mg3100")
{
TConfig prassid(CONFIG_DITTA, "ve"); // apre il file di configurazione della ditta corrente
if (prassid.get_bool("GES", NULL, A_LISTINI))
{
field(F_CATVENLISTINO).enable(prassid.get_bool("GESLISCV"));
else {
field(F_CATVENLISTINO).disable(); field(F_CODLISTINO).disable();
}
else
{
field(F_CATVENLISTINO).disable();
field(F_CODLISTINO).disable();
}
set_handler(F_TOLIVELLOART, handle_liv);
set_handler(F_TOLIVELLOGIAC, handle_liv);
set_handler(F_ORDINE, handle_ragg);
set_handler(F_ORDINEART,handle_subord);
set_handler(F_FILTRO,handle_filt);
if (!livelli_articolo().enabled()) {
set_handler(F_SUBORDINE,handle_subord);
if (!livelli_articolo().enabled())
{
TMask_field &f1=field(F_RAGGCODICE);
f1.reset(); f1.check();f1.hide();
field(F_FROMLIVELLOART).hide();
field(F_TOLIVELLOART).hide();
}
if (!livelli_giacenza().enabled()) {
if (!livelli_giacenza().enabled())
{
TMask_field &f2=field(F_RAGGLIVGIAC);
f2.reset(); f2.check();f2.hide();
field(F_FROMLIVELLOGIAC).hide();
field(F_TOLIVELLOGIAC).hide();
}
}
bool TStampadatist_mask::handle_filt(TMask_field &fld, KEY k)
{
if (k == K_SPACE)
{
TMask& m = fld.mask();
const bool articles = m.get(F_ORDINE)=="A";
if (articles)
{
switch (fld.get()[0])
{
case '0':
case 'P':
case 'N':
case 'S':
m.show(F_ORDINEMAG);
m.hide(F_ORDINEART);
m.send_key(K_SPACE, F_ORDINEMAG);
break;
case 'T':
m.show(F_ORDINEART);
m.hide(F_ORDINEMAG);
m.send_key(K_SPACE, F_ORDINEART);
default:
break;
}
}
if (prassid.get_bool("CHK_USER", "ve", 1))
{
const TString& user1 = prassid.get("PROMPT_USER", "ve", 1);
field(F_DAUSR).set_prompt(user1);
show(F_DAUSR); show(F_AUSR);
}
return TRUE;
}
bool TStampadatist_mask::handle_subord(TMask_field &fld, KEY k)
@ -135,12 +126,17 @@ bool TStampadatist_mask::handle_subord(TMask_field &fld, KEY k)
TOperable_field &fraggcod=(TOperable_field &)m.field(F_RAGGCODICE);
TOperable_field &fragggiac=(TOperable_field &)m.field(F_RAGGLIVGIAC);
switch (fld.get()[0]) {
case 'C':
if (m.get(F_ORDINE)=="A")
switch (fld.get()[0])
{
case 'C':
{
const char ordine = m.get(F_ORDINE)[0];
if (ordine == 'A')
{
fraggcod.enable();m.send_key(K_SPACE,F_RAGGCODICE);
} else {
}
else
{
if (!m.get_bool(F_DETTAGLIODEP))
{
fraggcod.reset(); fraggcod.disable();
@ -148,13 +144,17 @@ bool TStampadatist_mask::handle_subord(TMask_field &fld, KEY k)
fraggcod.do_message(0);fragggiac.do_message(0);
}
}
}
break;
case 'M':
case 'D':
fraggcod.reset(); fraggcod.disable();
fraggcod.do_message(0);
fragggiac.reset(); fragggiac.disable();
fragggiac.do_message(0);
case 'M':
case 'D':
case 'P':
fraggcod.reset(); fraggcod.disable();
fraggcod.do_message(0);
fragggiac.reset(); fragggiac.disable();
fragggiac.do_message(0);
break;
default:
break;
}
}
@ -165,21 +165,28 @@ bool TStampadatist_mask::handle_liv(TMask_field &fld, KEY k)
{
if (k == K_TAB)
{
TOperable_field &ftotmag=(TOperable_field &)fld.mask().field(F_TOTALIMAGAZZINI);
TOperable_field &fdettgiac=(TOperable_field &)fld.mask().field(F_RAGGLIVGIAC);
const TMask& m = fld.mask();
TOperable_field &ftotmag=(TOperable_field &)m.field(F_TOTALIMAGAZZINI);
TOperable_field &fdettgiac=(TOperable_field &)m.field(F_RAGGLIVGIAC);
if (fld.mask().get_int(F_TOLIVELLOART))
{
fdettgiac.reset();
fdettgiac.disable();
} else
fdettgiac.enable();
if (fld.mask().get(F_ORDINE)=="A")
}
else
{
if (fld.mask().get_int(F_TOLIVELLOART) || fld.mask().get_int(F_TOLIVELLOGIAC))
fdettgiac.enable();
}
const char ordine = m.get(F_ORDINE)[0];
if (ordine == 'A')
{
if (m.get_int(F_TOLIVELLOART) || m.get_int(F_TOLIVELLOGIAC))
{
// raggruppamenti prima del dettaglio magazzini
ftotmag.reset(); ftotmag.disable();ftotmag.do_message(0);
} else {
ftotmag.reset(); ftotmag.disable(); ftotmag.do_message(0);
}
else
{
ftotmag.enable();
}
}
@ -191,39 +198,41 @@ bool TStampadatist_mask::handle_ragg(TMask_field &fld, KEY k)
{
if (k == K_SPACE)
{
TStampadatist_mask &m=(TStampadatist_mask &)fld.mask();
TStampadatist_mask& m = (TStampadatist_mask&)fld.mask();
TOperable_field &ftotmag=(TOperable_field &)fld.mask().field(F_TOTALIMAGAZZINI);
TOperable_field &fraggcod=(TOperable_field &)fld.mask().field(F_RAGGCODICE);
TOperable_field &fragggiac=(TOperable_field &)fld.mask().field(F_RAGGLIVGIAC);
TOperable_field& ftotmag = (TOperable_field&)m.field(F_TOTALIMAGAZZINI);
TOperable_field& fraggcod = (TOperable_field&)m.field(F_RAGGCODICE);
TOperable_field& fragggiac = (TOperable_field&)m.field(F_RAGGLIVGIAC);
fraggcod.enable();
fragggiac.enable();
if (fld.mask().get(F_ORDINE)=="M")
if (m.get(F_ORDINE)=="M")
{
ftotmag.enable();
if (!fld.mask().get_bool(F_DETTAGLIODEP))
if (!m.get_bool(F_DETTAGLIODEP))
{
fraggcod.reset(); fraggcod.disable();
fragggiac.reset(); fragggiac.disable();
fraggcod.do_message(0);fragggiac.do_message(0);
return TRUE;
return true;
}
} else {
}
else
{
bool enabmag=m.magazz_ini().gestmultimag() || m.magazz_ini().gestdep();
m.enable(F_TOTALIMAGAZZINI,enabmag && m.field(F_TOTALIMAGAZZINI).enabled());
m.enable(F_DETTAGLIOMAG,enabmag && m.field(F_DETTAGLIOMAG).enabled());
}
}
return TRUE;
return true;
}
// STAMPA anagrafiche
class TStampa_datistorici : public TSkeleton_application
{
TStampadatist_mask * _mask;
TCursor * _cur;
TStampadatist_mask* _mask;
TCursor* _cur;
TForm_giacprezzi * _form; // to be moved into TPrint_application
protected:
@ -247,7 +256,7 @@ void TStampa_datistorici ::on_firm_change()
bool TStampa_datistorici::create()
{
open_files(LF_ANAMAG,LF_MAG,LF_TAB,LF_TABCOM,LF_UMART, 0);
open_files(LF_TAB,LF_TABCOM,LF_ANAMAG,LF_MAG,LF_UMART, 0);
_mask = new TStampadatist_mask();
return TSkeleton_application::create();
}
@ -269,18 +278,19 @@ void TStampa_datistorici::setprint_permagazzini()
TForm_item & it_filtro=_form->find_field('H',odd_page,FF_FILTRO);
TForm_item & rangea=_form->find_field('H',odd_page,FF_RANGEARTIC);
TString srangea;
if (*_mask->get(F_DAART))
if (_mask->get(F_DAART).full())
{
cfilter << "(CODART[1," << _mask->get(F_DAART).len() << "]>=" <<'"' << _mask->get(F_DAART)<< "\")&&" ;
srangea << "da \"" << _mask->get(F_DAART) << "\" ";
}
if (*_mask->get(F_AART))
if (_mask->get(F_AART).full())
{
cfilter << "(CODART[1," << _mask->get(F_AART).len() << "]<=" <<'"' << _mask->get(F_AART)<< "\")&&" ;
srangea << "fino a " << _mask->get(F_AART) << "\" ";
}
rangea.set(srangea.empty() ? TR("Tutti gli articoli") : format(FR("Articoli %s"), (const char *)srangea));
switch (*_mask->get(F_FILTRO)) {
rangea.set(srangea.empty() ? TR("Tutti gli articoli") : format(FR("Articoli %s"), (const char *)srangea));
switch (_mask->get(F_FILTRO)[0])
{
case '0': // non nulli
cfilter << "(STR(" << LF_MAG << "->GIAC!=\"0\"))&&";
it_filtro.set(TR("non nulle"));
@ -334,14 +344,14 @@ void TStampa_datistorici::setprint_permagazzini()
// ********************
// range di stampa magazzini
TForm_item & rangem=_form->find_field('H',odd_page,FF_RANGEMAGAZ);
TForm_item& rangem=_form->find_field('H',odd_page,FF_RANGEMAGAZ);
TString srangem;
if (!_mask->get(F_DAMAG).blank())
if (_mask->get(F_DAMAG).full())
{
darec.put("CODMAG",_mask->get(F_DAMAG));
srangem << "da \"" << _mask->get(F_DAMAG) << "\" ";
}
if (!_mask->get(F_AMAG).blank())
if (_mask->get(F_AMAG).full())
{
arec.put("CODMAG",_mask->get(F_AMAG));
srangem << "fino a \"" << _mask->get(F_AMAG) << "\" ";
@ -355,7 +365,9 @@ void TStampa_datistorici::setprint_permagazzini()
void TStampa_datistorici::setprint_perarticoli()
{
char subordine=*_mask->get(F_ORDINEMAG);
const char ordine= _mask->get(F_ORDINE)[0];
const char subordine= _mask->get(F_SUBORDINE)[0];
TRectype darec(LF_MAG),arec(LF_MAG);
TString filter;
char filtro_articoli=*_mask->get(F_FILTRO);
@ -366,9 +378,10 @@ void TStampa_datistorici::setprint_perarticoli()
TString srangem;
TForm_item & rangem=_form->find_field('H',odd_page,FF_RANGEMAGAZ);
_cur = _form->cursor();
if (*_mask->get(F_DAMAG))
if (_mask->get(F_DAMAG).full())
srangem << "da \"" << _mask->get(F_DAMAG) << "\" ";
if (*_mask->get(F_AMAG))
if (_mask->get(F_AMAG).full())
srangem << "fino a \"" << _mask->get(F_AMAG) << "\"";
rangem.set(srangem.blank()? TR("Tutti i magazzini") : format(FR("Magazzini %s"),(const char *)srangem));
@ -376,7 +389,8 @@ void TStampa_datistorici::setprint_perarticoli()
// ********************
// filtro giacenze
TForm_item & it_filtro=_form->find_field('H',odd_page,FF_FILTRO);
switch (filtro_articoli) {
switch (filtro_articoli)
{
case '0': // non nulli
filter << "(STR(" << LF_MAG << "->GIAC!=\"0\"))&&";
it_filtro.set(TR("non nulle"));
@ -390,56 +404,83 @@ void TStampa_datistorici::setprint_perarticoli()
it_filtro.set(TR("negative"));
break;
case 'S': // sottoscorta
filter << "(STR("<< LF_MAG << "->GIAC < " <<LF_MAG << "->SCORTAMIN))&&";
filter << "(STR("<< LF_MAG << "->GIAC < " << LF_MAG << "->SCORTAMIN))&&";
it_filtro.set(TR("sottoscorta"));
break;
}
if (_mask->get(F_DAART).not_empty())
filter << "(CODART>=\"" << _mask->get(F_DAART) << "\")&&";
if (_mask->get(F_AART).not_empty())
filter << "(CODART<=\"" << _mask->get(F_AART) << "\")&&";
TString srangea;
if (subordine == 'P')
{
if (_mask->get(F_DAUSR).full())
{
filter << "(47->USER1>=\"" << _mask->get(F_DAUSR) << "\")&&";
srangea << "da \"" << _mask->get(F_DAUSR) << "\" ";
}
if (_mask->get(F_AUSR).full())
{
filter << "(47->USER1<=\"" << _mask->get(F_AUSR) << "~\")&&";
srangea << "fino a \"" << _mask->get(F_AUSR) << "\"";
}
}
else
{
if (_mask->field(F_DAART).active())
{
if (_mask->get(F_DAART).full())
{
filter << "(CODART>=\"" << _mask->get(F_DAART) << "\")&&";
srangea << "da \"" << _mask->get(F_DAART) << "\" ";
}
if (_mask->get(F_AART).full())
{
filter << "(CODART<=\"" << _mask->get(F_AART) << "~\")&&";
srangea << "fino a \"" << _mask->get(F_AART) << "\"";
}
}
}
TForm_item& rangea=_form->find_field('H',odd_page,FF_RANGEARTIC);
rangea.set(srangea.empty() ? TR("Tutti gli articoli") : format(FR("Articoli %s"), (const char *)srangea));
if (filter.not_empty())
filter.rtrim(2);
// ******************
// sotto-ordinamenti e range di stampa articoli
TString srangea,srangecm,espr;
TForm_item & rangecm=_form->find_field('H',odd_page,FF_RANGECATMER);
TForm_item & rangea=_form->find_field('H',odd_page,FF_RANGEARTIC);
if (!_mask->get(F_DAART).blank())
srangea << "da \"" << _mask->get(F_DAART) << "\" ";
if (!_mask->get(F_AART).blank())
srangea << "fino a \"" << _mask->get(F_AART) << "\"";
rangea.set(srangea.empty() ? TR("Tutti gli articoli") : format(FR("Articoli %s"), (const char *)srangea));
switch (subordine)
{
case 'C':
case 'D':
_form->find_field('B',odd_page,"H_CATMER").hide();
_form->find_field('B',odd_page,"TOT_CATMER").hide();
_form->set_ordering(mg_normale);
case 'C':
case 'D':
case 'P':
_form->find_field('B',odd_page,"H_CATMER").hide();
_form->find_field('B',odd_page,"TOT_CATMER").hide();
_form->set_ordering(mg_normale);
break;
case 'M':
case 'S':
case 'M':
case 'S':
{
TString espr;
TForm_item & rangecm=_form->find_field('H',odd_page,FF_RANGECATMER);
_form->find_field('B',odd_page,"H_CATMER").show();
_form->find_field('B',odd_page,"TOT_CATMER").show();
_form->set_ordering(subordine == 'M' ? mg_cat_merc : mg_scat_merc);
espr.format("%d->%s", LF_ANAMAG, subordine == 'M' ? "GRMERC[1,3]" : "GRMERC");
_form->find_field('B',odd_page,"GRUPPI_CATMER").setcondition(espr,_strexpr);
if (!_mask->get(F_DASCATMER).blank())
TString srangecm;
if (_mask->get(F_DASCATMER).full())
{
srangecm << "da \"" << _mask->get(F_DASCATMER) << "\" ";
filter << "&&(" << espr << ">=\"" << _mask->get(F_DASCATMER) << "\")";
}
if (!_mask->get(F_ASCATMER).blank())
if (_mask->get(F_ASCATMER).full())
{
srangecm << "fino a \"" << _mask->get(F_ASCATMER) << "\"";
filter << "&&(" << espr << "<=\"" << _mask->get(F_ASCATMER) << "\")";
}
rangecm.set(srangecm.empty() ? TR("Tutte le categorie merceologiche") : format(FR("Categorie merc. %s"), (const char *)srangecm));
}
break;
default:
break;
}
@ -452,17 +493,18 @@ void TStampa_datistorici::setprint_perarticoli()
_mask->get_int(F_TOLIVELLOGIAC),
_mask->get_bool(F_TOTALIMAGAZZINI),
_mask->get_bool(F_DETTAGLIOMAG));
_form->set_description_field(subordine == 'P' ? ANAMAG_USER1 : ANAMAG_DESCR);
TString16 ena=((_mask->get_bool(F_STAMPAGIAC) && *_mask->get(F_FILTRO)!='S')? "1": "0");
TString16 ena = ((_mask->get_bool(F_STAMPAGIAC) && *_mask->get(F_FILTRO)!='S')? "1": "0");
_form->find_field('H',odd_page,FF_FLAGGIAC).set(ena );
_form->find_field('B',odd_page,FF_FLAGGIAC).set(ena);
ena=((_mask->get_bool(F_STAMPAGIAC) && *_mask->get(F_FILTRO)=='S')? "1": "0") ;
ena= ((_mask->get_bool(F_STAMPAGIAC) && *_mask->get(F_FILTRO)=='S')? "1": "0") ;
_form->find_field('H',odd_page,FF_FLAGSOTTOS).set(ena);
_form->find_field('B',odd_page,FF_FLAGSOTTOS).set(ena);
_form->find_field('H',odd_page,FF_PREZZIVALORI).set(_mask->get(F_PREZZIVALORI));
_form->find_field('B',odd_page,FF_PREZZIVALORI).set(_mask->get(F_PREZZIVALORI));
ena=_mask->get_bool(F_VALMEDI) ? "1": "0";
ena = _mask->get_bool(F_VALMEDI) ? "1": "0";
_form->find_field('H',odd_page,FF_FLAGVALMEDI).set(ena);
_form->find_field('B',odd_page,FF_FLAGVALMEDI).set(ena);
@ -473,17 +515,20 @@ void TStampa_datistorici::setprint_perarticoli()
arec.put("ANNOES",_mask->get(F_ANNOES));
arec.put("CODMAG",_mask->get(F_AMAG));
const bool order_by_group = subordine == 'M' || subordine == 'S';
TString so;
switch (subordine)
{
case 'M':
case 'S': so.format("ANNOES|%d->GRMERC|CODART|LIVELLO|CODMAG", LF_ANAMAG); break;
case 'D': so.format("ANNOES|%d->DESCR|CODMAG", LF_ANAMAG); break;
case 'P': so.format("ANNOES|%d->USER1|CODMAG", LF_ANAMAG); break;
default : break;
}
_cur->setregion(darec,arec);
_cur->setfilter(filter, order_by_group);
if (order_by_group)
{
TString so;
so.format("ANNOES|%d->GRMERC|CODART|LIVELLO|CODMAG", LF_ANAMAG);
_cur->setfilter(filter, so.full());
if (so.full())
((TSorted_cursor*) _cur)->change_order(so);
}
}
// ORDINAMENTO
@ -491,60 +536,29 @@ void TStampa_datistorici::setprint_perarticoli_all()
{
TRectype darec(LF_ANAMAG),arec(LF_ANAMAG);
TString cfilter,filter,joinexp;
TString sortexp("ANNOES|CODART");
if (_mask->get_bool(F_RAGGCODICE))
{
if (_mask->get_int(F_TOLIVELLOART))
sortexp << "[" << livelli_articolo().packed_length(_mask->get_int(F_TOLIVELLOART)) << "]";
}
if (_mask->get_bool(F_RAGGLIVGIAC))
{
sortexp << "|LIVELLO" ;
if (_mask->get_int(F_TOLIVELLOGIAC))
sortexp << "[1," << livelli_articolo().packed_length(_mask->get_int(F_TOLIVELLOGIAC)) << "]";
}
sortexp << "|CODMAG";
char filtro_articoli=*_mask->get(F_FILTRO);
char subordine=*_mask->get(F_ORDINEART);
TString sortexp = ANAMAG_CODART; // Ordinamento su LF_ANAMAG (per default concide con key 1)
const char ordine = _mask->get(F_ORDINE)[0];
const char subordine = ordine == 'A' ? _mask->get(F_SUBORDINE)[0] : 'C';
_form = new TForm_giacprezzi("mg3100aa", "");
// ********************
// range di stampa magazzini
TForm_item & rangem=_form->find_field('H',odd_page,FF_RANGEMAGAZ);
TString srangem;
_cur = _form->cursor();
if (*_mask->get(F_DAMAG))
if (_mask->get(F_DAMAG).full())
{
filter << "(" << LF_MAG <<"->CODMAG[1,3]>=" <<'"' << _mask->get(F_DAMAG)<< "\")&&" ;
srangem << "da \"" << _mask->get(F_DAMAG) << "\" ";
}
if (*_mask->get(F_AMAG))
if (_mask->get(F_AMAG).full())
{
filter << "(" << LF_MAG <<"->CODMAG[1,3]<=" <<'"' << _mask->get(F_AMAG)<< "\")&&" ;
srangem << "fino a \"" << _mask->get(F_AMAG) << "\"";
}
rangem.set(srangem.blank()? TR("Tutti i magazzini") : format(FR("Magazzini %s"),(const char *)srangem));
// ********************
// filtro giacenze
TForm_item & it_filtro=_form->find_field('H',odd_page,FF_FILTRO);
switch (filtro_articoli) {
case '0': // non nulli
filter << "(STR(" << LF_MAG << "->GIAC!=\"0\"))&&";
it_filtro.set(TR("non nulle"));
break;
case 'P': // positivi
filter << "(STR(" << LF_MAG << "->GIAC>\"0\"))&&";
it_filtro.set(TR("positive"));
break;
case 'N': // negativi
filter << "(STR(" << LF_MAG << "->GIAC<\"0\"))&&";
it_filtro.set(TR("negative"));
break;
case 'S': // sottoscorta
filter << "(STR("<< LF_MAG << "->GIAC < " <<LF_MAG << "->SCORTAMIN))&&";
it_filtro.set(TR("sottoscorta"));
break;
}
if (filter.not_empty())
filter.cut(filter.len()-2);
@ -556,7 +570,7 @@ void TStampa_datistorici::setprint_perarticoli_all()
switch (subordine)
{
case 'C':
_cur->setkey(1);
_cur->setkey(1); sortexp = ANAMAG_CODART;
darec.put("CODART",_mask->get(F_DAART));
arec.put("CODART",_mask->get(F_AART));
_form->find_field('B',odd_page,"H_CATMER").hide();
@ -568,7 +582,7 @@ void TStampa_datistorici::setprint_perarticoli_all()
srangea << TR("fino a \"") << _mask->get(F_AART) << "\"";
break;
case 'D':
_cur->setkey(2);
_cur->setkey(2); sortexp = ANAMAG_DESCR;
darec.put("DESCR",_mask->get(F_DADES));
arec.put("DESCR",_mask->get(F_ADES));
_form->find_field('B',odd_page,"H_CATMER").disable();
@ -581,29 +595,47 @@ void TStampa_datistorici::setprint_perarticoli_all()
break;
case 'M':
case 'S':
_cur->setkey(3);
_cur->setkey(3); sortexp = ANAMAG_GRMERC;
darec.put("GRMERC",_mask->get(F_DACATMER));
arec.put("GRMERC",_mask->get(F_ACATMER));
_form->find_field('B',odd_page,"H_CATMER").show();
_form->find_field('B',odd_page,"TOT_CATMER").show();
_form->set_ordering(subordine == 'M' ? mg_cat_merc : mg_scat_merc);
if (!_mask->get(F_DAART).blank())
if (_mask->get(F_DAART).full())
{
srangea << TR("da \"") << _mask->get(F_DAART) << "\" ";
cfilter << "(CODART[1," << _mask->get(F_DAART).len() << "]>=" <<'"' << _mask->get(F_AART)<< "\")&&" ;
}
if (!_mask->get(F_AART).blank())
if (_mask->get(F_AART).full())
{
srangea << TR("fino a \"") << _mask->get(F_AART) << "\"";
cfilter << "(CODART[1," << _mask->get(F_AART).len() << "]<=" <<'"' << _mask->get(F_AART)<< "\")&&" ;
}
if (!_mask->get(F_DACATMER).blank())
if (_mask->get(F_DACATMER).full())
srangecm << TR("da \"") << _mask->get(F_DACATMER) << "\" ";
if (!_mask->get(F_ACATMER).blank())
if (_mask->get(F_ACATMER).full())
srangecm << TR("fino a \"") << _mask->get(F_ACATMER) << "\"";
rangecm.set(srangecm.empty() ? TR("Tutte le categorie merceologiche") : format(FR("Categorie merc. %s"), (const char *)srangecm));
break;
case 'P':
_cur->setkey(1); sortexp = ANAMAG_USER1;
_form->find_field('B',odd_page,"H_CATMER").hide();
_form->find_field('B',odd_page,"TOT_CATMER").hide();
_form->set_ordering(mg_normale);
if (_mask->get(F_DAUSR).full())
{
cfilter << "(USER1>=\"" << _mask->get(F_DAUSR) << "\")&&";
srangea << TR("da \"") << _mask->get(F_DAUSR) << "\" ";
}
if (_mask->get(F_AUSR).full())
{
cfilter << "(USER1<=\"" << _mask->get(F_AUSR) << "~\")&&";
srangea << TR("fino a \"") << _mask->get(F_AUSR) << "\"";
}
break;
default:
break;
}
rangea.set(srangea.empty() ? TR("Tutti gli articoli") : format(FR("Articoli %s"), (const char *)srangea));
@ -616,6 +648,7 @@ void TStampa_datistorici::setprint_perarticoli_all()
_mask->get_int(F_TOLIVELLOGIAC),
_mask->get_bool(F_TOTALIMAGAZZINI),
_mask->get_bool(F_DETTAGLIOMAG));
_form->set_description_field(subordine == 'P' ? ANAMAG_USER1 : ANAMAG_DESCR);
TString16 ena=((_mask->get_bool(F_STAMPAGIAC) && *_mask->get(F_FILTRO)!='S')? "1": "0");
_form->find_field('H',odd_page,FF_FLAGGIAC).set(ena );
@ -634,9 +667,8 @@ void TStampa_datistorici::setprint_perarticoli_all()
joinexp << "ANNOES==\"" << _mask->get(F_ANNOES) << "\"|CODART==CODART";
TSortedfile *mag;
// !?!?!! ATTENZIONE : Modifica temporanea
mag= new TSortedfile(LF_MAG,NULL,sortexp,"",1);
TSortedfile* mag = new TSortedfile(LF_MAG,NULL,"ANNOES|CODART|LIVELLO|CODMAG","",1);
// il filtro viene qui settato DOPO la creazione del Sortedfile a causa di una bug
// sulla libreria nei TSorted_file / TCursor
mag->cursor().setfilter(filter);
@ -644,10 +676,11 @@ void TStampa_datistorici::setprint_perarticoli_all()
_cur->relation()->replace(mag,1,joinexp);
if (cfilter.not_empty())
{
cfilter.cut(cfilter.len()-2);
cfilter.rtrim(2);
_cur->setfilter(cfilter);
}
_cur->setregion(darec,arec);
((TSorted_cursor*)_cur)->change_order(sortexp);
}
@ -657,14 +690,15 @@ void TStampa_datistorici::main_loop()
{
if (_mask->magazz_ini().gestmag(TRUE))
{
if (_mask->get(F_ORDINE)[0]=='A')
const char ordine = _mask->get(F_ORDINE)[0];
if (ordine=='A')
{
if (_mask->get(F_FILTRO)[0] == 'T')
setprint_perarticoli_all();
else
setprint_perarticoli();
const bool sp = _mask->field(F_SALTOPAG).active()&&_mask->get_bool(F_SALTOPAG);
const bool sp = _mask->get_bool(F_SALTOPAG) && _mask->field(F_SALTOPAG).active();
TForm_subsection& ss = _form->find_field('B', odd_page, "H_CATMER");
ss.set_newpage(sp);
}

View File

@ -1,7 +1,7 @@
#include "mg3msk.h"
#define F_ORDINE 101
#define F_ORDINEART 102
#define F_ORDINEMAG 103
#define F_SUBORDINE 102
#define F_ANNOES 104
#define F_DAART 105
#define F_AART 106
@ -26,7 +26,8 @@
#define F_PREZZIVALORI 127
#define F_CODLISTINO 128
#define F_CATVENLISTINO 129
#define F_DAUSR 130
#define F_AUSR 131
#define G_CATMER 1
#define G_CODART 2
@ -34,5 +35,6 @@
#define G_PARAMVALORI 4
#define G_LISTINO 5
#define G_SCATMER 6
#define G_USER 7

View File

@ -1,5 +1,20 @@
#include "mg3100.h"
PAGE "Stampa dati storici" -1 -1 80 20
TOOLBAR "" 0 -2 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -11 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -11 ""
END
ENDPAGE
PAGE "Stampa dati storici" 0 0 80 2
LIST F_PREZZIVALORI 18
BEGIN
@ -51,42 +66,32 @@ BEGIN
GROUP G_LISTINO
END
LISTBOX F_ORDINE 10
LISTBOX F_ORDINE 15
BEGIN
PROMPT 2 2 "Ordinamento "
ITEM "A|articoli"
MESSAGE " ", F_FILTRO|SHOW,F_ORDINEART|ENABLE,F_ORDINEART|HIDE,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
ITEM "A|Articoli"
MESSAGE " ", F_FILTRO|SHOW,F_SUBORDINE|HIDE,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
MESSAGE SHOW,F_TOTALIMAGAZZINI|SHOW,F_DETTAGLIOMAG
ITEM "M|magazzini"
MESSAGE " ", F_FILTRO|"C",F_ORDINEART|K_SPACE,F_ORDINEART|SHOW,F_ORDINEART|DISABLE,F_ORDINEART|HIDE,F_ORDINEMAG|SHOW,G_CODART@
ITEM "M|Magazzini"
MESSAGE " ",F_FILTRO|HIDE,F_SUBORDINE|SHOW,G_CODART@
MESSAGE SHOW,F_TOTALIDEPOSITI|"X",F_DETTAGLIODEP
MESSAGE HIDE,F_TOTALIMAGAZZINI|HIDE,F_DETTAGLIOMAG
END
LISTBOX F_ORDINEART 20
LISTBOX F_SUBORDINE 20
BEGIN
FLAGS "G"
PROMPT 34 2 "Sotto-ordinamento "
ITEM "C|codice"
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,F_SALTOPAG
ITEM "D|descrizione"
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|DISABLE,G_CODART@|HIDE,F_SALTOPAG
ITEM "M|gruppo merc./codice"
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
ITEM "C|Codice"
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,F_SALTOPAG|HIDE,G_USER@|ENABLE,G_DESART@
ITEM "D|Descrizione"
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|DISABLE,G_CODART@|HIDE,F_SALTOPAG|HIDE,G_USER@|ENABLE,G_DESART@
ITEM "M|Gruppo merc./codice"
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG|HIDE,G_USER@|ENABLE,G_DESART@
ITEM "S|Sottogr.merc./codice"
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
END
LISTBOX F_ORDINEMAG 20
BEGIN
FLAGS "G"
PROMPT 34 2 "Sotto-ordinamento "
ITEM "C|codice"
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|HIDE,F_SALTOPAG
ITEM "M|gruppo merc./codice"
MESSAGE SHOW,G_CATMER@|HIDE,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
ITEM "S|Sottogr.merc./codice"
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG
MESSAGE HIDE,G_CATMER@|SHOW,G_SCATMER@|ENABLE,G_CODART@|SHOW,F_SALTOPAG|HIDE,G_USER@|ENABLE,G_DESART@
ITEM "P|Personalizzato"
MESSAGE HIDE,G_CATMER@|HIDE,G_SCATMER@|CLEAR,G_CODART@|HIDE,F_SALTOPAG|SHOW,G_USER@|CLEAR,G_DESART@
END
BOOLEAN F_SALTOPAG
@ -122,17 +127,17 @@ END
TEXT DLG_NULL
BEGIN
PROMPT 2 5 "Dall'articolo "
PROMPT 16 5 "@bDall'articolo"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 6 " all'articolo "
PROMPT 50 5 "@bAll'articolo"
END
STRING F_DAART 20
BEGIN
PROMPT 16 5 ""
PROMPT 2 6 "Codice "
FLAGS "U"
USE LF_ANAMAG
INPUT CODART F_DAART
@ -140,47 +145,63 @@ BEGIN
DISPLAY "Descr@50" DESCR
OUTPUT F_DAART CODART
OUTPUT F_DADES DESCR
OUTPUT F_DAUSR USER1
GROUP G_CODART
END
STRING F_DADES 50 36
STRING F_DADES 50 28
BEGIN
PROMPT 40 5 ""
PROMPT 2 7 "Descrizione "
FLAGS "U"
USE LF_ANAMAG KEY 2
INPUT DESCR F_DADES
DISPLAY "Descr@50" DESCR
DISPLAY "Codice@20" CODART
OUTPUT F_DAART CODART
OUTPUT F_DADES DESCR
COPY OUTPUT F_DAART
GROUP G_DESART
END
STRING F_DAUSR 40 30
BEGIN
PROMPT 2 8 "Personalizz. "
FLAGS "UH"
GROUP G_USER
END
STRING F_AART 20
BEGIN
PROMPT 16 6 ""
PROMPT 50 6 ""
FLAGS "U"
COPY USE F_DAART
INPUT CODART F_AART
COPY DISPLAY F_DAART
OUTPUT F_AART CODART
OUTPUT F_ADES DESCR
OUTPUT F_AUSR USER1
GROUP G_CODART
END
STRING F_ADES 50 36
STRING F_ADES 50 28
BEGIN
PROMPT 40 6 ""
PROMPT 50 7 ""
FLAGS "U"
COPY USE F_DADES
INPUT DESCR F_ADES
COPY DISPLAY F_DADES
OUTPUT F_ADES DESCR
OUTPUT F_AART CODART
COPY OUTPUT F_AART
GROUP G_DESART
END
STRING F_AUSR 40 30
BEGIN
PROMPT 50 8 ""
FLAGS "UH"
GROUP G_USER
END
STRING F_DAMAG 3
BEGIN
PROMPT 2 8 "Dal magazzino "
PROMPT 2 10 "Dal magazzino "
FLAGS "U"
USE MAG SELECT CODTAB[4,5]==""
INPUT CODTAB F_DAMAG
@ -191,7 +212,7 @@ END
STRING F_AMAG 3
BEGIN
PROMPT 2 9 " al magazzino "
PROMPT 2 11 "Al magazzino "
FLAGS "U"
COPY USE F_DAMAG
INPUT CODTAB F_AMAG
@ -201,7 +222,7 @@ END
STRING F_DACATMER 3
BEGIN
PROMPT 2 11 "Dal gruppo "
PROMPT 2 12 "Dal gruppo "
FLAGS "U"
USE GMC SELECT CODTAB[4,5]==""
INPUT CODTAB F_DACATMER
@ -215,7 +236,7 @@ END
STRING F_ACATMER 3
BEGIN
PROMPT 2 12 " al gruppo "
PROMPT 2 13 "Al gruppo "
FLAGS "U"
COPY USE F_DACATMER
INPUT CODTAB F_ACATMER
@ -227,7 +248,7 @@ END
STRING F_DASCATMER 5
BEGIN
PROMPT 2 11 "Dal gruppo "
PROMPT 2 12 "Dal gruppo "
FLAGS "UH"
USE GMC SELECT CODTAB[4,5]!=""
INPUT CODTAB F_DASCATMER
@ -239,7 +260,7 @@ END
STRING F_ASCATMER 5
BEGIN
PROMPT 2 12 " al gruppo "
PROMPT 2 13 "Al gruppo "
FLAGS "UH"
COPY USE F_DASCATMER
INPUT CODTAB F_ASCATMER
@ -252,7 +273,7 @@ END
BOOL F_TOTALIDEPOSITI
BEGIN
PROMPT 2 13 "Suddivido per depositi"
PROMPT 2 14 "Suddivido per depositi"
// MESSAGE TRUE ENABLE,F_DETTAGLIODEP
// MESSAGE FALSE "",F_DETTAGLIODEP|DISABLE,F_DETTAGLIODEP
END
@ -260,7 +281,7 @@ END
BOOL F_DETTAGLIODEP
BEGIN
FLAGS "HD"
PROMPT 42 13 "Dettaglio i depositi"
PROMPT 42 14 "Dettaglio i depositi"
MESSAGE TRUE ENABLE,F_RAGGLIVGIAC|ENABLE,F_RAGGCODICE
MESSAGE FALSE CLEAR,F_RAGGLIVGIAC|K_SPACE,F_RAGGLIVGIAC|CLEAR,F_RAGGCODICE|K_SPACE,F_RAGGCODICE
FLAGS "D"
@ -268,7 +289,7 @@ END
BOOLEAN F_RAGGCODICE
BEGIN
PROMPT 2 14 "Stampa totali livelli di codice"
PROMPT 2 15 "Stampa totali livelli di codice"
MESSAGE FALSE CLEAR,F_FROMLIVELLOART|CLEAR,F_TOLIVELLOART|CHECK,F_TOLIVELLOART
MESSAGE TRUE ENABLE,F_FROMLIVELLOART|ENABLE,F_TOLIVELLOART|CHECK,F_TOLIVELLOART
END
@ -276,7 +297,7 @@ END
NUMBER F_FROMLIVELLOART 1
BEGIN
FLAGS "G"
PROMPT 42 14 "da "
PROMPT 42 15 "da "
USE FCA
INPUT CODTAB F_FROMLIVELLOART
DISPLAY "Num." CODTAB
@ -289,7 +310,7 @@ END
NUMBER F_TOLIVELLOART 1
BEGIN
PROMPT 52 14 "a "
PROMPT 52 15 "a "
USE FCA
INPUT CODTAB F_TOLIVELLOART
DISPLAY "Num." CODTAB
@ -302,7 +323,7 @@ END
BOOL F_RAGGLIVGIAC
BEGIN
PROMPT 2 15 "Stampa totali livelli di giacenza"
PROMPT 2 16 "Stampa totali livelli di giacenza"
MESSAGE FALSE CLEAR,F_FROMLIVELLOGIAC|CLEAR,F_TOLIVELLOGIAC|CHECK,F_TOLIVELLOGIAC
MESSAGE TRUE ENABLE,F_FROMLIVELLOGIAC|ENABLE,F_TOLIVELLOGIAC
END
@ -310,7 +331,7 @@ END
NUMBER F_FROMLIVELLOGIAC 1
BEGIN
FLAG "D"
PROMPT 42 15 "da "
PROMPT 42 16 "da "
USE FCG
INPUT CODTAB F_FROMLIVELLOGIAC
DISPLAY "Num." CODTAB
@ -325,7 +346,7 @@ END
NUMBER F_TOLIVELLOGIAC 1
BEGIN
FLAG "D"
PROMPT 52 15 "a "
PROMPT 52 16 "a "
USE FCG
INPUT CODTAB F_TOLIVELLOGIAC
DISPLAY "Num." CODTAB
@ -338,27 +359,17 @@ END
BOOL F_TOTALIMAGAZZINI
BEGIN
PROMPT 2 16 "Stampo i totali di magazzino"
PROMPT 2 17 "Stampo i totali di magazzino"
MESSAGE FALSE "",F_DETTAGLIOMAG|DISABLE,F_DETTAGLIOMAG
MESSAGE TRUE ENABLE,F_DETTAGLIOMAG
END
BOOL F_DETTAGLIOMAG
BEGIN
PROMPT 42 16 "Stampo i depositi"
PROMPT 42 17 "Stampo i depositi"
FLAGS "D"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -523,7 +523,7 @@ SECTION BODY ODD 0 COLUMNWISE
BEGIN
KEY "DESCR.articolo"
PROMPT 3 1 ""
FIELD LF_ANAMAG->DESCR
MESSAGE _USER,DESCR
MESSAGE COPY,650
END
VALUTA 22 12

View File

@ -1,7 +1,6 @@
#include "mg3frm.h"
USE LF_ANAMAG KEY 1
SORT LF_MAG BY ANNOES CODART LIVELLO CODMAG
JOIN TO LF_ANAMAG INTO ANNOES==1996 CODART==CODART
USE LF_ANAMAG BY CODART
JOIN LF_MAG TO LF_ANAMAG INTO ANNOES==2006 CODART==CODART
JOIN MAG TO LF_MAG ALIAS 500 INTO CODTAB==CODMAG[1,3]
JOIN MAG TO LF_MAG ALIAS 501 INTO CODTAB==CODMAG
JOIN GMC TO LF_ANAMAG ALIAS 400 INTO CODTAB==GRMERC[1,3]
@ -524,7 +523,7 @@ SECTION BODY ODD 0 COLUMNWISE
BEGIN
KEY "DESCR.articolo"
PROMPT 3 1 ""
FIELD LF_ANAMAG->DESCR
MESSAGE _USER,DESCR
MESSAGE COPY,650
END
VALUTA 22 12

Some files were not shown because too many files have changed in this diff Show More