Errori corretti

git-svn-id: svn://10.65.10.50/trunk@1590 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1995-07-13 07:51:59 +00:00
parent 79c2bab453
commit 0303a5c42a
6 changed files with 5123 additions and 5128 deletions

View File

@ -1,6 +1,6 @@
//
//Riepilogo Progressivi IVA
//
//********************************
//* Riepilogo Progressivi IVA *
//********************************
#include <applicat.h>
#include <date.h>
#include <lffiles.h>
@ -176,7 +176,7 @@ const char* CG0400_application::desc_attivita(const char* codatt)
const char* CG0400_application::desc_iva(const char* cod)
{
TTable tab_iva("%IVA");
TString codtab(format ("%-4s", cod));
TString codtab(format("%-4s", cod));
tab_iva.zero();
tab_iva.put("CODTAB", codtab);
@ -257,6 +257,7 @@ void CG0400_application::look_pim()
int mese = atoi(codtab.mid(13,2));
TString16 codatt = codtab.mid(4,5);
TString16 codiva = codtab.mid(16,4);
TString16 tipoiva = pim.get("S5");
codiva = codiva.trim();
codatt = codatt.trim();
@ -272,6 +273,9 @@ void CG0400_application::look_pim()
if (codatt != _cod_att) continue;
//Modifica del 12/07/1995
if (tipoiva == "VE") continue; //i codici iva di tipo "VE"
//Fine //non devono essere stampati
while (classify_pim(pim.curr(), imponibile, imposta, tipo))
{
@ -325,9 +329,14 @@ void CG0400_application::cerca_i_pim()
TString16 codatt = codtab.mid(4,5);
int mese = atoi(codtab.mid(13,2));
TString16 codiva = codtab.mid(16,4);
TString16 tipoiva = pim.get("S5");
if (anno != _annoiva) continue;
//Modifica del 12/07/1995
if (tipoiva == "VE") continue;
//Fine
if (_livelloprog == 1) //riepilogo per aliquota
{
codiva = codiva.trim();
@ -728,7 +737,7 @@ void CG0400_application::prospetto_pagina(TGen_array& gen, TIva_array& iva)
/*
set_row(r++, "ALTRI DATI RELATIVI ALLA DICHIARAZIONE@54gImponibile@74gImposta@91gDetrazione");
r++;
*/
*/
r+=2;
st_riga = FALSE;
@ -1004,7 +1013,7 @@ void CG0400_application::preprocess_header()
/*
set_header (soh++, "Riepilogo progressivi IVA del periodo %s %d Cod. Att. %s %s", itom(_mese), _anno, (const char*) _cod_att, (const char*) descr);
set_header (soh++, (const char *) sep);
*/
*/
if (_st_inizio_anno)
{
if (_prima_pagina)

File diff suppressed because it is too large Load Diff

View File

@ -94,35 +94,6 @@ bool CG4400_application::mask_azzera (TMask_field& f, KEY k)
return TRUE;
}
/*
bool CG4400_application::mask_firm_to (TMask_field& f, KEY k)
{
if (k == K_TAB && f.focusdirty())
{
TMask& m = f.mask();
const long from = m.get_long(DA_CODICE);
long to = m.get_long(A_CODICE);
if (from != 0 || to != 0)
{
TBit_array& sel = app()._selected;
if (to == 0) to = 99999;
for (int i = 0; i < app()._ditte->items(); i++)
{
TToken_string& d = app()._ditte->row(i);
const long cod = d.get_long(1);
if (cod >= from && cod <= to)
sel.set(i);
}
// m.reset(DA_CODICE);
// m.reset(A_CODICE);
const long numd = sel.ones();
f.mask().set(F_SELECT, numd);
}
}
return TRUE;
}
*/
bool CG4400_application::mask_tipo_stampa(TMask_field& f, KEY k)
{
TMask& m = f.mask();
@ -801,12 +772,18 @@ void CG4400_application::calcola_progressivi()
impo = cs.get(0);
impos = cs.get(1);
}
TToken_string fatt_rit (pim.get("S1"));
//se in sospensione d'imposta l'imponibile e l'iva li trovo in R11 e R12
if (_sosp_imposta) //in genere non sara' mai un corrispettivo
{
impo = pim.get_real("R11");
impos = pim.get_real("R12");
}
TToken_string fatt_rit (pim.get("S1")); //e' sempre un acquisto
real im (fatt_rit.get(0));
real is (fatt_rit.get(1));
impo += im;
impos += is;
implo += im+is;
implo += im+is; // potrei percio' ignorare l'importo lordo
if (impo != ZERO || impos != ZERO || implo != ZERO)
_tot_iva_array.add_riga(impo,impos,implo,ZERO,ZERO,ZERO,codiva);
if (_tipo_reg == 2) //registro acquisti
@ -849,6 +826,12 @@ void CG4400_application::calcola_progressivi()
impo = cs.get(0);
impos = cs.get(1);
}
//se in sospensione d'imposta l'imponibile e l'iva li trovo in R11 e R12
if (_sosp_imposta)
{
impo = pim.get_real("R11");
impos = pim.get_real("R12");
}
TToken_string fatt_rit (pim.get("S1"));
real im (fatt_rit.get(0));
real is (fatt_rit.get(1));
@ -1401,93 +1384,6 @@ int CG4400_application::stampa_acquisti(int row)
return rw;
}
/*
void CG4400_application::set_page_tot_reg()
{
TString16 codivaprec = "";
int row=0, rr=0;
rr = stampa_prospetto();
//if (_nrec > 0) //numero di records di rmoviva
if (_esiste_riga_iva && _stampa)
{
real tot_imponib, tot_imposta, tot_imponibp, tot_impostap, tot_lordo;
real dep_imponib, dep_imposta, dep_lordo;
tot_imponib = tot_imposta = tot_imponibp = tot_impostap = tot_lordo = ZERO;
dep_imponib = dep_imposta = dep_lordo = ZERO;
_tot_iva_array.sort(compare_rows); //viene ordinato per codice iva
for (int k = 0; k < _tot_iva_array.items(); k++)
{
TRiga& riga = (TRiga&)_tot_iva_array[k];
//row = rr+k;
if (codivaprec == "")
codivaprec = riga._codiva;
if (codivaprec != riga._codiva)
{
set_row(rr, "%3s", (const char*)codivaprec);
TString descr = descr_iva(codivaprec);
set_row(rr, "@5g%s",(const char*)descr);
if (dep_imponib != ZERO)
set_row(rr, "@25g%r", &dep_imponib);
if (dep_imposta != ZERO)
set_row(rr, "@41g%r", &dep_imposta);
if (dep_lordo != ZERO)
set_row(rr, "@61g%r", &dep_lordo);
}
rr++;
codivaprec = riga._codiva;
dep_imponib = dep_imposta = dep_lordo = ZERO;
}
if (riga._tipodoc == "FS")
{
real somma = -(riga._imponibile + riga._imposta);
dep_lordo += somma;
}
else if (riga._tipodoc == "CR" || riga._tipodoc == "RF" || riga._tipodoc == "SC")
{
dep_lordo += riga._imponibile + riga._imposta;
tot_lordo += riga._imponibile + riga._imposta;
}
if (riga._tipodoc != "CR" && riga._tipodoc != "SC" && riga._tipodoc == "RF")
{
dep_imponib += riga._imponibile;
dep_imposta += riga._imposta;
tot_imponib += riga._imponibile;
tot_imposta += riga._imposta;
}
if (k == (_tot_iva_array.items()-1))
{
set_row(rr, "%3s", (const char*)riga._codiva);
TString descr = descr_iva(riga._codiva);
set_row(rr, "@5g%s", (const char*)descr);
if (dep_imponib != ZERO)
set_row(rr, "@25g%r", &dep_imponib);
if (dep_imposta != ZERO)
set_row(rr, "@41g%r", &dep_imposta);
if (dep_lordo != ZERO)
set_row(rr, "@61g%r", &dep_lordo);
}
}
_tot_iva_array.destroy();
rr++;
set_row(++rr, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta);
if (_corrispettivi)
if (tot_lordo != ZERO)
set_row(rr, "@61g%r", &tot_lordo);
if (_tipo_reg == 2) rr = stampa_acquisti(rr);
if (_tipo_reg == 2 && _tipo_stampa != 1)
stampa_plafonds(rr);
}
}
*/
void CG4400_application::set_page_tot_reg()
{
int rr=0;
@ -1830,6 +1726,7 @@ bool CG4400_application::compila_reg(const TMask& m)
_pagine_stampate = _tabreg->get_long("I1");
_numini = _pagine_stampate;
_corrispettivi = _tabreg->get_bool("B0");
_sosp_imposta = _tabreg->get_bool("B1");
_liquidazione = _tabreg->get_bool("B7");
_riep_liq = _tabreg->get_bool("B6");
_stampa_cred_pre = _tabreg->get_bool("B4");
@ -2694,6 +2591,7 @@ void CG4400_application::look_reg()
_liquidazione = _tabreg->get_bool("B7");
_riep_liq = _tabreg->get_bool("B6");
_corrispettivi = _tabreg->get_bool("B0");
_sosp_imposta = _tabreg->get_bool("B1");
_pagine_stampate = _tabreg->get_long("I1");
_numini = _pagine_stampate;
_cod_un_loc = _tabreg->get_int("I7");
@ -3228,11 +3126,23 @@ void CG4400_application::preprocess_header()
r++;
/*
if (!_intesta_vidi)
set_header(r, "Registro IVA: %s %s %s Attivita\' %s %s",
(const char *) _codreg, (const char *) _desc_lib,
(const char *) data, (const char *) _codatt,
(const char *) _attivita);
*/
if (!_intesta_vidi)
{
if (_intesta_liq)
set_header(r, "Registro IVA: %s %s %s", (const char*)_codreg,
(const char*)_desc_lib, (const char*) data);
else set_header(r, "Registro IVA: %s %s %s Attivita\' %s %s",
(const char*) _codreg, (const char*) _desc_lib,
(const char*) data, (const char*) _codatt,
(const char*) _attivita);
}
else
{
set_header(r++, "Registro IVA: %s %s", (const char *) _codreg, (const char *) _desc_lib);

View File

@ -54,6 +54,7 @@ class CG4400_application : public TPrintapp
bool _mov_empty, _stampa_ind_ditta, _stampa_tutti_i_registri, _auto_intraf, _stampa;
bool _corrispettivi, _liquidazione, _riep_liq, _stampa_ind_comp, _esiste_riga_iva, _stampa_cred_pre;
bool _rif_vid, _intesta_vidi, _intesta_liq, _stampa_data_reg, _ok_vidi;
bool _sosp_imposta;
char _frequiva, _tipo_riepilogativo;
TDate _data_da, _data_a, _data_stampa, _dataregp, _dataregs, _datareg;
TDate _u_data;
@ -66,7 +67,7 @@ class CG4400_application : public TPrintapp
TString _codreg, _desc_lib, _codatt, _attivita, _tipoatt;
TString _tipodoc, _descr_doc, _codlib, _codice_vidi;
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
TFilename _t;
TFilename _t, _pippo;
TParagraph_string* _desc27;
messaggio _scelta;

View File

@ -34,7 +34,7 @@ BEGIN
PROMPT 16 2 "Scelta ditte"
END
NUMBER DA_CODICE 6
NUMBER DA_CODICE 5
BEGIN
PROMPT 17 3 "Da codice "
HELP "Codice ditta di inizio selezione"
@ -42,11 +42,11 @@ END
BUTTON BUT_DFR 2 1
BEGIN
PROMPT 34 3 "*"
PROMPT 33 3 "*"
PICTURE 109
END
NUMBER A_CODICE 6
NUMBER A_CODICE 5
BEGIN
PROMPT 17 4 "A codice "
HELP "Codice ditta di fine selezione"
@ -54,14 +54,14 @@ END
BUTTON BUT_DTO 2 1
BEGIN
PROMPT 34 4 "*"
PROMPT 33 4 "*"
PICTURE 109
END
STRING F_SELECT 5
BEGIN
PROMPT 17 5 "Scelte n. "
FLAGS "D"
FLAGS "DR"
END
BUTTON DLG_SELECT 10 2

View File

@ -17,6 +17,7 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
const bool vola = pimr.get_bool("B2");
const bool rimb = pimr.get_bool("B3");
const bool ricl = pimr.get_bool("B4");
TString tipoiva = pimr.get("S5");
@ -31,17 +32,19 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
switch(tocheck)
{
case acq_norm:
found = tipomov == 2 && tipoiva != "NS";
//found = tipomov == 2 && tipoiva != "NS";
found = tipomov == 2;
found &= (tipodet == 0 /* || tipodet == 1 || tipodet == 3 ||
tipodet == 5 || tipodet == 9 */);
if (found)
{
imp = pimr.get_real("R0");
iva = pimr.get_real("R1");
imp = pimr.get_real("R0") - pimr.get_real("R9");
iva = pimr.get_real("R1") - pimr.get_real("R10");
}
break;
case vend_norm:
found = tipomov == 1 /* && corrisp == 1 */ && tipoiva != "NS";
//found = tipomov == 1 /* && corrisp == 1 */ && tipoiva != "NS";
found = tipomov == 1 /* && corrisp == 1 */;
if (found)
{
imp = pimr.get_real("R0");
@ -65,7 +68,8 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
found = !imp.is_zero() || !iva.is_zero();
break;
case bolle_doganali:
if (tipomov == 2 && tipoiva != "NS")
//if (tipomov == 2 && tipoiva != "NS")
if (tipomov == 2)
{
imp = pimr.get_real("R9");
iva = pimr.get_real("R10");
@ -75,6 +79,7 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
case base_ventilazione:
found = (tipomov == 2 && tipodet != 9 && tipocr == 1);
found &= (tipoiva != "NS" && tipoiva != "NI" && tipoiva != "ES");
found &= (ricl ? TRUE : tipodet == 3);
if (found)
{
imp = pimr.get_real("R0");
@ -83,9 +88,13 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
found &= !imp.is_zero() || !iva.is_zero();
break;
case acq_beni_riv:
/*
found = (tipomov == 2 && tipodet != 9 &&
(tipocr == 1 || (tipocr == 5 && tipodet == 3)));
(tipocr == 1 || (tipocr == 5 && tipodet == 3)));
found &= tipoiva != "NS" && tipoiva != "NI" && tipoiva != "ES";
found &= (ricl ? TRUE : tipodet == 3);
*/
found = (tipomov == 2 && (tipocr == 1 || tipocr == 5));
if (found)
{
imp = pimr.get_real("R0");
@ -94,7 +103,7 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
found &= (!imp.is_zero() || !iva.is_zero());
break;
case corr_norm:
found = tipomov == 1 && corrisp == 2 && tipoiva != "NS";
found = tipomov == 1 && corrisp == 2 && tipoiva != "NS";
if (found)
{
imp = pimr.get_real("R0");
@ -111,8 +120,9 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
found = !imp.is_zero() || !iva.is_zero();
break;
case acq_beni_ammort:
found = tipomov == 2 && tipocr == 2 &&
tipodet == 0 && tipoiva != "NS";
//found = tipomov == 2 && tipocr == 2 &&
// tipodet == 0 && tipoiva != "NS";
found = tipomov == 2 && tipocr == 2 && tipodet == 0;
if (found)
{
imp = pimr.get_real("R0");
@ -121,8 +131,9 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
}
break;
case acq_beni_ammort_nd:
found = tipomov == 2 && tipocr ==2 &&
tipodet != 0 && tipoiva != "NS";
//found = tipomov == 2 && tipocr ==2 &&
// tipodet != 0 && tipoiva != "NS";
found = tipomov == 2 && tipocr ==2 && tipodet != 0;
if (found)
{
imp = pimr.get_real("R0");
@ -131,7 +142,8 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
}
break;
case acq_beni_leasing:
found = tipomov == 2 && tipocr == 8 && tipoiva != "NS";
//found = tipomov == 2 && tipocr == 8 && tipoiva != "NS";
found = tipomov == 2 && tipocr == 8;
if (found)
{
imp = pimr.get_real("R0");
@ -140,7 +152,8 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
}
break;
case acq_amm_ultdetr:
found = tipomov == 2 && tipocr == 3 && tipoiva != "NS";
//found = tipomov == 2 && tipocr == 3 && tipoiva != "NS";
found = tipomov == 2 && tipocr == 3;
if (found)
{
imp = pimr.get_real("R0");
@ -176,7 +189,8 @@ bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t)
}
break;
case cess_amm:
found = tipomov == 1 && tipocr == 4 && tipoiva != "NS";
//found = tipomov == 1 && tipocr == 4 && tipoiva != "NS";
found = tipomov == 1 && tipocr == 4;
if (found)
{
imp = pimr.get_real("R0");