Patch level : 12.0 754
Files correlati : cg2100, fplib Commento : - Aggancio FPPRO in Prima Nota: - Aggiunta modifica e eliminazione del documento agganciato FPPRO e movimento - Aggiunto flag per visualizzare anche le fatture già registrate - Cambiato ordinamento documenti in maschera FPPRO - Aggiunto pulsante in alternativa per aprire fatture SDI - Aggiunto caricamento protocollazione FPPRO in modalità modifica - Migliorati messaggi di warning - Modificato fplib: tolta fatalbox quando non avviene la connessione al db
This commit is contained in:
parent
61aacce9ba
commit
07cfa615d0
@ -23,6 +23,14 @@
|
|||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
#include "../fp/fplib.h"
|
#include "../fp/fplib.h"
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
pro_err = -86552,
|
||||||
|
pro_noerr = 1,
|
||||||
|
pro_notsaved = 0,
|
||||||
|
pro_nofp = -1
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Dati incasso immediato
|
// Dati incasso immediato
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -117,6 +125,13 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
ism.set_handler(CG_RISCONTO, sheet_risconto_handler);
|
ism.set_handler(CG_RISCONTO, sheet_risconto_handler);
|
||||||
if (!(fexist("fp0.exe") && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8()))
|
if (!(fexist("fp0.exe") && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8()))
|
||||||
m->hide(F_PROTFPPRO);
|
m->hide(F_PROTFPPRO);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m->add_button_tool(DLG_LINK, "Fatture SDI", TOOL_ELABORA);
|
||||||
|
m->set_handler(DLG_LINK, fppro_mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_quadratura)
|
if (_quadratura)
|
||||||
m->set_handler(F_ADJUST_IVA, quadratura_handler);
|
m->set_handler(F_ADJUST_IVA, quadratura_handler);
|
||||||
}
|
}
|
||||||
@ -1034,6 +1049,8 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
|||||||
m.enable(F_BOLLACODCLI, causale().tipo_doc() == "BD");
|
m.enable(F_BOLLACODCLI, causale().tipo_doc() == "BD");
|
||||||
m.enable(F_BOLLARAGCLI, causale().tipo_doc() == "BD");
|
m.enable(F_BOLLARAGCLI, causale().tipo_doc() == "BD");
|
||||||
}
|
}
|
||||||
|
if(!m.field(F_PROTFPPRO).hidden())
|
||||||
|
m.set(F_PROTFPPRO, mov.get(MOV_PROGFPPRO));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controlla sulla causale se il segno del totale documento (ritsoc=false)
|
// Controlla sulla causale se il segno del totale documento (ritsoc=false)
|
||||||
@ -1547,12 +1564,34 @@ int TPrimanota_application::rewrite(const TMask& m)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TPrimanota_application::clean_fppro() const
|
||||||
|
{
|
||||||
|
TMask& msk = curr_mask();
|
||||||
|
const KEY last = msk.last_key();
|
||||||
|
|
||||||
|
if (_mode != MODE_MOD)
|
||||||
|
return;
|
||||||
|
if (!fexist("fp0.exe") || fp_settings().get_db_indirizzo().empty() || fp_settings().is_f8())
|
||||||
|
return; // Salto il salvataggio in FPPRO
|
||||||
|
if (last != 127 && last != K_SAVE) // Salto se non sto eliminando
|
||||||
|
return;
|
||||||
|
|
||||||
|
TString query;
|
||||||
|
const TString& numreg = msk.get(F_NUMREG);
|
||||||
|
query << "UPDATE FPPRO00F\n" <<
|
||||||
|
"SET PZ_NUMREGCONT = 0, PZ_DATAREGCONT = '2001-01-01'\n" <<
|
||||||
|
"WHERE PZ_NUMREGCONT = '" << numreg << "'";
|
||||||
|
fp_db().sq_set_exec(query);
|
||||||
|
fp_db().sq_commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TPrimanota_application::remove()
|
bool TPrimanota_application::remove()
|
||||||
{
|
{
|
||||||
const bool ok = TRelation_application::remove();
|
const bool ok = TRelation_application::remove();
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
|
clean_fppro();
|
||||||
_saldi.registra();
|
_saldi.registra();
|
||||||
check_saldi();
|
check_saldi();
|
||||||
|
|
||||||
@ -2167,13 +2206,15 @@ bool TPrimanota_application::save(bool check_dirty)
|
|||||||
_swap_mask = false;
|
_swap_mask = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const bool saved_fppro = save_fppro();
|
const int fp_code = save_fppro();
|
||||||
const bool saved = TRelation_application::save(check_dirty);
|
const bool saved = TRelation_application::save(check_dirty);
|
||||||
if (saved && saved_fppro)
|
|
||||||
|
if (saved && fp_code > 0 && !save_dbmov())
|
||||||
{
|
{
|
||||||
if (!save_dbmov())
|
message_box(TString("ATTENZIONE:") << " non è stato possibile salvare i riferimenti del documento in ingresso per questo movimento.\n" <<
|
||||||
message_box("Attenzione non è stato possibile salvare i riferimenti del documento (in ingresso) nel movimento");
|
"Movimento registrato senza collegamento ai documenti in ingresso.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return saved;
|
return saved;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2287,27 +2328,52 @@ void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::save_fppro() const
|
int TPrimanota_application::save_fppro() const
|
||||||
{
|
{
|
||||||
TMask& msk = curr_mask();
|
TMask& msk = curr_mask();
|
||||||
const KEY last = msk.last_key();
|
const KEY last = msk.last_key();
|
||||||
|
|
||||||
|
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
||||||
|
if (!fexist("fp0.exe") || fp_settings().get_db_indirizzo().empty() || fp_settings().is_f8())
|
||||||
|
return pro_nofp; // Salto il salvataggio in FPPRO
|
||||||
|
if (!fp_db().sq_is_connect())
|
||||||
|
{
|
||||||
|
message_box("Attenzione connesione al database non riuscita.\nImpossibile collegarsi ai documenti in entrata.");
|
||||||
|
return pro_nofp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_mode != MODE_INS)
|
||||||
|
{
|
||||||
|
if(_mode == MODE_MOD && last == K_SAVE)
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
query << "SELECT COUNT(*) AS COUNT FROM FPPRO00F WHERE PZ_NUMREGCONT = '" << msk.get(F_NUMREG) << "'";
|
||||||
|
fp_db().sq_set_exec(query);
|
||||||
|
if (fp_db().sq_get_int("COUNT") != 0)
|
||||||
|
{
|
||||||
|
message_box(TString("Attenzione!") << " E' stato modificato un movimento già collegato a un documento in ingresso.");
|
||||||
|
clean_fppro();
|
||||||
|
msk.set(F_PROKEY, "");
|
||||||
|
msk.set(F_PROTFPPRO, "");
|
||||||
|
save_dbmov();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else return pro_notsaved;
|
||||||
|
}
|
||||||
|
|
||||||
// Controllo che sto registrando un documento FA Fattura di Acquisto
|
// Controllo che sto registrando un documento FA Fattura di Acquisto
|
||||||
TLocalisamfile clifo(LF_CAUSALI);
|
TLocalisamfile clifo(LF_CAUSALI);
|
||||||
clifo.setkey(1);
|
clifo.setkey(1);
|
||||||
clifo.put("CODCAUS", msk.get(F_CODCAUS));
|
clifo.put("CODCAUS", msk.get(F_CODCAUS));
|
||||||
if (clifo.read() != NOERR)
|
if (clifo.read() != NOERR)
|
||||||
return false;
|
return pro_notsaved;
|
||||||
if (clifo.get("TIPODOC") != "FA")
|
if (clifo.get("TIPODOC") != "FA")
|
||||||
return false;
|
return pro_notsaved;
|
||||||
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
|
||||||
if (!fexist("fp0.exe") || fp_settings().get_db_indirizzo().empty() || fp_settings().is_f8())
|
|
||||||
return false; // Salto il salvataggio in FPPRO
|
|
||||||
|
|
||||||
|
|
||||||
if (last != K_SAVE) { // Salto se sto uscendo
|
if (last != K_SAVE) { // Salto se sto uscendo
|
||||||
message_box("La registrazione del movimento non verrà salvata sul database.");
|
message_box("La registrazione del movimento non verrà salvata sul database.");
|
||||||
return false;
|
return pro_notsaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TDate data_operazione(msk.get(F_DATAREG));
|
const TDate data_operazione(msk.get(F_DATAREG));
|
||||||
@ -2341,7 +2407,7 @@ bool TPrimanota_application::save_fppro() const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
error_box("Attenzione non è stata inserita ne la partita iva ne il cod.fisc del fornitore:\nimpossibile associarlo in FPPRO");
|
error_box("Attenzione non è stata inserita ne la partita iva ne il cod.fisc del fornitore:\nimpossibile associarlo in FPPRO");
|
||||||
return false;
|
return pro_notsaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
TString query;
|
TString query;
|
||||||
@ -2354,14 +2420,14 @@ bool TPrimanota_application::save_fppro() const
|
|||||||
const int n = fp_db().sq_items();
|
const int n = fp_db().sq_items();
|
||||||
if (n != 1)
|
if (n != 1)
|
||||||
{
|
{
|
||||||
message_box("Attenzione non è stato possibile indentificare\nil documento con una specifica fattura in FPPRO");
|
message_box("Attenzione non è stato possibile indentificare\nil documento con una specifica fattura in ingresso");
|
||||||
return false;
|
return pro_notsaved;
|
||||||
}
|
}
|
||||||
const int numreg = fp_db().sq_get_int("PZ_NUMREGCONT");
|
const int numreg = fp_db().sq_get_int("PZ_NUMREGCONT");
|
||||||
if (numreg != 0)
|
if (numreg != 0)
|
||||||
{
|
{
|
||||||
error_box(TString("Il documento ") << data_documento.year() << " / " << numero_doc << " è già stato inserito con la registrazione numero " << numreg << "\nSalvataggio in FPPRO impossibile.");
|
error_box(TString("Il documento ") << data_documento.year() << " / " << numero_doc << " è già stato inserito con la registrazione numero " << numreg << "\nSalvataggio su protocollo in ingresso impossibile.");
|
||||||
return false;
|
return pro_notsaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Devo controllare che la data operazione sia maggiore della data ric
|
// Devo controllare che la data operazione sia maggiore della data ric
|
||||||
@ -2369,7 +2435,7 @@ bool TPrimanota_application::save_fppro() const
|
|||||||
if(data_operazione < dataoraric)
|
if(data_operazione < dataoraric)
|
||||||
{
|
{
|
||||||
error_box("Attenzione non è possibile registrare una fattura\ncon data operazione minore della data di ricezione.");
|
error_box("Attenzione non è possibile registrare una fattura\ncon data operazione minore della data di ricezione.");
|
||||||
return false;
|
return pro_notsaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TString keyprginvio = fp_db().sq_get("PZ_KEYPRGINVIO");
|
const TString keyprginvio = fp_db().sq_get("PZ_KEYPRGINVIO");
|
||||||
@ -2387,8 +2453,9 @@ bool TPrimanota_application::save_fppro() const
|
|||||||
const bool saved = fp_db().sq_commit();
|
const bool saved = fp_db().sq_commit();
|
||||||
if (!saved)
|
if (!saved)
|
||||||
error_box("Attenzione non è stato possibile registrare la fattura nel database.");
|
error_box("Attenzione non è stato possibile registrare la fattura nel database.");
|
||||||
return saved;
|
return saved? pro_noerr : pro_notsaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::save_dbmov() const
|
bool TPrimanota_application::save_dbmov() const
|
||||||
{
|
{
|
||||||
const TMask& msk = curr_mask();
|
const TMask& msk = curr_mask();
|
||||||
|
@ -208,10 +208,12 @@
|
|||||||
#define F_TOTDOCI 609
|
#define F_TOTDOCI 609
|
||||||
#define F_PROTFPPROI 610
|
#define F_PROTFPPROI 610
|
||||||
#define F_FPPROKEYSI 611
|
#define F_FPPROKEYSI 611
|
||||||
|
#define F_SHEET_TEXT 612
|
||||||
|
#define F_SHOWALL 613
|
||||||
|
|
||||||
#define F_SELFPPROS 101
|
#define F_SELFPPROS 101
|
||||||
#define F_DATAS 102
|
#define F_DATAORARICS 102
|
||||||
#define F_DATAORARICS 103
|
#define F_DATAS 103
|
||||||
#define F_IMPTOTDOCS 104
|
#define F_IMPTOTDOCS 104
|
||||||
#define F_NUMEROS 105
|
#define F_NUMEROS 105
|
||||||
#define F_FISCIVAPAESES 106
|
#define F_FISCIVAPAESES 106
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
TOOLBAR "topbar" 0 0 0 2
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
#include <relapbar.h>
|
#include <relapbar.h>
|
||||||
|
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Testata" -1 -1 77 20
|
PAGE "Testata" -1 -1 77 20
|
||||||
|
@ -3451,12 +3451,14 @@ bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
TMask& cg_msk = f.mask();
|
TMask& cg_msk = f.mask();
|
||||||
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
||||||
if (!(fexist("fp0.exe") && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8()))
|
if (!(fexist("fp0.exe") && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8()))
|
||||||
return;
|
return true;
|
||||||
|
if (key != 32 && key != 9)
|
||||||
|
return true;
|
||||||
|
|
||||||
TMask* msk = new TMask("cgFPPRO");
|
TMask* msk = new TMask("cgFPPRO");
|
||||||
msk->set_handler(DLG_CONFIG, fppro_handler);
|
msk->set_handler(DLG_CONFIG, fppro_handler);
|
||||||
@ -3465,6 +3467,9 @@ void TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
|||||||
msk->set(F_COFIS, cg_msk.get(F_COFI));
|
msk->set(F_COFIS, cg_msk.get(F_COFI));
|
||||||
msk->set(F_STATOPAIVS, cg_msk.get(F_STATOPAIV));
|
msk->set(F_STATOPAIVS, cg_msk.get(F_STATOPAIV));
|
||||||
msk->set(F_PIVAS, cg_msk.get(F_PIVA));
|
msk->set(F_PIVAS, cg_msk.get(F_PIVA));
|
||||||
|
|
||||||
|
if(load_fppro_mask(msk))
|
||||||
|
{
|
||||||
msk->run();
|
msk->run();
|
||||||
// Riporto dati FPPRO su maschera Prima Nota
|
// Riporto dati FPPRO su maschera Prima Nota
|
||||||
cg_msk.set(F_NUMDOCEXT, msk->get(F_NUMEROI));
|
cg_msk.set(F_NUMDOCEXT, msk->get(F_NUMEROI));
|
||||||
@ -3473,6 +3478,11 @@ void TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
|||||||
cg_msk.set(F_TOTALE, msk->get(F_TOTDOCI));
|
cg_msk.set(F_TOTALE, msk->get(F_TOTDOCI));
|
||||||
cg_msk.set(F_PROTFPPRO, msk->get(F_PROTFPPROI));
|
cg_msk.set(F_PROTFPPRO, msk->get(F_PROTFPPROI));
|
||||||
cg_msk.set(F_PROKEY, msk->get(F_FPPROKEYSI));
|
cg_msk.set(F_PROKEY, msk->get(F_FPPROKEYSI));
|
||||||
|
cg_msk.set(F_ANNORIF, cg_msk.get(F_ANNOIVA));
|
||||||
|
}
|
||||||
|
|
||||||
|
delete msk;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3850,29 +3860,29 @@ bool TPrimanota_application::quadratura_handler(TMask_field& f, KEY key)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPrimanota_application::load_fppro_mask(TMask* msk, KEY k)
|
||||||
bool TPrimanota_application::fppro_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
{
|
||||||
if (k != 32)
|
if (k != 32)
|
||||||
return true;
|
return false;
|
||||||
TMask& msk = f.mask();
|
|
||||||
//if(msk.curr_page() != 3)
|
|
||||||
//return true;
|
|
||||||
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
||||||
if (!fexist("fp0.exe") || fp_settings().get_db_indirizzo().empty() || fp_settings().is_f8())
|
if (!fexist("fp0.exe") || fp_settings().get_db_indirizzo().empty() || fp_settings().is_f8())
|
||||||
return true; // Salto il salvataggio in FPPRO
|
return false; // Salto il salvataggio in FPPRO
|
||||||
|
if (!fp_db().sq_is_connect())
|
||||||
|
{
|
||||||
|
message_box("Attenzione connessione al database non riuscita.\nImpossibile collegarsi ai documenti in entrata.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int forn = msk->get_int(F_CODCLIFORS);
|
||||||
const int forn = msk.get_int(F_CODCLIFORS);
|
|
||||||
if (forn == 0)
|
if (forn == 0)
|
||||||
{
|
{
|
||||||
message_box("Inserire prima il fornitore");
|
message_box("Inserire prima il fornitore");
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TString& codfisc = msk.get(F_COFIS);
|
const TString& codfisc = msk->get(F_COFIS);
|
||||||
const TString& stato_piva = msk.get(F_STATOPAIVS);
|
const TString& stato_piva = msk->get(F_STATOPAIVS);
|
||||||
const TString& piva = msk.get(F_PIVAS);
|
const TString& piva = msk->get(F_PIVAS);
|
||||||
TString id_fornitore;
|
TString id_fornitore;
|
||||||
if (!piva.empty())
|
if (!piva.empty())
|
||||||
{
|
{
|
||||||
@ -3896,20 +3906,24 @@ bool TPrimanota_application::fppro_handler(TMask_field& f, KEY k)
|
|||||||
"FROM PAA0200F\n" << "JOIN FPPRO00F\n" << " ON P2_KEYPRGINVIO = PZ_KEYPRGINVIO AND P2_KEYHEADERFATT = PZ_KEYHEADERFATT AND P2_KEYBODYFATT = PZ_KEYBODYFATT\n" <<
|
"FROM PAA0200F\n" << "JOIN FPPRO00F\n" << " ON P2_KEYPRGINVIO = PZ_KEYPRGINVIO AND P2_KEYHEADERFATT = PZ_KEYHEADERFATT AND P2_KEYBODYFATT = PZ_KEYBODYFATT\n" <<
|
||||||
"JOIN PAA0100F\n" << " ON P2_KEYPRGINVIO = P1_KEYPRGINVIO AND P2_KEYHEADERFATT = P1_KEYHEADERFATT AND P2_KEYBODYFATT = P1_KEYBODYFATT\n" <<
|
"JOIN PAA0100F\n" << " ON P2_KEYPRGINVIO = P1_KEYPRGINVIO AND P2_KEYHEADERFATT = P1_KEYHEADERFATT AND P2_KEYBODYFATT = P1_KEYBODYFATT\n" <<
|
||||||
"JOIN PAA2700F\n" << "ON P2_KEYPRGINVIO = PQ_KEYPRGINVIO AND P2_KEYHEADERFATT = PQ_KEYHEADERFATT AND P2_KEYBODYFATT = PQ_KEYBODYFATT\n" <<
|
"JOIN PAA2700F\n" << "ON P2_KEYPRGINVIO = PQ_KEYPRGINVIO AND P2_KEYHEADERFATT = PQ_KEYHEADERFATT AND P2_KEYBODYFATT = PQ_KEYBODYFATT\n" <<
|
||||||
"WHERE " << id_fornitore << ";";
|
"WHERE " << id_fornitore << "\n" <<
|
||||||
|
"ORDER BY P1_DATAORARIC ASC;";
|
||||||
fp_db().sq_set_exec(query, false);
|
fp_db().sq_set_exec(query, false);
|
||||||
|
|
||||||
TSheet_field& sf = msk.sfield(F_SHEETFPPROS);
|
TSheet_field& sf = msk->sfield(F_SHEETFPPROS);
|
||||||
sf.hide();
|
sf.hide();
|
||||||
|
if (sf.items() > 0)
|
||||||
|
sf.destroy();
|
||||||
while (fp_db().sq_next())
|
while (fp_db().sq_next())
|
||||||
{
|
{
|
||||||
TString numreg = fp_db().sq_get("PZ_NUMREGCONT");
|
TString numreg = fp_db().sq_get("PZ_NUMREGCONT");
|
||||||
if (numreg != "0")
|
const bool show_all = msk->get_bool(F_SHOWALL);
|
||||||
|
if (numreg != "0" && !show_all)
|
||||||
continue;
|
continue;
|
||||||
TToken_string& row = sf.row(-1);
|
TToken_string& row = sf.row(-1);
|
||||||
row.add("", 0);
|
row.add("", 0);
|
||||||
row.add(TDate(fp_db().sq_get_date("PZ_DATA")));
|
|
||||||
row.add(TDate(fp_db().sq_get_date("P1_DATAORARIC")));
|
row.add(TDate(fp_db().sq_get_date("P1_DATAORARIC")));
|
||||||
|
row.add(TDate(fp_db().sq_get_date("PZ_DATA")));
|
||||||
row.add(fp_db().sq_get("PQ_IMPTOTDOC"));
|
row.add(fp_db().sq_get("PQ_IMPTOTDOC"));
|
||||||
row.add(fp_db().sq_get("PZ_NUMERO"));
|
row.add(fp_db().sq_get("PZ_NUMERO"));
|
||||||
row.add(fp_db().sq_get("P2_FISCIVAPAESE"));
|
row.add(fp_db().sq_get("P2_FISCIVAPAESE"));
|
||||||
@ -3923,6 +3937,13 @@ bool TPrimanota_application::fppro_handler(TMask_field& f, KEY k)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPrimanota_application::fppro_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
TMask& msk = f.mask();
|
||||||
|
const bool load = load_fppro_mask(&msk, k);
|
||||||
|
return load;
|
||||||
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::fppro_ok_handler(TMask_field& f, KEY k)
|
bool TPrimanota_application::fppro_ok_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k != 32)
|
if (k != 32)
|
||||||
@ -3933,6 +3954,7 @@ bool TPrimanota_application::fppro_ok_handler(TMask_field& f, KEY k)
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
TSheet_field& sf = msk.sfield(F_SHEETFPPROS);
|
TSheet_field& sf = msk.sfield(F_SHEETFPPROS);
|
||||||
bool loaded = false;
|
bool loaded = false;
|
||||||
|
|
||||||
FOR_EACH_SHEET_ROW(sf, nr, row)
|
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||||
{
|
{
|
||||||
if(!loaded && *row->get(0) == 'X')
|
if(!loaded && *row->get(0) == 'X')
|
||||||
|
@ -171,7 +171,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
|
|
||||||
static bool fppro_handler(TMask_field& f, KEY k); // Carica spread fppro
|
static bool fppro_handler(TMask_field& f, KEY k); // Carica spread fppro
|
||||||
static bool fppro_ok_handler(TMask_field& f, KEY k); // Riporta doc FPPRO in testata
|
static bool fppro_ok_handler(TMask_field& f, KEY k); // Riporta doc FPPRO in testata
|
||||||
static void fppro_mask(TMask_field& f, KEY key);
|
static bool fppro_mask(TMask_field& f, KEY key);
|
||||||
|
|
||||||
void reset_sheet_row(TSheet_field& s, int n);
|
void reset_sheet_row(TSheet_field& s, int n);
|
||||||
int crea_somma_spese(TImporto& imp);
|
int crea_somma_spese(TImporto& imp);
|
||||||
@ -186,8 +186,10 @@ protected: // TApplication
|
|||||||
void dump_fatt(TConfig& ini, TPartita & game, int rigafatt, int pref = 0);
|
void dump_fatt(TConfig& ini, TPartita & game, int rigafatt, int pref = 0);
|
||||||
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
||||||
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
||||||
bool save_fppro() const;
|
|
||||||
// Salva riferimento documento in FPPRO in mov
|
static bool load_fppro_mask(TMask* msk, KEY k = 32);
|
||||||
|
int save_fppro() const;
|
||||||
|
// Salva sul movimento il riferimento al documento in FPPRO
|
||||||
bool save_dbmov() const;
|
bool save_dbmov() const;
|
||||||
virtual bool save(bool check_dirty);
|
virtual bool save(bool check_dirty);
|
||||||
|
|
||||||
@ -210,6 +212,7 @@ protected: // TRelation_application
|
|||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
virtual int write(const TMask& m);
|
virtual int write(const TMask& m);
|
||||||
virtual int rewrite(const TMask& m);
|
virtual int rewrite(const TMask& m);
|
||||||
|
void clean_fppro() const;
|
||||||
virtual bool remove();
|
virtual bool remove();
|
||||||
virtual void write_enable(bool) {}
|
virtual void write_enable(bool) {}
|
||||||
virtual bool protected_record(TRectype& rec);
|
virtual bool protected_record(TRectype& rec);
|
||||||
|
@ -4,13 +4,13 @@ TOOLBAR "topbar" 0 0 0 2
|
|||||||
|
|
||||||
BUTTON DLG_CONFIG 2 2
|
BUTTON DLG_CONFIG 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 3 1 "Carica FPPRO"
|
PROMPT 3 1 "Ricarica Fatture"
|
||||||
PICTURE TOOL_ELABORA
|
PICTURE TOOL_ELABORA
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_LINK 2 2
|
BUTTON DLG_LINK 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 3 1 "Collega FPPRO"
|
PROMPT 3 1 "Riporta Dati"
|
||||||
PICTURE TOOL_LINK
|
PICTURE TOOL_LINK
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ END
|
|||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
|
||||||
PAGE "FPPRO" -1 -1 77 20
|
PAGE "Fatture Ricevute SDI" -1 -1 77 20
|
||||||
|
|
||||||
NUMBER F_CODCLIFORS 6
|
NUMBER F_CODCLIFORS 6
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -33,35 +33,45 @@ END
|
|||||||
|
|
||||||
STRING F_COFIS 16
|
STRING F_COFIS 16
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 1 "C.F. "
|
PROMPT 35 1 "Cod. Fiscale "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_STATOPAIVS 2
|
STRING F_STATOPAIVS 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 2 "STATO P.I."
|
PROMPT 1 2 "P. IVA"
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_PIVAS 12
|
STRING F_PIVAS 12
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 2 "P.I. "
|
PROMPT 15 2 ""
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_SHEETFPPROS 0 5
|
TEXT F_SHEET_TEXT
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 4 ""
|
PROMPT 0 4 "@BSelezionare la fattura, quindi premere 'Riporta Dati'"
|
||||||
ITEM "SEL"
|
END
|
||||||
ITEM "DATA"
|
|
||||||
ITEM "DATAORARIC"
|
BOOLEAN F_SHOWALL
|
||||||
ITEM "IMPTOTDOCP"
|
BEGIN
|
||||||
ITEM "NUMERO"
|
PROMPT 0 5 "Mostra anche fatture già registrate"
|
||||||
ITEM "FISCIVAPAESE"
|
END
|
||||||
ITEM "FISCIVACOD"
|
|
||||||
ITEM "CODFISCALE"
|
SPREADSHEET F_SHEETFPPROS 0 15
|
||||||
ITEM "TIPOPROT"
|
BEGIN
|
||||||
ITEM "PROGRESS"
|
PROMPT 0 6 ""
|
||||||
|
ITEM " "
|
||||||
|
ITEM "Data Ricezione"
|
||||||
|
ITEM "Data Doc."
|
||||||
|
ITEM "Importo Totale"
|
||||||
|
ITEM "Numero"
|
||||||
|
ITEM "Paese"
|
||||||
|
ITEM "P. IVA"
|
||||||
|
ITEM "Cod. Fiscale"
|
||||||
|
ITEM "Tipo Protocollo\nin ingresso"
|
||||||
|
ITEM "Progressivo di ingresso"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_NUMEROI 20
|
STRING F_NUMEROI 20
|
||||||
|
@ -21,8 +21,9 @@
|
|||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include "../cg/cfban.h"
|
#include "../cg/cfban.h"
|
||||||
#include "modaut.h"
|
#include "modaut.h"
|
||||||
void set_connection(SSimple_query& s)
|
bool set_connection(SSimple_query& s)
|
||||||
{
|
{
|
||||||
|
bool ok = true;
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
TString ip = fp_settings().get_db_indirizzo();
|
TString ip = fp_settings().get_db_indirizzo();
|
||||||
if (ip.upper() != "TESTCAMPO2012")
|
if (ip.upper() != "TESTCAMPO2012")
|
||||||
@ -31,7 +32,10 @@ void set_connection(SSimple_query& s)
|
|||||||
"fp",
|
"fp",
|
||||||
"fp",
|
"fp",
|
||||||
TSDB_MSSQL) != NOERR)
|
TSDB_MSSQL) != NOERR)
|
||||||
fatal_box("Impossibile connettersi al DB esterno");
|
{
|
||||||
|
warning_box("Impossibile connettersi al DB esterno");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -41,10 +45,14 @@ void set_connection(SSimple_query& s)
|
|||||||
fp_settings().get_db_user(),
|
fp_settings().get_db_user(),
|
||||||
fp_settings().get_db_password(),
|
fp_settings().get_db_password(),
|
||||||
TSDB_MSSQL) != NOERR)
|
TSDB_MSSQL) != NOERR)
|
||||||
fatal_box("Impossibile connettersi al DB esterno");
|
{
|
||||||
|
warning_box("Impossibile connettersi al DB esterno");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
SSimple_query& fp_db()
|
SSimple_query& fp_db()
|
||||||
@ -53,9 +61,9 @@ SSimple_query& fp_db()
|
|||||||
if (db == nullptr)
|
if (db == nullptr)
|
||||||
{
|
{
|
||||||
db = new SSimple_query();
|
db = new SSimple_query();
|
||||||
set_connection(*db);
|
const bool ok = set_connection(*db);
|
||||||
// Non utilizzo l'autocommit, viene gestito manualmente
|
// Non utilizzo l'autocommit, viene gestito manualmente
|
||||||
db->sq_set_autocommit(false);
|
if (ok) db->sq_set_autocommit(false);
|
||||||
}
|
}
|
||||||
return *db;
|
return *db;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user