Controllata esistenza e sospensione conti nelle causali usate in inserimento

di prima nota


git-svn-id: svn://10.65.10.50/trunk@831 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-01-05 17:47:17 +00:00
parent 81bb4d1ca8
commit a3286685d7
9 changed files with 486 additions and 361 deletions

View File

@ -21,7 +21,9 @@ class TStampa_deleghe_IVA : public TApplication
int _mese, _anno, _tipo;
TString16 _azienda, _dipendenza;
TFilename _profilo;
bool _stampa_distinte, _aggiorna_codici, _stampa_prova;
bool _stampa_distinte, _aggiorna_codici, _definitiva;
bool test_comrf(TLocalisamfile& anag, TLocalisamfile& com);
protected:
virtual bool create();
@ -44,12 +46,12 @@ bool TStampa_deleghe_IVA::create()
_nditte = new TRelation(LF_NDITTE);
_nditte->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
_nditte->add(LF_COMUNI, "STATO=STATORF|COM=COMRF", 1, LF_ANAG);
_nditte->add(LF_COMUNI, "COM=COMRF", 1, LF_ANAG);
_banche = new TTable("%BAN");
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Deleghe da stampare",
"@1|Cod.@5|Ragione Sociale@50|Importo@15|Azienda|Dipendenza|Concessione");
"@1|Cod.@5|Ragione Sociale@50|Importo@15|ABI@5|CAB@5|Concessione");
TConfig c(CONFIG_STUDIO, "cg");
_azienda = c.get("CodABI");
@ -70,15 +72,54 @@ bool TStampa_deleghe_IVA::destroy()
}
HIDDEN bool abi_handler(TMask_field& f, KEY k)
{
if (k == K_TAB)
{
TMask& m = f.mask();
if (!m.get_bool(F_CONTOFIS))
m.set(F_PROFILO, f.get());
}
return TRUE;
}
HIDDEN bool profile_handler(TMask_field& f, KEY k)
{
if (f.to_check(k))
{
TFilename p;
p << "del" << f.get() << ".frm";
if (!fexist(p))
error_box("Non esiste il file di profilo %s", (const char*)p);
}
return TRUE;
}
// Posiziona correttamente il comune di residenza fiscale se non specificato
// in anagrafica in quanto uguale a quello di residenza
bool TStampa_deleghe_IVA::test_comrf(TLocalisamfile& anag, TLocalisamfile& com)
{
if (anag.get("COMRF").empty())
{
com.zero("STATO");
com.put("COM", anag.get("COMRES"));
if (com.read() != NOERR)
com.zero();
}
return com.good();
}
int TStampa_deleghe_IVA::select()
{
TMask m("cg1400a");
TConfig c(CONFIG_STUDIO, "cg");
m.set_handler(F_ABI, abi_handler);
m.set_handler(F_PROFILO, profile_handler);
m.set(F_ABI, _azienda);
m.set(F_CAB, _dipendenza);
if (m.run() != K_ENTER)
return 0;
_azienda = m.get(F_ABI);
_dipendenza = m.get(F_CAB);
@ -86,17 +127,16 @@ int TStampa_deleghe_IVA::select()
_anno = m.get_int(F_ANNO);
_tipo = m.get_int(F_TIPO);
_stampa_prova = !m.get_bool(F_DEFINITIVA);
_definitiva = m.get_bool(F_DEFINITIVA);
_stampa_distinte = m.get_bool(F_DISTINTA);
_aggiorna_codici = m.get_bool(F_AGGIORNA);
_profilo = "del";
if (m.get_bool(F_CONTOFIS))
_profilo = m.get(F_PROFILO);
else
{
_profilo = "del";
_profilo << _azienda;
}
const TDate pd(m.get(F_DATA));
printer().setdate(pd);
@ -112,42 +152,48 @@ int TStampa_deleghe_IVA::select()
_ditte->destroy();
for (_nditte->first(); _nditte->good(); _nditte->next())
{
const int co = _nditte->lfile(LF_COMUNI).get_int("UFFCONC");
if (concessione != 0 && concessione != co) continue;
TLocalisamfile& anag = _nditte->lfile(LF_ANAG);
TLocalisamfile& com = _nditte->lfile(LF_COMUNI); // Comune residenza fiscale
test_comrf(anag, com);
const int con = com.get_int("UFFCONC");
if (concessione != 0 && concessione != con) continue;
const long dit = _nditte->lfile().get_long("CODDITTA");
chiave.format("%05ld%04d%02d%d", dit, _anno, _mese, _tipo);
deleghe.put("CODTAB", chiave);
if (deleghe.read() == NOERR && deleghe.get_bool("B0") == FALSE) // Da stampare
{
const long az = deleghe.get_long("I0");
const long di = deleghe.get_long("I1");
if ((soloabi == 0 || soloabi == az) && (solocab == 0 || solocab == di))
const long abi = deleghe.get_long("S7");
const long cab = deleghe.get_long("S8");
if ((soloabi == 0 || soloabi == abi) && (solocab == 0 || solocab == cab))
{
d = " "; // Selezione
d.add(dit); // Codice ditta
d.add(_nditte->lfile().get("RAGSOC")); // Ragione sociale
d.add(deleghe.get_real("R0").string(".")); // Importo
d.add(format("%05ld", az)); // Azienda
d.add(format("%05ld", di)); // Dipendenza
d.add(format("%03d", co)); // Concessione
d.add(abi ? format("%05ld", abi) : ""); // Azienda
d.add(cab ? format("%05ld", cab) : ""); // Dipendenza
d.add(con ? format("%03d", con) : ""); // Concessione
_ditte->add(d);
}
}
}
int res = 1;
if (_ditte->items() > 0)
{
const bool ok = _ditte->run() == K_ENTER;
enable_menu_item(M_FILE_PRINT, ok);
const bool ok = _ditte->run() == K_ENTER && _ditte->one_checked();
if (!ok) res = 2;
}
else
{
warning_box("Nessuna ditta ha deleghe da stampare");
disable_menu_item(M_FILE_PRINT);
return 2;
res = 2;
}
return 1;
enable_menu_item(M_FILE_PRINT, res == 1);
return res;
}
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
@ -189,8 +235,8 @@ void TStampa_deleghe_IVA::print_distinta()
if (atol(_azienda))
row.put(_banche->get("S0"), 0);
row.put("DISTINTA DELEGHE DI VERSAMENTO", 60);
row.put("Data @>", 110);
row.put("@bDISTINTA DELEGHE DI VERSAMENTO", TAB_SEDE);
row.put("Data @>", 106);
row.put("Pag.@#", 124);
printer().setheaderline(0, row);
@ -206,10 +252,10 @@ void TStampa_deleghe_IVA::print_distinta()
case 7:
t << "acconti IVA : "; break;
default:
t << "periodica : " << _mese << '-'; break;
t << "periodica : " << itom(_mese) << ' '; break;
}
t << _anno;
row.put(t, 60);
row.put(t, TAB_SEDE);
printer().setheaderline(1, row);
t.fill('-', 130);
@ -227,27 +273,28 @@ void TStampa_deleghe_IVA::print_distinta()
real totale;
TLocalisamfile& com = _nditte->lfile(LF_COMUNI);
for (int i = 0; i < _ditte->items(); i++)
if (_ditte->checked(i))
{
const TString16 cod(_ditte->row(i).get(1));
TToken_string& riga = _ditte->row(i);
const TString16 cod(riga.get(1));
_nditte->lfile().put("CODDITTA", cod);
_nditte->read();
test_comrf(_nditte->lfile(LF_ANAG), com);
TParagraph_string dencom(_nditte->lfile(LF_COMUNI).get("DENCOM"), 18);
TParagraph_string dencom(com.get("DENCOM"), 18);
row.reset();
row.put(_nditte->lfile().get("RAGSOC"), TAB_DITTA);
row.put(dencom.get(), TAB_SEDE);
row.put(_nditte->lfile(LF_COMUNI).get("PROVCOM"), TAB_PROV);
row.put(com.get("PROVCOM"), TAB_PROV);
TString imp(_ditte->row(i).get(3));
row.put(imp, TAB_IMPORTO);
const real imp(real::ita2eng(riga.get(3)));
row.put(imp.string("###.###.###.###"), TAB_IMPORTO);
printer().print(row);
imp.strip(".");
real importo(imp);
totale += importo;
totale += imp;
const char* r;
while ((r = dencom.get()) != NULL)
@ -260,7 +307,7 @@ void TStampa_deleghe_IVA::print_distinta()
row.reset();
printer().print(row);
row.put("@BTotale versamenti :", TAB_SEDE);
row.put("@bTotale versamenti :", TAB_SEDE);
row.put(totale.string("###.###.###.###"), TAB_IMPORTO);
printer().print(row);
@ -274,33 +321,39 @@ bool TStampa_deleghe_IVA::print_deleghe()
TForm f(_profilo);
TCursor& cur = *f.cursor();
TLocalisamfile& delega = cur.file();
TLocalisamfile& anag = cur.file(LF_ANAG);
TLocalisamfile& com = cur.file(-12); // Comune residenza fiscale
TString16 chiave;
for (int i = 0; ok && i < _ditte->items(); i++)
if (_ditte->checked(i))
{
const TString16 d(_ditte->row(i).get(1));
TRectype& delega = f.cursor()->curr();
TString16 chiave;
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
const long d = _ditte->row(i).get_long(1);
chiave.format("%05ld%04d%02d%d", d, _anno, _mese, _tipo);
delega.put("CODTAB", chiave);
f.cursor()->file().read();
const bool cera = atoi(delega.get("S7")) != 0;
cur.read(); // Posiziona il cursore
const bool cera = delega.get_int("S7") != 0;
if (!cera)
{
delega.put("S7", _azienda);
delega.put("S8", _dipendenza);
f.cursor()->file().rewrite();
delega.rewrite();
cur.repos(); // Riposiziona il cursore
}
f.cursor()->read(); // Posiziona il cursore
if (!test_comrf(anag, com))
warning_box("Manca il comune di residenza fiscale di %s",
(const char*)anag.get("RAGSOC"));
ok = f.print(-1); // Stampa solo il record corrente
if (!ok) break;
bool scrivi = _aggiorna_codici && !cera;
if (!_stampa_prova)
if (_definitiva)
{
delega.put("B0", "X"); // Stampato
scrivi = TRUE;
@ -312,7 +365,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
scrivi = TRUE;
}
if (scrivi)
f.cursor()->file().rewrite();
delega.rewrite();
}
printer().close();

View File

@ -10,7 +10,7 @@ END
NUMBER F_CONCESSIONE 3
BEGIN
PROMPT 2 2 "Concessione "
HELP "Codice concessione cui fanno capo le ditte da gestire"
HELP "Codice concessione in cui hanno residenza fiscale le ditte da gestire"
USE %UCC
FLAGS "Z"
INPUT CODTAB F_CONCESSIONE
@ -81,7 +81,7 @@ BEGIN
PROMPT 2 7 "Codice ABI "
HELP "Codice ABI della banca per la presentazione della delega"
FLAGS "Z"
COPY USE F_SOLO_ABI
USE %BAN SELECT CODTAB[6,10]?="?????"
INPUT CODTAB[1,5] F_ABI
INPUT CODTAB[6,10] F_CAB
COPY DISPLAY F_SOLO_ABI
@ -98,12 +98,13 @@ BEGIN
FLAGS "Z"
COPY ALL F_ABI
CHECKTYPE NORMAL
WARNING "E' richiesto un codice CAB valido"
END
STRING F_DESC_BAN 50
BEGIN
PROMPT 2 8 "Denominazione "
COPY USE F_DESC_SOLO_BAN
USE %BAN KEY 2 SELECT CODTAB[6,10]?="?????"
INPUT S0 F_DESC_BAN
COPY DISPLAY F_DESC_SOLO_BAN
COPY OUTPUT F_ABI
@ -141,9 +142,10 @@ BEGIN
FLAGS "A"
END
NUMBER F_PROFILO 5
STRING F_PROFILO 5
BEGIN
PROMPT 2 13 "Profilo "
VALIDATE ZEROFILL_FUNC 5
CHECKTYPE REQUIRED
END
@ -167,8 +169,6 @@ END
BOOLEAN F_CONTOFIS
BEGIN
PROMPT 43 13 "Titolari Conto fiscale"
MESSAGE FALSE CLEAR,F_PROFILO
MESSAGE TRUE ENABLE,F_PROFILO
END
BUTTON DLG_SELECT 9 2

View File

@ -21,7 +21,9 @@ class TStampa_deleghe_IVA : public TApplication
int _mese, _anno, _tipo;
TString16 _azienda, _dipendenza;
TFilename _profilo;
bool _stampa_distinte, _aggiorna_codici, _stampa_prova;
bool _stampa_distinte, _aggiorna_codici, _definitiva;
bool test_comrf(TLocalisamfile& anag, TLocalisamfile& com);
protected:
virtual bool create();
@ -44,12 +46,12 @@ bool TStampa_deleghe_IVA::create()
_nditte = new TRelation(LF_NDITTE);
_nditte->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
_nditte->add(LF_COMUNI, "STATO=STATORF|COM=COMRF", 1, LF_ANAG);
_nditte->add(LF_COMUNI, "COM=COMRF", 1, LF_ANAG);
_banche = new TTable("%BAN");
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Deleghe da stampare",
"@1|Cod.@5|Ragione Sociale@50|Importo@15|Azienda|Dipendenza|Concessione");
"@1|Cod.@5|Ragione Sociale@50|Importo@15|ABI@5|CAB@5|Concessione");
TConfig c(CONFIG_STUDIO, "cg");
_azienda = c.get("CodABI");
@ -70,15 +72,54 @@ bool TStampa_deleghe_IVA::destroy()
}
HIDDEN bool abi_handler(TMask_field& f, KEY k)
{
if (k == K_TAB)
{
TMask& m = f.mask();
if (!m.get_bool(F_CONTOFIS))
m.set(F_PROFILO, f.get());
}
return TRUE;
}
HIDDEN bool profile_handler(TMask_field& f, KEY k)
{
if (f.to_check(k))
{
TFilename p;
p << "del" << f.get() << ".frm";
if (!fexist(p))
error_box("Non esiste il file di profilo %s", (const char*)p);
}
return TRUE;
}
// Posiziona correttamente il comune di residenza fiscale se non specificato
// in anagrafica in quanto uguale a quello di residenza
bool TStampa_deleghe_IVA::test_comrf(TLocalisamfile& anag, TLocalisamfile& com)
{
if (anag.get("COMRF").empty())
{
com.zero("STATO");
com.put("COM", anag.get("COMRES"));
if (com.read() != NOERR)
com.zero();
}
return com.good();
}
int TStampa_deleghe_IVA::select()
{
TMask m("cg1400a");
TConfig c(CONFIG_STUDIO, "cg");
m.set_handler(F_ABI, abi_handler);
m.set_handler(F_PROFILO, profile_handler);
m.set(F_ABI, _azienda);
m.set(F_CAB, _dipendenza);
if (m.run() != K_ENTER)
return 0;
_azienda = m.get(F_ABI);
_dipendenza = m.get(F_CAB);
@ -86,17 +127,16 @@ int TStampa_deleghe_IVA::select()
_anno = m.get_int(F_ANNO);
_tipo = m.get_int(F_TIPO);
_stampa_prova = !m.get_bool(F_DEFINITIVA);
_definitiva = m.get_bool(F_DEFINITIVA);
_stampa_distinte = m.get_bool(F_DISTINTA);
_aggiorna_codici = m.get_bool(F_AGGIORNA);
_profilo = "del";
if (m.get_bool(F_CONTOFIS))
_profilo = m.get(F_PROFILO);
else
{
_profilo = "del";
_profilo << _azienda;
}
const TDate pd(m.get(F_DATA));
printer().setdate(pd);
@ -112,42 +152,48 @@ int TStampa_deleghe_IVA::select()
_ditte->destroy();
for (_nditte->first(); _nditte->good(); _nditte->next())
{
const int co = _nditte->lfile(LF_COMUNI).get_int("UFFCONC");
if (concessione != 0 && concessione != co) continue;
TLocalisamfile& anag = _nditte->lfile(LF_ANAG);
TLocalisamfile& com = _nditte->lfile(LF_COMUNI); // Comune residenza fiscale
test_comrf(anag, com);
const int con = com.get_int("UFFCONC");
if (concessione != 0 && concessione != con) continue;
const long dit = _nditte->lfile().get_long("CODDITTA");
chiave.format("%05ld%04d%02d%d", dit, _anno, _mese, _tipo);
deleghe.put("CODTAB", chiave);
if (deleghe.read() == NOERR && deleghe.get_bool("B0") == FALSE) // Da stampare
{
const long az = deleghe.get_long("I0");
const long di = deleghe.get_long("I1");
if ((soloabi == 0 || soloabi == az) && (solocab == 0 || solocab == di))
const long abi = deleghe.get_long("S7");
const long cab = deleghe.get_long("S8");
if ((soloabi == 0 || soloabi == abi) && (solocab == 0 || solocab == cab))
{
d = " "; // Selezione
d.add(dit); // Codice ditta
d.add(_nditte->lfile().get("RAGSOC")); // Ragione sociale
d.add(deleghe.get_real("R0").string(".")); // Importo
d.add(format("%05ld", az)); // Azienda
d.add(format("%05ld", di)); // Dipendenza
d.add(format("%03d", co)); // Concessione
d.add(abi ? format("%05ld", abi) : ""); // Azienda
d.add(cab ? format("%05ld", cab) : ""); // Dipendenza
d.add(con ? format("%03d", con) : ""); // Concessione
_ditte->add(d);
}
}
}
int res = 1;
if (_ditte->items() > 0)
{
const bool ok = _ditte->run() == K_ENTER;
enable_menu_item(M_FILE_PRINT, ok);
const bool ok = _ditte->run() == K_ENTER && _ditte->one_checked();
if (!ok) res = 2;
}
else
{
warning_box("Nessuna ditta ha deleghe da stampare");
disable_menu_item(M_FILE_PRINT);
return 2;
res = 2;
}
return 1;
enable_menu_item(M_FILE_PRINT, res == 1);
return res;
}
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
@ -189,8 +235,8 @@ void TStampa_deleghe_IVA::print_distinta()
if (atol(_azienda))
row.put(_banche->get("S0"), 0);
row.put("DISTINTA DELEGHE DI VERSAMENTO", 60);
row.put("Data @>", 110);
row.put("@bDISTINTA DELEGHE DI VERSAMENTO", TAB_SEDE);
row.put("Data @>", 106);
row.put("Pag.@#", 124);
printer().setheaderline(0, row);
@ -206,10 +252,10 @@ void TStampa_deleghe_IVA::print_distinta()
case 7:
t << "acconti IVA : "; break;
default:
t << "periodica : " << _mese << '-'; break;
t << "periodica : " << itom(_mese) << ' '; break;
}
t << _anno;
row.put(t, 60);
row.put(t, TAB_SEDE);
printer().setheaderline(1, row);
t.fill('-', 130);
@ -227,27 +273,28 @@ void TStampa_deleghe_IVA::print_distinta()
real totale;
TLocalisamfile& com = _nditte->lfile(LF_COMUNI);
for (int i = 0; i < _ditte->items(); i++)
if (_ditte->checked(i))
{
const TString16 cod(_ditte->row(i).get(1));
TToken_string& riga = _ditte->row(i);
const TString16 cod(riga.get(1));
_nditte->lfile().put("CODDITTA", cod);
_nditte->read();
test_comrf(_nditte->lfile(LF_ANAG), com);
TParagraph_string dencom(_nditte->lfile(LF_COMUNI).get("DENCOM"), 18);
TParagraph_string dencom(com.get("DENCOM"), 18);
row.reset();
row.put(_nditte->lfile().get("RAGSOC"), TAB_DITTA);
row.put(dencom.get(), TAB_SEDE);
row.put(_nditte->lfile(LF_COMUNI).get("PROVCOM"), TAB_PROV);
row.put(com.get("PROVCOM"), TAB_PROV);
TString imp(_ditte->row(i).get(3));
row.put(imp, TAB_IMPORTO);
const real imp(real::ita2eng(riga.get(3)));
row.put(imp.string("###.###.###.###"), TAB_IMPORTO);
printer().print(row);
imp.strip(".");
real importo(imp);
totale += importo;
totale += imp;
const char* r;
while ((r = dencom.get()) != NULL)
@ -260,7 +307,7 @@ void TStampa_deleghe_IVA::print_distinta()
row.reset();
printer().print(row);
row.put("@BTotale versamenti :", TAB_SEDE);
row.put("@bTotale versamenti :", TAB_SEDE);
row.put(totale.string("###.###.###.###"), TAB_IMPORTO);
printer().print(row);
@ -274,33 +321,39 @@ bool TStampa_deleghe_IVA::print_deleghe()
TForm f(_profilo);
TCursor& cur = *f.cursor();
TLocalisamfile& delega = cur.file();
TLocalisamfile& anag = cur.file(LF_ANAG);
TLocalisamfile& com = cur.file(-12); // Comune residenza fiscale
TString16 chiave;
for (int i = 0; ok && i < _ditte->items(); i++)
if (_ditte->checked(i))
{
const TString16 d(_ditte->row(i).get(1));
TRectype& delega = f.cursor()->curr();
TString16 chiave;
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
const long d = _ditte->row(i).get_long(1);
chiave.format("%05ld%04d%02d%d", d, _anno, _mese, _tipo);
delega.put("CODTAB", chiave);
f.cursor()->file().read();
const bool cera = atoi(delega.get("S7")) != 0;
cur.read(); // Posiziona il cursore
const bool cera = delega.get_int("S7") != 0;
if (!cera)
{
delega.put("S7", _azienda);
delega.put("S8", _dipendenza);
f.cursor()->file().rewrite();
delega.rewrite();
cur.repos(); // Riposiziona il cursore
}
f.cursor()->read(); // Posiziona il cursore
if (!test_comrf(anag, com))
warning_box("Manca il comune di residenza fiscale di %s",
(const char*)anag.get("RAGSOC"));
ok = f.print(-1); // Stampa solo il record corrente
if (!ok) break;
bool scrivi = _aggiorna_codici && !cera;
if (!_stampa_prova)
if (_definitiva)
{
delega.put("B0", "X"); // Stampato
scrivi = TRUE;
@ -312,7 +365,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
scrivi = TRUE;
}
if (scrivi)
f.cursor()->file().rewrite();
delega.rewrite();
}
printer().close();

View File

@ -10,7 +10,7 @@ END
NUMBER F_CONCESSIONE 3
BEGIN
PROMPT 2 2 "Concessione "
HELP "Codice concessione cui fanno capo le ditte da gestire"
HELP "Codice concessione in cui hanno residenza fiscale le ditte da gestire"
USE %UCC
FLAGS "Z"
INPUT CODTAB F_CONCESSIONE
@ -81,7 +81,7 @@ BEGIN
PROMPT 2 7 "Codice ABI "
HELP "Codice ABI della banca per la presentazione della delega"
FLAGS "Z"
COPY USE F_SOLO_ABI
USE %BAN SELECT CODTAB[6,10]?="?????"
INPUT CODTAB[1,5] F_ABI
INPUT CODTAB[6,10] F_CAB
COPY DISPLAY F_SOLO_ABI
@ -98,12 +98,13 @@ BEGIN
FLAGS "Z"
COPY ALL F_ABI
CHECKTYPE NORMAL
WARNING "E' richiesto un codice CAB valido"
END
STRING F_DESC_BAN 50
BEGIN
PROMPT 2 8 "Denominazione "
COPY USE F_DESC_SOLO_BAN
USE %BAN KEY 2 SELECT CODTAB[6,10]?="?????"
INPUT S0 F_DESC_BAN
COPY DISPLAY F_DESC_SOLO_BAN
COPY OUTPUT F_ABI
@ -141,9 +142,10 @@ BEGIN
FLAGS "A"
END
NUMBER F_PROFILO 5
STRING F_PROFILO 5
BEGIN
PROMPT 2 13 "Profilo "
VALIDATE ZEROFILL_FUNC 5
CHECKTYPE REQUIRED
END
@ -167,8 +169,6 @@ END
BOOLEAN F_CONTOFIS
BEGIN
PROMPT 43 13 "Titolari Conto fiscale"
MESSAGE FALSE CLEAR,F_PROFILO
MESSAGE TRUE ENABLE,F_PROFILO
END
BUTTON DLG_SELECT 9 2

View File

@ -40,6 +40,7 @@ TMask* TPrimanota_application::load_mask(int n)
switch (n)
{
case 0:
if (m)
{
m->set_handler(F_NUMREG, num_handler);
m->set_handler(F_CODCAUS, caus_query_handler);
@ -57,7 +58,8 @@ TMask* TPrimanota_application::load_mask(int n)
}
break;
case 2:
{
if (m)
{
m->set_handler(F_DATADOC, doc_handler);
m->set_handler(F_NUMDOC, doc_handler);
m->set_handler(F_DATA74TER, data74ter_handler);
@ -84,10 +86,11 @@ TMask* TPrimanota_application::load_mask(int n)
ism.set_handler(109, iva_sottoconto_handler);
ism.set_handler(209, sheet_clifo_handler);
ism.set_handler(309, sheet_clifo_handler);
}
_iva_showed = FALSE;
}
_iva_showed = FALSE;
case 1:
{
if (m)
{
m->first_focus(_firstfocus);
m->set_handler(F_DATAREG, datareg_handler);
m->set_handler(F_DATACOMP, datacomp_handler);
@ -110,17 +113,17 @@ _iva_showed = FALSE;
cgm.set_handler(113, suspended_handler);
cgm.set_handler(213, sheet_clifo_handler);
cgm.set_handler(313, sheet_clifo_handler);
}
break;
}
break;
case 3:
m->set_handler(O_CODICE, occas_code_handler);
break;
default:
CHECKD(0, "Che cavolo di maschera e' la ", n);
break;
}
default:
CHECKD(0, "Che cavolo di maschera e' la ", n);
break;
}
return _msk[n] = m;
return _msk[n] = m;
}

View File

@ -55,6 +55,8 @@
#define F_IMPOSTE 140
#define F_VALUTAINTRA 141
#define F_CAMBIOINTRA 142
#define F_STAMPATO 143
#define F_REGST 144
#define F_SHEETCG 300
#define F_SHEETIVA 301

View File

@ -6,6 +6,18 @@ ENDPAGE
PAGE "OPERAZIONE DI PRIMA NOTA" -1 -1 77 20
BOOLEAN F_REGST
BEGIN
FIELD REGST
FLAGS "H"
END
BOOLEAN F_STAMPATO
BEGIN
FIELD STAMPATO
FLAGS "H"
END
NUMBER F_GRUPPOCLIFO 3
BEGIN
FLAGS "H"

View File

@ -1545,14 +1545,16 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
// Handler of the F_PROTIVA
bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
{
bool ok = TRUE;
if (key == K_ENTER && f.dirty() && f.mask().mode() == MODE_INS)
{
const long protiva = atol(f.get());
const long protocol = app().causale().reg().protocol() + 1;
if (protiva != protocol)
f.warning_box("Protocollo IVA fuori sequenza: %ld invece di %ld", protiva, protocol);
ok = f.yesno_box("Accettare il protocollo IVA fuori sequenza: %ld invece di %ld",
protiva, protocol);
}
return TRUE;
return ok;
}

View File

@ -304,13 +304,13 @@ bool TLiquidazione_app::look_ppa(int month, const char* codatt, int type, bool c
bool TLiquidazione_app::look_del(int month, int type, bool create)
{
TString ditta = _nditte->curr().get("CODDITTA");
TString16 ditta = _nditte->curr().get("CODDITTA");
_del->zero();
(*_del_ditta) = ditta;
(*_del_anno) = _year;
(*_del_mese) = month;
(*_del_tipo) = type;
TString ctab = _del->get("CODTAB");
TString16 ctab = _del->get("CODTAB");
_del->read();
bool ok = _del->good();