Correzioni a mastrini registri liquidazione e progressivi IVA
git-svn-id: svn://10.65.10.50/trunk@1252 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4090498c78
commit
b8c361eaca
@ -45,6 +45,7 @@ class TMastrini_application : public TPrintapp
|
||||
TLocalisamfile* _clifo;
|
||||
TLocalisamfile* _caus;
|
||||
TSaldo* _sld;
|
||||
TParagraph_string* _d18,* _d23,* _d30;
|
||||
|
||||
TDate _data_ini,_data_fine,_data_finese,_data_finesesucc,_ultima_data_reg;
|
||||
TDate _datareg,_datadoc,_data_inizioese,_datareg_stampa,_inizioes;
|
||||
@ -787,6 +788,8 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
|
||||
case LF_RMOV:
|
||||
{
|
||||
//int rw = 1;
|
||||
|
||||
// Ricerca la contropartita di quel movimento
|
||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||
|
||||
@ -874,32 +877,44 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
if (_descrizione != "")
|
||||
{
|
||||
*_d23 = (const char*) _descrizione;
|
||||
if (_descrizionemov != "")
|
||||
{
|
||||
set_row (1,"@42g%.18s", (const char*) _descrizionemov);
|
||||
set_row (1,"@61g%.23s", (const char*) _descrizione);
|
||||
*_d18 = (const char*) _descrizionemov;
|
||||
set_row(1, "@42g#a", _d18);
|
||||
set_row(1, "@61g#a", _d23);
|
||||
}
|
||||
else if (_descrizionemov == "")
|
||||
{
|
||||
set_row (1,"@42g%.18s", (const char*) _descrcaus);
|
||||
set_row (1,"@61g%.23s", (const char*) _descrizione);
|
||||
*_d18 = (const char*) _descrcaus;
|
||||
set_row(1, "@42g#a", _d18);
|
||||
set_row(1, "@61g#a", _d23);
|
||||
}
|
||||
}
|
||||
else if (_descrizione == "")
|
||||
if (_descrizionemov != "")
|
||||
{
|
||||
set_row (1,"@42g%.18s", (const char*) _descrcaus);
|
||||
set_row (1,"@61g%.23s", (const char*) _descrizionemov);
|
||||
*_d23 = (const char*) _descrizionemov;
|
||||
*_d18 = (const char*) _descrcaus;
|
||||
set_row (1,"@42g#a", _d18);
|
||||
set_row (1,"@61g#a", _d23);
|
||||
}
|
||||
else
|
||||
if (_descrizionemov == "")
|
||||
{
|
||||
conto(_gruppocontr,_contocontr,FALSE);
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
TString descr_contr = tc.descrizione();
|
||||
set_row (1,"@42g%.18s", (const char*) _descrcaus);
|
||||
TString80 descr_contr = tc.descrizione();
|
||||
//set_row (1,"@42g%.18s", (const char*) _descrcaus);
|
||||
//if (descr_contr != "Sconosciuto")
|
||||
// set_row (1,"@61g%.23s", (const char*) descr_contr);
|
||||
*_d18 = (const char*) _descrcaus;
|
||||
set_row (1,"@42g#a", _d18);
|
||||
if (descr_contr != "Sconosciuto")
|
||||
set_row (1,"@61g%.23s", (const char*) descr_contr);
|
||||
{
|
||||
*_d23 = (const char*) descr_contr;
|
||||
set_row (1,"@61g#a", _d23);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -907,22 +922,31 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
if (_descrizione != "")
|
||||
{
|
||||
*_d30 = (const char*) _descrizione;
|
||||
if (_descrizionemov != "")
|
||||
{
|
||||
set_row (1,"@46g%.23s", (const char*) _descrizionemov);
|
||||
set_row (1,"@70g%.30s", (const char*) _descrizione);
|
||||
*_d23 = (const char*) _descrizionemov;
|
||||
set_row (1,"@46g#a", _d23);
|
||||
set_row (1,"@70g#a", _d30);
|
||||
}
|
||||
else if (_descrizionemov == "")
|
||||
{
|
||||
set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
set_row (1,"@70g%.30s", (const char*) _descrizione);
|
||||
//set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
//set_row (1,"@70g%.30s", (const char*) _descrizione);
|
||||
*_d23 = (const char*) _descrcaus;
|
||||
set_row(1, "@46g#a", _d23);
|
||||
set_row(1, "@70g#a", _d30);
|
||||
}
|
||||
}
|
||||
else if (_descrizione == "")
|
||||
if (_descrizionemov != "")
|
||||
{
|
||||
set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
set_row (1,"@70g%.30s", (const char*) _descrizionemov);
|
||||
//set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
//set_row (1,"@70g%.30s", (const char*) _descrizionemov);
|
||||
*_d30 = (const char*) _descrizionemov;
|
||||
*_d23 = (const char*) _descrcaus;
|
||||
set_row (1,"@46g#a", _d23);
|
||||
set_row (1,"@70g#a", _d30);
|
||||
}
|
||||
else
|
||||
if (_descrizionemov == "")
|
||||
@ -930,9 +954,16 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
conto(_gruppocontr,_contocontr,FALSE);
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
TString descr_contr = tc.descrizione();
|
||||
set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
//set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
//if (descr_contr != "Sconosciuto")
|
||||
// set_row (1,"@70g%.30s", (const char*) descr_contr);
|
||||
*_d23 = (const char*) _descrcaus;
|
||||
set_row (1,"@46g#a", _d23);
|
||||
if (descr_contr != "Sconosciuto")
|
||||
set_row (1,"@70g%.30s", (const char*) descr_contr);
|
||||
{
|
||||
*_d30 = (const char*) descr_contr;
|
||||
set_row (1,"@70g#a", _d30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2150,10 +2181,10 @@ int TMastrini_application::ricerca_gruppo(int start)
|
||||
else
|
||||
descriz2 = "";
|
||||
|
||||
set_row(3,"@27g%-30s",(const char*) descrizione_gruppo());
|
||||
set_row(3,"@59g%-30s",(const char*) descrizione_conto());
|
||||
set_row(3,"@27g%-.30s",(const char*) descrizione_gruppo());
|
||||
set_row(3,"@59g%-.30s",(const char*) descrizione_conto());
|
||||
|
||||
set_row(3,"@91g%-30s",(const char*) _descr);
|
||||
set_row(3,"@91g%-.41s",(const char*) _descr);
|
||||
set_row(4, "@0gClasse@12g%c", _lettivd);
|
||||
set_row(4, "@14g%-8s",(const char*) _numrivd);
|
||||
if (_numivd != 0)
|
||||
@ -2268,6 +2299,11 @@ bool TMastrini_application::user_create()
|
||||
_tabesc = new TTable (TAB_ESC);
|
||||
_sld = new TSaldo ();
|
||||
|
||||
_d18 = new TParagraph_string ("",18);
|
||||
_d23 = new TParagraph_string ("",23);
|
||||
_d30 = new TParagraph_string ("",30);
|
||||
|
||||
|
||||
_msk = new TMask("cg3200a");
|
||||
_msk->set_handler(F_SOTTOCINI_CONTO, sottoc_handler_ini);
|
||||
_msk->set_handler(F_SOTTOCINI_CLIENTE, sottoc_handler_ini);
|
||||
@ -2306,6 +2342,9 @@ bool TMastrini_application::user_destroy()
|
||||
delete _tabreg;
|
||||
delete _tabesc;
|
||||
delete _sld;
|
||||
delete _d18;
|
||||
delete _d23;
|
||||
delete _d30;
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -24,7 +24,7 @@ inline TLiquidazione_app& app()
|
||||
|
||||
TLiquidazione_app::TLiquidazione_app() :
|
||||
_ditte(NULL), _selected(10000),
|
||||
_year(4), _nomiditte(100), _firm_bookmark(-1)
|
||||
_year(4), _nomiditte(100)
|
||||
{
|
||||
_isprint = _is_interactive = _canprint = TRUE;
|
||||
_isplafond = _printonly = _is_visliq = FALSE;
|
||||
|
106
cg/cg4400.cpp
106
cg/cg4400.cpp
@ -1860,6 +1860,7 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
||||
|
||||
_datareg = mov.get_date(MOV_DATAREG);
|
||||
|
||||
/*
|
||||
if (_tipo_stampa != 3 && _liquidazione)
|
||||
{
|
||||
int da;
|
||||
@ -1891,6 +1892,50 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
||||
_st_liq[m] = TRUE;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (_tipo_stampa != 3 && _liquidazione)
|
||||
{
|
||||
int da;
|
||||
if (_tipo_stampa == 1)
|
||||
da = _data_da.month();
|
||||
else da = 1;
|
||||
int a = _datareg.month();
|
||||
for (int m = da; m < a; m++)
|
||||
{
|
||||
if (!_st_liq[m])
|
||||
if (stampo_liquidazione(m))
|
||||
{
|
||||
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
|
||||
TFilename t;
|
||||
t.temp("reg");
|
||||
if (_scelta == B0_settato || _scelta == prosegui_stampa)
|
||||
{
|
||||
if (_tipo_stampa == 1)
|
||||
send_message('S',t, m);
|
||||
else send_message('s',t, m);
|
||||
}
|
||||
else //_scelta == prosegui_cal_stampa
|
||||
{
|
||||
if (_tipo_stampa == 1)
|
||||
send_message('L', t, m);
|
||||
else send_message('l', t, m);
|
||||
}
|
||||
//TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
|
||||
//if (fexist(nomef))
|
||||
if (fexist(t))
|
||||
{
|
||||
_intesta_liq = TRUE;
|
||||
printer().footerlen(0);
|
||||
merge_export_file(t,FALSE,TRUE);
|
||||
printer().formfeed();
|
||||
_intesta_liq = FALSE;
|
||||
reset_print();
|
||||
}
|
||||
}
|
||||
_st_liq[m] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
_datareg = mov.get_date(MOV_DATAREG);
|
||||
_mov_empty = FALSE;
|
||||
@ -1899,6 +1944,7 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
_auto_intraf = FALSE;
|
||||
printer().formfeed();
|
||||
printer().footerlen(5);
|
||||
}
|
||||
|
||||
_dataregp = _datareg;
|
||||
@ -2144,6 +2190,21 @@ void CG4400_application::scrivi_reg()
|
||||
|
||||
Tabreg.rewrite();
|
||||
}
|
||||
|
||||
if (_tipo_stampa == 3)
|
||||
{
|
||||
TString16 cod = "";
|
||||
TTable lbu ("%LBU");
|
||||
|
||||
cod << _annoes << _codlib;
|
||||
lbu.zero();
|
||||
lbu.put("CODTAB", cod);
|
||||
if (lbu.read() == NOERR)
|
||||
{
|
||||
lbu.put("I0", (long) _fino_a_mese);
|
||||
lbu.rewrite();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CG4400_application::aggiorna_reg(const bool aggiorna_vidi)
|
||||
@ -2361,12 +2422,14 @@ void CG4400_application::liq_b0_settato()
|
||||
if (_tipo_stampa == 1)
|
||||
send_message('S',f, _datareg.month());
|
||||
else send_message('s',f, _datareg.month());
|
||||
TString80 nomef;
|
||||
nomef = f.path(); nomef << "\\" << f.name();
|
||||
if (fexist(nomef))
|
||||
//TString80 nomef;
|
||||
//nomef = f.path(); nomef << "\\" << f.name();
|
||||
//if (fexist(nomef))
|
||||
if (fexist(f))
|
||||
{
|
||||
printer().formfeed();
|
||||
_intesta_liq = TRUE;
|
||||
printer().footerlen(0);
|
||||
merge_export_file(f,FALSE,TRUE);
|
||||
_intesta_liq = FALSE;
|
||||
}
|
||||
@ -2421,6 +2484,7 @@ print_action CG4400_application::postprocess_page (int file, int counter)
|
||||
{
|
||||
printer().formfeed();
|
||||
_intesta_liq = TRUE;
|
||||
printer().footerlen(0);
|
||||
merge_export_file(_t,FALSE,TRUE);
|
||||
_intesta_liq = FALSE;
|
||||
}
|
||||
@ -2507,7 +2571,6 @@ bool CG4400_application::set_print(int n)
|
||||
else _stampa_width = 198;
|
||||
if (_stampa_len != 0)
|
||||
printer().formlen(_stampa_len);
|
||||
else printer().formlen(66);
|
||||
//Se stampa di prova l'utente indica data_da e data_a
|
||||
if (_tipo_stampa == 1)
|
||||
{
|
||||
@ -2667,12 +2730,13 @@ void CG4400_application::no_movimenti()
|
||||
send_message('L', f, m);
|
||||
else send_message('l', f, m);
|
||||
}
|
||||
TString80 nomef;
|
||||
nomef = f.path(); nomef << "\\" << f.name();
|
||||
if (fexist(nomef))
|
||||
//TString80 nomef;
|
||||
//nomef = f.path(); nomef << "\\" << f.name();
|
||||
//if (fexist(nomef))
|
||||
if (fexist(f))
|
||||
{
|
||||
_intesta_liq = TRUE;
|
||||
//if (m > da) printer().formfeed();
|
||||
printer().footerlen(0);
|
||||
merge_export_file(f,FALSE,TRUE);
|
||||
printer().formfeed();
|
||||
_intesta_liq = FALSE;
|
||||
@ -2699,7 +2763,7 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
_primast = _u_stampata;
|
||||
_ok_vidi = FALSE;
|
||||
_stampa_mese = 13;
|
||||
_scelta = controlla_b0();
|
||||
//_scelta = controlla_b0();
|
||||
|
||||
TApplication::set_firm(_ditta);
|
||||
look_lia();
|
||||
@ -2711,14 +2775,17 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
TApplication::set_firm(__firm);
|
||||
return fatal_box("Finire di stampare registri anno precedente");
|
||||
}
|
||||
if (!_stampa_tutti_i_registri)
|
||||
_cur->set_filterfunction(filter_func);
|
||||
if (!_stampa_tutti_i_registri)
|
||||
{
|
||||
_scelta = controlla_b0();
|
||||
_cur->set_filterfunction(filter_func);
|
||||
ok = setta_mask(i);
|
||||
if (!ok) continue;
|
||||
if (_liquidazione)
|
||||
{
|
||||
if (_tipo_stampa == 2 || _tipo_stampa == 4)
|
||||
_size_header = _stampa_ind_ditta ? 8 : 6;
|
||||
else _size_header = 8;
|
||||
clear_stliq();
|
||||
_scelta = controlla_liquidazione();
|
||||
if (_scelta == non_proseguire)
|
||||
@ -2816,6 +2883,9 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
|
||||
if (_liquidazione)
|
||||
{
|
||||
if (_tipo_stampa == 2 || _tipo_stampa == 4)
|
||||
_size_header = _stampa_ind_ditta ? 8 : 6;
|
||||
else _size_header = 8;
|
||||
clear_stliq();
|
||||
_scelta = controlla_liquidazione();
|
||||
if (_scelta == non_proseguire)
|
||||
@ -2848,8 +2918,9 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
||||
}
|
||||
} //for
|
||||
if (msg)
|
||||
message_box("Ditta %ld: Nessun registro soddisfa i parametri indicati", _ditta);
|
||||
}
|
||||
if ( (_tipo_stampa != 3) || (_tipo_stampa == 3 && _fino_a_mese == 1) ) //il messaggio seguente, nel caso di stampa su libro unico,
|
||||
message_box("Ditta %ld: nessun registro soddisfa i parametri indicati", _ditta); //viene gia' dato nell'handler (che scatta pero' se il mese di
|
||||
} //stampa e' diverso da gennaio
|
||||
}
|
||||
}
|
||||
TApplication::set_firm(__firm);
|
||||
@ -2873,11 +2944,13 @@ void CG4400_application::stampa_liq_mesi_succ()
|
||||
if (_tipo_stampa == 1)
|
||||
send_message('S',t, m);
|
||||
else send_message('s',t,m);
|
||||
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
|
||||
if (fexist(nomef))
|
||||
//TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
|
||||
//if (fexist(nomef))
|
||||
if (fexist(t))
|
||||
{
|
||||
_intesta_liq = TRUE;
|
||||
if (m > da) printer().formfeed();
|
||||
printer().footerlen(0);
|
||||
merge_export_file(t,FALSE,TRUE);
|
||||
_intesta_liq = FALSE;
|
||||
}
|
||||
@ -2904,6 +2977,7 @@ void CG4400_application::send_message(char tipo, const TFilename& nome, int mese
|
||||
ss.add(tipo);
|
||||
ss.add(_data_stampa.string());
|
||||
ss.add(nome);
|
||||
ss.add(_size_header);
|
||||
ss.add("x");
|
||||
|
||||
TMessage liq (app, "RCL", ss);
|
||||
@ -3116,7 +3190,7 @@ void CG4400_application::preprocess_header()
|
||||
set_header(r++,riga);
|
||||
set_header(r,"");
|
||||
}
|
||||
else
|
||||
else //non sto stampando la liquidazione
|
||||
{
|
||||
r++;
|
||||
set_header(r, riga);
|
||||
|
Loading…
x
Reference in New Issue
Block a user