Patch level : 12.0 1190
Files correlati : cg7.exe cg7700a.rep Commento: Modifice quadri iva 2022
This commit is contained in:
parent
ebacbbfba6
commit
324c587781
@ -68,7 +68,8 @@ class TListaMov_application : public TPrintapp
|
||||
int _ricser;
|
||||
bool _settata_prima_riga, _causale_gia_stampata,_mov_di_sola_iva;
|
||||
int _cur1,_cur2,_cur2b,_cur3,_cur4,_decidi,/*_tipod,*/_controllo_mov_errati;
|
||||
int _numero_riga, _alleg, _tiporegistro, _scelta_stampa, _nr, _n;
|
||||
int _numero_riga, _alleg, _scelta_stampa, _nr, _n;
|
||||
tiporeg _tiporegistro;
|
||||
int _provvis;
|
||||
liste _tipo_lista;
|
||||
word _flags;
|
||||
@ -481,11 +482,11 @@ bool TListaMov_application::filter_func_fatture (const TRelation* rel)
|
||||
|
||||
const int ann_reg = mov.get_int(MOV_ANNOIVA);
|
||||
const TString4 cod_reg = mov.get(MOV_REG);
|
||||
const int tipo_reg = tipo_registro(cod_reg, ann_reg);
|
||||
const tiporeg tipo_reg = cached_registro(cod_reg, ann_reg).tipo_registro();
|
||||
|
||||
// Considera solo iva acquisti o vendite
|
||||
if (tipo_reg != 1 && tipo_reg != 2)
|
||||
return FALSE;
|
||||
if (tipo_reg != vendita && tipo_reg != acquisto)
|
||||
return false;
|
||||
|
||||
if (app()._annoes > 0) //anno esercizio specificato nella maschera
|
||||
{
|
||||
@ -536,8 +537,10 @@ bool TListaMov_application::filter_func (const TRelation * rel)
|
||||
{
|
||||
const TString& cod_reg = mov.get(MOV_REG);
|
||||
const int ann_reg = mov.get_int(MOV_ANNOIVA);
|
||||
const int tipo_reg = tipo_registro(cod_reg, ann_reg);
|
||||
if (tipo_reg == 1 || tipo_reg == 2)
|
||||
const tiporeg tipo_reg = cached_registro(cod_reg, ann_reg).tipo_registro();
|
||||
|
||||
// Considera solo iva acquisti o vendite
|
||||
if (tipo_reg != vendita && tipo_reg != acquisto)
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -626,9 +629,10 @@ void TListaMov_application::stampa_errori_rmov()
|
||||
else set_row(_nr++, FR("@11gCodice C/F non presente in Anagrafica"));
|
||||
if (_registro.not_empty()) //se su mov e' indicato il codice registro
|
||||
{
|
||||
TRegistro rg (_registro, _ae);
|
||||
const int tiporeg = rg.tipo();
|
||||
if ((tiporeg == 1 && t != 'C') || (tiporeg == 2 && t != 'F'))
|
||||
const TRegistro & reg = cached_registro(_registro, _ae);
|
||||
const tiporeg tipo = reg.tipo_registro();
|
||||
|
||||
if ((tipo == vendita && t != 'C') || (tipo == acquisto && t != 'F'))
|
||||
set_row(_nr++, FR("@11gTipo C/F non compatibile con tipo registro"));
|
||||
}
|
||||
}
|
||||
@ -715,14 +719,14 @@ void TListaMov_application::stampa_errori_iva(int* nr, const TRigaiva& riva)
|
||||
const int tipocr = riva._tipocr;
|
||||
|
||||
if (tipodet == 1 || tipodet == 3 || tipodet == 5 || tipodet == 9)
|
||||
if (_tiporegistro != 2)
|
||||
if (_tiporegistro != acquisto)
|
||||
set_row(++(*nr), FR("@11gCodice di indetraibilita' errato"));
|
||||
|
||||
if (_tiporegistro == 1)
|
||||
if (_tiporegistro == vendita)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 4 && tipocr != 9)
|
||||
set_row(++(*nr), FR("@11gTipo costo/ricavo non valido"));
|
||||
|
||||
if (_tiporegistro == 2)
|
||||
if (_tiporegistro == acquisto)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 2 && tipocr != 3 && tipocr != 5 && tipocr != 8 && tipocr != 9)
|
||||
set_row(++(*nr), FR("@11gTipo costo/ricavo non valido"));
|
||||
}
|
||||
@ -782,11 +786,11 @@ void TListaMov_application::set_page(int file, int count)
|
||||
TString16 reg = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||
int anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
char prov = current_cursor()->curr(LF_MOV).get_char(MOV_PROVVIS);
|
||||
int tipo = tipo_registro(reg, anno);
|
||||
|
||||
const tiporeg tipo = cached_registro(reg, anno).tipo_registro();
|
||||
TEsercizi_contabili esc;
|
||||
|
||||
esc.date2esc(data); // qui verificare
|
||||
if ( (tipo == 1) || (tipo == 2) )
|
||||
if ( (tipo == vendita) || (tipo == acquisto) )
|
||||
{
|
||||
set_row (_n, FR("@103greg @3s"),FLD(LF_MOV,MOV_REG));
|
||||
set_row (_n, FR("@111gpr @5n"),FLD(LF_MOV,MOV_PROTIVA));
|
||||
@ -860,7 +864,8 @@ bool TListaMov_application::preprocess_page(int file,int counter)
|
||||
_codcf = curmov.get_long(MOV_CODCF);
|
||||
_numero = curmov.get_long(MOV_NUMREG);
|
||||
_codval = curmov.get(MOV_CODVALI);
|
||||
_tiporegistro = tipo_registro(_registro, _anno);
|
||||
_tiporegistro = cached_registro(_registro, _anno).tipo_registro();
|
||||
|
||||
|
||||
_causale_gia_stampata = FALSE;
|
||||
TEsercizi_contabili esc;
|
||||
@ -987,11 +992,9 @@ bool TListaMov_application::preprocess_page(int file,int counter)
|
||||
_descr_causale = caus.get(CAU_DESCR);
|
||||
_alleg_causale = caus.get_bool(CAU_ALLEG);
|
||||
_tipodocumento = caus.get(CAU_TIPODOC);
|
||||
|
||||
_tiporegistro = tipo_registro (_registro, _anno);
|
||||
|
||||
if ((_tiporegistro != 1)&&(_tiporegistro != 2))//se si tratta di un movimento di sola prima nota
|
||||
return TRUE;
|
||||
_tiporegistro = cached_registro(_registro, _anno).tipo_registro();
|
||||
if ((_tiporegistro != vendita) && (_tiporegistro != acquisto))//se si tratta di un movimento di sola prima nota
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (file == LF_RMOV)
|
||||
@ -1038,10 +1041,10 @@ bool TListaMov_application::preprocess_page(int file,int counter)
|
||||
_numr = curmov.get_long(MOV_NUMREG);
|
||||
_tipo_elenco = curmov.get(MOV_TIPO);
|
||||
_codcf = curmov.get_long(MOV_CODCF);
|
||||
const int tiporeg = tipo_registro (codreg, anno);
|
||||
const TString8 attreg = AttivitaRegistro (codreg, anno);
|
||||
const tiporeg tiporeg = cached_registro(codreg, anno).tipo_registro();
|
||||
const TString8 attreg = cached_registro(codreg, anno).attivita();
|
||||
|
||||
if (tiporeg == 1 || tiporeg == 2)//se si tratta di un movimento iva
|
||||
if (tiporeg == vendita || tiporeg == acquisto)//se si tratta di un movimento iva
|
||||
{
|
||||
_tipoatt = TipoAttivita(attreg, get_firm());
|
||||
_tipo_elenco = curmov.get(MOV_TIPO);
|
||||
@ -1870,18 +1873,18 @@ bool TListaMov_application::segnala_errori_iva()
|
||||
return true;
|
||||
}
|
||||
if (tipodet == 1 || tipodet == 3 || tipodet == 5 || tipodet == 9)
|
||||
if (_tiporegistro != 2)
|
||||
if (_tiporegistro != acquisto)
|
||||
{
|
||||
rmoviva.readat(nrec);
|
||||
return true;
|
||||
}
|
||||
if (_tiporegistro == 1)
|
||||
if (_tiporegistro == vendita)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 4 && tipocr != 9)
|
||||
{
|
||||
rmoviva.readat(nrec);
|
||||
return true;
|
||||
}
|
||||
if (_tiporegistro == 2)
|
||||
if (_tiporegistro == acquisto)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 2 && tipocr != 3 && tipocr != 5 && tipocr != 8 && tipocr != 9)
|
||||
{
|
||||
rmoviva.readat(nrec);
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "cg3.h"
|
||||
#include "cg3300.h"
|
||||
#include "cglib.h"
|
||||
|
||||
#include "cg3300a.h"
|
||||
#include "cg3300b.h"
|
||||
@ -469,18 +470,19 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
{
|
||||
pi.addstatus(1);
|
||||
|
||||
const int tiporeg = reg.get_int("I0");
|
||||
if ((tiporeg != 2) && (tiporeg != 1))
|
||||
const tiporeg tipo = cached_registro(reg).tipo_registro();
|
||||
|
||||
if ((tipo != acquisto) && (tipo != vendita))
|
||||
continue;
|
||||
|
||||
if (tiporeg == 1)
|
||||
if (tiporeg == vendita)
|
||||
{
|
||||
bool sosp = reg.get_bool ("B0");
|
||||
if (sosp) continue;
|
||||
vendite = TRUE;
|
||||
if (cached_registro(reg).sospeso())
|
||||
continue;
|
||||
vendite = true;
|
||||
}
|
||||
else
|
||||
vendite = FALSE;
|
||||
vendite = false;
|
||||
|
||||
tipodoc = cau.get (CAU_TIPODOC);
|
||||
if (corrispettivo (tipodoc))
|
||||
|
@ -84,7 +84,6 @@ class TLista_fatture : public TPrintapp
|
||||
|
||||
protected:
|
||||
long select_firm_range(long from, long to);
|
||||
int tiporeg(const TString& );
|
||||
static bool mix_handler(TMask_field&, KEY);
|
||||
static bool date_handler(TMask_field&, KEY);
|
||||
static bool to_ditt_handler(TMask_field&, KEY);
|
||||
@ -117,12 +116,6 @@ public:
|
||||
|
||||
inline TLista_fatture& app() { return (TLista_fatture&) main_app(); }
|
||||
|
||||
int TLista_fatture::tiporeg(const TString& reg)
|
||||
{
|
||||
TString8 s; s.format("%4d%-3s",_date_from.year(),(const char*)reg);
|
||||
return atoi(cache().get("REG", s, "I0"));
|
||||
}
|
||||
|
||||
bool TLista_fatture::filter_func1(const TRelation *r)
|
||||
{
|
||||
TLista_fatture& a = app();
|
||||
@ -144,8 +137,8 @@ bool TLista_fatture::filter_func1(const TRelation *r)
|
||||
if (riv.get(RMI_TIPODET).blank() || percind.is_zero())
|
||||
return false;
|
||||
|
||||
const int tiporeg = a.tiporeg(rg);
|
||||
if (tiporeg != 2)
|
||||
const tiporeg tipo = cached_registro(rg).tipo_registro();
|
||||
if (tipo != acquisto)
|
||||
return false;
|
||||
}
|
||||
else // Tipo costo/ricavo
|
||||
@ -443,8 +436,9 @@ bool TLista_fatture::preprocess_page(int file, int counter)
|
||||
if (_tipo == intra)
|
||||
{
|
||||
TString4 codiva = rec.get(RMI_CODIVA);
|
||||
const int tipomov = tiporeg(mov.get(MOV_REG));
|
||||
if (tipomov == 2 && tipodet == 9)
|
||||
const tiporeg tipomov = cached_registro(mov.get(MOV_REG)).tipo_registro();
|
||||
|
||||
if (tipomov == acquisto && tipodet == 9)
|
||||
codiva = "~A19"; // Speciale per acquisti indeducibili art. 19
|
||||
const bool is_key = _intra_items.is_key(codiva); // Esiste l'elemento ?
|
||||
// Se si' allora prendi quello, altrimenti prendine uno nuovo
|
||||
@ -469,8 +463,10 @@ 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)
|
||||
|
||||
const tiporeg tipomov = cached_registro(mov.get(MOV_REG)).tipo_registro();
|
||||
|
||||
if (_tipo == indetraibile && tipomov == acquisto && tipodet > 0)
|
||||
{
|
||||
TString4 codiva = rec.get(RMI_CODIVA);
|
||||
_Iva_item * iva_row = (_Iva_item *) _indetr.objptr(codiva);
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <saldi.h>
|
||||
#include <causali.h>
|
||||
|
||||
#include "cglib02.h"
|
||||
#include "cglib.h"
|
||||
|
||||
struct therec
|
||||
{
|
||||
@ -89,7 +89,7 @@ bool CG4100_App::sort_sal()
|
||||
sal.set_anno_es(year);
|
||||
sal.clear_saldi(year);
|
||||
long numreg = 0L;
|
||||
tiposal tsal = normale;
|
||||
tiposal tsal = saldo_normale;
|
||||
char provvis;
|
||||
TDate datareg;
|
||||
|
||||
@ -127,20 +127,11 @@ bool CG4100_App::sort_sal()
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
mov.read();
|
||||
CHECK(mov.good(),"Archivi movimenti e righe inconsistenti");
|
||||
const TString& codcaus = mov.get(MOV_CODCAUS);
|
||||
|
||||
// Tipo saldo normale per default
|
||||
tsal = normale;
|
||||
const TString& codcaus = mov.get(MOV_CODCAUS);
|
||||
const TRectype& causale = cache().get(LF_CAUSALI, codcaus);
|
||||
if (!causale.empty())
|
||||
{
|
||||
const char ac = causale.get_char(CAU_MOVAP);
|
||||
if (ac == 'A')
|
||||
tsal = apertura; else
|
||||
if (ac == 'C')
|
||||
tsal = chiusura;
|
||||
}
|
||||
|
||||
tsal = saldo_normale; // Tipo saldo normale per default
|
||||
if(codcaus.full())
|
||||
tsal = cached_causale(codcaus, year).tipo_saldo();
|
||||
scaricato = mov.get_bool(MOV_SCARCON);
|
||||
provvis = mov.get_char(MOV_PROVVIS);
|
||||
datareg = mov.get_date(MOV_DATAREG);
|
||||
|
@ -208,7 +208,6 @@ bool TLiquidazione_app::user_create()
|
||||
_lam = new TTable("LAM");
|
||||
_pla = new TTable("%PLA");
|
||||
_reg = new TTable("REG");
|
||||
_iva = new TTable("%IVA");
|
||||
_del = new TTable("%DEL");
|
||||
|
||||
_mov = &_cur->file(LF_MOV);
|
||||
@ -225,7 +224,6 @@ bool TLiquidazione_app::user_create()
|
||||
_pum_r = &(_pum->curr());
|
||||
_pam_r = &(_pam->curr());
|
||||
_pom_r = &(_pom->curr());
|
||||
_iva_r = &(_iva->curr());
|
||||
_del_r = &(_del->curr());
|
||||
_lam_r = &(_lam->curr());
|
||||
_pla_r = &(_pla->curr());
|
||||
|
@ -338,7 +338,6 @@ class TLiquidazione_app : public TPrint_application
|
||||
TTable* _pla;
|
||||
TTable* _ppa;
|
||||
TTable* _reg;
|
||||
TTable* _iva;
|
||||
TTable* _del;
|
||||
|
||||
// a reference rectype per file/table
|
||||
@ -346,7 +345,6 @@ class TLiquidazione_app : public TPrint_application
|
||||
TRectype* _rmoviva_r;
|
||||
TRectype* _pcon_1_r;
|
||||
TRectype* _pcon_2_r;
|
||||
TRectype* _iva_r;
|
||||
TRectype* _pim_r;
|
||||
TRectype* _pis_r;
|
||||
TRectype* _prm_r;
|
||||
@ -622,7 +620,7 @@ public:
|
||||
bool look_pla(const char* a, bool create = false);
|
||||
bool look_ppa(int m, const char* a, int t, bool create = false);
|
||||
bool look_del(int month, int type, bool create = false);
|
||||
bool look_iva(const char* cod);
|
||||
// bool look_iva(const char* cod);
|
||||
bool look_reg(const char* reg);
|
||||
const TRectype & get_lia(long ditta = 0l, bool create = false, int anno = 0);
|
||||
const int put_lia(const TRectype & lia, bool re = true);
|
||||
|
@ -554,8 +554,7 @@ bool TLiquidazione_app::look_pla(const char* a, bool create)
|
||||
(*_pla_codatt) = buf;
|
||||
|
||||
const TString16 s = _pla_r->get("CODTAB");
|
||||
const int err = _pla->read();
|
||||
bool ok = err == NOERR;
|
||||
bool ok = _pla->read() == NOERR;
|
||||
if (!ok && create)
|
||||
{
|
||||
_pla->zero();
|
||||
@ -584,6 +583,7 @@ bool TLiquidazione_app::look_reg(const char* reg)
|
||||
return rt;
|
||||
}
|
||||
|
||||
/*
|
||||
bool TLiquidazione_app::look_iva(const char* cod)
|
||||
{
|
||||
bool rt = true;
|
||||
@ -604,6 +604,7 @@ bool TLiquidazione_app::look_iva(const char* cod)
|
||||
|
||||
return rt;
|
||||
}
|
||||
*/
|
||||
|
||||
bool TLiquidazione_app::look_ppa(int month, const char* codatt, int type, bool create)
|
||||
{
|
||||
@ -982,8 +983,10 @@ real TLiquidazione_app::aliquota_agvia()
|
||||
{
|
||||
real r;
|
||||
const TString& codagv = ini_get_string(CONFIG_STUDIO, "cg", "CodAgv");
|
||||
if (codagv.full() && look_iva(codagv)) // Controlla se è vuoto! CM600475
|
||||
r = _iva->get_real("R0");
|
||||
const TCodiceIVA & civa = cached_codIVA(codagv);
|
||||
|
||||
if (civa.ok()) // Controlla se è vuoto! CM600475
|
||||
r = civa.percentuale();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -95,10 +95,13 @@ void TLiquidazione_app::recalc_corrispettivi(int month, const char* codatt)
|
||||
vaf += imponibile;
|
||||
_pam->put("R1", vaf);
|
||||
_pam->rewrite();
|
||||
|
||||
// Aggiorna il totale IVA periodica CD1_1
|
||||
if (month == 13 && look_iva(ci->_codiva))
|
||||
const TCodiceIVA & civa = cached_codIVA(ci->_codiva);
|
||||
|
||||
if (month == 13 && civa.ok())
|
||||
{
|
||||
if (_iva->get("S10").not_empty()) // Solo CD1_1 ha senso coi corrispettivi...
|
||||
if (civa.tipo_comunicazione_attive().full()) // Solo CD1_1 ha senso coi corrispettivi...
|
||||
{
|
||||
_pum->curr().add("R14", imponibile); // CD1_1
|
||||
_pum->rewrite();
|
||||
@ -142,12 +145,11 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
||||
int tipocr = atoi(*_pim_tipocr);
|
||||
int mese = atoi(*_pim_mese);
|
||||
int tipodet = atoi(*_pim_tipodet);
|
||||
look_iva(*_pim_codiva);
|
||||
const TCodiceIVA & civa = cached_codIVA(*_pim_codiva);
|
||||
// base di riparto solo se non esente, non soggetto, non imponibile
|
||||
TString16 tipoiva(_iva->get("S1"));
|
||||
TString16 tipoiva(civa.tipo());
|
||||
TString16 reg = *_pim_codreg;
|
||||
|
||||
|
||||
/*
|
||||
* caso particolare SENSU Vladimiro (1995) #MI3001
|
||||
* questi vengono pero' conteggiati nel totale
|
||||
@ -161,18 +163,15 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
||||
if (tipocr == 1 && (mese == m) &&
|
||||
att == (const char*)(*_pim_codatt))
|
||||
{
|
||||
if (tipoiva != "NS" && tipoiva != "NI" && tipoiva != "ES")
|
||||
if (civa.iva_da_ventilare())
|
||||
{
|
||||
real lurd = _pim->get_real("R0");
|
||||
lurd += _pim->get_real("R1");
|
||||
real perc = _iva->get_real("R0");
|
||||
TString other = _iva->get("S6");
|
||||
if (!other.empty())
|
||||
{
|
||||
// ventila a un altro codice
|
||||
look_iva(other);
|
||||
perc = _iva->get_real("R0");
|
||||
}
|
||||
real perc = civa.percentuale();
|
||||
TString other = civa.iva_a_cui_ventilare();
|
||||
|
||||
if (other.full())
|
||||
perc = cached_codIVA(other).percentuale(); // ventila a un altro codice
|
||||
add_ventilation(perc / CENTO, lurd, *_pim_codiva, other);
|
||||
}
|
||||
}
|
||||
@ -341,9 +340,11 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
||||
_pam->rewrite();
|
||||
|
||||
// Aggiorna il totale IVA periodica CD1_1
|
||||
if (month == 13 && look_iva(vv->_codiva))
|
||||
const TCodiceIVA & civa = cached_codIVA(vv->_codiva);
|
||||
|
||||
if (month == 13 && civa.ok())
|
||||
{
|
||||
if (_iva->get("S10").not_empty()) // Solo CD1_1 ha senso coi corrispettivi
|
||||
if (civa.get("S10").full()) // Solo CD1_1 ha senso coi corrispettivi
|
||||
{
|
||||
_pum->curr().add("R14", imponibile); // CD1_1
|
||||
_pum->rewrite();
|
||||
@ -364,9 +365,10 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
||||
// viene amorosamente messo a quanto il codice IVA prevede
|
||||
if (!was)
|
||||
{
|
||||
look_iva(vv->_codiva);
|
||||
const TCodiceIVA & civa = cached_codIVA((vv->_codiva));
|
||||
|
||||
_pim->put("I1", (long)vendita);
|
||||
if (!_iva->get_bool("B4"))
|
||||
if (!civa.escluso_dal_rimborso())
|
||||
_pim->put("B3", "X");
|
||||
}
|
||||
_pim->rewrite();
|
||||
@ -533,8 +535,8 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||
if (!_pim->get_bool("B3")) continue;
|
||||
|
||||
// Se il tipo di codice e' NS non va considerato nella sommatoria del tot. acquisti
|
||||
look_iva(codiva);
|
||||
const bool non_sogg = _iva->get("S1") == "NS";
|
||||
const TCodiceIVA & civa = cached_codIVA(codiva);
|
||||
const bool non_sogg = civa.iva_non_soggetta();
|
||||
|
||||
if (!is_mens) // Trimestrali
|
||||
{
|
||||
@ -565,7 +567,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts,
|
||||
ca._totale += _pim->get_real("R3");
|
||||
if (!is_key) // se non c'e' lo aggiunge
|
||||
{
|
||||
ca._aliquota = _iva->get_real("R0")/CENTO; // Se e' nuovo setta l'aliquota
|
||||
ca._aliquota = civa.moltiplicatore_percentuale(); // Se e' nuovo setta l'aliquota
|
||||
corr_ann.add(codiva,ca);
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
|
||||
continue;
|
||||
|
||||
look_reg(*_pim_codreg);
|
||||
look_iva(*_pim_codiva);
|
||||
const TCodiceIVA & civa = cached_codIVA(*_pim_codiva);
|
||||
|
||||
int tipocr = atoi(*_pim_tipocr);
|
||||
int tipodet = atoi(*_pim_tipodet);
|
||||
@ -295,7 +295,7 @@ void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
|
||||
real imponibile = _pim->get_real("R0");
|
||||
real imposta = _pim->get_real("R1");
|
||||
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
||||
TString4 tipoiva = _iva->get("S1");
|
||||
TString4 tipoiva = civa.tipo();
|
||||
|
||||
if (_year != *_pim_anno || (month == 13 && mese < 13))
|
||||
continue;
|
||||
@ -564,28 +564,19 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
|
||||
continue;
|
||||
|
||||
TString4 codiva = codtab.mid(16,4); codiva.trim();
|
||||
if (!look_iva(codiva))
|
||||
const TCodiceIVA & civa = cached_codIVA(codiva);
|
||||
|
||||
if (!civa.ok())
|
||||
continue;
|
||||
|
||||
tiporeg tipomov = (tiporeg)_reg->get_int("I0");
|
||||
bool corrisp = _reg->get_bool("B0");
|
||||
const TString4 tipoiva = _iva->get("S1");
|
||||
const TString4 tipoiva = civa.tipo();
|
||||
const TString4 other = tab->get("S4");
|
||||
TToken_string s1(tab->get("S1"), '!'); // Imponibile/iva fatture in ritardo
|
||||
real rit_imp(s1.get(0));
|
||||
real rit_iva(s1.get(1));
|
||||
|
||||
/* Perchè _pim invece di tab ? 17-10-2012
|
||||
diffimp = _pim->get_real("R26");
|
||||
diffiva = _pim->get_real("R27");
|
||||
diffincimp = _pim->get_real("R28");
|
||||
diffinciva = _pim->get_real("R29");
|
||||
|
||||
diffimp_acq = _pim->get_real("R30");
|
||||
diffiva_acq = _pim->get_real("R31");
|
||||
diffincimp_acq = _pim->get_real("R32");
|
||||
diffinciva_acq = _pim->get_real("R33"); */
|
||||
|
||||
diffimp = tab->get_real("R26");
|
||||
diffiva = tab->get_real("R27");
|
||||
diffincimp = tab->get_real("R28");
|
||||
@ -603,10 +594,10 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
|
||||
issosp |= (sosp_imp != nessuna_sospensione); // Setta il flag di presenza registri in sospensione (qualsiasi tipo: sospensione_normale, vol_affari, liquidazione)
|
||||
// ACHTUNG! Corrispettivi da ventileer possono ventilare ad un altro codiva; in tal caso si scrive quello
|
||||
if (corrisp && other.full())
|
||||
{
|
||||
look_iva(other);
|
||||
codiva = other;
|
||||
}
|
||||
|
||||
const TCodiceIVA & civa1 = cached_codIVA(codiva); // codice IVA aggiornato per eventuale ventilazione
|
||||
|
||||
// se e' corrispettivo da ventilare non scrivo un cannolo ripieno visto che e' stato ventilato
|
||||
if (tipomov == vendita && tipoiva == "VE" && !describe_pis)
|
||||
continue;
|
||||
@ -713,7 +704,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
|
||||
ca._totale_vf += tab->get_real(tipoiva == "VE" ? "R2" : "R3");
|
||||
if (!is_key) // se non c'e' lo aggiunge
|
||||
{
|
||||
ca._aliquota = _iva->get_real("R0")/CENTO; // Se e' nuovo setta l'aliquota
|
||||
ca._aliquota = civa.moltiplicatore_percentuale(); // Se e' nuovo setta l'aliquota
|
||||
corr_ann.add(codiva,ca);
|
||||
}
|
||||
// vedi corrispettivi veri e falsi
|
||||
@ -1804,8 +1795,9 @@ void TLiquidazione_app::set_pim(_DescrItem& d)
|
||||
rw++;
|
||||
else
|
||||
{
|
||||
look_iva(d._s1);
|
||||
d._s2 = _iva->get("S0");
|
||||
const TCodiceIVA & civa = cached_codIVA(d._s1);
|
||||
|
||||
d._s2 = civa.get("S0");
|
||||
if (d._s2.len() > 19) d._s2.cut(19);
|
||||
}
|
||||
|
||||
@ -2934,8 +2926,9 @@ void TLiquidazione_app::set_ventila(_DescrItem& d)
|
||||
for(i = 0; i < d._arr.items(); i++)
|
||||
{
|
||||
_vDesc& vd = (_vDesc&)d._arr[i];
|
||||
look_iva(vd._codiva);
|
||||
s0 = _iva->get("S0"); s0.cut(23);
|
||||
const TCodiceIVA & civa = cached_codIVA(vd._codiva);
|
||||
|
||||
s0 = civa.descrizione(); s0.cut(23);
|
||||
|
||||
set_row(row+i,"@8g%5s@17g%-23s@41g%r@68g%r@89g%r",
|
||||
(const char*)vd._codiva,
|
||||
@ -3065,13 +3058,15 @@ void TLiquidazione_app::set_regagr(_DescrItem& d)
|
||||
_DescrItem& di = (_DescrItem&) agr_array[i];
|
||||
if (di._flags != PROGAGR)
|
||||
continue;
|
||||
look_iva(di._s0);
|
||||
des = _iva->get("S0"); des.cut(25);
|
||||
al = _iva->get_real("R0");
|
||||
|
||||
const TCodiceIVA & civa = cached_codIVA(di._s0);
|
||||
|
||||
des = civa.descrizione(); des.cut(25);
|
||||
al = civa.percentuale();
|
||||
set_row(r,"%4s %-25s@48g%s %%", (const char*) di._s0, (const char*) des, al.string("#@,@@"));
|
||||
set_row(r,"@56g%r@75g%4s",&di._r0, (const char*)di._s1);
|
||||
look_iva(di._s1);
|
||||
al = _iva->get_real("R0");
|
||||
const TCodiceIVA & civa1 = cached_codIVA(di._s1);
|
||||
al = civa1.percentuale();
|
||||
set_row(r++,"@92g%s %%@100g%r", al.string("#@,@@"), &di._r1);
|
||||
t1 += di._r0;
|
||||
t2 += di._r1;
|
||||
|
@ -120,7 +120,7 @@ void TQuadro_VE_recordset::load()
|
||||
const int int_tipo_iva11_ven = atoi(tipo_iva11_ven);
|
||||
const bool non_imponibile = (tipo_aliquota == "NI");
|
||||
const bool esente = (tipo_aliquota == "ES");
|
||||
const bool reverse = int_tipo_iva11_ven >= 31 && int_tipo_iva11_ven <= 38;
|
||||
const bool reverse = (int_tipo_iva11_ven >= 31 && int_tipo_iva11_ven <= 39) || (tipo_iva11_ven == "G7A");
|
||||
const bool terremotati = int_tipo_iva11_ven == 25;
|
||||
TToken_string codatt;
|
||||
codatt.add(prefix().get_codditta());
|
||||
@ -172,7 +172,7 @@ void TQuadro_VE_recordset::load()
|
||||
|
||||
if (tipocr == 4)
|
||||
{
|
||||
if (int_tipo_iva11_ven == acq_ind_pass_int || int_tipo_iva11_ven == cess_amm)
|
||||
if (reverse || int_tipo_iva11_ven == acq_ind_pass_int || int_tipo_iva11_ven == cess_amm)
|
||||
add_value("VE40.1", imp);
|
||||
}
|
||||
}
|
||||
|
@ -286,9 +286,9 @@ void TQuadro_VF_recordset::load()
|
||||
}
|
||||
if (non_soggetto)
|
||||
{
|
||||
if (tipo_iva11_acq == "15A" || int_tipo_iva11_acq == 15)
|
||||
if (int_tipo_iva11_acq == 15)
|
||||
{
|
||||
if (tipo_iva11_acq == "15A")
|
||||
if (tipo_iva11_acq == "15B")
|
||||
add_value("VF17.2", imp);
|
||||
add_value("VF17.1", imp);
|
||||
}
|
||||
@ -350,7 +350,7 @@ void TQuadro_VF_recordset::load()
|
||||
key = codiva;
|
||||
tipo_aliquota = cache().get("%IVA", key, "S1");
|
||||
|
||||
if (tipo_aliquota.blank() && datapag <= a_datareg && tipoiva == 2) // Acquists
|
||||
if (tipo_aliquota.blank() && datapag <= a_datareg && tipoiva == 2) // Acquisti
|
||||
{
|
||||
imp211 += imp;
|
||||
if (tipodiff == 2)
|
||||
|
@ -5,7 +5,7 @@
|
||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1" />
|
||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" />
|
||||
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="" hidden="" page_break="" can_break="" pattern="1">
|
||||
<field deactivated="" type="Immagine" hidden="" link="" dynamic_height="" shade_offset="" width="83" codval="" height="72" id="" pattern="1" hide_zero="" text="">
|
||||
<field deactivated="" type="Immagine" hidden="" image_resize_type="" link="" dynamic_height="" shade_offset="" width="83" codval="" height="72" id="" pattern="1" hide_zero="" text="">
|
||||
<source>"cg7700a.png"</source>
|
||||
</field>
|
||||
</section>
|
||||
@ -142,7 +142,7 @@
|
||||
<source>VF22.1</source>
|
||||
</field>
|
||||
<field x="51" y="40" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2301" pattern="1" hide_zero="" text="###.###.###">
|
||||
<source>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#1201+#1301+#1401+#1501+#1601+#1701+#1801+#1901+#2001+#2101-#2201</source>
|
||||
<source>#101+#201+#301+#401+#501+#601+#701+#801+#901+#1001+#1101+#1201+#1301+#1401+#1501+#1601+#1602+#1701+#1801+#1901+#2001+#2101-#2201</source>
|
||||
</field>
|
||||
<field x="65" y="40" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="11" codval="" id="2302" pattern="1" hide_zero="" text="###.###.###">
|
||||
<source>#102+#202+#302+#402+#502+#602+#702+#802+#902+#1002+#1102+#1202+#1302+#1402</source>
|
||||
|
4
src/cg/dir18.xml
Normal file
4
src/cg/dir18.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<FileDesc>
|
||||
<DirInfo Name="$occas" File="18" EOD="4" EOX="4" Des="Clienti occasionali" Com="" Flags="" Len="607" />
|
||||
</FileDesc>
|
39
src/cg/trc18.xml
Normal file
39
src/cg/trc18.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<RecDesc>
|
||||
<TrcInfo TabCode="" Lenght="607" File="18">
|
||||
<Fields NFields="28">
|
||||
<Field0001 Description="Codice progressivo, codice fiscale, o partita IVA" Name="CFPI" Decimals="" Offset="1" Lenght="16" Type="1" />
|
||||
<Field0002 Description="Ragione sociale" Name="RAGSOC" Decimals="" Offset="17" Lenght="50" Type="1" />
|
||||
<Field0003 Description="Indirizzo" Name="INDIR" Decimals="" Offset="67" Lenght="50" Type="1" />
|
||||
<Field0004 Description="Numero civico" Name="CIV" Decimals="" Offset="117" Lenght="6" Type="1" />
|
||||
<Field0005 Description="Codice stato" Name="STATO" Decimals="" Offset="123" Lenght="3" Type="1" />
|
||||
<Field0006 Description="Localit&#E0;" Name="LOCALITA" Decimals="" Offset="126" Lenght="35" Type="1" />
|
||||
<Field0007 Description="Codice comune" Name="COM" Decimals="" Offset="161" Lenght="4" Type="1" />
|
||||
<Field0008 Description="CAP" Name="CAP" Decimals="" Offset="165" Lenght="5" Type="1" />
|
||||
<Field0009 Description="Sesso" Name="SESSO" Decimals="" Offset="170" Lenght="1" Type="1" />
|
||||
<Field0010 Description="Data di nascita" Name="DNASC" Decimals="" Offset="171" Lenght="8" Type="5" />
|
||||
<Field0011 Description="Codice stato di nascita" Name="STATONASC" Decimals="" Offset="179" Lenght="3" Type="1" />
|
||||
<Field0012 Description="Codice comune di nascita" Name="COMNASC" Decimals="" Offset="182" Lenght="4" Type="1" />
|
||||
<Field0013 Description="Codice fiscale" Name="COFI" Decimals="" Offset="186" Lenght="16" Type="1" />
|
||||
<Field0014 Description="Stato CEE" Name="STATOPAIV" Decimals="" Offset="202" Lenght="2" Type="1" />
|
||||
<Field0015 Description="Partita IVA" Name="PAIV" Decimals="" Offset="204" Lenght="12" Type="1" />
|
||||
<Field0016 Description="referente" Name="REFERENTE" Decimals="" Offset="216" Lenght="50" Type="1" />
|
||||
<Field0017 Description="Consenso all'invio documenti per email" Name="BYMAIL" Decimals="" Offset="266" Lenght="1" Type="8" />
|
||||
<Field0018 Description="e-mail" Name="MAIL" Decimals="" Offset="267" Lenght="50" Type="1" />
|
||||
<Field0019 Description="e-mail invio documenti" Name="DOCMAIL" Decimals="" Offset="317" Lenght="50" Type="1" />
|
||||
<Field0020 Description="PEC" Name="PEC" Decimals="" Offset="367" Lenght="80" Type="1" />
|
||||
<Field0021 Description="Prefisso telefono 1" Name="PTEL" Decimals="" Offset="447" Lenght="10" Type="1" />
|
||||
<Field0022 Description="Telefono 1" Name="TEL" Decimals="" Offset="457" Lenght="30" Type="1" />
|
||||
<Field0023 Description="Prefisso telefono 2" Name="PTEL2" Decimals="" Offset="487" Lenght="10" Type="1" />
|
||||
<Field0024 Description="Telefono 2" Name="TEL2" Decimals="" Offset="497" Lenght="30" Type="1" />
|
||||
<Field0025 Description="Prefisso telefono 3" Name="PTEL3" Decimals="" Offset="527" Lenght="10" Type="1" />
|
||||
<Field0026 Description="Telefono 3" Name="TEL3" Decimals="" Offset="537" Lenght="30" Type="1" />
|
||||
<Field0027 Description="Utente" Name="UTENTE" Decimals="" Offset="567" Lenght="32" Type="1" />
|
||||
<Field0028 Description="Data aggiornamento" Name="DATAAGG" Decimals="" Offset="599" Lenght="8" Type="5" />
|
||||
</Fields>
|
||||
<Keys NKeys="2">
|
||||
<Key0001 DuplicateKeys="" Expr="CFPI" />
|
||||
<Key0002 DuplicateKeys="1" Expr="RAGSOC" />
|
||||
</Keys>
|
||||
</TrcInfo>
|
||||
</RecDesc>
|
Loading…
x
Reference in New Issue
Block a user