Correzioni ai libri IVA

git-svn-id: svn://10.65.10.50/trunk@928 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1995-01-27 17:05:35 +00:00
parent 0276359101
commit 93e06dc260
4 changed files with 94 additions and 71 deletions

View File

@ -479,7 +479,7 @@ void CG4400_application::build_ditte_sheet()
_ditte->destroy(); _ditte->destroy();
for (int i = 0; i < _nomiditte.items(); i++) for (int i = 0; i < _nomiditte.items(); i++)
{ {
TToken_string* d = new TToken_string(74); TToken_string* d = new TToken_string(64);
*d = (TToken_string&)_nomiditte[i]; *d = (TToken_string&)_nomiditte[i];
const char vers = d->get_char(2); const char vers = d->get_char(2);
bool selectable = vers == '?'; bool selectable = vers == '?';
@ -622,17 +622,12 @@ void CG4400_application::build_nomiditte()
if (!look_lia()) good = FALSE; if (!look_lia()) good = FALSE;
} }
_n_ditte++; _n_ditte++;
TToken_string* d = new TToken_string(74); TToken_string* d = new TToken_string(64);
// add record
d->add(dt.get("CODDITTA")); d->add(dt.get("CODDITTA"));
d->add(dt.get("RAGSOC")); d->add(dt.get("RAGSOC"));
if (good) if (good) d->add(_tablia->get("S7"));
{
d->add(_tablia->get("S7"));
real c = _tablia->get_real("R0");
d->add(c.string("###.###.###.###"));
}
else d->add("??"); else d->add("??");
_nomiditte.add(d); _nomiditte.add(d);
} }
TApplication::set_firm(__firm); TApplication::set_firm(__firm);
@ -668,7 +663,7 @@ bool CG4400_application::user_create()
_cur = new TCursor(_rel, "", 2); _cur = new TCursor(_rel, "", 2);
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte", _ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte",
"@1|Cod.@5|Ragione Sociale@50|Vers.|Credito inizio anno"); "@1|Cod.@5|Ragione Sociale@50|Vers.");
_n_ditte = 0l; _n_ditte = 0l;
__firm = TApplication::get_firm(); __firm = TApplication::get_firm();
@ -1100,13 +1095,13 @@ int CG4400_application::stampa_prospetto()
rr = r; rr = r;
if (_stampa && _tipo_reg == 2) if (_stampa && _tipo_reg == 2)
//if (_stampa_cred_pre && _mese_credito==0 && _credito > ZERO)
if (_stampa_cred_pre && _mese_credito==0 && _credito.not_empty() )
{ {
//set_row (++rr, "** CREDITO INIZIO ANNO @39g%r", &_credito); if (_stampa_cred_pre && _mese_credito==0 && _credito > ZERO)
set_row (++rr, "** CREDITO INIZIO ANNO @39g%s", (const char*)_credito); {
set_row (++rr, "** CREDITO INIZIO ANNO @39g%r", &_credito);
rr++; rr++;
} }
}
if (_esiste_riga_iva && _stampa) if (_esiste_riga_iva && _stampa)
{ {
@ -1754,10 +1749,10 @@ bool CG4400_application::preprocess_page(int file, int counter)
{ {
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione) _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
TFilename t; TFilename t;
t.temp(); t.temp("reg");
//if (_tipo_stampa == 1)
send_message(_tipo_stampa == 1 ? 'L': 'l', t, m); send_message('L', t, m);
//else send_message('l', t, m);
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
{ {
@ -2028,22 +2023,22 @@ void CG4400_application::aggiorna_reg()
if (Tabreg.read() == NOERR) if (Tabreg.read() == NOERR)
{ {
TDate d = Tabreg.get_date("D3"); TDate d = Tabreg.get_date("D3");
//stampate = ultimast + 1;
if (!_mov_empty) //cioe' se e' stata stampata almeno una pagina if (!_mov_empty) //cioe' se e' stata stampata almeno una pagina
{ {
TDate ultima_data = format("%02d/%02d/%4d", _datareg.last_day(_datareg.month(), _annoes), _datareg.month(), _annoes); TDate ultima_data = format("%02d/%02d/%4d", _datareg.last_day(_datareg.month(), _annoes), _datareg.month(), _annoes);
if (ultima_data > d) if (ultima_data > d)
Tabreg.put("D3", ultima_data); Tabreg.put("D3", ultima_data);
//pag = _pagine_stampate + ultimast;
//Tabreg.put("I1", pag);
} }
else if (_data_a > d) else if (_data_a > d)
Tabreg.put("D3", _data_a); Tabreg.put("D3", _data_a);
Tabreg.put("I1", _pagine_stampate); Tabreg.put("I1", _pagine_stampate);
if (_intesta_liq)
Tabreg.put("I4", (long)_datareg.month());
if (_tipo_reg == 2 && _stampa_cred_pre) if (_tipo_reg == 2 && _stampa_cred_pre)
//if (_mese_credito == 0 && _credito > ZERO) if (_mese_credito == 0 && _credito > ZERO)
if (_mese_credito == 0 && _credito.not_empty())
if (_mov_empty) if (_mov_empty)
Tabreg.put("I8", (long)_fino_a_mese); Tabreg.put("I8", (long)_fino_a_mese);
else Tabreg.put("I8", (long)_datareg.month()); else Tabreg.put("I8", (long)_datareg.month());
@ -2229,9 +2224,9 @@ print_action CG4400_application::postprocess_page (int file, int counter)
_st_liq[_datareg.month()] = TRUE; _st_liq[_datareg.month()] = TRUE;
TFilename t; TFilename t;
t.temp("rg"); t.temp("rg");
if (_tipo_stampa == 1) //if (_tipo_stampa == 1)
send_message('L',t, _datareg.month()); //stampa liquidazione send_message('L',t, _datareg.month());
else send_message('l',t, _datareg.month()); //else send_message('l',t, _datareg.month());
TString80 nomef; TString80 nomef;
nomef = t.path(); nomef << "\\" << t.name(); nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
@ -2391,6 +2386,9 @@ bool CG4400_application::look_lia()
_tablia->put("CODTAB", y); _tablia->put("CODTAB", y);
_tablia->read(); _tablia->read();
const bool ok = _tablia->good(); const bool ok = _tablia->good();
if (ok)
_credito = _tablia->get_real("R0");
else _credito = ZERO;
return ok; return ok;
} }
@ -2407,11 +2405,12 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
{ {
if (_selected[(long)i]) if (_selected[(long)i])
{ {
bool msg = TRUE;
_ditta = _ditte->row(i).get_long(1); _ditta = _ditte->row(i).get_long(1);
_frequiva = _ditte->row(i).get_char(3); _frequiva = _ditte->row(i).get_char(3);
_credito = _ditte->row(i).get(4); //credito iva anno precedente _intesta_liq = FALSE;
bool msg = TRUE;
TApplication::set_firm(_ditta); TApplication::set_firm(_ditta);
look_lia();
ok = compila_reg(m); ok = compila_reg(m);
if (!ok) continue; if (!ok) continue;
if (_tipo_stampa == 2 || _tipo_stampa == 4) if (_tipo_stampa == 2 || _tipo_stampa == 4)
@ -2437,6 +2436,8 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
if (_tipo_stampa == 2 || _tipo_stampa == 4) if (_tipo_stampa == 2 || _tipo_stampa == 4)
{ {
TMask mb("cg4400b"); TMask mb("cg4400b");
mb.set(F_CODDITTA, _ditta);
mb.set(F_RAGSOC, _ditte->row(i).get(2));
mb.set(COD_LIB, _codreg); mb.set(COD_LIB, _codreg);
const char* m = ""; const char* m = "";
m = format("%02d", _stampa_mese); m = format("%02d", _stampa_mese);
@ -2453,7 +2454,6 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
t.temp(); t.temp();
send_message('C',t, _fino_a_mese); send_message('C',t, _fino_a_mese);
} }
print(); print();
if (_tipo_stampa != 3 && _liquidazione) if (_tipo_stampa != 3 && _liquidazione)
@ -2476,18 +2476,18 @@ else //non ci sono movimenti da stampare nel periodo richiesto!
if (_tipo_stampa == 1) if (_tipo_stampa == 1)
a = _data_a.month(); a = _data_a.month();
else a = _fino_a_mese; else a = _fino_a_mese;
if (! printer().isopen())
printer().open();
for (int m = da; m <= a; m++) for (int m = da; m <= a; m++)
{ {
if (! printer().isopen())
printer().open();
if (stampo_liquidazione(m)) if (stampo_liquidazione(m))
{ {
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header
TFilename t; TFilename t;
t.temp("rgp"); t.temp("rgp");
if (_tipo_stampa == 1) //if (_tipo_stampa == 1)
send_message('L',t, m); send_message('L',t, m);
else send_message('l',t, m); //else send_message('l',t, m);
TString80 nomef; TString80 nomef;
nomef = t.path(); nomef << "\\" << t.name(); nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
@ -2498,10 +2498,10 @@ else //non ci sono movimenti da stampare nel periodo richiesto!
_intesta_liq = FALSE; _intesta_liq = FALSE;
} }
} }
}
printer().close(); printer().close();
} }
} }
}
if (_tipo_stampa == 3 && _rif_vid) if (_tipo_stampa == 3 && _rif_vid)
{ {
_intesta_vidi = TRUE; _intesta_vidi = TRUE;
@ -2589,6 +2589,8 @@ else //stampa tutti i registri
if (_tipo_stampa == 2 || _tipo_stampa == 4) if (_tipo_stampa == 2 || _tipo_stampa == 4)
{ {
TMask mb("cg4400b"); TMask mb("cg4400b");
mb.set(F_CODDITTA, _ditta);
mb.set(F_RAGSOC, _ditte->row(i).get(2));
mb.set(COD_LIB, _codreg); mb.set(COD_LIB, _codreg);
const char* m = ""; const char* m = "";
m = format("%02d", _stampa_mese); m = format("%02d", _stampa_mese);
@ -2633,12 +2635,10 @@ else //stampa tutti i registri
if (_tipo_stampa == 1) if (_tipo_stampa == 1)
a = _data_a.month(); a = _data_a.month();
else a = _fino_a_mese; else a = _fino_a_mese;
if (!printer().isopen())
printer().open();
for (int m = da; m <= a; m++) for (int m = da; m <= a; m++)
{ {
if (!printer().isopen())
printer().open();
if (stampo_liquidazione(m)) if (stampo_liquidazione(m))
{ {
//ok = controlla_liquidazione(); //ok = controlla_liquidazione();
@ -2647,9 +2647,9 @@ else //stampa tutti i registri
TFilename t; TFilename t;
t.temp("rgi"); t.temp("rgi");
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
if (_tipo_stampa == 1) //if (_tipo_stampa == 1)
send_message('L',t, m); send_message('L',t, m);
else send_message('l',t, m); //else send_message('l',t, m);
if (fexist(nomef)) if (fexist(nomef))
{ {
_intesta_liq = TRUE; _intesta_liq = TRUE;
@ -2658,10 +2658,10 @@ else //stampa tutti i registri
_intesta_liq = FALSE; _intesta_liq = FALSE;
} }
} }
}
printer().close(); printer().close();
} }
} }
}
if (_tipo_stampa == 3 && _rif_vid) if (_tipo_stampa == 3 && _rif_vid)
{ {
_intesta_vidi = TRUE; _intesta_vidi = TRUE;
@ -2682,19 +2682,19 @@ return TRUE;
void CG4400_application::stampa_liq_mesi_succ() void CG4400_application::stampa_liq_mesi_succ()
{ {
int da = _datareg.month() + 1; int da = _datareg.month() + 1;
if (!printer().isopen())
printer().open();
int a = _data_a.month(); int a = _data_a.month();
for (int m = da; m <= a; m++) for (int m = da; m <= a; m++)
{ {
if (!printer().isopen())
printer().open();
if (stampo_liquidazione(m)) if (stampo_liquidazione(m))
{ {
_datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione) _datareg = format("01/%02d/%4d", m, _annoes); //serve per la preprocess_header (intestazione per la stampa liquidazione)
TFilename t; TFilename t;
t.temp("iva"); t.temp("iva");
if (_tipo_stampa == 1) //if (_tipo_stampa == 1)
send_message('L',t, m); send_message('L',t, m);
else send_message('l',t,m); //else send_message('l',t,m);
TString80 nomef; nomef = t.path(); nomef << "\\" << t.name(); TString80 nomef; nomef = t.path(); nomef << "\\" << t.name();
if (fexist(nomef)) if (fexist(nomef))
{ {
@ -2704,9 +2704,9 @@ void CG4400_application::stampa_liq_mesi_succ()
_intesta_liq = FALSE; _intesta_liq = FALSE;
} }
} }
}
printer().close(); printer().close();
} }
}
void CG4400_application::send_message(char tipo, const TFilename& nome, int mese) void CG4400_application::send_message(char tipo, const TFilename& nome, int mese)
{ {

View File

@ -13,7 +13,11 @@
#include <sheet.h> #include <sheet.h>
#include <config.h> #include <config.h>
#include <prefix.h> #include <prefix.h>
<<<<<<< cg4400.h
#include "conto.h"
=======
#include "conto.h" // CI VOGLIONO LE VIRGOLETTE! CAPITELA! #include "conto.h" // CI VOGLIONO LE VIRGOLETTE! CAPITELA!
>>>>>>> 1.25
#include <nditte.h> #include <nditte.h>
#include <anagr.h> #include <anagr.h>
#include <comuni.h> #include <comuni.h>
@ -53,9 +57,9 @@ class CG4400_application : public TPrintapp
int _fino_a_mese, _tipo_reg, _tipo_stampa, _cod_un_loc; int _fino_a_mese, _tipo_reg, _tipo_stampa, _cod_un_loc;
int _annoes, _r, _stampa_width, _mese_ultima_liq, _mese_credito; int _annoes, _r, _stampa_width, _mese_ultima_liq, _mese_credito;
int _stampa_len, _stampa_mese; int _stampa_len, _stampa_mese;
real _totale_doc; real _totale_doc, _credito;
TString _codreg, _desc_lib, _codatt, _attivita, _tipoatt; TString _codreg, _desc_lib, _codatt, _attivita, _tipoatt;
TString _tipodoc, _descr_doc, _codlib, _codice_vidi, _credito; TString _tipodoc, _descr_doc, _codlib, _codice_vidi;
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis; TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
protected: protected:

View File

@ -1,4 +1,6 @@
#define COD_LIB 123 #define F_CODDITTA 123
#define U_MESE 124 #define F_RAGSOC 124
#define U_PAGINA 125 #define COD_LIB 125
#define U_DATA 126 #define U_MESE 126
#define U_PAGINA 127
#define U_DATA 128

View File

@ -1,39 +1,56 @@
#include "cg4400b.h" #include "cg4400b.h"
PAGE "Stampa registri IVA" -1 -1 54 10 PAGE "Stampa registri IVA" -1 -1 78 14
GROUPBOX DLG_NULL 78 3
BEGIN
PROMPT 1 0 ""
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 3 1 "Ditta "
FLAGS "D"
END
STRING F_RAGSOC 50
BEGIN
PROMPT 17 1 "Ragione "
FLAGS "D"
END
STRING COD_LIB 3 STRING COD_LIB 3
BEGIN BEGIN
PROMPT 2 1 "Codice Libro " PROMPT 3 4 "Codice Libro "
FLAGS "D" FLAGS "D"
END END
LISTBOX U_MESE 10 LISTBOX U_MESE 10
BEGIN BEGIN
PROMPT 2 2 "Stampa mese " PROMPT 3 5 "Stampa mese "
FLAGS "MD" FLAGS "MD"
END END
NUMBER U_PAGINA 4 NUMBER U_PAGINA 4
BEGIN BEGIN
PROMPT 2 3 "Ult.num.pagina stampata libro ditta " PROMPT 3 6 "Ult.num.pagina stampata libro ditta "
FLAGS "R" FLAGS "R"
END END
DATE U_DATA DATE U_DATA
BEGIN BEGIN
PROMPT 2 4 "Ultima data di stampa " PROMPT 3 7 "Ultima data di stampa "
FLAGS "D" FLAGS "D"
END END
BUTTON DLG_OK 9 2 BUTTON DLG_OK 9 2
BEGIN BEGIN
PROMPT -12 7 "" PROMPT -12 -1 ""
END END
BUTTON DLG_CANCEL 9 2 BUTTON DLG_CANCEL 9 2
BEGIN BEGIN
PROMPT -22 7 "" PROMPT -22 -1 ""
END END
ENDPAGE ENDPAGE