Patch level : 10.0 24
Files correlati : cg3.exe Ricompilazione Demo : [ ] Commento : Nuova Tabella per aliquota IVA nella stampa fatture con IVA indetraibile git-svn-id: svn://10.65.10.50/trunk@18261 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4733c51bb0
commit
ee9da14f28
@ -56,6 +56,7 @@ class TLista_fatture : public TPrintapp
|
||||
long _unica_ditta;
|
||||
|
||||
TAssoc_array _intra_items;// Array ordinato (per codice IVA) dei totali per fatture INTRA
|
||||
TAssoc_array _indetr;// Array ordinato (per codice IVA) dei totali per fatture indetraibili
|
||||
long _from_cf, // Estremi selezione clienti/fornitori
|
||||
_to_cf;
|
||||
TString4 _from_reg, // Estremi selezione registri
|
||||
@ -468,7 +469,20 @@ bool TLista_fatture::preprocess_page(int file, int counter)
|
||||
_tot_iva += iva;
|
||||
_tp_imp += imp;
|
||||
_tp_iva += iva;
|
||||
}
|
||||
const int tipomov = tiporeg(mov.get(MOV_REG));
|
||||
if (_tipo == indetraibile && tipomov == 2 && tipodet > 0)
|
||||
{
|
||||
TString4 codiva = rec.get(RMI_CODIVA);
|
||||
_Iva_item * iva_row = (_Iva_item *) _indetr.objptr(codiva);
|
||||
if (iva_row == NULL)
|
||||
{
|
||||
iva_row = new _Iva_item;
|
||||
_indetr.add(codiva, iva_row);
|
||||
}
|
||||
iva_row->impa() += imp;
|
||||
iva_row->ivaa() += iva;
|
||||
}
|
||||
}
|
||||
|
||||
const bool same_reg = numreg == _numregprec;
|
||||
if (same_reg && !new_det && !new_cr) // Se sta stampando un'altra riga di uno stesso documento,
|
||||
@ -531,6 +545,49 @@ print_action TLista_fatture::postprocess_print(int file, int counter)
|
||||
_pr.put(real2string(_tot_iva),112);
|
||||
p.print(_pr);
|
||||
}
|
||||
if (_tipo == indetraibile)
|
||||
{
|
||||
real tot3,tot4;
|
||||
TString16 cod;
|
||||
TString80 des;
|
||||
_Iva_item * xiva; // Scorre gli elementi memorizzati
|
||||
|
||||
_pr.reset();
|
||||
for (int i=0; i<3; i++)
|
||||
p.print(_pr);
|
||||
_pr.put(FR("Cod.@92gACQUISTI INDETRAIBILI"),1);
|
||||
p.print(_pr);
|
||||
_pr.reset();
|
||||
_pr.put(FR("IVA Descrizione@82gImponibile@101gImposta"),1);
|
||||
p.print(_pr);
|
||||
_pr.reset();
|
||||
p.print(_pr);
|
||||
|
||||
for (xiva = (_Iva_item *) _indetr.first_item(); xiva != NULL; xiva = (_Iva_item*)_indetr.succ_item())
|
||||
{
|
||||
real& r3 = xiva->impa();
|
||||
real& r4 = xiva->ivaa();
|
||||
cod = _indetr.get_hashobj()->key();
|
||||
des = cache().get("%IVA", cod).get("S0");
|
||||
_pr.put(cod,1);
|
||||
_pr.put(des,6);
|
||||
if (r3 != ZERO)
|
||||
_pr.put(real2string(r3),77);
|
||||
if (r4 != ZERO)
|
||||
_pr.put(real2string(r4),93);
|
||||
tot3 += r3;
|
||||
tot4 += r4;
|
||||
p.print(_pr);
|
||||
_pr.reset();
|
||||
}
|
||||
p.print(_pr);
|
||||
_pr.put(TR("Totale Generale IVA"),1);
|
||||
if (tot3 != ZERO)
|
||||
_pr.put(real2string(tot3),77);
|
||||
if (tot4 != ZERO)
|
||||
_pr.put(real2string(tot4),93);
|
||||
p.print(_pr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -815,6 +872,8 @@ bool TLista_fatture::set_print(int m)
|
||||
{
|
||||
if (_tipo == intra)
|
||||
_intra_items.destroy(); // Azzera l'array dei totali per fatture intra
|
||||
if (_tipo == indetraibile)
|
||||
_indetr.destroy(); // Azzera l'array dei totali per fatture intra
|
||||
print();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user