Patch level : 12.0 870

Files correlati     : f9.exe, f23.dirr, f23.trr
Commento            :
- Aggiunto codice registrazione al protocollo iva
- Aggiunta eliminazione dei pacchetti provvisori o in stato 02
- Cambiata gestione maschera esclusi per non farla chiudere
- Memorizzati errori in tabella F9ERROR e possibilita' di vedere gli errori passati
- Corretta visualizzazione conferma estrazione
- Corretta query IVA flag provvisorio
- Aggiunto sistema di aggiornamento tabelle F9
- Aggiunto collegamento in prima nota su maschera di controllo
This commit is contained in:
Simone Palacino 2019-09-13 17:06:08 +02:00
parent a6ba547dc5
commit b56e8badf6
9 changed files with 810 additions and 196 deletions

View File

@ -12,8 +12,16 @@
#include "f90100c.h"
#include "f90100b.h"
#define PROVA_DBG
#undef PROVA_DBG
/*
* - Per aggiornare le tabelle f9 aggiungere nella cartella "sql\f9\" il file sql cosi' fatto:
* f9xxxx.sql dove xxxx e' il numero zero-filled della versione delle tabelle, che INCREMENTA DI DUE COME CON LE PATCH, IMPORTANTE!
* - Aggiornare la definizione qui sotto di F9_SQL_VERSION mettendo la nuova versione.
* - Fare patch del file sql e dell'eseguibile f90.exe
* - Lanciare il programma per eseguire l'aggiornamento.
*/
#define TABMOD_SQL_VERSION "S0"
#define F9_SQL_VERSION 100 // Utilizzo questo per controllare la versione attuale delle tabelle e nel caso aggiornarle
SSimple_query& db()
{
@ -26,11 +34,39 @@ SSimple_query& db()
return *db;
}
TMask** esclusi_mask()
{
static TMask* _esclusi_mask = nullptr;
if(_esclusi_mask == nullptr)
{
_esclusi_mask = new TMask("f90100c.msk");
TMask& m = *_esclusi_mask;
((TSheet_field&)m.field(S_ESCL)).set_notify(TF9_app::select_escl_notify); // Handler dello sheet per selezione singola
m.set_handler(DLG_FINDREC, TF9_app::controllo_escl_handler); // Bottone per aprire maschera di controllo movimenti
m.set_handler(B_ESTRAI, TF9_app::estrai_escl_handler); // Bottone estrai
TMask& sheet_m = ((TSheet_field&)m.field(S_ESCL)).sheet_mask(); // Maschera dei campi dello sheet
sheet_m.set_handler(DLG_USER, TF9_app::mov_handler); // Bottone collega movimento
m.field(DLG_FINDREC).disable();
}
return &_esclusi_mask;
}
const char* check_str(const TString& str)
{
static TString n_str; n_str.cut(0) << str;
n_str.replace("'", "\'\'");
n_str.replace(" ", " ");
return (const char*)n_str;
}
////////////////////////////////////////////////////////
// TEstrai_mask
////////////////////////////////////////////////////////
TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 10), _dirty(true)
TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 10)
{
add_button_tool(DLG_ELABORA, "Estrai", TOOL_ELABORA);
add_button_tool(DLG_NULL, "", 0);
@ -42,7 +78,7 @@ TEstrai_mask::TEstrai_mask() : TMask("Estrazione", 1, 60, 10), _dirty(true)
add_groupbox(ES_FLAGGROUP, 0, "Selezionare tipo di estrazione:", 1, 3, 28, 3, "");
add_list(ES_FLAGPROV, 0, "Flag provvisorio", 2, 4, 1, "", "P|D", "Provvisorio|Definitivo");
add_groupbox(ES_TIPOGROUP, 0, "Selezionare documenti da estrarre:", 32, 3, 28, 3, "");
add_list(ES_TIPODOC, 0, "Tipi documento", 33, 4, 1, "", "A|V|C", "Acquisti|Vendite|Corrispettivi");
add_list(ES_TIPODOC, 0, "Tipi documento", 33, 4, 1, "", "A|V", "Acquisti|Vendite");
TMask::set_handler(DLG_ELABORA, estrai_handler);
TMask::set_handler(ES_DATAINI, dataini_handler);
@ -58,9 +94,13 @@ bool TEstrai_mask::estrai_handler(TMask_field& f, unsigned short key)
auto& msk = (TEstrai_mask&)f.mask(); // this
TF9_app::descr_msk().run();
msk._descr.cut(0) << TF9_app::descr_msk().get(DES_TEXT);
if (app().estrai())
message_box("Estrazione avvenuta con successo!");
else
const int stato = app().estrai();
if (stato == 1)
{
message_box("Estrazione avvenuta con successo!");
app().segna_estratti();
}
else if (!stato)
{
app().segna_in_errore();
warning_box("L'estrazione non e' stata completata. Controllare il log degli errori.");
@ -74,10 +114,6 @@ void TEstrai_mask::enable_fields(bool en)
enable(ES_DATAEND, en);
enable(ES_FLAGPROV, en);
enable(ES_TIPODOC, en);
//enable(DLG_ELABORA, !en);
//enable(DLG_FINDREC, en);
//enable(DLG_EDIT, !en);
}
bool TEstrai_mask::enable_handler(TMask_field& f, unsigned short key)
@ -94,7 +130,6 @@ bool TEstrai_mask::dataini_handler(TMask_field& f, unsigned short key)
if(msk.get(ES_DATAINI).full() && msk.get(ES_DATAEND).full() && msk.get_date(ES_DATAINI) > msk.get_date(ES_DATAEND))
return f.error_box("La data di inizio non puo' essere maggiore di quella di fine");
}
//msk.enable(DLG_ELABORA, false);
return true;
}
@ -106,10 +141,10 @@ bool TEstrai_mask::dataend_handler(TMask_field& f, unsigned short key)
if (msk.get(ES_DATAINI).full() && msk.get(ES_DATAEND).full() && msk.get_date(ES_DATAINI) > msk.get_date(ES_DATAEND))
return f.error_box("La data di fine non puo' essere minore di quella di inizio");
}
//msk.enable(DLG_ELABORA, false);
return true;
}
////////////////////////////////////////////////////////
// TMonitor_mask
////////////////////////////////////////////////////////
@ -130,10 +165,27 @@ bool TMonitor_mask::save_conf_handler(TMask_field& f, unsigned short key)
return true;
}
void TMonitor_mask::controllo_errori()
void TMonitor_mask::controllo_errori() const
{
TControllo_mask controllo;
controllo.run();
TString id_estr;
TSheet_field& sf = sfield(S_ELAB);
bool flag = false;
FOR_EACH_SHEET_ROW(sf, nr, row)
{
if (row->get(0)[0] == 'X')
{
id_estr << row->get(cid2index(F_IDESTR));
flag = true;
break;
}
}
if (flag)
{
TControllo_mask controllo(id_estr);
controllo.run();
}
else
warning_box("Selezionare un'estrazione.");
}
bool TMonitor_mask::on_key(const KEY key)
@ -173,6 +225,119 @@ void TMonitor_mask::open_win_conf() const
m->run();
}
void TMonitor_mask::fill()
{
app()._ambiente = ini_get_string(CONFIG_DITTA, PAR_MOD, AMBIENTE_F9);
app()._addr_doc = ini_get_string(CONFIG_DITTA, PAR_MOD, ADDRCART_F9);
TString query;
query << "SELECT * FROM F9DRD00K ORDER BY " << DRD_TIME << ";";
db().sq_set_exec(query, false);
TSheet_field& sf = sfield(S_ELAB);
sf.hide();
sf.destroy();
int i = 0;
for (bool ok = db().sq_next(); ok; ok = db().sq_next())
{
TString tipo;
TToken_string& row = sf.row(i++);
row.add(" ");
row.add(db().sq_get(DRD_STATO) == "09" ? "X" : "");
row.add(db().sq_get(DRD_ID_EST));
row.add(db().sq_get_date(DRD_TIME));
row.add(db().sq_get(DRD_FLAG_PD) == "P" ? "X" : "");
tipo << db().sq_get(DRD_TIPODOC);
if (tipo == "A") tipo << "cquisti";
if (tipo == "V") tipo << "endite";
if (tipo == "C") tipo << "orrispettivi";
row.add(tipo);
row.add(db().sq_get_date(DRD_DATADA));
row.add(db().sq_get_date(DRD_DATAA));
row.add(db().sq_get(DRD_UTENTE));
row.add(TF9_app::traduci_stato(db().sq_get(DRD_STATO)));
row.add(db().sq_get(DRD_DESC));
if (TDate(row.get(cid2index(F_DATAESTR))) == today)
{
if (TString(row.get(cid2index(F_PROV_B))) == "X")
app()._last_estr_p = real(TString(row.get(cid2index(F_IDESTR))).ltrim(10)).integer();
else
app()._last_estr_d = real(TString(row.get(cid2index(F_IDESTR))).ltrim(10)).integer();
}
}
sf.force_update();
sf.show();
}
void TMonitor_mask::delete_pack(bool all)
{
bool flag = false;
TSheet_field& sf = sfield(S_ELAB);
FOR_EACH_SHEET_ROW(sf, nr, row)
{
if(row->get(0)[0] == 'X' || all)
{
flag = true;
const TString id_estr(row->get(cid2index(F_IDESTR)));
TString query;
// Elimino testata in DRD, solo se provvis.
query << "BEGIN\n"
" DECLARE @flag_prov CHAR(1), @stato CHAR(2);\n\n"
" SELECT @flag_prov = " DRD_FLAG_PD ", @stato = " DRD_STATO "\n"
" FROM " F9_DRD "\n"
" WHERE " DRD_ID_EST " = '" << id_estr << "';\n\n"
" IF (@flag_prov = 'P' OR @stato = '" D_GEST_ERR "') BEGIN\n"
" DELETE FROM " F9_DRD " WHERE " DRD_ID_EST " = '" << id_estr << "';\n"
" DELETE FROM " F9_IVA " WHERE " IVA_IDLAN " = '" << id_estr << "';\n"
" END\n"
" SELECT @flag_prov AS FLAG, @stato AS STATO;\n"
"END";
db().sq_set_exec(query);
if(db().sq_get("FLAG") != 'P' && db().sq_get("STATO") != "02" && !all)
{
warning_box("E' possibile eliminare solo un'estrazione provvisoria o in stato di errore diagnostica gestionale.");
return;
}
query.cut(0) << "BEGIN\n"
" DECLARE @stato CHAR(2);\n\n"
" SELECT @stato = " DRD_STATO "\n"
" FROM " F9_DRD "\n"
" WHERE " DRD_ID_EST " = '" << id_estr << "';\n\n"
" IF(@stato = '" D_GEST_ERR "') BEGIN\n"
" DELETE FROM " F9_ERR " WHERE IDESTR = '" << id_estr << "';\n"
" END\n"
" ELSE BEGIN\n"
" SELECT @STATO AS STATO;\n"
" END\n"
" END";
db().sq_set_exec(query);
if (!all)
break;
}
}
if(!flag)
{
if(noyes_box("Eliminare tutti i pacchetti provvisori o in stato di errore gestionale?"))
delete_pack(true);
}
fill();
}
void TMonitor_mask::sel() const
{
TSheet_field& sf = sfield(S_ELAB);
sf.hide();
FOR_EACH_SHEET_ROW(sf, nr, row)
{
if (*row->get(0) == 'X')
row->add("", 0);
}
sf.force_update();
sf.show();
}
void TMonitor_mask::disable_controllo_err()
{
disable(DLG_FINDREC);
@ -182,9 +347,9 @@ bool TMonitor_mask::on_field_event(TOperable_field& o, TField_event e, long joll
{
switch (o.dlg())
{
case DLG_ALL:
if(e == fe_button && curr_page() == 1)
//sel_all();
case DLG_DELREC:
if (e == fe_button)
delete_pack();
break;
case DLG_ELABORA:
if (e == fe_button)
@ -202,7 +367,7 @@ bool TMonitor_mask::on_field_event(TOperable_field& o, TField_event e, long joll
controllo_errori();
break;
case DLG_RECALC:
app().fill();
fill();
break;
case B_SHOWESCL:
if(e == fe_button)
@ -210,11 +375,78 @@ bool TMonitor_mask::on_field_event(TOperable_field& o, TField_event e, long joll
app().open_esclusi();
}
break;
case F_SEL:
if(e == fe_modify)
{
sel();
}
default: break;
}
return true;
}
//////////////////////////////////////////////////////
// TF9_dberr
//////////////////////////////////////////////////////
void TF9_dberr::add_str(const TString& string)
{
_insert.rtrim(1);
if (_insert[_insert.len() - 1] != '(')
_insert << ", ";
_insert << string << ")";
}
void TF9_dberr::add(const TString& string)
{
TString str;
add_str(str << "'" << string << "'");
}
void TF9_dberr::add(const long num)
{
TString app;
app << num;
add(app);
}
void TF9_dberr::send()
{
db().sq_set_exec(_insert);
_insert.cut(0) << "INSERT INTO " F9_ERR " VALUES ()";
}
char TF9_dberr::get_errori(const TString& id_estr, vector<TToken_string>& movs)
{
TString query;
query << "SELECT * FROM " F9_ERR " WHERE IDESTR = '" << id_estr << "';";
db().sq_set_exec(query, false);
for (bool ok = db().sq_next(); ok; ok = db().sq_next())
{
TToken_string row("", '|');
row.add("X", 0);
for (int i = 1; i < 15; i++)
{
if (db().sq_get_type_field(i) == _datefld)
row.add(db().sq_get_date(db().sq_get_name_field(i)));
else
row.add(db().sq_get(i));
}
movs.insert(movs.end(), row);
}
query.cut(0) << "SELECT " DRD_TIPODOC " FROM " F9_DRD "\n" <<
"WHERE " DRD_ID_EST " = '" << id_estr << "'";
db().sq_set_exec(query);
return db().sq_get((unsigned)0)[0];
}
TF9_dberr::TF9_dberr()
{
_insert.cut(0) << "INSERT INTO " F9_ERR " VALUES ()";
}
////////////////////////////////////////////////////////
// TF9_app
////////////////////////////////////////////////////////
@ -239,8 +471,7 @@ bool TF9_app::select_escl_notify(TSheet_field& s, int row, KEY key)
bool TF9_app::controllo_escl_handler(TMask_field& field, KEY key)
{
// open controllo
TControllo_mask controllo(true);
TControllo_mask controllo(app()._head.id_estr, true);
controllo.run();
return true;
}
@ -315,15 +546,17 @@ void TF9_app::open_esclusi()
static TMask* ym_msk = nullptr;
if (ym_msk == nullptr)
{
ym_msk = new TMask("Mostra esclusi", 1, 20, 10);
ym_msk = new TMask("Mostra esclusi", 1, 25, 16);
ym_msk->add_button_tool(DLG_OK, "Conferma", TOOL_OK);
ym_msk->add_button_tool(DLG_NULL, "", 0);
ym_msk->add_button_tool(DLG_QUIT, "Esci", TOOL_QUIT);
ym_msk->add_groupbox(507, 0, "Movimenti da visualizzare:", 0, 0, 25, 6);
ym_msk->add_number(501, 0, "Anno", 1, 1, 4);
ym_msk->add_list(502, 0, "Mese", 1, 2, 8, "", "01|02|03|04|05|06|07|08|09|10|11|12", "Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre");
ym_msk->add_list(503, 0, "Fino al", 1, 3, 9, "", " |01|02|03|04|05|06|07|08|09|10|11|12", " |Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre");
ym_msk->add_list(504, 0, "Flag Provvisorio", 1, 4, 1, "", "P|D", "Provvisorio|Definitivo");
ym_msk->add_list(505, 0, "Tipo doc.", 1, 5, 1, "", "A|V", "Acquisti|Vendite");
ym_msk->add_groupbox(506, 0, "Selezionare il tipo di estrazione", 0, 6, 25);
ym_msk->add_list(504, 0, "Flag Provvisorio", 1, 7, 1, "", "P|D", "Provvisorio|Definitivo");
ym_msk->add_list(505, 0, "Tipo doc.", 1, 4, 1, "", "A|V", "Acquisti|Vendite");
ym_msk->set(501, today.year());
ym_msk->set_handler(501, year_handler);
}
@ -337,7 +570,7 @@ void TF9_app::open_esclusi()
// Caricamento esclusi
/* LOADING DI QUEL MESE E ANNO
*/
vector<TToken_string> esclusi;
app()._esclusi_vect.clear();
const int anno = ym_msk->get_int(501);
const int mese = ym_msk->get_int(502);
const int to_m = ym_msk->get_int(503);
@ -355,7 +588,7 @@ void TF9_app::open_esclusi()
{
for(bool ok = true; ok && movs.get_date(MOV_DATAREG) <= to; ok = movs.next() == NOERR)
{
TToken_string stato(movs.get(MOV_ELABF9));
TToken_string stato(movs.get(MOV_ELABF9), ';');
if(stato.items() == 3 && stato.get(2)[0] == 'X')
{
TToken_string m("", '|');
@ -372,52 +605,78 @@ void TF9_app::open_esclusi()
TLocalisamfile clifo(LF_CLIFO);
TString ragsoc; ragsoc = clifo.get(CLI_RAGSOC);
m.add(ragsoc);
m.add(movs.get(MOV_PROTIVA));
m.add(TString(movs.get(MOV_REG)) << "/" << movs.get(MOV_PROTIVA));
m.add(movs.get(MOV_DESCR));
esclusi.insert(esclusi.end(), m);
app()._esclusi_vect.insert(app()._esclusi_vect.end(), m);
}
}
}
if(esclusi.empty())
if(app()._esclusi_vect.empty())
{
warning_box("Non ci sono movimenti esclusi da mostrare");
return;
}
static TMask* escl_msk = nullptr;
if (escl_msk == nullptr)
{
escl_msk = new TMask("f90100c.msk");
((TSheet_field&)escl_msk->field(S_ESCL)).set_notify(select_escl_notify); // handler sheet per selezione singola
escl_msk->set_handler(DLG_FINDREC, controllo_escl_handler);
escl_msk->field(DLG_FINDREC).disable();
}
TSheet_field& sf = escl_msk->sfield(S_ESCL);
sf.reset();
for(auto it = esclusi.begin(); it != esclusi.end(); ++it)
sf.row(-1) = *it;
while(escl_msk->run() == K_ENTER)
// Esclusi mask ////////////////////////////////
fill_esclusi();
while((*esclusi_mask())->run() == K_ENTER)
{
// Prendo la riga selezionata (e controllo che sia selezionato qualcosa)
bool flag = false;
FOR_EACH_SHEET_ROW(sf, nr, row)
{
if((*row)[0] == 'X')
{
if(estrai_single(*row, _flagprov_escl, _tipodoc_escl) == -2) // Attivo pulsante controllo estr
escl_msk->field(DLG_FINDREC).enable();
flag = true;
break;
}
}
if (!flag)
message_box("Selezionare almeno un movimento");
}
}
void TF9_app::fill_esclusi()
{
vector<TToken_string>& esclusi = app()._esclusi_vect;
TSheet_field& sf = (*esclusi_mask())->sfield(S_ESCL);
sf.hide();
sf.destroy();
for (auto it = esclusi.begin(); it != esclusi.end(); ++it)
sf.row(-1) = *it;
sf.force_update();
sf.show();
}
bool TF9_app::estrai_escl_handler(TMask_field&, KEY key)
{
TMask* msk = *esclusi_mask();
vector<TToken_string>& _esclusi = app()._esclusi_vect;
TSheet_field& sf = msk->sfield(S_ESCL);
msk->field(DLG_FINDREC).disable();
// Prendo la riga selezionata (e controllo che sia selezionato qualcosa)
bool flag = false;
FOR_EACH_SHEET_ROW(sf, nr, row)
{
if ((*row)[0] == 'X')
{
const int stato = app().estrai_single(*row, app()._flagprov_escl, app()._tipodoc_escl);
if (stato == -2) // Attivo pulsante controllo estr
msk->field(DLG_FINDREC).enable();
else if (stato == 1)
{
_esclusi.erase(_esclusi.begin() + nr); // Tolto il movimento estratto dal vettore e setto come estratto su elabf9 di mov
app().segna_estratti(true, row->get_int(cid2index(F_NUMREG)));
}
flag = true;
break;
}
}
if (!flag)
message_box("Selezionare almeno un movimento");
fill_esclusi();
return true;
}
bool TF9_app::mov_handler(TMask_field&, KEY key)
{
TSheet_field& sf = (*esclusi_mask())->sfield(S_ESCL);
TToken_string& row = sf.row(sf.selected());
TRectype mov(LF_MOV);
mov.put(MOV_NUMREG, row.get(sf.cid2index(F_NUMREG)));
return open_mov(mov);
}
TMask& TF9_app::descr_msk()
{
static TMask* m = nullptr;
@ -438,6 +697,30 @@ void TF9_app::edit_wa() const
"INSERT INTO F9WA00K (F9PCSOC, F9PPCDC0) VALUES (" << _ambiente << ", " << _addr_doc << ");";
}
void TF9_app::export_error_list(bool esclusi) // todo: da ritestare
{
TF9_dberr dberr;
vector<TToken_string>& movs = esclusi ? _esclusi : _movs;
for(auto it = movs.begin(); it != movs.end(); ++it)
{
if(it->get(0)[0] == 'X')
{
dberr.add(_head.id_estr);
for(int i = 1; i < 15; i++)
{
TString string(it->get(i));
if (i == 2 || i == 3) // Sono obbligato a far cosi' per aggiungere le date
dberr.add(TDate(it->get(i)));
else if (string.full())
dberr.add(string);
else
dberr.add(); // Se vuoto metto NULL
}
dberr.send();
}
}
}
void TF9_app::load()
{
const TDate dataini = get_dataini();
@ -487,7 +770,7 @@ void TF9_app::load()
clifo.put(CLI_TIPOCF, "F");
clifo.put(CLI_CODCF, mov.get(MOV_CODCF));
t.add(clifo.read() == NOERR ? clifo.get(CLI_RAGSOC) : " ");
t.add(mov.get(MOV_PROTIVA));
t.add(TString(mov.get(MOV_REG)) << "/" << mov.get(MOV_PROTIVA));
t.add(mov.get(MOV_DESCR));
_movs.insert(_movs.end(), t);
i++;
@ -526,50 +809,6 @@ const char* TF9_app::traduci_stato(const TString& cod)
return (const char*)stato;
}
void TF9_app::fill()
{
_ambiente = ini_get_string(CONFIG_DITTA, PAR_MOD, AMBIENTE_F9);
_addr_doc = ini_get_string(CONFIG_DITTA, PAR_MOD, ADDRCART_F9);
TString query;
query << "SELECT * FROM F9DRD00K ORDER BY " << DRD_TIME << ";";
db().sq_set_exec(query, false);
TSheet_field& sf = _msk->sfield(S_ELAB);
sf.hide();
int i = 0;
for(bool ok = db().sq_next(); ok; ok = db().sq_next())
{
TString tipo;
TToken_string& row = sf.row(i++);
row.add(db().sq_get(DRD_STATO) == "09" ? "X" : "");
row.add(db().sq_get(DRD_ID_EST));
row.add(db().sq_get_date(DRD_TIME));
row.add(db().sq_get(DRD_FLAG_PD) == "P" ? "X" : "");
tipo << db().sq_get(DRD_TIPODOC);
if(tipo == "A") tipo << "cquisti";
if(tipo == "V") tipo << "endite";
if(tipo == "C") tipo << "orrispettivi";
row.add(tipo);
row.add(db().sq_get_date(DRD_DATADA));
row.add(db().sq_get_date(DRD_DATAA));
row.add(db().sq_get(DRD_UTENTE));
row.add(traduci_stato(db().sq_get(DRD_STATO)));
row.add(db().sq_get(DRD_DESC));
if(TDate(row.get(cid2index(F_DATAESTR))) == today)
{
if (TString(row.get(cid2index(F_PROV_B))) == "X")
_last_estr_p = real(TString(row.get(cid2index(F_IDESTR))).ltrim(10)).integer();
else
_last_estr_d = real(TString(row.get(cid2index(F_IDESTR))).ltrim(10)).integer();
}
}
sf.force_update();
sf.show();
}
state_fppro TF9_app::check_fppro(int numreg) const
{
TLocalisamfile mov(LF_MOV);
@ -630,7 +869,7 @@ const char * TF9_app::prepara_movimenti(TipoIVA tipo)
case no_guessed:
ok &= false;
row.add("X", 0); // Mi segno il movimento che ha un problema
row.add("Non associato a fattura elettr.; abbinamanto automatico non riuscito. Abbinare manualmente, o escludere", cid2index(F_DESCRERR));
row.add("Non associato a fattura elettr. abbinamento automatico non riuscito. Abbinare manualmente, o escludere", cid2index(F_DESCRERR));
default: break;
}
}
@ -748,19 +987,15 @@ bool TF9_app::check_periodo_def(const drd& head)
// Nel caso di stato di errore e' invece possibile la ri-estrazione
query << "SELECT *\nFROM F9DRD00K\n" <<
"WHERE '" << head.dal.date2ansi() << "' =< " DRD_DATAA " AND '" << head.al.date2ansi() << "' >= " DRD_DATADA " AND "
DRD_FLAG_PD " = 'D' AND\n F9RIDAS <> '02' AND F9RIDAS <> '05' AND F9RIDAS <> '08' AND " DRD_TIPODOC " = '" << head.tipo_doc << "';";
DRD_FLAG_PD " = 'D' AND\n F9RIDAS <> '" D_GEST_ERR "' AND F9RIDAS <> '" D_WA_ERR "' AND F9RIDAS <> '" D_ERR_SOS "' AND " DRD_TIPODOC " = '" << head.tipo_doc << "';";
db().sq_set_exec(query);
return db().sq_items() == 0;
}
bool TF9_app::esporta()
bool TF9_app::esporta() const
{
#ifndef PROVA_DBG
const bool ok = new_extr();
#else
const bool ok = true;
#endif
fill();
_msk->fill();
return ok;
}
@ -829,8 +1064,9 @@ int TF9_app::estrai()
{
if (_head.stato_estr == D_GEST_ERR)
{
warning_box("Attenzione l'estrazione ha prodotto degli errori. \nControllare e correggere eventuali problemi \npremendo il pulsante 'Controllo Estr.'");
_msk->enable(DLG_FINDREC);
_msk->enable(DLG_FINDREC);
export_error_list();
warning_box("Attenzione l'estrazione ha prodotto degli errori. \nControllare e correggere eventuali problemi \ndal Controllo Estrazione.");
}
else if (_head.stato_estr == D_GEST_OK)
{
@ -841,15 +1077,7 @@ int TF9_app::estrai()
return -2;
}
const char* check_str(const TString& str)
{
static TString n_str; n_str.cut(0) << str;
n_str.replace("'", "\'\'");
n_str.replace(" ", " ");
return (const char*)n_str;
}
bool TF9_app::estrazione_iva(bool escluso)
bool TF9_app::estrazione_iva(const bool escluso)
{
bool stato = true;
TString& codsoc = _ambiente;
@ -902,13 +1130,13 @@ bool TF9_app::estrazione_iva(bool escluso)
const TString& name_reg = TRegistro(TCausale(mov.get(MOV_CODCAUS)).reg()).name();
query << "\n)\n" <<
"VALUES (\n" <<
"'" << codsoc << "', '" << _head.id_estr << "', '" << _head.flag_prov << "',\n" <<
"'" << mov.get(MOV_ANNOES) << "', '" << _head.tipo_doc << "', '" << name_reg << "',\n" <<
"'" << 'S' << "', '" << mov.get(MOV_TIPO) << "', '" << mov.get(MOV_CODCF) << "',\n" <<
"'" << check_str(cli.get(CLI_RAGSOC)) << "', '" << idfisc << "', '" << cli.get(CLI_PAIV) << "',\n" <<
"'" << cli.get(CLI_COFI) << "', '" << categoria_doc() << "', '" << caus_sos(mov, get_tipoiva()) << "',\n" <<
"'" << numdoc << "', '" << datadoc << "', '" << mov.get(MOV_REG) << "',\n" <<
"'" << "" << "', '" << mov.get(MOV_PROTIVA) << "', '" << datareg << "'";
"'" << codsoc << "', '" << _head.id_estr << "', '" << (_head.flag_prov ? "P" : "D") << "',\n" <<
"'" << mov.get(MOV_ANNOES) << "', '" << _head.tipo_doc << "', '" << name_reg << "',\n" <<
"'" << 'S' << "', '" << mov.get(MOV_TIPO) << "', '" << mov.get(MOV_CODCF) << "',\n" <<
"'" << check_str(cli.get(CLI_RAGSOC)) << "', '" << idfisc << "', '" << cli.get(CLI_PAIV) << "',\n" <<
"'" << cli.get(CLI_COFI) << "', '" << categoria_doc() << "', '" << caus_sos(mov, get_tipoiva()) << "',\n" <<
"'" << numdoc << "', '" << datadoc << "', '" << mov.get(MOV_REG) << "',\n" <<
"'" << "" << "', '" << mov.get(MOV_PROTIVA) << "', '" << datareg << "'";
//if (is_autofattura(mov))
//{
// query << ",\n" <<
@ -965,6 +1193,30 @@ bool TF9_app::is_autofattura(const TLocalisamfile& mov)
return TCausale(mov.get(MOV_CODCAUS)).tipo_doc() == "AF";
}
bool TF9_app::segna_estratti(const bool escluso, const int numreg)
{
bool ok = true;
vector<TToken_string> escl;
if (escluso)
escl.insert(escl.begin(), TToken_string(TString("|") << numreg << "|", '|'));
vector<TToken_string>& movs_v = escluso ? escl : _movs;
TLocalisamfile mov(LF_MOV);
TToken_string elab("", ';');
elab.add("X", 0); elab.add(today.date2ansi()); elab.add(" "); // "[flag estratto];[data estrazione];[flag escluso]"
for(auto it = movs_v.begin(); it != movs_v.end(); ++it)
{
TString8 num_reg = it->get(cid2index(F_NUMREG));
mov.zero();
mov.put(MOV_NUMREG, num_reg);
mov.read();
mov.put(MOV_ELABF9, elab);
ok &= mov.rewrite() == NOERR;
}
return ok;
}
void TF9_app::segna_in_errore() const
{
TString query;
@ -977,15 +1229,132 @@ void TF9_app::segna_in_errore() const
void TF9_app::main_loop()
{
check_table();
_msk = new TMonitor_mask();
_estr_msk = new TEstrai_mask();
fill();
while (_msk->run() == K_ENTER){ }
_msk->fill();
while (_msk->run() != K_QUIT){ }
delete _msk;
delete _estr_msk;
}
bool TF9_app::create_tables() const
{
bool ok = aggiorna_tab_f9(100);
TLocalisamfile tabmod(LF_TABMOD);
tabmod.put("MOD", "F9");
tabmod.put("COD", "SQL");
tabmod.put("CODTAB", "VERSION");
tabmod.put(TABMOD_SQL_VERSION, 100);
ok &= tabmod.write(); // todo: controllare
return ok;
}
bool TF9_app::check_tabelle_f9()
{
bool ok = true;
TString query;
query << "IF (EXISTS (\n" <<
"SELECT * FROM INFORMATION_SCHEMA.TABLES\n" <<
"WHERE TABLE_NAME = '" F9_DRD "'))\n" <<
"SELECT 1 AS EXIST ELSE SELECT 0 AS EXIST";
db().sq_set_exec(query);
if (db().sq_get("EXIST") != "1") // Se non esiste la tabella la creo
ok &= create_tables();
return ok;
}
bool TF9_app::aggiorna_tab_f9(int version) const
{
bool ok = true;
TString file;
string sql;
file << "sql\\f90" << version << ".sql";
std::ifstream fin;
fin.open(file);
if(ok &= fin.is_open())
{
while (!fin.eof())
{
std::string appo_line; // todo: Controllare che si svuota ad ogni ciclo o aggiungere un erase
std::getline(fin, appo_line);
if (appo_line[0] == '-' && appo_line[1] == '-') // Se è una riga di commento la salto
continue;
sql += "\n" + appo_line;
const int end = sql.find(';'); // Se trovo un comma lancio la query
if(end != int(std::string::npos))
{
TString query; query << sql.c_str();
ok &= fp_db().sq_set_exec(query);
sql.erase();
}
}
}
return ok;
}
bool TF9_app::check_tab_version() const
{
bool ok = true;
TLocalisamfile tabmod(LF_TABMOD);
tabmod.put("MOD", "F9");
tabmod.put("COD", "SQL");
tabmod.put("CODTAB", "VERSION");
if(ok &= tabmod.read() == NOERR)
{
int version = real(tabmod.get(TABMOD_SQL_VERSION)).integer();
if(version < F9_SQL_VERSION) // Controllo la versione
{
for(; version <= F9_SQL_VERSION; version += 2) // Effettuo le modifiche per ogni avanzamento di versione
{
if (ok &= aggiorna_tab_f9(version + 2))
{
tabmod.put(TABMOD_SQL_VERSION, version + 2); // Avanzo il contatore della versione in TABMOD
tabmod.rewrite();
}
else
break;
}
}
}
return ok;
}
bool TF9_app::check_table()
{
if (!check_tabelle_f9())
{
TString msg;
std::ofstream fout;
fout.open("f9checktaberr.txt");
fout << fp_db().sq_get_text_error(false) << std::endl;
fout.close();
msg << "Errore controllo database F9: creazione tabelle.\n" << fp_db().sq_get_text_error(false);
fatal_box(msg);
return false;
}
// Se il check tabelle va a buon fine controllo la versione delle tabelle
if (!check_tab_version())
{
TString msg;
std::ofstream fout;
fout.open("f9checktaberr.txt");
fout << fp_db().sq_get_text_error(false) << std::endl;
fout.close();
msg << "Errore controllo database F9: aggiornamento tabelle.\n" << fp_db().sq_get_text_error(false);
fatal_box(msg);
return false;
}
return true;
}
TF9_app& app()
{
static TF9_app* app = nullptr;
@ -1001,35 +1370,45 @@ int f90100(int argc, char* argv[])
return 0;
}
/////////////////////////////////////////////
// TControllo_mask
/////////////////////////////////////////////
void TControllo_mask::fill() const
vector<TToken_string>& TControllo_mask::import_error_list()
{
static vector<TToken_string> movs;
movs.clear();
TF9_dberr dberr;
_tipo_doc_err = dberr.get_errori(_id_estr, movs);
return movs;
}
void TControllo_mask::fill()
{
TSheet_field& sf = sfield(S_CONTROLLO);
sf.hide();
sf.destroy();
vector<TToken_string>& movs = !_esclusi ? app()._movs : app()._esclusi;
vector<TToken_string>& movs = !_is_escluso ? import_error_list() : app()._esclusi; // Prendo da _esclusi se sto aprendo il controllo dalla maschera degli esclusi
for (auto it = movs.begin(); it != movs.end(); ++it)
{
TToken_string& row = sf.row(-1);
if (it->get(0)[0] == 'X')
if (*it->get(0) == 'X')
{
row = *it;
row[0] = (char&)" ";
if (!_esclusi && app().get_tipoiva() == iva_acquisti || _esclusi && app().get_tipoiva_escl() == iva_acquisti)
row.add('N', cid2index(F_CESCLUDI));
if (!_is_escluso && _tipo_doc_err == 'A' || _is_escluso && app().get_tipoiva_escl() == iva_acquisti)
row.add("", cid2index(F_CESCLUDI));
else
row.add('Y', cid2index(F_CESCLUDI));
row.add("X", cid2index(F_CESCLUDI));
}
}
sf.force_update();
sf.show();
// Fill fppro sheet
if (!_esclusi && app().get_tipoiva() == iva_acquisti || _esclusi && app().get_tipoiva_escl() == iva_acquisti)
if (!_is_escluso && _tipo_doc_err == 'A' || _is_escluso && app().get_tipoiva_escl() == iva_acquisti)
fill_fppro_sheet();
}
@ -1157,8 +1536,17 @@ void TControllo_mask::associa()
const bool ok = fppro_db().associa_mov(mov_sel->get_int(cid2index(F_CNUMREG)));
if (ok)
{
auto it = app()._movs.begin();
it += _selected_mov;
// Tolgo il flag di in errore sul vettore in modo da rifare la fill e non venir piu' contato come da controllare
vector<TToken_string>& movs = _is_escluso ? app()._esclusi : app()._movs;
auto it = movs.begin();
int count = -1;
while (count < _selected_mov && it != movs.end())
{
if (it->get(0)[0] == 'X') // Devo saltare tutti quelli che non hanno il flag e contare solo quelli che ce l'hanno
count++;
if(count < _selected_mov)
++it;
}
it->add(" ", 0);
}
}
@ -1167,7 +1555,7 @@ void TControllo_mask::selfatt(TOperable_field& o, const long jolly) const
{
const TMask& mask = *this;
TSheet_field* sf;
if (jolly == 2) // Sheet controllo
if (jolly == 1) // Sheet controllo
sf = &mask.sfield(S_CONTROLLO);
else
sf = &mask.sfield(S_FPPRO);
@ -1191,23 +1579,23 @@ void TControllo_mask::conferma_esclusi() const
TLocalisamfile movs(LF_MOV);
movs.put(MOV_NUMREG, row->get_int(cid2index(F_CNUMREG)));
movs.read();
if (*row->get(12) == 'Y')
if (*row->get(cid2index(F_CESCLUDI)) == 'X')
{
const TDate today(TODAY);
TToken_string stato("", '|');
TToken_string stato("", ';');
stato.add("", 0);
stato.add(today.date2ansi());
stato.add("X");
movs.put(MOV_ELABF9, stato);
movs.rewrite();
row->add("X", 13);
row->add("Si", cid2index(F_CESCLUSO));
}
else
{
if (movs.get(MOV_ELABF9).full())
{
movs.put(MOV_ELABF9, "");
row->add("", 13);
row->add("", cid2index(F_CESCLUSO));
movs.rewrite();
}
}
@ -1220,6 +1608,17 @@ bool TControllo_mask::on_field_event(TOperable_field& o, TField_event e, long jo
{
switch (o.dlg())
{
case DLG_USER:
if (e == fe_button && jolly > 0)
{
TSheet_field& sf = sfield(S_CONTROLLO);
TToken_string& row = sf.row(sf.selected());
TRectype mov(LF_MOV);
mov.put(MOV_NUMREG, row.get(sf.cid2index(F_NUMREG)));
if (open_mov(mov))
fill();
}
break;
case B_ORDER:
if (e == fe_button)
{
@ -1261,11 +1660,12 @@ bool TControllo_mask::on_field_event(TOperable_field& o, TField_event e, long jo
return true;
}
TControllo_mask::TControllo_mask(bool esclusi) : TAutomask("f90100b"), _ordin('D'), _verso('A'), _selected_mov(0), _sel_esclusi(false)
TControllo_mask::TControllo_mask(const char* id_estr, bool esclusi) : TAutomask("f90100b"), _ordin('D'), _verso('A'), _selected_mov(0), _sel_esclusi(false)
{
_id_estr = id_estr;
field(B_ESCL).disable();
get_win_order();
_esclusi = esclusi;
_is_escluso = esclusi;
// Fill controllo sheet
fill();

View File

@ -2,6 +2,7 @@
#include "applicat.h"
#include "f90100a.h"
#include <automask.h>
#include "execp.h"
#define PAR_MOD "F9"
#define AMBIENTE_F9 "CODSOC" // Codice ambiente (codsoc)
@ -64,6 +65,7 @@ class TF9_app : public TSkeleton_application
//TControllo_mask* _controllo_msk;
vector<TToken_string> _movs;
vector<TToken_string> _esclusi; // Vettore con i movimenti esclusi
vector<TToken_string> _esclusi_vect;
TToken_string _mov_escl;
int _tot_movs;
TString _ambiente; // Codice ambiente (codsoc)
@ -85,19 +87,19 @@ class TF9_app : public TSkeleton_application
TString& drd_tovalues() const;
TString next_estr_today(char tipo) const;
bool esporta();
bool esporta() const;
bool new_extr() const;
TDate get_dataini() const { return _estr_msk->get_date(ES_DATAINI); }
TDate get_dataend() const { return _estr_msk->get_date(ES_DATAEND); }
char get_tipodoc() const { return _estr_msk->get(ES_TIPODOC)[0]; }
char get_tipodoc_escl() const { return _tipodoc_escl; }
TipoIVA get_tipoiva() const { return get_tipodoc() == 'V' ? iva_vendite : iva_acquisti; }
TipoIVA get_tipoiva_escl() const { return get_tipodoc_escl() == 'V' ? iva_vendite : iva_acquisti; }
TipoIVA get_tipoiva() const { return get_tipodoc() == 'A' ? iva_acquisti : iva_vendite; }
TipoIVA get_tipoiva_escl() const { return get_tipodoc_escl() == 'A' ? iva_acquisti : iva_vendite; }
TString& get_descr() const { return _estr_msk->get_descr(); }
bool is_provviso() const { return _estr_msk->get(ES_FLAGPROV)[0] == 'P'; }
void fill();
//void fill();
void load();
public:
@ -116,11 +118,16 @@ public:
static bool controllo_escl_handler(TMask_field& field, KEY key);
static bool year_handler(TMask_field& field, KEY key);
void open_esclusi();
static void fill_esclusi();
static bool estrai_escl_handler(TMask_field&, KEY key);
static bool mov_handler(TMask_field&, KEY key);
void edit_wa() const;
void export_error_list(bool esclusi = false);
int estrai(); // Estrazione per pacchetti "normali"
int estrai_single(TToken_string& row, char flagprov, char tipodoc); // Estrazione singole per esclusi
int estrai_single(TToken_string& row, char flagprov, char tipodoc); // Estrazione singole per esclusi
bool estrazione_iva(bool escluso = false); // Estrazione dati IVA sia per pacch. normali che per esclusi
bool segna_estratti(bool escluso = false, int numreg = 0); // Segna su mov che il movimento e' stato estratto
void segna_in_errore() const;
static const char* categoria_doc();
@ -128,42 +135,60 @@ public:
static bool is_autofattura(const TLocalisamfile& mov);
void main_loop() override;
TF9_app() : _estr_msk(nullptr), _msk(nullptr), _mov_escl("", '|'), _tot_movs(0), _ambiente(""), _addr_doc(""), _last_estr_p(0), _last_estr_d(0),
_tipodoc_escl('A'), _flagprov_escl('P') { }
// Controllo e aggiornamento tabelle F9
bool create_tables() const; // Creazione tabelle F9
bool check_tabelle_f9(); // Controllo esistenza delle tabelle e in caso le crea
bool aggiorna_tab_f9(int version) const; // Aggiorna modifiche alle tabelle F9 come descritto in cima al file .cpp
bool check_tab_version() const; // Controllo della versione e in caso aggiorna le tabelle
bool check_table();
TF9_app() : _estr_msk(nullptr), _msk(nullptr), _mov_escl("", '|'), _tot_movs(0), _ambiente(""), _addr_doc(""),
_last_estr_p(0), _last_estr_d(0), _tipodoc_escl('A'), _flagprov_escl('P') { }
};
TF9_app& app();
class TMonitor_mask : public TAutomask
{
vector<TToken_string> _fppro;
friend class TF9_app;
static bool save_conf_handler(TMask_field& f, unsigned short key);
static void controllo_errori();
void controllo_errori() const;
// Riempie sheet per visualizzare le estrazioni
bool on_key(KEY key) override;
static void open_win_estr();
void open_win_conf() const;
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
void fill();
void delete_pack(bool all = false);
void sel() const;
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
public:
void disable_controllo_err();
TMonitor_mask() : TAutomask("f90100a")
{
disable(DLG_FINDREC);
//disable(DLG_FINDREC);
}
};
class TControllo_mask : public TAutomask
{
char _ordin;
char _verso;
int _selected_mov;
bool _sel_esclusi;
bool _esclusi;
char _ordin;
char _verso;
int _selected_mov;
bool _sel_esclusi;
bool _is_escluso;
TString _id_estr;
char _tipo_doc_err;
void fill() const;
vector<TToken_string>& import_error_list();
void fill();
void fill_fppro_sheet() const;
TMask& get_win_order();
void open_win_order();
@ -179,5 +204,46 @@ class TControllo_mask : public TAutomask
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
public:
TControllo_mask(bool esclusi = false);
};
TControllo_mask(const char* id_estr, bool esclusi = false);
};
class TF9_dberr
{
TString _str;
TString _insert;
void add_str(const TString& string);
public:
void add(const TString& string);
void add(const TDate& date) { add(date.date2ansi()); }
void add(const char* string) { add(TString(string)); }
void add(long num);
void add() { add_str("NULL"); }
void send();
static char get_errori(const TString& id_estr, vector<TToken_string>& movs);
TF9_dberr();
};
inline bool open_mov(const TRectype& mov)
{
TFilename ininame; ininame.temp("lnk", "ini");
{
TConfig ini(ininame, "Transaction");
ini.set("Action", "LINK");
ini.set_paragraph("23");
ini.set("NUMREG", mov.get(MOV_NUMREG));
}
TString app;
app << "cg2.exe -0 -i" << ininame;
TExternal_app a(app);
bool ok = a.run() == 0;
if (ok)
{
xvt_sys_sleep(500);
const TString& result = ini_get_string(ininame, "Transaction", "Result");
ok = result == "OK";
}
xvt_fsys_remove_file(ininame);
return ok;
}

View File

@ -3,16 +3,17 @@
#define F_TEXT 202
#define B_SHOWESCL 203
#define F_ARCH_B 101
#define F_IDESTR 102
#define F_DATAESTR 103
#define F_PROV_B 104
#define F_TIPODOC 105
#define F_DATADAL 106
#define F_DATAAL 107
#define F_USER 108
#define F_STATESTR 109
#define F_DESCR_E 110
#define F_SEL 101
#define F_ARCH_B 102
#define F_IDESTR 103
#define F_DATAESTR 104
#define F_PROV_B 105
#define F_TIPODOC 106
#define F_DATADAL 107
#define F_DATAAL 108
#define F_USER 109
#define F_STATESTR 110
#define F_DESCR_E 111
// Campi del vettore _movs per promemoria
#define F_SEL 101

View File

@ -2,10 +2,10 @@
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_ALL 2 2
BUTTON DLG_DELREC 2 2
BEGIN
PROMPT 1 1 "~Tutti"
PICTURE TOOL_MULTISEL
PROMPT 1 1 "~Elimina"
PICTURE TOOL_DELREC
END
BUTTON DLG_ELABORA 2 2
@ -26,7 +26,7 @@ BUTTON DLG_FINDREC 2 2
BEGIN
PROMPT 1 4 "Controllo Estr."
PICTURE TOOL_PERMISSIONS
FLAGS "D"
FLAGS ""
END
BUTTON DLG_RECALC
@ -61,6 +61,7 @@ END
SPREADSHEET S_ELAB -1 -1
BEGIN
PROMPT 0 2 "Elenco pacchetti elaborati"
ITEM ""
ITEM "Archiviato@8"
ITEM "ID Estrazione@14"
ITEM "Data@8"
@ -77,6 +78,11 @@ ENDMASK
PAGE "Pacchetti" -1 -1 78 13
BOOLEAN F_SEL
BEGIN
PROMPT 1 1 ""
END
BOOLEAN F_ARCH_B
BEGIN
PROMPT 1 1 ""

View File

@ -30,12 +30,6 @@ BEGIN
FLAGS ""
END
BUTTON DLG_NULL 2 2
BEGIN
PROMPT 1 8 ""
PICTURE 0
END
#include <helpbar.h>
ENDPAGE
@ -56,8 +50,8 @@ BEGIN
ITEM "RAGSOC@8"
ITEM "PROTIVA@8"
ITEM "DESCR@8"
ITEM "ESCLUDI@4"
ITEM "ESCLUSO@5"
ITEM "ESCLUDI@5"
ITEM "ESCLUSO@6"
ITEM "DESCR ERR"
END
@ -92,66 +86,76 @@ END
NUMERIC F_CNUMREG 7
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
DATA F_CDATAREG
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
DATA F_CDATADOC
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
STRING F_CCODCAUS 3
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
NUMERIC F_CMESELIQ 2
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
STRING F_CNUMDOC 50
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
NUMERIC F_CIMPTOTDOC 15 2
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
NUMERIC F_CFORN 6
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
STRING F_CRAGSOC 80
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
NUMERIC F_CPROTIVA 6
STRING F_CPROTIVA 10
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
STRING F_CDESCR 50
BEGIN
PROMPT 1 1 ""
FLAGS "D"
END
LIST F_CESCLUDI 2
BOOLEAN F_CESCLUDI
BEGIN
PROMPT 41 2 "Escludi"
ITEM "N|NO"
ITEM "Y|SI"
PROMPT 1 1 "Escludi"
FLAGS "D"
END
BOLEAN F_CESCLUSO
STRING F_CESCLUSO 2
BEGIN
PROMPT 1 1 "ESCLUSO"
FLAG "D"
@ -166,6 +170,12 @@ ENDPAGE
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_USER 2 2
BEGIN
PROMPT 1 1 "Collega"
PICTURE TOOL_LINK
END
BUTTON DLG_NULL 2 2
BEGIN
PROMPT -1 0 ""

View File

@ -1,5 +1,6 @@
#define S_ESCL 201
#define F_ETEXT 202
#define B_ESTRAI 203
// Elenco movimenti esclusi
#define F_SEL 101

View File

@ -2,7 +2,7 @@
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 2 2
BUTTON B_ESTRAI 2 2
BEGIN
PROMPT 1 1 "Estrai"
PICTURE TOOL_ELABORA
@ -112,7 +112,7 @@ BEGIN
FLAGS "D"
END
NUMERIC F_PROTIVA 6
STRING F_PROTIVA 10
BEGIN
PROMPT 1 1 ""
FLAGS "D"
@ -128,6 +128,12 @@ ENDPAGE
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_USER 2 2
BEGIN
PROMPT 1 1 "Collega"
PICTURE TOOL_LINK
END
BUTTON DLG_NULL 2 2
BEGIN
PROMPT -1 0 ""

View File

@ -4,6 +4,7 @@
#define F9_DRD "F9DRD00K"
#define F9_IVA "F9IVA00K"
#define F9_DRT "F9DRT00K"
#define F9_ERR "F9ERROR"
// FILE DRD : DRIVER ESTRAZIONE GIORNALE IVA
#define DRD_CODSOC "F9RCSOC" // A(10) [K]

123
src/f9/sql/f90100.sql Normal file
View File

@ -0,0 +1,123 @@
CREATE TABLE F9DRD00K (
F9RCSOC CHAR(10) NOT NULL DEFAULT '' ,
F9RIDES CHAR(18) NOT NULL DEFAULT '' ,
F9RFPDE CHAR(1) NOT NULL DEFAULT '' ,
F9RDDES CHAR(256) NOT NULL DEFAULT '' ,
F9RFTDC CHAR(1) NOT NULL DEFAULT '' ,
F9RUESD DATE NOT NULL DEFAULT getdate() ,
F9RUESA DATE NOT NULL DEFAULT getdate() ,
F9RUTEE CHAR(10) NOT NULL DEFAULT '' ,
F9RUHES DATETIME NOT NULL DEFAULT getdate() ,
F9RIDAS CHAR(2) NOT NULL DEFAULT '' ,
F9RIDWA CHAR(2) NOT NULL DEFAULT '' ,
F9RDSIW CHAR(256) NOT NULL DEFAULT '' ,
F9RUHIM DATETIME NOT NULL DEFAULT getdate() ,
F9RIISO CHAR(1) NOT NULL DEFAULT '' ,
F9RUHIS DATETIME NOT NULL DEFAULT getdate() ,
F9RSINW CHAR(2) NOT NULL DEFAULT '' ,
F9RDSIN CHAR(256) NOT NULL DEFAULT '' ,
F9RPCDC CHAR(256) NOT NULL DEFAULT '' ,
PRIMARY KEY( F9RCSOC , F9RIDES , F9RFPDE ) ) ;
CREATE TABLE F9DRT00K (
F9TCSOC CHAR(10) NOT NULL DEFAULT '' ,
F9TCADO CHAR(10) NOT NULL DEFAULT '' ,
F9TDDES CHAR(30) NOT NULL DEFAULT '' ,
F9TCLDC CHAR(10) NOT NULL DEFAULT '' ,
F9TCDD1 CHAR(2) NOT NULL DEFAULT '' ,
F9TCSOS CHAR(6) NOT NULL DEFAULT '' ,
F9TCCAU CHAR(6) NOT NULL DEFAULT '' ,
F9TTCAU CHAR(6) NOT NULL DEFAULT '' ,
F9TTMOV CHAR(6) NOT NULL DEFAULT '' ,
F9TFCEE CHAR(6) NOT NULL DEFAULT '' ,
PRIMARY KEY( F9TCSOC , F9TCADO , F9TCCAU , F9TTCAU , F9TTMOV , F9TFCEE ) ) ;
CREATE TABLE F9IVA00K (
F9ICSOC CHAR(10) NOT NULL DEFAULT '' ,
F9IIDLA CHAR(18) NOT NULL DEFAULT '' ,
F9IFPDE CHAR(1) NOT NULL DEFAULT '' ,
F9IAFES CHAR(4) NOT NULL DEFAULT '' ,
F9IGIVA CHAR(1) NOT NULL DEFAULT '' ,
F9ITPGI CHAR(10) NOT NULL DEFAULT '' ,
F9IDXML CHAR(1) NOT NULL DEFAULT '' ,
F9ITCFO CHAR(1) NOT NULL DEFAULT '' ,
F9ICCFO CHAR(10) NOT NULL DEFAULT '' ,
F9IDRSO CHAR(60) NOT NULL DEFAULT '' ,
F9IIDFI CHAR(30) NOT NULL DEFAULT '' ,
F9IPIVA CHAR(28) NOT NULL DEFAULT '' ,
F9ICFIS CHAR(16) NOT NULL DEFAULT '' ,
F9ICADO CHAR(10) NOT NULL DEFAULT '' ,
F9ICSOS CHAR(6) NOT NULL DEFAULT '' ,
F9INDOC CHAR(20) NOT NULL DEFAULT '' ,
F9IUDOC DATE NOT NULL DEFAULT getdate() ,
F9ISIVA CHAR(10) NOT NULL DEFAULT '' ,
F9ICREG CHAR(6) NOT NULL DEFAULT '' ,
F9INPRI CHAR(20) NOT NULL DEFAULT '' ,
F9IUPRI DATE NOT NULL DEFAULT getdate() ,
F9IFOOA CHAR(10) NOT NULL DEFAULT '' ,
F9ITROT CHAR(6) NOT NULL DEFAULT '' ,
F9INRRO CHAR(20) NOT NULL DEFAULT '' ,
F9IURGO DATE NOT NULL DEFAULT getdate() ,
F9ICLDF CHAR(10) NOT NULL DEFAULT '' ,
F9INMF1 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLDN CHAR(10) NOT NULL DEFAULT '' ,
F9INMF2 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLDA CHAR(10) NOT NULL DEFAULT '' ,
F9INMF3 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLD4 CHAR(10) NOT NULL DEFAULT '' ,
F9INMF4 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLD5 CHAR(10) NOT NULL DEFAULT '' ,
F9INMF5 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLD6 CHAR(10) NOT NULL DEFAULT '' ,
F9INMF6 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLD7 CHAR(10) NOT NULL DEFAULT '' ,
F9INMF7 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLD8 CHAR(10) NOT NULL DEFAULT '' ,
F9INMF8 CHAR(100) NOT NULL DEFAULT '' ,
F9ICLD9 CHAR(10) NOT NULL DEFAULT '' ,
F9INMF9 CHAR(100) NOT NULL DEFAULT '' ,
F9ICL10 CHAR(10) NOT NULL DEFAULT '' ,
F9INM10 CHAR(100) NOT NULL DEFAULT '' ,
F9IUTEE CHAR(10) NOT NULL DEFAULT '' ,
F9IUHEL DATETIME NOT NULL DEFAULT getdate() ,
F9IUHEW DATETIME NOT NULL DEFAULT getdate() ,
F9IDDES CHAR(30) NOT NULL DEFAULT '' ,
F9ITPRT CHAR(2) NOT NULL DEFAULT '' ,
F9IAPRT NUMERIC(4, 0) NOT NULL DEFAULT 0 ,
F9INPRT NUMERIC(10, 0) NOT NULL DEFAULT 0 ,
F9IURIC DATETIME NOT NULL DEFAULT getdate() ,
PRIMARY KEY( F9ICSOC , F9IIDLA , F9IFPDE , F9ISIVA , F9ICREG , F9INPRI , F9IUPRI , F9ITPGI ) ) ;
CREATE TABLE F9PWA00K (
F9PCSOC CHAR(10) NOT NULL DEFAULT '' ,
F9PCDFN CHAR(2) NOT NULL DEFAULT '' ,
F9PCDNT CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA1 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA2 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA3 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA4 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA5 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA6 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA7 CHAR(2) NOT NULL DEFAULT '' ,
F9PCDA8 CHAR(2) NOT NULL DEFAULT '' ,
F9PPCDC CHAR(256) NOT NULL DEFAULT '' ,
PRIMARY KEY( F9PCSOC ) ) ;
CREATE TABLE F9ERROR(
IDESTR CHAR(18) NOT NULL,
NUMREG NUMERIC(7,0) NOT NULL,
DATAREG DATE NOT NULL,
DATADOC DATE NOT NULL,
CODCAUS VARCHAR(3) NOT NULL,
MESELIQ NUMERIC(2,0),
NUMDOC VARCHAR(50) NOT NULL,
IMPTOTDOC NUMERIC(18,3) NOT NULL,
FORN NUMERIC(6,0) NOT NULL,
RAGSOC VARCHAR(50),
PROTIVA VARCHAR(10) NOT NULL,
DESCR VARCHAR(50),
ESCLUDI CHAR(1),
ESCLUSO CHAR(2),
DESCRERR VARCHAR(110),
PRIMARY KEY(IDESTR, NUMREG)
);