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:
parent
81bb4d1ca8
commit
a3286685d7
@ -21,7 +21,9 @@ class TStampa_deleghe_IVA : public TApplication
|
|||||||
int _mese, _anno, _tipo;
|
int _mese, _anno, _tipo;
|
||||||
TString16 _azienda, _dipendenza;
|
TString16 _azienda, _dipendenza;
|
||||||
TFilename _profilo;
|
TFilename _profilo;
|
||||||
bool _stampa_distinte, _aggiorna_codici, _stampa_prova;
|
bool _stampa_distinte, _aggiorna_codici, _definitiva;
|
||||||
|
|
||||||
|
bool test_comrf(TLocalisamfile& anag, TLocalisamfile& com);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
@ -44,12 +46,12 @@ bool TStampa_deleghe_IVA::create()
|
|||||||
|
|
||||||
_nditte = new TRelation(LF_NDITTE);
|
_nditte = new TRelation(LF_NDITTE);
|
||||||
_nditte->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
|
_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");
|
_banche = new TTable("%BAN");
|
||||||
|
|
||||||
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Deleghe da stampare",
|
_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");
|
TConfig c(CONFIG_STUDIO, "cg");
|
||||||
_azienda = c.get("CodABI");
|
_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()
|
int TStampa_deleghe_IVA::select()
|
||||||
{
|
{
|
||||||
TMask m("cg1400a");
|
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_ABI, _azienda);
|
||||||
m.set(F_CAB, _dipendenza);
|
m.set(F_CAB, _dipendenza);
|
||||||
if (m.run() != K_ENTER)
|
if (m.run() != K_ENTER)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
_azienda = m.get(F_ABI);
|
_azienda = m.get(F_ABI);
|
||||||
_dipendenza = m.get(F_CAB);
|
_dipendenza = m.get(F_CAB);
|
||||||
|
|
||||||
@ -86,17 +127,16 @@ int TStampa_deleghe_IVA::select()
|
|||||||
_anno = m.get_int(F_ANNO);
|
_anno = m.get_int(F_ANNO);
|
||||||
_tipo = m.get_int(F_TIPO);
|
_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);
|
_stampa_distinte = m.get_bool(F_DISTINTA);
|
||||||
_aggiorna_codici = m.get_bool(F_AGGIORNA);
|
_aggiorna_codici = m.get_bool(F_AGGIORNA);
|
||||||
|
|
||||||
|
_profilo = "del";
|
||||||
if (m.get_bool(F_CONTOFIS))
|
if (m.get_bool(F_CONTOFIS))
|
||||||
_profilo = m.get(F_PROFILO);
|
_profilo = m.get(F_PROFILO);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_profilo = "del";
|
|
||||||
_profilo << _azienda;
|
_profilo << _azienda;
|
||||||
}
|
|
||||||
const TDate pd(m.get(F_DATA));
|
const TDate pd(m.get(F_DATA));
|
||||||
printer().setdate(pd);
|
printer().setdate(pd);
|
||||||
|
|
||||||
@ -112,42 +152,48 @@ int TStampa_deleghe_IVA::select()
|
|||||||
_ditte->destroy();
|
_ditte->destroy();
|
||||||
for (_nditte->first(); _nditte->good(); _nditte->next())
|
for (_nditte->first(); _nditte->good(); _nditte->next())
|
||||||
{
|
{
|
||||||
const int co = _nditte->lfile(LF_COMUNI).get_int("UFFCONC");
|
TLocalisamfile& anag = _nditte->lfile(LF_ANAG);
|
||||||
if (concessione != 0 && concessione != co) continue;
|
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");
|
const long dit = _nditte->lfile().get_long("CODDITTA");
|
||||||
chiave.format("%05ld%04d%02d%d", dit, _anno, _mese, _tipo);
|
chiave.format("%05ld%04d%02d%d", dit, _anno, _mese, _tipo);
|
||||||
deleghe.put("CODTAB", chiave);
|
deleghe.put("CODTAB", chiave);
|
||||||
if (deleghe.read() == NOERR && deleghe.get_bool("B0") == FALSE) // Da stampare
|
if (deleghe.read() == NOERR && deleghe.get_bool("B0") == FALSE) // Da stampare
|
||||||
{
|
{
|
||||||
const long az = deleghe.get_long("I0");
|
const long abi = deleghe.get_long("S7");
|
||||||
const long di = deleghe.get_long("I1");
|
const long cab = deleghe.get_long("S8");
|
||||||
if ((soloabi == 0 || soloabi == az) && (solocab == 0 || solocab == di))
|
if ((soloabi == 0 || soloabi == abi) && (solocab == 0 || solocab == cab))
|
||||||
{
|
{
|
||||||
d = " "; // Selezione
|
d = " "; // Selezione
|
||||||
d.add(dit); // Codice ditta
|
d.add(dit); // Codice ditta
|
||||||
d.add(_nditte->lfile().get("RAGSOC")); // Ragione sociale
|
d.add(_nditte->lfile().get("RAGSOC")); // Ragione sociale
|
||||||
d.add(deleghe.get_real("R0").string(".")); // Importo
|
d.add(deleghe.get_real("R0").string(".")); // Importo
|
||||||
d.add(format("%05ld", az)); // Azienda
|
d.add(abi ? format("%05ld", abi) : ""); // Azienda
|
||||||
d.add(format("%05ld", di)); // Dipendenza
|
d.add(cab ? format("%05ld", cab) : ""); // Dipendenza
|
||||||
d.add(format("%03d", co)); // Concessione
|
d.add(con ? format("%03d", con) : ""); // Concessione
|
||||||
_ditte->add(d);
|
_ditte->add(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int res = 1;
|
||||||
if (_ditte->items() > 0)
|
if (_ditte->items() > 0)
|
||||||
{
|
{
|
||||||
const bool ok = _ditte->run() == K_ENTER;
|
const bool ok = _ditte->run() == K_ENTER && _ditte->one_checked();
|
||||||
enable_menu_item(M_FILE_PRINT, ok);
|
if (!ok) res = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
warning_box("Nessuna ditta ha deleghe da stampare");
|
warning_box("Nessuna ditta ha deleghe da stampare");
|
||||||
disable_menu_item(M_FILE_PRINT);
|
res = 2;
|
||||||
return 2;
|
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
|
enable_menu_item(M_FILE_PRINT, res == 1);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
|
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
|
||||||
@ -189,8 +235,8 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
|
|
||||||
if (atol(_azienda))
|
if (atol(_azienda))
|
||||||
row.put(_banche->get("S0"), 0);
|
row.put(_banche->get("S0"), 0);
|
||||||
row.put("DISTINTA DELEGHE DI VERSAMENTO", 60);
|
row.put("@bDISTINTA DELEGHE DI VERSAMENTO", TAB_SEDE);
|
||||||
row.put("Data @>", 110);
|
row.put("Data @>", 106);
|
||||||
row.put("Pag.@#", 124);
|
row.put("Pag.@#", 124);
|
||||||
printer().setheaderline(0, row);
|
printer().setheaderline(0, row);
|
||||||
|
|
||||||
@ -206,10 +252,10 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
case 7:
|
case 7:
|
||||||
t << "acconti IVA : "; break;
|
t << "acconti IVA : "; break;
|
||||||
default:
|
default:
|
||||||
t << "periodica : " << _mese << '-'; break;
|
t << "periodica : " << itom(_mese) << ' '; break;
|
||||||
}
|
}
|
||||||
t << _anno;
|
t << _anno;
|
||||||
row.put(t, 60);
|
row.put(t, TAB_SEDE);
|
||||||
printer().setheaderline(1, row);
|
printer().setheaderline(1, row);
|
||||||
|
|
||||||
t.fill('-', 130);
|
t.fill('-', 130);
|
||||||
@ -227,27 +273,28 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
|
|
||||||
real totale;
|
real totale;
|
||||||
|
|
||||||
|
TLocalisamfile& com = _nditte->lfile(LF_COMUNI);
|
||||||
|
|
||||||
for (int i = 0; i < _ditte->items(); i++)
|
for (int i = 0; i < _ditte->items(); i++)
|
||||||
if (_ditte->checked(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->lfile().put("CODDITTA", cod);
|
||||||
_nditte->read();
|
_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.reset();
|
||||||
row.put(_nditte->lfile().get("RAGSOC"), TAB_DITTA);
|
row.put(_nditte->lfile().get("RAGSOC"), TAB_DITTA);
|
||||||
row.put(dencom.get(), TAB_SEDE);
|
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));
|
const real imp(real::ita2eng(riga.get(3)));
|
||||||
row.put(imp, TAB_IMPORTO);
|
row.put(imp.string("###.###.###.###"), TAB_IMPORTO);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
|
totale += imp;
|
||||||
imp.strip(".");
|
|
||||||
real importo(imp);
|
|
||||||
totale += importo;
|
|
||||||
|
|
||||||
const char* r;
|
const char* r;
|
||||||
while ((r = dencom.get()) != NULL)
|
while ((r = dencom.get()) != NULL)
|
||||||
@ -260,7 +307,7 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
|
|
||||||
row.reset();
|
row.reset();
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
row.put("@BTotale versamenti :", TAB_SEDE);
|
row.put("@bTotale versamenti :", TAB_SEDE);
|
||||||
row.put(totale.string("###.###.###.###"), TAB_IMPORTO);
|
row.put(totale.string("###.###.###.###"), TAB_IMPORTO);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
|
|
||||||
@ -274,33 +321,39 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
|
|
||||||
TForm f(_profilo);
|
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++)
|
for (int i = 0; ok && i < _ditte->items(); i++)
|
||||||
if (_ditte->checked(i))
|
if (_ditte->checked(i))
|
||||||
{
|
{
|
||||||
const TString16 d(_ditte->row(i).get(1));
|
const long d = _ditte->row(i).get_long(1);
|
||||||
|
chiave.format("%05ld%04d%02d%d", d, _anno, _mese, _tipo);
|
||||||
TRectype& delega = f.cursor()->curr();
|
|
||||||
|
|
||||||
TString16 chiave;
|
|
||||||
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
|
||||||
delega.put("CODTAB", chiave);
|
delega.put("CODTAB", chiave);
|
||||||
|
|
||||||
f.cursor()->file().read();
|
cur.read(); // Posiziona il cursore
|
||||||
const bool cera = atoi(delega.get("S7")) != 0;
|
const bool cera = delega.get_int("S7") != 0;
|
||||||
if (!cera)
|
if (!cera)
|
||||||
{
|
{
|
||||||
delega.put("S7", _azienda);
|
delega.put("S7", _azienda);
|
||||||
delega.put("S8", _dipendenza);
|
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
|
ok = f.print(-1); // Stampa solo il record corrente
|
||||||
if (!ok) break;
|
if (!ok) break;
|
||||||
|
|
||||||
bool scrivi = _aggiorna_codici && !cera;
|
bool scrivi = _aggiorna_codici && !cera;
|
||||||
|
|
||||||
if (!_stampa_prova)
|
if (_definitiva)
|
||||||
{
|
{
|
||||||
delega.put("B0", "X"); // Stampato
|
delega.put("B0", "X"); // Stampato
|
||||||
scrivi = TRUE;
|
scrivi = TRUE;
|
||||||
@ -312,7 +365,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
scrivi = TRUE;
|
scrivi = TRUE;
|
||||||
}
|
}
|
||||||
if (scrivi)
|
if (scrivi)
|
||||||
f.cursor()->file().rewrite();
|
delega.rewrite();
|
||||||
}
|
}
|
||||||
printer().close();
|
printer().close();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ END
|
|||||||
NUMBER F_CONCESSIONE 3
|
NUMBER F_CONCESSIONE 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 "Concessione "
|
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
|
USE %UCC
|
||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
INPUT CODTAB F_CONCESSIONE
|
INPUT CODTAB F_CONCESSIONE
|
||||||
@ -81,7 +81,7 @@ BEGIN
|
|||||||
PROMPT 2 7 "Codice ABI "
|
PROMPT 2 7 "Codice ABI "
|
||||||
HELP "Codice ABI della banca per la presentazione della delega"
|
HELP "Codice ABI della banca per la presentazione della delega"
|
||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
COPY USE F_SOLO_ABI
|
USE %BAN SELECT CODTAB[6,10]?="?????"
|
||||||
INPUT CODTAB[1,5] F_ABI
|
INPUT CODTAB[1,5] F_ABI
|
||||||
INPUT CODTAB[6,10] F_CAB
|
INPUT CODTAB[6,10] F_CAB
|
||||||
COPY DISPLAY F_SOLO_ABI
|
COPY DISPLAY F_SOLO_ABI
|
||||||
@ -98,12 +98,13 @@ BEGIN
|
|||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
COPY ALL F_ABI
|
COPY ALL F_ABI
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "E' richiesto un codice CAB valido"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESC_BAN 50
|
STRING F_DESC_BAN 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 8 "Denominazione "
|
PROMPT 2 8 "Denominazione "
|
||||||
COPY USE F_DESC_SOLO_BAN
|
USE %BAN KEY 2 SELECT CODTAB[6,10]?="?????"
|
||||||
INPUT S0 F_DESC_BAN
|
INPUT S0 F_DESC_BAN
|
||||||
COPY DISPLAY F_DESC_SOLO_BAN
|
COPY DISPLAY F_DESC_SOLO_BAN
|
||||||
COPY OUTPUT F_ABI
|
COPY OUTPUT F_ABI
|
||||||
@ -141,9 +142,10 @@ BEGIN
|
|||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_PROFILO 5
|
STRING F_PROFILO 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 13 "Profilo "
|
PROMPT 2 13 "Profilo "
|
||||||
|
VALIDATE ZEROFILL_FUNC 5
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -167,8 +169,6 @@ END
|
|||||||
BOOLEAN F_CONTOFIS
|
BOOLEAN F_CONTOFIS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 43 13 "Titolari Conto fiscale"
|
PROMPT 43 13 "Titolari Conto fiscale"
|
||||||
MESSAGE FALSE CLEAR,F_PROFILO
|
|
||||||
MESSAGE TRUE ENABLE,F_PROFILO
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_SELECT 9 2
|
BUTTON DLG_SELECT 9 2
|
||||||
|
149
cg/cg1400.cpp
149
cg/cg1400.cpp
@ -21,7 +21,9 @@ class TStampa_deleghe_IVA : public TApplication
|
|||||||
int _mese, _anno, _tipo;
|
int _mese, _anno, _tipo;
|
||||||
TString16 _azienda, _dipendenza;
|
TString16 _azienda, _dipendenza;
|
||||||
TFilename _profilo;
|
TFilename _profilo;
|
||||||
bool _stampa_distinte, _aggiorna_codici, _stampa_prova;
|
bool _stampa_distinte, _aggiorna_codici, _definitiva;
|
||||||
|
|
||||||
|
bool test_comrf(TLocalisamfile& anag, TLocalisamfile& com);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
@ -44,12 +46,12 @@ bool TStampa_deleghe_IVA::create()
|
|||||||
|
|
||||||
_nditte = new TRelation(LF_NDITTE);
|
_nditte = new TRelation(LF_NDITTE);
|
||||||
_nditte->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
|
_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");
|
_banche = new TTable("%BAN");
|
||||||
|
|
||||||
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Deleghe da stampare",
|
_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");
|
TConfig c(CONFIG_STUDIO, "cg");
|
||||||
_azienda = c.get("CodABI");
|
_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()
|
int TStampa_deleghe_IVA::select()
|
||||||
{
|
{
|
||||||
TMask m("cg1400a");
|
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_ABI, _azienda);
|
||||||
m.set(F_CAB, _dipendenza);
|
m.set(F_CAB, _dipendenza);
|
||||||
if (m.run() != K_ENTER)
|
if (m.run() != K_ENTER)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
_azienda = m.get(F_ABI);
|
_azienda = m.get(F_ABI);
|
||||||
_dipendenza = m.get(F_CAB);
|
_dipendenza = m.get(F_CAB);
|
||||||
|
|
||||||
@ -86,17 +127,16 @@ int TStampa_deleghe_IVA::select()
|
|||||||
_anno = m.get_int(F_ANNO);
|
_anno = m.get_int(F_ANNO);
|
||||||
_tipo = m.get_int(F_TIPO);
|
_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);
|
_stampa_distinte = m.get_bool(F_DISTINTA);
|
||||||
_aggiorna_codici = m.get_bool(F_AGGIORNA);
|
_aggiorna_codici = m.get_bool(F_AGGIORNA);
|
||||||
|
|
||||||
|
_profilo = "del";
|
||||||
if (m.get_bool(F_CONTOFIS))
|
if (m.get_bool(F_CONTOFIS))
|
||||||
_profilo = m.get(F_PROFILO);
|
_profilo = m.get(F_PROFILO);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_profilo = "del";
|
|
||||||
_profilo << _azienda;
|
_profilo << _azienda;
|
||||||
}
|
|
||||||
const TDate pd(m.get(F_DATA));
|
const TDate pd(m.get(F_DATA));
|
||||||
printer().setdate(pd);
|
printer().setdate(pd);
|
||||||
|
|
||||||
@ -112,42 +152,48 @@ int TStampa_deleghe_IVA::select()
|
|||||||
_ditte->destroy();
|
_ditte->destroy();
|
||||||
for (_nditte->first(); _nditte->good(); _nditte->next())
|
for (_nditte->first(); _nditte->good(); _nditte->next())
|
||||||
{
|
{
|
||||||
const int co = _nditte->lfile(LF_COMUNI).get_int("UFFCONC");
|
TLocalisamfile& anag = _nditte->lfile(LF_ANAG);
|
||||||
if (concessione != 0 && concessione != co) continue;
|
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");
|
const long dit = _nditte->lfile().get_long("CODDITTA");
|
||||||
chiave.format("%05ld%04d%02d%d", dit, _anno, _mese, _tipo);
|
chiave.format("%05ld%04d%02d%d", dit, _anno, _mese, _tipo);
|
||||||
deleghe.put("CODTAB", chiave);
|
deleghe.put("CODTAB", chiave);
|
||||||
if (deleghe.read() == NOERR && deleghe.get_bool("B0") == FALSE) // Da stampare
|
if (deleghe.read() == NOERR && deleghe.get_bool("B0") == FALSE) // Da stampare
|
||||||
{
|
{
|
||||||
const long az = deleghe.get_long("I0");
|
const long abi = deleghe.get_long("S7");
|
||||||
const long di = deleghe.get_long("I1");
|
const long cab = deleghe.get_long("S8");
|
||||||
if ((soloabi == 0 || soloabi == az) && (solocab == 0 || solocab == di))
|
if ((soloabi == 0 || soloabi == abi) && (solocab == 0 || solocab == cab))
|
||||||
{
|
{
|
||||||
d = " "; // Selezione
|
d = " "; // Selezione
|
||||||
d.add(dit); // Codice ditta
|
d.add(dit); // Codice ditta
|
||||||
d.add(_nditte->lfile().get("RAGSOC")); // Ragione sociale
|
d.add(_nditte->lfile().get("RAGSOC")); // Ragione sociale
|
||||||
d.add(deleghe.get_real("R0").string(".")); // Importo
|
d.add(deleghe.get_real("R0").string(".")); // Importo
|
||||||
d.add(format("%05ld", az)); // Azienda
|
d.add(abi ? format("%05ld", abi) : ""); // Azienda
|
||||||
d.add(format("%05ld", di)); // Dipendenza
|
d.add(cab ? format("%05ld", cab) : ""); // Dipendenza
|
||||||
d.add(format("%03d", co)); // Concessione
|
d.add(con ? format("%03d", con) : ""); // Concessione
|
||||||
_ditte->add(d);
|
_ditte->add(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int res = 1;
|
||||||
if (_ditte->items() > 0)
|
if (_ditte->items() > 0)
|
||||||
{
|
{
|
||||||
const bool ok = _ditte->run() == K_ENTER;
|
const bool ok = _ditte->run() == K_ENTER && _ditte->one_checked();
|
||||||
enable_menu_item(M_FILE_PRINT, ok);
|
if (!ok) res = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
warning_box("Nessuna ditta ha deleghe da stampare");
|
warning_box("Nessuna ditta ha deleghe da stampare");
|
||||||
disable_menu_item(M_FILE_PRINT);
|
res = 2;
|
||||||
return 2;
|
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
|
enable_menu_item(M_FILE_PRINT, res == 1);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
|
bool TStampa_deleghe_IVA::menu(MENU_TAG mt)
|
||||||
@ -189,8 +235,8 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
|
|
||||||
if (atol(_azienda))
|
if (atol(_azienda))
|
||||||
row.put(_banche->get("S0"), 0);
|
row.put(_banche->get("S0"), 0);
|
||||||
row.put("DISTINTA DELEGHE DI VERSAMENTO", 60);
|
row.put("@bDISTINTA DELEGHE DI VERSAMENTO", TAB_SEDE);
|
||||||
row.put("Data @>", 110);
|
row.put("Data @>", 106);
|
||||||
row.put("Pag.@#", 124);
|
row.put("Pag.@#", 124);
|
||||||
printer().setheaderline(0, row);
|
printer().setheaderline(0, row);
|
||||||
|
|
||||||
@ -206,10 +252,10 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
case 7:
|
case 7:
|
||||||
t << "acconti IVA : "; break;
|
t << "acconti IVA : "; break;
|
||||||
default:
|
default:
|
||||||
t << "periodica : " << _mese << '-'; break;
|
t << "periodica : " << itom(_mese) << ' '; break;
|
||||||
}
|
}
|
||||||
t << _anno;
|
t << _anno;
|
||||||
row.put(t, 60);
|
row.put(t, TAB_SEDE);
|
||||||
printer().setheaderline(1, row);
|
printer().setheaderline(1, row);
|
||||||
|
|
||||||
t.fill('-', 130);
|
t.fill('-', 130);
|
||||||
@ -227,27 +273,28 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
|
|
||||||
real totale;
|
real totale;
|
||||||
|
|
||||||
|
TLocalisamfile& com = _nditte->lfile(LF_COMUNI);
|
||||||
|
|
||||||
for (int i = 0; i < _ditte->items(); i++)
|
for (int i = 0; i < _ditte->items(); i++)
|
||||||
if (_ditte->checked(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->lfile().put("CODDITTA", cod);
|
||||||
_nditte->read();
|
_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.reset();
|
||||||
row.put(_nditte->lfile().get("RAGSOC"), TAB_DITTA);
|
row.put(_nditte->lfile().get("RAGSOC"), TAB_DITTA);
|
||||||
row.put(dencom.get(), TAB_SEDE);
|
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));
|
const real imp(real::ita2eng(riga.get(3)));
|
||||||
row.put(imp, TAB_IMPORTO);
|
row.put(imp.string("###.###.###.###"), TAB_IMPORTO);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
|
totale += imp;
|
||||||
imp.strip(".");
|
|
||||||
real importo(imp);
|
|
||||||
totale += importo;
|
|
||||||
|
|
||||||
const char* r;
|
const char* r;
|
||||||
while ((r = dencom.get()) != NULL)
|
while ((r = dencom.get()) != NULL)
|
||||||
@ -260,7 +307,7 @@ void TStampa_deleghe_IVA::print_distinta()
|
|||||||
|
|
||||||
row.reset();
|
row.reset();
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
row.put("@BTotale versamenti :", TAB_SEDE);
|
row.put("@bTotale versamenti :", TAB_SEDE);
|
||||||
row.put(totale.string("###.###.###.###"), TAB_IMPORTO);
|
row.put(totale.string("###.###.###.###"), TAB_IMPORTO);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
|
|
||||||
@ -274,33 +321,39 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
|
|
||||||
TForm f(_profilo);
|
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++)
|
for (int i = 0; ok && i < _ditte->items(); i++)
|
||||||
if (_ditte->checked(i))
|
if (_ditte->checked(i))
|
||||||
{
|
{
|
||||||
const TString16 d(_ditte->row(i).get(1));
|
const long d = _ditte->row(i).get_long(1);
|
||||||
|
chiave.format("%05ld%04d%02d%d", d, _anno, _mese, _tipo);
|
||||||
TRectype& delega = f.cursor()->curr();
|
|
||||||
|
|
||||||
TString16 chiave;
|
|
||||||
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
|
||||||
delega.put("CODTAB", chiave);
|
delega.put("CODTAB", chiave);
|
||||||
|
|
||||||
f.cursor()->file().read();
|
cur.read(); // Posiziona il cursore
|
||||||
const bool cera = atoi(delega.get("S7")) != 0;
|
const bool cera = delega.get_int("S7") != 0;
|
||||||
if (!cera)
|
if (!cera)
|
||||||
{
|
{
|
||||||
delega.put("S7", _azienda);
|
delega.put("S7", _azienda);
|
||||||
delega.put("S8", _dipendenza);
|
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
|
ok = f.print(-1); // Stampa solo il record corrente
|
||||||
if (!ok) break;
|
if (!ok) break;
|
||||||
|
|
||||||
bool scrivi = _aggiorna_codici && !cera;
|
bool scrivi = _aggiorna_codici && !cera;
|
||||||
|
|
||||||
if (!_stampa_prova)
|
if (_definitiva)
|
||||||
{
|
{
|
||||||
delega.put("B0", "X"); // Stampato
|
delega.put("B0", "X"); // Stampato
|
||||||
scrivi = TRUE;
|
scrivi = TRUE;
|
||||||
@ -312,7 +365,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
scrivi = TRUE;
|
scrivi = TRUE;
|
||||||
}
|
}
|
||||||
if (scrivi)
|
if (scrivi)
|
||||||
f.cursor()->file().rewrite();
|
delega.rewrite();
|
||||||
}
|
}
|
||||||
printer().close();
|
printer().close();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ END
|
|||||||
NUMBER F_CONCESSIONE 3
|
NUMBER F_CONCESSIONE 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 "Concessione "
|
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
|
USE %UCC
|
||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
INPUT CODTAB F_CONCESSIONE
|
INPUT CODTAB F_CONCESSIONE
|
||||||
@ -81,7 +81,7 @@ BEGIN
|
|||||||
PROMPT 2 7 "Codice ABI "
|
PROMPT 2 7 "Codice ABI "
|
||||||
HELP "Codice ABI della banca per la presentazione della delega"
|
HELP "Codice ABI della banca per la presentazione della delega"
|
||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
COPY USE F_SOLO_ABI
|
USE %BAN SELECT CODTAB[6,10]?="?????"
|
||||||
INPUT CODTAB[1,5] F_ABI
|
INPUT CODTAB[1,5] F_ABI
|
||||||
INPUT CODTAB[6,10] F_CAB
|
INPUT CODTAB[6,10] F_CAB
|
||||||
COPY DISPLAY F_SOLO_ABI
|
COPY DISPLAY F_SOLO_ABI
|
||||||
@ -98,12 +98,13 @@ BEGIN
|
|||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
COPY ALL F_ABI
|
COPY ALL F_ABI
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
|
WARNING "E' richiesto un codice CAB valido"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESC_BAN 50
|
STRING F_DESC_BAN 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 8 "Denominazione "
|
PROMPT 2 8 "Denominazione "
|
||||||
COPY USE F_DESC_SOLO_BAN
|
USE %BAN KEY 2 SELECT CODTAB[6,10]?="?????"
|
||||||
INPUT S0 F_DESC_BAN
|
INPUT S0 F_DESC_BAN
|
||||||
COPY DISPLAY F_DESC_SOLO_BAN
|
COPY DISPLAY F_DESC_SOLO_BAN
|
||||||
COPY OUTPUT F_ABI
|
COPY OUTPUT F_ABI
|
||||||
@ -141,9 +142,10 @@ BEGIN
|
|||||||
FLAGS "A"
|
FLAGS "A"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_PROFILO 5
|
STRING F_PROFILO 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 13 "Profilo "
|
PROMPT 2 13 "Profilo "
|
||||||
|
VALIDATE ZEROFILL_FUNC 5
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -167,8 +169,6 @@ END
|
|||||||
BOOLEAN F_CONTOFIS
|
BOOLEAN F_CONTOFIS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 43 13 "Titolari Conto fiscale"
|
PROMPT 43 13 "Titolari Conto fiscale"
|
||||||
MESSAGE FALSE CLEAR,F_PROFILO
|
|
||||||
MESSAGE TRUE ENABLE,F_PROFILO
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_SELECT 9 2
|
BUTTON DLG_SELECT 9 2
|
||||||
|
@ -40,6 +40,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
switch (n)
|
switch (n)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
if (m)
|
||||||
{
|
{
|
||||||
m->set_handler(F_NUMREG, num_handler);
|
m->set_handler(F_NUMREG, num_handler);
|
||||||
m->set_handler(F_CODCAUS, caus_query_handler);
|
m->set_handler(F_CODCAUS, caus_query_handler);
|
||||||
@ -57,6 +58,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
if (m)
|
||||||
{
|
{
|
||||||
m->set_handler(F_DATADOC, doc_handler);
|
m->set_handler(F_DATADOC, doc_handler);
|
||||||
m->set_handler(F_NUMDOC, doc_handler);
|
m->set_handler(F_NUMDOC, doc_handler);
|
||||||
@ -87,6 +89,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
}
|
}
|
||||||
_iva_showed = FALSE;
|
_iva_showed = FALSE;
|
||||||
case 1:
|
case 1:
|
||||||
|
if (m)
|
||||||
{
|
{
|
||||||
m->first_focus(_firstfocus);
|
m->first_focus(_firstfocus);
|
||||||
m->set_handler(F_DATAREG, datareg_handler);
|
m->set_handler(F_DATAREG, datareg_handler);
|
||||||
|
@ -55,6 +55,8 @@
|
|||||||
#define F_IMPOSTE 140
|
#define F_IMPOSTE 140
|
||||||
#define F_VALUTAINTRA 141
|
#define F_VALUTAINTRA 141
|
||||||
#define F_CAMBIOINTRA 142
|
#define F_CAMBIOINTRA 142
|
||||||
|
#define F_STAMPATO 143
|
||||||
|
#define F_REGST 144
|
||||||
#define F_SHEETCG 300
|
#define F_SHEETCG 300
|
||||||
#define F_SHEETIVA 301
|
#define F_SHEETIVA 301
|
||||||
|
|
||||||
|
@ -6,6 +6,18 @@ ENDPAGE
|
|||||||
|
|
||||||
PAGE "OPERAZIONE DI PRIMA NOTA" -1 -1 77 20
|
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
|
NUMBER F_GRUPPOCLIFO 3
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
|
@ -1545,14 +1545,16 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
|
|||||||
// Handler of the F_PROTIVA
|
// Handler of the F_PROTIVA
|
||||||
bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
|
bool ok = TRUE;
|
||||||
if (key == K_ENTER && f.dirty() && f.mask().mode() == MODE_INS)
|
if (key == K_ENTER && f.dirty() && f.mask().mode() == MODE_INS)
|
||||||
{
|
{
|
||||||
const long protiva = atol(f.get());
|
const long protiva = atol(f.get());
|
||||||
const long protocol = app().causale().reg().protocol() + 1;
|
const long protocol = app().causale().reg().protocol() + 1;
|
||||||
if (protiva != protocol)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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)
|
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->zero();
|
||||||
(*_del_ditta) = ditta;
|
(*_del_ditta) = ditta;
|
||||||
(*_del_anno) = _year;
|
(*_del_anno) = _year;
|
||||||
(*_del_mese) = month;
|
(*_del_mese) = month;
|
||||||
(*_del_tipo) = type;
|
(*_del_tipo) = type;
|
||||||
TString ctab = _del->get("CODTAB");
|
TString16 ctab = _del->get("CODTAB");
|
||||||
_del->read();
|
_del->read();
|
||||||
|
|
||||||
bool ok = _del->good();
|
bool ok = _del->good();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user