Patch level : 12.0 394
Files correlati : cg4.exe Corretto in funzionamento per fatture per cassa Corretta stampa registri per l'ultima registrazione stampata 2 volte in certe condizioni git-svn-id: svn://10.65.10.50/branches/R_10_00@23823 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4674d19582
commit
b956d15022
@ -1184,7 +1184,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
const long nr = _mov->get_long(MOV_NUMREG);
|
const long nr = _mov->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (nr == 29252)
|
if (tipomov == vendita && iva_cass)
|
||||||
int i = 1 ;
|
int i = 1 ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1461,6 +1461,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
|
|
||||||
if (nr == 29252)
|
if (nr == 29252)
|
||||||
int i = 1 ;
|
int i = 1 ;
|
||||||
|
if (iva_cass && tm == vendita)
|
||||||
|
int i = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((soloiva &&
|
if ((soloiva &&
|
||||||
@ -1678,7 +1680,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
|
|
||||||
id.put(RMI_IMPONIBILE, val_imp);
|
id.put(RMI_IMPONIBILE, val_imp);
|
||||||
id.put(RMI_IMPOSTA, val_iva);
|
id.put(RMI_IMPOSTA, val_iva);
|
||||||
if (is_detr_diff == 0) // detraibile
|
if (is_detr_diff == 0 && (tipomov_pag == tm_pagamento || tipomov_pag == tm_pagamento_insoluto)) // detraibile
|
||||||
{
|
{
|
||||||
if (tipomov == vendita)
|
if (tipomov == vendita)
|
||||||
{
|
{
|
||||||
|
@ -136,8 +136,14 @@ const TRectype& TStampa_registri_app::look_comuni (const char* cod)
|
|||||||
void TStampa_registri_app::get_dati_ditta()
|
void TStampa_registri_app::get_dati_ditta()
|
||||||
{
|
{
|
||||||
const TRectype& nditte = cache().get(LF_NDITTE, get_firm());
|
const TRectype& nditte = cache().get(LF_NDITTE, get_firm());
|
||||||
|
|
||||||
_ragsoc = nditte.get(NDT_RAGSOC);
|
_ragsoc = nditte.get(NDT_RAGSOC);
|
||||||
|
|
||||||
|
TToken_string key; key.format("%ld|%s", get_firm(), (const char*) _codatt);
|
||||||
|
const TRectype& ndt_att = cache().get(LF_ATTIV, key);
|
||||||
|
|
||||||
|
_isviaggio = ndt_att.get_bool("REG74TER");
|
||||||
|
|
||||||
const char tipoa = nditte.get_char(NDT_TIPOA);
|
const char tipoa = nditte.get_char(NDT_TIPOA);
|
||||||
const long codanagr = nditte.get_long(NDT_CODANAGR);
|
const long codanagr = nditte.get_long(NDT_CODANAGR);
|
||||||
const TRectype& anag = cache().get(LF_ANAG, format("%c|%ld", tipoa, codanagr));
|
const TRectype& anag = cache().get(LF_ANAG, format("%c|%ld", tipoa, codanagr));
|
||||||
@ -1051,7 +1057,13 @@ int TStampa_registri_app::riga_rmoviva()
|
|||||||
|
|
||||||
_riga_rmi.add_riga(iva);
|
_riga_rmi.add_riga(iva);
|
||||||
|
|
||||||
if (!mov.get_bool(MOV_LIQDIFF) && !(mov.get_bool(MOV_IVAXCASSA) && mov.get_int(MOV_TIPOMOV)>0))
|
const bool splitpay = mov.get_char(MOV_TIPO) == 'C' && is_split_payment(mov);
|
||||||
|
const bool liqdiff = !splitpay && mov.get_bool(MOV_LIQDIFF) && is_IVA_diff(mov);
|
||||||
|
const tipo_movimento tm = (tipo_movimento) mov.get_int(MOV_TIPOMOV);
|
||||||
|
const bool IVAxcassa = !splitpay && !liqdiff && !_isviaggio && tm > tm_nessuno && is_IVAxCassa(mov);
|
||||||
|
const bool indetr = iva.get_int(RMI_TIPODET) != 0;
|
||||||
|
|
||||||
|
if (!IVAxcassa && !indetr)
|
||||||
_riga_prospettoXcassa.add_riga(impo, impos, codiva);
|
_riga_prospettoXcassa.add_riga(impo, impos, codiva);
|
||||||
|
|
||||||
if (is_split_payment(mov))
|
if (is_split_payment(mov))
|
||||||
@ -1165,7 +1177,7 @@ messaggio TStampa_registri_app::controlla_liquidazione()
|
|||||||
{
|
{
|
||||||
chiave.format("%04d%02d", _annoes, i);
|
chiave.format("%04d%02d", _annoes, i);
|
||||||
lim.put("CODTAB", chiave);
|
lim.put("CODTAB", chiave);
|
||||||
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
if (lim.read() != NOERR || lim.get_bool("B0"))
|
||||||
{
|
{
|
||||||
if (lim.get_bool("B1"))
|
if (lim.get_bool("B1"))
|
||||||
mesi_cal ="";
|
mesi_cal ="";
|
||||||
@ -1180,9 +1192,9 @@ messaggio TStampa_registri_app::controlla_liquidazione()
|
|||||||
{
|
{
|
||||||
chiave.format("%04d%02d", _annoes, i);
|
chiave.format("%04d%02d", _annoes, i);
|
||||||
lim.put("CODTAB", chiave);
|
lim.put("CODTAB", chiave);
|
||||||
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
if (lim.read() != NOERR || lim.get_bool("B0"))
|
||||||
{
|
{
|
||||||
if (!lim.get_bool("B1"))
|
if (lim.get_bool("B1")) // qui
|
||||||
mesi_cal ="";
|
mesi_cal ="";
|
||||||
else
|
else
|
||||||
mesi_cal << itom(i) << '\n';
|
mesi_cal << itom(i) << '\n';
|
||||||
@ -1225,7 +1237,7 @@ messaggio TStampa_registri_app::controlla_liquidazione()
|
|||||||
{
|
{
|
||||||
chiave.format("%04d%02d", _annoes, m);
|
chiave.format("%04d%02d", _annoes, m);
|
||||||
lim.put("CODTAB", chiave);
|
lim.put("CODTAB", chiave);
|
||||||
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
if (lim.read() != NOERR || lim.get_bool("B0"))
|
||||||
need_refresh |= !lim.get_bool("B1");
|
need_refresh |= !lim.get_bool("B1");
|
||||||
}
|
}
|
||||||
if (need_refresh)
|
if (need_refresh)
|
||||||
@ -1533,8 +1545,6 @@ int TStampa_registri_app::stampa_acquisti(int row)
|
|||||||
|
|
||||||
void TStampa_registri_app::set_page_tot_reg()
|
void TStampa_registri_app::set_page_tot_reg()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int rr = 1;
|
int rr = 1;
|
||||||
bool printed = false;
|
bool printed = false;
|
||||||
|
|
||||||
@ -1542,8 +1552,8 @@ void TStampa_registri_app::set_page_tot_reg()
|
|||||||
//la riga di riporto
|
//la riga di riporto
|
||||||
_totali_stampati = true; //siamo in stampa totali, quindi...
|
_totali_stampati = true; //siamo in stampa totali, quindi...
|
||||||
_riporti = false; //inoltre non deve stapare riporti mentre stampa i totali
|
_riporti = false; //inoltre non deve stapare riporti mentre stampa i totali
|
||||||
|
|
||||||
_totdoc_prog = _totimpn_prog = _totimps_prog = ZERO;
|
_totdoc_prog = _totimpn_prog = _totimps_prog = ZERO;
|
||||||
|
reset_print();
|
||||||
|
|
||||||
if (_esiste_riga_iva && _stampa)
|
if (_esiste_riga_iva && _stampa)
|
||||||
{
|
{
|
||||||
@ -1629,7 +1639,8 @@ void TStampa_registri_app::set_page_tot_reg()
|
|||||||
}
|
}
|
||||||
} // for
|
} // for
|
||||||
}
|
}
|
||||||
|
if (printed)
|
||||||
|
flush();
|
||||||
if (_stampa_plafonds)
|
if (_stampa_plafonds)
|
||||||
stampa_plafonds(rr);
|
stampa_plafonds(rr);
|
||||||
}
|
}
|
||||||
@ -2336,8 +2347,10 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
const bool autof = caus.get_bool(CAU_AUTOFATT);
|
const bool autof = caus.get_bool(CAU_AUTOFATT);
|
||||||
|
|
||||||
const bool splitpay = tipocf == 'C' && is_split_payment(mov.curr());
|
const bool splitpay = tipocf == 'C' && is_split_payment(mov.curr());
|
||||||
const bool liqdiff = !splitpay && mov.get_bool(MOV_LIQDIFF);
|
|
||||||
const bool IVAxcassa= !splitpay && !liqdiff && mov.get_bool(MOV_IVAXCASSA);
|
const bool liqdiff = !splitpay && mov.get_bool(MOV_LIQDIFF) && is_IVA_diff(mov.curr());
|
||||||
|
const tipo_movimento tm = (tipo_movimento)mov.get_int(MOV_TIPOMOV);
|
||||||
|
const bool IVAxcassa= !splitpay && !liqdiff && !_isviaggio && tm > tm_nessuno && is_IVAxCassa(mov.curr());
|
||||||
|
|
||||||
const TString80 descrcau = caus.get(CAU_DESCR);
|
const TString80 descrcau = caus.get(CAU_DESCR);
|
||||||
|
|
||||||
@ -2459,7 +2472,7 @@ bool TStampa_registri_app::preprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mov.get_bool(MOV_IVAXCASSA) && mov.get_int(MOV_TIPOMOV) <= 0)
|
if (IVAxcassa && mov.get_int(MOV_TIPOMOV) <= 0)
|
||||||
{
|
{
|
||||||
set_row(_r+1, FR(" @b*** IVA PER CASSA SENZA SALDACONTO@r"));
|
set_row(_r+1, FR(" @b*** IVA PER CASSA SENZA SALDACONTO@r"));
|
||||||
riga = _r+2;
|
riga = _r+2;
|
||||||
@ -2746,7 +2759,7 @@ print_action TStampa_registri_app::postprocess_page (int file, int counter)
|
|||||||
if (_tipo_stampa != prova)
|
if (_tipo_stampa != prova)
|
||||||
calcola_progressivi();
|
calcola_progressivi();
|
||||||
set_page_tot_reg();
|
set_page_tot_reg();
|
||||||
return REPEAT_PAGE;
|
return NEXT_PAGE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2762,7 +2775,7 @@ print_action TStampa_registri_app::postprocess_page (int file, int counter)
|
|||||||
if (_tipo_stampa != prova)
|
if (_tipo_stampa != prova)
|
||||||
calcola_progressivi();
|
calcola_progressivi();
|
||||||
set_page_tot_reg();
|
set_page_tot_reg();
|
||||||
return REPEAT_PAGE;
|
return NEXT_PAGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3784,6 +3797,7 @@ bool TStampa_registri_app::stampa_registri_IVA(const TMask& m)
|
|||||||
_frequiva = riga->get_char(3);
|
_frequiva = riga->get_char(3);
|
||||||
_intesta_liq = false;
|
_intesta_liq = false;
|
||||||
_intesta_vidi = false;
|
_intesta_vidi = false;
|
||||||
|
_stampa = true;
|
||||||
_primast = _u_stampata;
|
_primast = _u_stampata;
|
||||||
_ok_vidi = false;
|
_ok_vidi = false;
|
||||||
_stampa_mese = 13;
|
_stampa_mese = 13;
|
||||||
@ -3861,6 +3875,7 @@ bool TStampa_registri_app::stampa_registri_IVA(const TMask& m)
|
|||||||
bool one_printed = false; // Flag per vedere se ha stampato almeno un registro (solo per rif. al libro giornale)
|
bool one_printed = false; // Flag per vedere se ha stampato almeno un registro (solo per rif. al libro giornale)
|
||||||
for (_tabreg->first(); !_tabreg->eof(); _tabreg->next())
|
for (_tabreg->first(); !_tabreg->eof(); _tabreg->next())
|
||||||
{
|
{
|
||||||
|
_stampa = true;
|
||||||
_tipo_reg = (tiporeg)_tabreg->get_int("I0");
|
_tipo_reg = (tiporeg)_tabreg->get_int("I0");
|
||||||
const TString16 codtab = _tabreg->get("CODTAB");
|
const TString16 codtab = _tabreg->get("CODTAB");
|
||||||
const int anno = atoi(codtab.left(4));
|
const int anno = atoi(codtab.left(4));
|
||||||
|
@ -68,6 +68,7 @@ class TStampa_registri_app : public TPrintapp
|
|||||||
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
|
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
|
||||||
TString _tabname;
|
TString _tabname;
|
||||||
TFilename _t;
|
TFilename _t;
|
||||||
|
bool _isviaggio;
|
||||||
|
|
||||||
messaggio _scelta;
|
messaggio _scelta;
|
||||||
tipo_stampa _tipo_stampa;
|
tipo_stampa _tipo_stampa;
|
||||||
|
@ -214,9 +214,10 @@ bool is_IVAxCassa(const TRectype& mov)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const TDate data_reg = mov.get(MOV_DATAREG);
|
const TDate data_reg = mov.get(MOV_DATAREG);
|
||||||
const TDate data_doc = mov.get(MOV_DATADOC);
|
// const TDate data_doc = mov.get(MOV_DATADOC);
|
||||||
const TDate data_rif = data_doc.ok() && data_doc < data_reg ? data_doc : data_reg;
|
// const TDate data_rif = data_doc.ok() && data_doc < data_reg ? data_doc : data_reg;
|
||||||
if (!gestione_IVAxCassa(data_rif))
|
// if (!gestione_IVAxCassa(data_rif))
|
||||||
|
if (!gestione_IVAxCassa(data_reg))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const TRectype& clifo = cache().get_rec(LF_CLIFO, mov.get(MOV_TIPO), mov.get(MOV_CODCF));
|
const TRectype& clifo = cache().get_rec(LF_CLIFO, mov.get(MOV_TIPO), mov.get(MOV_CODCF));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user