Corretti MI2224 e MI2225.
git-svn-id: svn://10.65.10.50/trunk@3956 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6af9bc3cfd
commit
eaae8b57a8
@ -252,17 +252,22 @@ void TProgressivi_iva::azzera_mesi()
|
|||||||
void TProgressivi_iva::look_pim()
|
void TProgressivi_iva::look_pim()
|
||||||
{
|
{
|
||||||
TTable pim("PIM");
|
TTable pim("PIM");
|
||||||
|
TTable reg("REG");
|
||||||
|
TString80 codtab;
|
||||||
|
TString16 codatt,codiva,tipoiva,codreg;
|
||||||
|
|
||||||
for (pim.first(); !pim.eof(); pim.next())
|
for (pim.first(); !pim.eof(); pim.next())
|
||||||
{
|
{
|
||||||
real imponibile, imposta;
|
real imponibile, imposta;
|
||||||
tiporec tipo;
|
tiporec tipo;
|
||||||
|
|
||||||
TString80 codtab = pim.get("CODTAB");
|
codtab = pim.get("CODTAB");
|
||||||
int anno = atoi(codtab.mid(0,4));
|
int anno = atoi(codtab.mid(0,4));
|
||||||
int mese = atoi(codtab.mid(13,2));
|
int mese = atoi(codtab.mid(13,2));
|
||||||
TString16 codatt = codtab.mid(4,5);
|
codreg.format("%d%-3s",anno, (const char*)codtab.mid(10,3));
|
||||||
TString16 codiva = codtab.mid(16,4);
|
codatt = codtab.mid(4,5);
|
||||||
TString16 tipoiva = pim.get("S5");
|
codiva = codtab.mid(16,4);
|
||||||
|
tipoiva = pim.get("S5");
|
||||||
codiva = codiva.trim();
|
codiva = codiva.trim();
|
||||||
codatt = codatt.trim();
|
codatt = codatt.trim();
|
||||||
|
|
||||||
@ -282,6 +287,10 @@ void TProgressivi_iva::look_pim()
|
|||||||
if (tipoiva == "VE") continue; //i codici iva di tipo "VE"
|
if (tipoiva == "VE") continue; //i codici iva di tipo "VE"
|
||||||
//Fine //non devono essere stampati
|
//Fine //non devono essere stampati
|
||||||
|
|
||||||
|
reg.put("CODTAB",codreg);
|
||||||
|
if (reg.read() != NOERR) reg.zero();
|
||||||
|
const bool corrisp = reg.get_bool("B0");
|
||||||
|
|
||||||
while (classify_pim(pim.curr(), imponibile, imposta, tipo, TRUE))
|
while (classify_pim(pim.curr(), imponibile, imposta, tipo, TRUE))
|
||||||
{
|
{
|
||||||
switch(tipo)
|
switch(tipo)
|
||||||
@ -293,6 +302,15 @@ void TProgressivi_iva::look_pim()
|
|||||||
_gen1_array.add_riga(codiva,ZERO,ZERO,imponibile,imposta,ZERO,ZERO);
|
_gen1_array.add_riga(codiva,ZERO,ZERO,imponibile,imposta,ZERO,ZERO);
|
||||||
break;
|
break;
|
||||||
case vend_norm:
|
case vend_norm:
|
||||||
|
if (corrisp)
|
||||||
|
{ // Questo perche' i documenti FS sono registrati col segno
|
||||||
|
// negativo in R0/R1 e col segno positivo in R5/R6,
|
||||||
|
// quindi per avere l'importo vero e' necessario aggiungerli 2 volte
|
||||||
|
const real ifs = pim.get_real("R5") * 2.0;
|
||||||
|
const real vfs = pim.get_real("R6") * 2.0;
|
||||||
|
imponibile += ifs;
|
||||||
|
imposta += vfs;
|
||||||
|
}
|
||||||
if (_mese != 13)
|
if (_mese != 13)
|
||||||
_gen_array.add_riga(codiva,imponibile,imposta,ZERO,ZERO,ZERO,ZERO);
|
_gen_array.add_riga(codiva,imponibile,imposta,ZERO,ZERO,ZERO,ZERO);
|
||||||
if ((_st_inizio_anno && mese == _mese) || _mese == 13) //lo metto in un array a parte
|
if ((_st_inizio_anno && mese == _mese) || _mese == 13) //lo metto in un array a parte
|
||||||
@ -329,17 +347,22 @@ void TProgressivi_iva::look_pim()
|
|||||||
void TProgressivi_iva::cerca_i_pim()
|
void TProgressivi_iva::cerca_i_pim()
|
||||||
{
|
{
|
||||||
TTable pim("PIM");
|
TTable pim("PIM");
|
||||||
|
TTable reg("REG");
|
||||||
|
TString80 codtab;
|
||||||
|
TString16 codatt,codiva,tipoiva,codreg;
|
||||||
|
|
||||||
for (pim.first(); !pim.eof(); pim.next())
|
for (pim.first(); !pim.eof(); pim.next())
|
||||||
{
|
{
|
||||||
real imponibile, imposta, impo, impos;
|
real imponibile, imposta, impo, impos;
|
||||||
tiporec tipo;
|
tiporec tipo;
|
||||||
|
|
||||||
TString80 codtab = pim.get("CODTAB");
|
codtab = pim.get("CODTAB");
|
||||||
int anno = atoi(codtab.mid(0,4));
|
int anno = atoi(codtab.mid(0,4));
|
||||||
TString16 codatt = codtab.mid(4,5);
|
codatt = codtab.mid(4,5);
|
||||||
int mese = atoi(codtab.mid(13,2));
|
int mese = atoi(codtab.mid(13,2));
|
||||||
TString16 codiva = codtab.mid(16,4);
|
codreg.format("%d%-3s",anno, (const char*)codtab.mid(10,3));
|
||||||
TString16 tipoiva = pim.get("S5");
|
codiva = codtab.mid(16,4);
|
||||||
|
tipoiva = pim.get("S5");
|
||||||
|
|
||||||
if (anno != _annoiva) continue;
|
if (anno != _annoiva) continue;
|
||||||
|
|
||||||
@ -361,6 +384,10 @@ void TProgressivi_iva::cerca_i_pim()
|
|||||||
|
|
||||||
impo = impos = ZERO;
|
impo = impos = ZERO;
|
||||||
|
|
||||||
|
reg.put("CODTAB",codreg);
|
||||||
|
if (reg.read() != NOERR) reg.zero();
|
||||||
|
const bool corrisp = reg.get_bool("B0");
|
||||||
|
|
||||||
while (classify_pim(pim.curr(), imponibile, imposta, tipo, FALSE))
|
while (classify_pim(pim.curr(), imponibile, imposta, tipo, FALSE))
|
||||||
{
|
{
|
||||||
switch(tipo)
|
switch(tipo)
|
||||||
@ -377,6 +404,15 @@ void TProgressivi_iva::cerca_i_pim()
|
|||||||
if (_tipoprog == 2) break; //acquisti
|
if (_tipoprog == 2) break; //acquisti
|
||||||
if (_sospmsk == 1) //nella maschera e' stato richiesto
|
if (_sospmsk == 1) //nella maschera e' stato richiesto
|
||||||
{ //vendite in genere
|
{ //vendite in genere
|
||||||
|
if (corrisp)
|
||||||
|
{ // Questo perche' i documenti FS sono registrati col segno
|
||||||
|
// negativo in R0/R1 e col segno positivo in R5/R6,
|
||||||
|
// quindi per avere l'importo vero e' necessario aggiungerli 2 volte
|
||||||
|
const real ifs = pim.get_real("R5") * 2.0;
|
||||||
|
const real vfs = pim.get_real("R6") * 2.0;
|
||||||
|
imponibile += ifs;
|
||||||
|
imposta += vfs;
|
||||||
|
}
|
||||||
impo += imponibile;
|
impo += imponibile;
|
||||||
impos += imposta;
|
impos += imposta;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user