Corretto errore MI3224
git-svn-id: svn://10.65.10.50/trunk@2007 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
252e8cd571
commit
719c55fa1f
@ -432,8 +432,7 @@ void CG3400_application::aggiorna_mov()
|
||||
#ifdef DBG
|
||||
long numreg = _cur->file(LF_MOV).get_long("NUMREG");
|
||||
TString datareg(_cur->file(LF_MOV).get("DATAREG"));
|
||||
|
||||
message_box("Numreg: %ld Datareg: %s", numreg, (const char*)datareg);
|
||||
// message_box("Numreg: %ld Datareg: %s", numreg, (const char*)datareg);
|
||||
#endif
|
||||
const bool gia_stampato = _cur->file(LF_MOV).get_bool(MOV_STAMPATO);
|
||||
if (!gia_stampato)
|
||||
@ -458,7 +457,7 @@ int CG3400_application::set_totali_giorno(const TDate& data, const int righeiva)
|
||||
const int SHIFT = 15;
|
||||
const int STACC = 51 + SHIFT;
|
||||
|
||||
r = righeiva == 0 ? 1 : righeiva;
|
||||
r = righeiva == 0 ? 1 : righeiva + 1;
|
||||
|
||||
// Se e' l'unico totale lo stampo anche se e' zero
|
||||
if (competenza_ec() || (_tot_avere_gg != ZERO || _tot_dare_gg != ZERO))
|
||||
@ -873,19 +872,15 @@ bool CG3400_application::preprocess_print(int file, int counter)
|
||||
void CG3400_application::fill_page(int start_riga, int righe_iva_settate)
|
||||
{
|
||||
TString256 rigas;
|
||||
// char frm[4];
|
||||
int rrr = start_riga;
|
||||
int r_l = printer().rows_left() - 2; // Tolgo le 2 righe del totale
|
||||
int r_l = printer().rows_left() - start_riga - righe_iva_settate;
|
||||
if (r_l < 0)
|
||||
{
|
||||
r_l += printer().formlen() - 8; // Tolgo la testata
|
||||
// Tolgo l'intestazione + la riga con i riporti
|
||||
r_l += printer().formlen() - (printer().headersize() + 1);
|
||||
_forza_ariportare = TRUE;
|
||||
}
|
||||
|
||||
// Tolgo le righe iva che sono state settate ma NON ancora stampate (=> non ancora contate da rows_left())
|
||||
if (_libro_giornale_iva_unico)
|
||||
r_l -= righe_iva_settate;
|
||||
|
||||
// Se sono rimaste righe da riempire
|
||||
if (r_l > 0)
|
||||
{
|
||||
@ -893,24 +888,11 @@ void CG3400_application::fill_page(int start_riga, int righe_iva_settate)
|
||||
rigas.cut(_stampa_width+1);
|
||||
// sprintf(frm, "%%%3ds", _stampa_width);
|
||||
set_row(rrr++, "%s", (const char*) rigas);
|
||||
// rigas = "";
|
||||
// if (--r_l)
|
||||
// {
|
||||
// int j=0;
|
||||
// Calcola una specie di coefficiente angolare
|
||||
// int alfa = _stampa_width / r_l;
|
||||
// for (int i = riga+1; i < r_l; i++, j++)
|
||||
// {
|
||||
// if (j*alfa >= _stampa_width-alfa) break; // non uscire dai margini
|
||||
// rigas.format("@%dg======", j*alfa);
|
||||
// set_row(i, "%s", (const char*)rigas);
|
||||
// }
|
||||
// }
|
||||
int j=0;
|
||||
// Calcola una specie di coefficiente angolare
|
||||
int alfa = (_stampa_width - 6) / r_l;
|
||||
|
||||
for ( ; r_l > 1; r_l--) // Non stampare sulla riga orizzontale!
|
||||
for ( ; r_l >= 1; r_l--) // Non stampare sulla riga orizzontale!
|
||||
{
|
||||
rigas.format("@%dg======", j);
|
||||
set_row(rrr++, rigas);
|
||||
@ -927,7 +909,8 @@ print_action CG3400_application::postprocess_page(int file, int counter)
|
||||
if (counter)
|
||||
{
|
||||
if (_nuovo_mese) {
|
||||
printer().formfeed();
|
||||
if (!_stampa_definitiva) // su bollato ho gia' barrato il foglio fino in fondo
|
||||
printer().formfeed();
|
||||
_nuovo_mese = FALSE;
|
||||
}
|
||||
return NEXT_PAGE;
|
||||
@ -938,7 +921,7 @@ print_action CG3400_application::postprocess_page(int file, int counter)
|
||||
case LF_MOV:
|
||||
|
||||
reset_print();
|
||||
|
||||
righe_iva_settate = 0;
|
||||
if (_libro_giornale_iva_unico)
|
||||
{
|
||||
righe_iva_settate = setta_righe_iva();
|
||||
@ -1067,9 +1050,8 @@ void CG3400_application::set_rows (int file, int counter)
|
||||
// Usati in setta_righe_iva per determinare tipo attivita'
|
||||
_reg = _cur->file(LF_MOV).get(MOV_REG);
|
||||
_anno_iva = _cur->file(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
protiva = _cur->file(LF_MOV).get_long(MOV_PROTIVA);
|
||||
protiva = _cur->file(LF_MOV).get_long(MOV_PROTIVA);
|
||||
caus = _cur->file(LF_MOV).get(MOV_CODCAUS);
|
||||
_occfpi = _cur->file(LF_MOV).get(MOV_OCFPI);
|
||||
_annoEsMov = _cur->file(LF_MOV).get_int(MOV_ANNOES);
|
||||
@ -1196,23 +1178,16 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
||||
switch (file) {
|
||||
|
||||
case LF_MOV:
|
||||
|
||||
_annoEsMov = _anno_iva = 0;
|
||||
_iva_array.destroy();
|
||||
|
||||
*_RecArrivoA = _cur->file(LF_MOV).curr();
|
||||
|
||||
_nprog_mov++;
|
||||
// Il numero di operazione deve ripartire da 0 per ogni movimento
|
||||
_num_rig = 0;
|
||||
|
||||
_data_corr = _cur->file(LF_MOV).get_date(MOV_DATAREG);
|
||||
|
||||
// _ultima_data_mov finisce sul registro come ultima data di stampa
|
||||
if (_data_corr > _ultima_data_mov) _ultima_data_mov = _data_corr;
|
||||
|
||||
_mese_corr = _data_corr.month();
|
||||
|
||||
break;
|
||||
|
||||
case LF_RMOV:
|
||||
@ -1359,20 +1334,19 @@ int CG3400_application::setta_righe_valuta(int riga)
|
||||
{
|
||||
TString16 codvali;
|
||||
real corrval;
|
||||
int r = riga+1;
|
||||
|
||||
int r = riga;
|
||||
corrval = current_cursor()->file(LF_MOV).get_real(MOV_CORRVALUTA);
|
||||
|
||||
if (corrval != ZERO)
|
||||
{
|
||||
codvali = current_cursor()->file(LF_MOV).get(MOV_CODVALI);
|
||||
TString valut(corrval.string("###.###.###.###,@@"));
|
||||
|
||||
r = riga+1;
|
||||
set_row(r,"@56gValuta %3s", (const char*)codvali);
|
||||
if (_stampa_width == 132)
|
||||
set_row(r++,"@89gCorr.in valuta @109g%s", (const char*)valut);
|
||||
set_row(r,"@89gCorr.in valuta @109g%s", (const char*)valut);
|
||||
else
|
||||
set_row(r++,"@119gCorr.in valuta @171g%s", (const char*)valut);
|
||||
set_row(r,"@119gCorr.in valuta @171g%s", (const char*)valut);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -1902,10 +1876,7 @@ bool CG3400_application::init_cursor()
|
||||
_cur->setregion(da, a);
|
||||
_cur->set_filterfunction(filter_func);
|
||||
|
||||
if (_stampa_definitiva)
|
||||
_cur->setfilter("STAMPATO!=\"X\"");
|
||||
else
|
||||
_cur->setfilter("");
|
||||
_cur->setfilter(_stampa_definitiva ? "STAMPATO!=\"X\"" : "");
|
||||
|
||||
(*_cur) = 0L;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user