Prima versione 770 2013

git-svn-id: svn://10.65.10.50/branches/R_10_00@22863 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2013-05-27 12:04:47 +00:00
parent 11da9586be
commit f5f80e6152
7 changed files with 195 additions and 147 deletions

View File

@ -1,7 +1,7 @@
// 770100.cpp - Scheda percipienti // 770100.cpp - Scheda percipienti
#include <tabutil.h>
#include <mailbox.h>
#include <defmask.h> #include <defmask.h>
#include <mailbox.h>
#include <recarray.h>
#include "scperc.h" #include "scperc.h"
#include "rver.h" #include "rver.h"
@ -152,13 +152,14 @@ TMask* TSchedaPercipienti::load_mask(int n)
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
TSheet_field& vers = m->sfield(F_VERSAMENTI); TSheet_field& vers = m->sfield(F_VERSAMENTI);
vers.set_notify(vers_notify); vers.set_notify(vers_notify);
vers.sheet_mask().set_handler(F_VERS_1015, vers1015_handler); TMask& sm = vers.sheet_mask();
vers.sheet_mask().set_handler(DLG_SELPAG, pag_select); sm.set_handler(F_VERS_1015, vers1015_handler);
vers.sheet_mask().set_handler(DLG_AZZERA, ver_azzera); sm.set_handler(DLG_SELPAG, pag_select);
vers.sheet_mask().set_handler(F_TIPOVERS, tipo_hndl); sm.set_handler(DLG_AZZERA, ver_azzera);
vers.sheet_mask().set_handler(F_LUOVERS, luo_hndl); sm.set_handler(F_TIPOVERS, tipo_hndl);
vers.sheet_mask().set_handler(F_ABI, abicab_hndl); sm.set_handler(F_LUOVERS, luo_hndl);
vers.sheet_mask().set_handler(F_CAB, abicab_hndl); sm.set_handler(F_ABI, abicab_hndl);
sm.set_handler(F_CAB, abicab_hndl);
} }
break; break;
default: default:
@ -271,12 +272,12 @@ bool TSchedaPercipienti::codanagr_handler(TMask_field& f, KEY k)
} }
void TSchedaPercipienti::calcola_riga_pag(TRectype & rec, void TSchedaPercipienti::calcola_riga_pag(TRectype & rec,
const real h_PercAssImp, const real h_PercAssImp,
const real h_PercCassaPrev, const real h_PercCassaPrev,
const real h_PercRitenuta, const real h_PercRitenuta,
const real h_PercInps, const real h_PercInps,
const real h_PercAssImpInps, const real h_PercAssImpInps,
const real h_PercCommitInps) const real h_PercCommitInps)
{ {
const int fdec = TCurrency::get_firm_dec(); const int fdec = TCurrency::get_firm_dec();
real compenso = rec.get_real(PAG_COMPENSO); real compenso = rec.get_real(PAG_COMPENSO);
@ -320,7 +321,7 @@ void TSchedaPercipienti::calcola_riga_pag(TRectype & rec,
rec.put(PAG_COMNETTO, comnetto); rec.put(PAG_COMNETTO, comnetto);
} }
void TSchedaPercipienti::agg_pagamenti(const TRectype & sch) void TSchedaPercipienti::agg_pagamenti(const TRectype& sch, const TDate& pag_dal)
{ {
const long numreg = sch.get_long(SCH_NUMREG); const long numreg = sch.get_long(SCH_NUMREG);
@ -344,7 +345,7 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
real spperc = spese / totale; spperc.round(8); real spperc = spese / totale; spperc.round(8);
real ivaperc = iva / totale; ivaperc.round(8); real ivaperc = iva / totale; ivaperc.round(8);
TString16 codcau(sc.lfile().get("CODCAUS")); const TString4 codcau = sc.lfile().get("CODCAUS");
const TRectype cau = cache().get("%CA7", codcau); const TRectype cau = cache().get("%CA7", codcau);
// leggo valori tabella causali per calcolo // leggo valori tabella causali per calcolo
@ -355,8 +356,7 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
const real h_PercAssImpInps = cau.get_real("R2"); const real h_PercAssImpInps = cau.get_real("R2");
const real h_PercCommitInps = cau.get_real("R3"); const real h_PercCommitInps = cau.get_real("R3");
for (TPartita* p = partarr.first(); p != NULL; p =partarr.next())
for (TPartita * p = partarr.first(); p != NULL; p =partarr.next())
{ {
const int row = p->prima_fattura(numreg); const int row = p->prima_fattura(numreg);
@ -377,17 +377,22 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
for (int rowp = ratapart.last(); rowp > 0; rowp = ratapart.pred(rowp)) for (int rowp = ratapart.last(); rowp > 0; rowp = ratapart.pred(rowp))
{ {
const TRectype& pag = ratapart.row(rowp); // Riga pagamento const TRectype& pag = ratapart.row(rowp); // Riga pagamento
const TRiga_partite& sum = p->riga(rowp); // Riga partite
const TRiga_partite& sum = p->riga(rowp); // Riga partite
const TDate sum_datapag = pag.get(PART_DATAPAG);
if (sum_datapag < pag_dal)
continue;
const char sez = sum.sezione(); const char sez = sum.sezione();
TImporto imppag(sez, pag.get_real(PAGSCA_IMPORTO)); TImporto imppag(sez, pag.get_real(PAGSCA_IMPORTO));
const long num = sum.get_long(PART_NREG); const long num = sum.get_long(PART_NREG);
if(lastsch == 0 && numregp[0] == 0L) if (lastsch == 0 && numregp[0] == 0L)
{ {
numregp[lastsch] = num; numregp[lastsch] = num;
tot[lastsch].reset(); tot[lastsch].reset();
} }
if(num != numregp[lastsch]) if (num != numregp[lastsch])
{ {
numregp[++lastsch] = num; numregp[++lastsch] = num;
tot[lastsch].reset(); tot[lastsch].reset();
@ -405,9 +410,9 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
real abb = pag.get_real(PAGSCA_ABBUONI); real abb = pag.get_real(PAGSCA_ABBUONI);
if (!abb.is_zero()) if (!abb.is_zero())
imppag += TImporto(sez, abb); imppag += TImporto(sez, abb);
for (int i = 0; !found &&i < rows; i++) for (int i = 0; !found && i < rows; i++)
{ {
TRectype & pagrec = sc.pag(i); TRectype& pagrec = sc.pag(i);
const long numsch = pagrec.get_long(PAG_NUMREG); const long numsch = pagrec.get_long(PAG_NUMREG);
found = num == numsch; found = num == numsch;
if (numsch == 0L && !found) if (numsch == 0L && !found)
@ -417,7 +422,7 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
data = sum.get_date(PART_DATAREG); data = sum.get_date(PART_DATAREG);
if (!data.ok()) if (!data.ok())
data = sum.get_date(PART_DATAPAG); data = sum.get_date(PART_DATAPAG);
const TDate datasch(pagrec.get(PAG_DATAPAG)); const TDate datasch = pagrec.get(PAG_DATAPAG);
if (data == datasch) if (data == datasch)
{ {
pagrec.put(PAG_NUMREG, num); pagrec.put(PAG_NUMREG, num);
@ -438,7 +443,6 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
ivap = iva; ivap = iva;
real compensop = imppag.valore() - spesep - ivap; real compensop = imppag.valore() - spesep - ivap;
compensop += compensop * h_PercRitenuta; compensop += compensop * h_PercRitenuta;
compensop.round(TCurrency::get_firm_dec()); compensop.round(TCurrency::get_firm_dec());
if (abs(compensop) > abs(compenso)) if (abs(compensop) > abs(compenso))
@ -454,13 +458,13 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
if (!found) if (!found)
{ {
tot[lastsch] += imppag; tot[lastsch] += imppag;
if (!datapag.ok()) if (!datapag.ok())
datapag = sum.get_date(PART_DATADOC); datapag = sum.get_date(PART_DATADOC);
if (!datapag.ok()) if (!datapag.ok())
datapag = sum.get_date(PART_DATAREG); datapag = sum.get_date(PART_DATAREG);
if (!datapag.ok()) if (!datapag.ok())
datapag = sum.get_date(PART_DATAPAG); datapag = sum.get_date(PART_DATAPAG);
} }
} }
for (int j = 0; j < 10 && numregp[j] > 0L; j++) for (int j = 0; j < 10 && numregp[j] > 0L; j++)
{ {
@ -479,32 +483,32 @@ void TSchedaPercipienti::agg_pagamenti(const TRectype & sch)
real spesepag = tot[j].valore() * spperc; real spesepag = tot[j].valore() * spperc;
real ivapag = tot[j].valore() * ivaperc; real ivapag = tot[j].valore() * ivaperc;
spesepag.round(TCurrency::get_firm_dec()); spesepag.round(TCurrency::get_firm_dec());
if (abs(spesepag) > abs(spese)) if (abs(spesepag) > abs(spese))
spesepag = spese; spesepag = spese;
ivapag.round(TCurrency::get_firm_dec()); ivapag.round(TCurrency::get_firm_dec());
if (abs(ivapag) > abs(iva)) if (abs(ivapag) > abs(iva))
ivapag = iva; ivapag = iva;
real compensopag = tot[j].valore() - spesepag - ivapag; real compensopag = tot[j].valore() - spesepag - ivapag;
compensopag += compensopag * h_PercRitenuta; compensopag += compensopag * h_PercRitenuta;
compensopag.round(TCurrency::get_firm_dec()); compensopag.round(TCurrency::get_firm_dec());
if (abs(compensopag) > abs(compenso)) if (abs(compensopag) > abs(compenso))
compensopag = compenso; compensopag = compenso;
pagrec.put(PAG_COMPENSO, compensopag); pagrec.put(PAG_COMPENSO, compensopag);
pagrec.put(PAG_SPESA, spesepag); pagrec.put(PAG_SPESA, spesepag);
pagrec.put(PAG_DATAPAG, datapag); pagrec.put(PAG_DATAPAG, datapag);
sc.lfile().put(SCH_ANNOC, datapag.year()); sc.lfile().put(SCH_ANNOC, datapag.year());
sc.lfile().put(SCH_MESEC, datapag.month()); sc.lfile().put(SCH_MESEC, datapag.month());
pagrec.put(PAG_PERC, h_PercRitenuta); // percentuale ritenuta acconto pagrec.put(PAG_PERC, h_PercRitenuta); // percentuale ritenuta acconto
pagrec.put(PAG_ALQIMP10, h_PercAssImpInps);// percentuale 10% INPS pagrec.put(PAG_ALQIMP10, h_PercAssImpInps);// percentuale 10% INPS
pagrec.put(PAG_NUMREG, numregp[j]); pagrec.put(PAG_NUMREG, numregp[j]);
pagrec.put(PAG_COD10, "C"); pagrec.put(PAG_COD10, "C");
calcola_riga_pag(pagrec, h_PercAssImp, h_PercCassaPrev, h_PercRitenuta, h_PercInps, h_PercAssImpInps, h_PercCommitInps); calcola_riga_pag(pagrec, h_PercAssImp, h_PercCassaPrev, h_PercRitenuta, h_PercInps, h_PercAssImpInps, h_PercCommitInps);
} }
} }
} }
} }
sc.rewrite(); sc.rewrite();
} }
@ -515,8 +519,16 @@ bool schede(const TRelation& rel, void* pJolly)
{ {
const TRectype& sch = rel.curr(); const TRectype& sch = rel.curr();
TSchedaPercipienti* schper = (TSchedaPercipienti *) pJolly; TSchedaPercipienti* schper = (TSchedaPercipienti *) pJolly;
schper->agg_pagamenti(sch);
return true; TMask mp("Aggiorna pagamenti", 1, 20, 4);
mp.add_date(101, 0, "Data minimima pagamenti ", 1, 1);
const bool ok = mp.run() == K_ENTER;
if (ok)
{
const TDate pag_dal = mp.get(101);
schper->agg_pagamenti(sch, pag_dal);
}
return ok;
} }
bool TSchedaPercipienti::aggpag_handler(TMask_field& f, KEY k) bool TSchedaPercipienti::aggpag_handler(TMask_field& f, KEY k)
@ -583,8 +595,8 @@ bool TSchedaPercipienti::user_create()
_rpag = new TLocalisamfile(LF_RPAG); _rpag = new TLocalisamfile(LF_RPAG);
_pags = new TNikArray_sheet(-1, -1, -4, -4, TR("Selezione Pagamenti"), _pags = new TNikArray_sheet(-1, -1, -4, -4, TR("Selezione Pagamenti"),
HR("@1|Data@11|Compenso@16|Ritenuta@16|"), HR("@1|Data@11|Compenso@16|Ritenuta@16|"),
0,NULL_WIN,5); 0, NULL_WIN, 5);
set_search_field(F_CODANAGRPERC); set_search_field(F_CODANAGRPERC);
@ -669,16 +681,16 @@ void TSchedaPercipienti::compila_testata(TMask& m)
switch (tipo_coll()) switch (tipo_coll())
{ {
case occasionale: case occasionale:
m.set(F_COMPENS, _coll._compenso.string()); m.set(F_COMPENS, _coll._compenso.string());
m.set(F_TOTDOC, _coll._compenso.string()); m.set(F_TOTDOC, _coll._compenso.string());
break; break;
case fattura: case fattura:
m.set(F_TOTDOC, _coll._totdoc.string()); m.set(F_TOTDOC, _coll._totdoc.string());
m.set(F_TOTRIT, _coll._ritenute.string()); m.set(F_TOTRIT, _coll._ritenute.string());
break; break;
default: default:
break; break;
} }
} }
@ -708,12 +720,29 @@ void TSchedaPercipienti::init_modify_mode(TMask& m)
void TSchedaPercipienti::init_insert_mode(TMask& m) void TSchedaPercipienti::init_insert_mode(TMask& m)
{ {
init_mask(m); init_mask(m);
// La proposta causale è valida con e senza collegamneto da prima nota
TToken_string key; key.format("%c|%ld", m.get(F_TIPOA)[0], m.get_long(F_CODANAGR));
TString4 codcaus = cache().get(LF_ANAG, key, "CAUSQUA");
if (codcaus.blank())
{
key.format("%ld|%c|%ld|%d",
m.get_long(F_CODDITTA), m.get(F_TIPOA)[0],
m.get_long(F_CODANAGR), m.get_int(F_NPROG)-1);
codcaus = cache().get(LF_SCPERC, key, SPR_CODCAUS);
}
if (codcaus.full())
{
const TRectype& caus = cache().get("%CA7", codcaus);
build_causqua_items(m, caus.get("S1"));
m.set(F_CODCAUS, codcaus, 0x3);
m.set(F_CAUSQUA, caus.get("S2"));
}
} }
void TSchedaPercipienti::on_config_change() void TSchedaPercipienti::on_config_change()
{ {
TConfig conf(CONFIG_STUDIO, "77"); _anno_dic = ini_get_int(CONFIG_STUDIO, "77", ANNO_SEL);
_anno_dic = conf.get_int(ANNO_SEL);
} }
void TSchedaPercipienti::init_query_mode(TMask& m) void TSchedaPercipienti::init_query_mode(TMask& m)
@ -1347,12 +1376,10 @@ TSheet_field& TSchedaPercipienti::pag_sheet_enabled(TMask& m, bool force_enable)
if (s == NULL) if (s == NULL)
{ {
// reperisco codice quadro della scheda // reperisco codice quadro della scheda
TString16 codcau(_rel->lfile().get("CODCAUS")); TString4 qua = "C";
TTable cau("%ca7"); const TString4 codcau = _rel->lfile().get("CODCAUS");
cau.zero(); const TRectype& cau = cache().get("%CA7", codcau);
cau.put("CODTAB", codcau); if (!cau.empty())
TString16 qua = "C";
if (cau.read() == NOERR)
qua = cau.get("S1"); qua = cau.get("S1");
// abilito sheet // abilito sheet
@ -1421,12 +1448,12 @@ bool TSchedaPercipienti::activate_pag_sheet(TMask& m)
for (int r = 0; r < curr_s.items(); r++) for (int r = 0; r < curr_s.items(); r++)
{ {
TToken_string& t = curr_s.row(r); TToken_string& t = curr_s.row(r);
if (!my_empty_items(t, FALSE)) if (!my_empty_items(t, false))
{ {
from_sheet_to_struct(t, s); from_sheet_to_struct(t, s);
calcola_riga_pag(s, calcola_riga_pag(s,
c, c,
TRUE, true,
h_PercAssImp, h_PercAssImp,
h_PercCassaPrev, h_PercCassaPrev,
h_PercRitenuta, h_PercRitenuta,
@ -1644,7 +1671,7 @@ Pag_struct& TSchedaPercipienti::from_sheet_to_struct(TToken_string& t, Pag_struc
return s; return s;
} }
void TSchedaPercipienti::from_struct_to_sheet(Pag_struct& s, TToken_string& t) void TSchedaPercipienti::from_struct_to_sheet(const Pag_struct& s, TToken_string& t)
{ {
// reperisco la Token_string pilota // reperisco la Token_string pilota
TToken_string columns(pilot_sheet()); TToken_string columns(pilot_sheet());
@ -2076,6 +2103,7 @@ Pag_struct& TSchedaPercipienti::clear_struct(Pag_struct& s)
s.quotaprov = ZERO; s.quotaprov = ZERO;
s.impnetto = ZERO; s.impnetto = ZERO;
s.comnetto = ZERO; s.comnetto = ZERO;
s.numreg = 0L;
return s; return s;
} }
@ -2096,13 +2124,13 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
clear_struct(c); clear_struct(c);
// calcolo CPA // calcolo CPA
c.impcpa = (s.compenso * h_PercCassaPrev) / (CENTO + h_PercCassaPrev); c.impcpa = s.compenso * h_PercCassaPrev / (CENTO + h_PercCassaPrev);
c.impcpa.round(fdec); c.impcpa.round(fdec);
if (s.impcpa == ZERO || force) if (s.impcpa == ZERO || force)
s.impcpa = c.impcpa; s.impcpa = c.impcpa;
// calcolo imponibile // calcolo imponibile
c.imponibile = ((s.compenso - s.impcpa) * h_PercAssImp) / CENTO; c.imponibile = (s.compenso - s.impcpa) * h_PercAssImp / CENTO;
c.imponibile.round(fdec); c.imponibile.round(fdec);
if (s.imponibile == ZERO || force) if (s.imponibile == ZERO || force)
s.imponibile = c.imponibile; s.imponibile = c.imponibile;
@ -2112,7 +2140,7 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
s.perc = h_PercRitenuta; s.perc = h_PercRitenuta;
// calcolo ritenuta lorda // calcolo ritenuta lorda
c.ritlorda = (s.imponibile * s.perc) / CENTO; c.ritlorda = s.imponibile * s.perc / CENTO;
c.ritlorda.round(fdec); c.ritlorda.round(fdec);
s.ritlorda = c.ritlorda; s.ritlorda = c.ritlorda;
@ -2132,7 +2160,7 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
s.alqimp10 = h_PercAssImpInps; s.alqimp10 = h_PercAssImpInps;
// calcolo contributo Inps complessivo // calcolo contributo Inps complessivo
c.ctssncomp = (((s.compenso * s.alqimp10) / CENTO) * h_PercInps) / CENTO; c.ctssncomp = ((s.compenso * s.alqimp10 / CENTO) * h_PercInps) / CENTO;
c.ctssncomp.round(fdec); c.ctssncomp.round(fdec);
if (s.ctssncomp == ZERO || force) if (s.ctssncomp == ZERO || force)
s.ctssncomp = c.ctssncomp; s.ctssncomp = c.ctssncomp;
@ -2182,8 +2210,6 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s,
// calcolo compenso al netto delle ritenute // calcolo compenso al netto delle ritenute
s.comnetto = s.compenso - s.ritenuta; s.comnetto = s.compenso - s.ritenuta;
s.numreg = c.numreg;
return s; return s;
} }

View File

@ -43,7 +43,7 @@ void TSchedaPercipienti::init_mask(TMask& m, bool inserimento)
// Update spreadsheet // Update spreadsheet
rec2row(pags.row(0), rpag, 0); rec2row(pags.row(0), rpag, 0);
// ricalcolo riga pagamento // ricalcolo riga pagamento
TString16 codcau(m.get(F_CODCAUS)); const TString& codcau = m.get(F_CODCAUS);
TTable cau("%ca7"); TTable cau("%ca7");
cau.zero(); cau.zero();
cau.put("CODTAB", codcau); cau.put("CODTAB", codcau);
@ -730,16 +730,19 @@ bool TSchedaPercipienti::vers1015_handler(TMask_field& f, KEY k)
bool TSchedaPercipienti::check_causale(TMask_field& f, KEY k) bool TSchedaPercipienti::check_causale(TMask_field& f, KEY k)
{ {
TMask& m = f.mask(); TMask& m = f.mask();
TString16 cod_qua(m.get(F_CODQUA));
// creo run-time gli items per la causale quadro
app().build_causqua_items(m, cod_qua);
if (k == K_TAB)
{
const TString& cod_qua = m.get(F_CODQUA);
// creo run-time gli items per la causale quadro
app().build_causqua_items(m, cod_qua);
}
if (k == K_TAB && m.is_running()) if (k == K_TAB && m.is_running())
{ {
// leggo causale indicata // leggo causale indicata
TFixed_string cod_caus(f.get(),3); //TFixed_string cod_caus(f.get(),3);
const TString& cod_qua = m.get(F_CODQUA);
// cose da fare solo se viene modificato il codice causale // cose da fare solo se viene modificato il codice causale
if (f.to_check(k)) if (f.to_check(k))

View File

@ -134,7 +134,7 @@ class TSchedaPercipienti : public TRelation_application
// riempe la struttura pagamento da una riga di sheet // riempe la struttura pagamento da una riga di sheet
Pag_struct& from_sheet_to_struct(TToken_string& t, Pag_struct& s); Pag_struct& from_sheet_to_struct(TToken_string& t, Pag_struct& s);
// riempe una riga di sheet dalla struttura pagamento // riempe una riga di sheet dalla struttura pagamento
void from_struct_to_sheet(Pag_struct& s, TToken_string& t); void from_struct_to_sheet(const Pag_struct& s, TToken_string& t);
// riempe la struttura pagamento dalla maschera di sheet // riempe la struttura pagamento dalla maschera di sheet
Pag_struct& from_mask_to_struct(TMask& m, Pag_struct& s); Pag_struct& from_mask_to_struct(TMask& m, Pag_struct& s);
// riempe la maschera di sheet dalla struttura pagamento // riempe la maschera di sheet dalla struttura pagamento
@ -207,7 +207,7 @@ class TSchedaPercipienti : public TRelation_application
bool coll_datanum() const { return _coll._datadoc.not_empty() && _coll._numdoc.not_empty(); } bool coll_datanum() const { return _coll._datadoc.not_empty() && _coll._numdoc.not_empty(); }
long coll_numreg() const { return _coll._numreg; } long coll_numreg() const { return _coll._numreg; }
bool esiste_perc(const TMask& m, const char* coda=NULL); bool esiste_perc(const TMask& m, const char* coda=NULL);
void agg_pagamenti(const TRectype & sch); void agg_pagamenti(const TRectype& sch, const TDate& pag_dal);
TSheet_field& pags() const; TSheet_field& pags() const;
TSheet_field& vers() const; TSheet_field& vers() const;

View File

@ -747,20 +747,13 @@ TTracciato770::TTracciato770(char tipo) : _tipo(tipo)
add_field("Situazione", NU, 674, 1); add_field("Situazione", NU, 674, 1);
add_field("Dicastero di appartenenza", CN, 675, 11); add_field("Dicastero di appartenenza", CN, 675, 11);
add_field("Firma del dichiarante", CB, 746, 1, 54); // 54
add_field("Codice fiscale incaricato", CF, 747,16);
add_field("Soggetto", NU, 763, 1);
add_field("Firma incaricato", CB, 764, 1);
add_field("Codice fiscale presidente", CF, 765,16);
add_field("Firma presidente", CB, 781, 1); // 59
add_field("Redazione della dichiarazione", NU, 797, 1, 75); // 75 add_field("Redazione della dichiarazione", NU, 797, 1, 75); // 75
add_field("Numero comunicaz. lavoro dipendente", NU, 798, 8); add_field("Numero comunicaz. lavoro dipendente", NU, 798, 8);
add_field("Numero comunicaz. lavoro autonomo", NU, 806, 8); add_field("Numero comunicaz. lavoro autonomo", NU, 806, 8);
add_field("Casella prospetto SS", CB, 814, 1); // 78 add_field("Casella prospetto SS", CB, 814, 1); // 78
add_field("Casella prospetto ST", CB, 815, 1); add_field("Casella prospetto ST", CB, 815, 1);
add_field("Casella prospetto SV", CB, 816, 1); // 80 add_field("Casella prospetto SV", CB, 816, 1);
add_field("Casella prospetto SX", CB, 817, 1); add_field("Casella prospetto SX", CB, 817, 1); // 81
add_field("Casella prospetto SY", CB, 818, 1); add_field("Casella prospetto SY", CB, 818, 1);
add_field("Presenza 770 ordinario 2011", CB, 819, 1); add_field("Presenza 770 ordinario 2011", CB, 819, 1);
add_field("Codice fiscale parte restante", CF, 820,16); add_field("Codice fiscale parte restante", CF, 820,16);
@ -776,7 +769,24 @@ TTracciato770::TTracciato770(char tipo) : _tipo(tipo)
add_field("Numero comunicaz. lavoro dipendente", NU, 864, 8); add_field("Numero comunicaz. lavoro dipendente", NU, 864, 8);
add_field("Numero comunicaz. lavoro autonomo", NU, 872, 8); // 93 add_field("Numero comunicaz. lavoro autonomo", NU, 872, 8); // 93
add_field("Situazioni particolari", NU,1180,2, 100); // 100 add_field("Firma del dichiarante", CB, 880, 1, 94); // 94
add_field("Codice fiscale", CF, 881,16);
add_field("Soggetto", NU, 897, 1);
add_field("Firma", CB, 898, 1); // 97
add_field("Codice fiscale", CF, 899,16);
add_field("Soggetto", NU, 915, 1);
add_field("Firma", CB, 916, 1); // 100
add_field("Codice fiscale", CF, 917,16);
add_field("Soggetto", NU, 933, 1);
add_field("Firma", CB, 934, 1); // 103
add_field("Codice fiscale", CF, 935,16);
add_field("Soggetto", NU, 951, 1);
add_field("Firma", CB, 952, 1); // 106
add_field("Codice fiscale", CF, 953,16);
add_field("Soggetto", NU, 969, 1);
add_field("Firma", CB, 970, 1); // 107
add_field("Situazioni particolari", NU,1180,2, 116); // 116
add_field("Codice fiscale del rappresentante", CF,1396,16,126); // 126 add_field("Codice fiscale del rappresentante", CF,1396,16,126); // 126
add_field("Codice carica del rappresentante", NU,1412, 2); add_field("Codice carica del rappresentante", NU,1412, 2);
@ -1352,7 +1362,6 @@ bool TTrasferimento770::append_record_b()
rec.set(47, rec_anagiu.get(ANG_SITSOC)); rec.set(47, rec_anagiu.get(ANG_SITSOC));
} }
rec.set(54, 1); // Firma del dichiarante
rec.set(75, 1); // Reazione della dichiarazione (sezione I) rec.set(75, 1); // Reazione della dichiarazione (sezione I)
rec.set(76, 0); // Comunicazioni relative a certificazioni lavoro dipendente rec.set(76, 0); // Comunicazioni relative a certificazioni lavoro dipendente
const int autonomi = conta_certificazioni(); const int autonomi = conta_certificazioni();
@ -1364,6 +1373,8 @@ bool TTrasferimento770::append_record_b()
rec.set(81, prosp_s); // casella prospetto SX rec.set(81, prosp_s); // casella prospetto SX
rec.set(82, false); // casella prospetto SY rec.set(82, false); // casella prospetto SY
rec.set(94, 1); // Firma del dichiarante
rec.set(100, 0); // situazioni particolari: vale sempre 0 rec.set(100, 0); // situazioni particolari: vale sempre 0
const TRectype& rec_nditte = _cache770.get(LF_NDITTE, _cod_ditta); const TRectype& rec_nditte = _cache770.get(LF_NDITTE, _cod_ditta);
@ -1412,9 +1423,9 @@ void TTrasferimento770::riepiloga_ss(const TRecord770& rec, TArray& riep_ss) con
{ {
const TString& key = code.right(3); const TString& key = code.right(3);
const int num = atoi(key); const int num = atoi(key);
if (num >= 25 && num <= 30) if (num >= 26 && num <= 31)
{ {
const int idx = num-25; const int idx = num-26;
real* r = (real*)riep_ss.objptr(idx); real* r = (real*)riep_ss.objptr(idx);
if (r == NULL) if (r == NULL)
{ {

View File

@ -401,17 +401,17 @@ struct Pag_struct
long numreg; long numreg;
// overloading operatore di confronto // overloading operatore di confronto
int operator==(Pag_struct& s); bool operator==(const Pag_struct& s) const;
// overloading operatore di assegnazione // overloading operatore di assegnazione
// ritorna per riferimento la struttura // ritorna per riferimento la struttura
// compilata con i valori del record passato // compilata con i valori del record passato
Pag_struct& operator=(TRectype & rec); Pag_struct& operator=(const TRectype & rec);
// overloading operatore di assegnazione // overloading operatore di assegnazione
// ritorna per riferimento la struttura // ritorna per riferimento la struttura
// incrementata dai valori della struttura passata // incrementata dai valori della struttura passata
Pag_struct& operator+=(Pag_struct& s); Pag_struct& operator+=(const Pag_struct& s);
}; };
#endif #endif

View File

@ -1076,7 +1076,7 @@ bool TVersamento_stampa::find(TVersamento& vers)
} }
// overloading operatore di confronto per la struct dei pagamenti // overloading operatore di confronto per la struct dei pagamenti
int Pag_struct::operator==(Pag_struct& s) bool Pag_struct::operator==(const Pag_struct& s) const
{ {
if (this->datapag != s.datapag) if (this->datapag != s.datapag)
return 0; return 0;
@ -1145,7 +1145,7 @@ int Pag_struct::operator==(Pag_struct& s)
// overloading operatore di assegnazione per la struct dei pagamenti // overloading operatore di assegnazione per la struct dei pagamenti
// partendo da un TRectype // partendo da un TRectype
Pag_struct& Pag_struct::operator=(TRectype& rec) Pag_struct& Pag_struct::operator=(const TRectype& rec)
{ {
// compila struttura con valori del record // compila struttura con valori del record
this->datapag = rec.get_date("DATAPAG"); this->datapag = rec.get_date("DATAPAG");
@ -1177,14 +1177,14 @@ Pag_struct& Pag_struct::operator=(TRectype& rec)
this->ammlordo = rec.get_real("AMMLORDO"); this->ammlordo = rec.get_real("AMMLORDO");
this->quotaprov = rec.get_real("QUOTAPROV"); this->quotaprov = rec.get_real("QUOTAPROV");
this->impnetto = rec.get_real("IMPNETTO"); this->impnetto = rec.get_real("IMPNETTO");
this->comnetto = rec.get_real("COMNETTO"); this->comnetto = rec.get_real(PAG_COMNETTO);
this->numreg = rec.get_long(PAG_NUMREG);
return *this; return *this;
} }
// overloading operatore di assegnazione per la struct dei pagamenti // overloading operatore di assegnazione per la struct dei pagamenti
// aggiunge i valori della struttura passata // aggiunge i valori della struttura passata
Pag_struct& Pag_struct::operator+=(Pag_struct& s) Pag_struct& Pag_struct::operator+=(const Pag_struct& s)
{ {
// aggiunge agli importi i valori della struttura passata // aggiunge agli importi i valori della struttura passata
this->imponibile += s.imponibile; this->imponibile += s.imponibile;

View File

@ -219,100 +219,108 @@ BEGIN
SPECIAL STRING TRASFER "AU001022" "NP" SPECIAL STRING TRASFER "AU001022" "NP"
END END
VALUTA 23 NUMERO 23
BEGIN BEGIN
KEY "SOMME NON SOGGETTE A RITENUTA" KEY "Codice somme non soggette a ritenuta"
PROMPT 66 9 "" PROMPT 64 9 ""
FIELD SOMME
SPECIAL STRING TRASFER "AU001023" "NP" SPECIAL STRING TRASFER "AU001023" "NP"
MESSAGE _NUMEXPR,IF(SOMME>0,1,0)
END END
VALUTA 24 VALUTA 24
BEGIN BEGIN
KEY "IMPONIBILE = 21-22-23" KEY "SOMME NON SOGGETTE A RITENUTA"
PROMPT 88 9 "" PROMPT 66 9 ""
FIELD IMPONIBILE FIELD SOMME
SPECIAL STRING TRASFER "AU001024" "NP" SPECIAL STRING TRASFER "AU001024" "NP"
END END
VALUTA 25 VALUTA 25
BEGIN BEGIN
KEY "Ritenute operate a titolo di acconto" KEY "IMPONIBILE = 21-22-23"
PROMPT 109 9 "" PROMPT 88 9 ""
FIELD IMPORTO FIELD IMPONIBILE
SPECIAL STRING TRASFER "AU001025" "NP" SPECIAL STRING TRASFER "AU001025" "NP"
END END
VALUTA 26 VALUTA 26
BEGIN BEGIN
KEY "Ritenute operate a titolo di imposta" KEY "Ritenute operate a titolo di acconto"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD IMPORTO
SPECIAL STRING TRASFER "AU001026" "NP" SPECIAL STRING TRASFER "AU001026" "NP"
END END
VALUTA 27 VALUTA 27
BEGIN BEGIN
KEY "RITENUTE SOSPESE" KEY "Ritenute operate a titolo di imposta"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD RITSOSPESE SPECIAL STRING TRASFER "AU001027" "NP"
SPECIAL STRING TRASFER "AU001027" ""
END END
VALUTA 28 VALUTA 28
BEGIN BEGIN
KEY "ADDIZIONALE REGIONALE a titolo di acconto" KEY "RITENUTE SOSPESE"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD ADDREG FIELD RITSOSPESE
SPECIAL STRING TRASFER "AU001028" "NP" SPECIAL STRING TRASFER "AU001028" ""
END END
VALUTA 29 VALUTA 29
BEGIN BEGIN
KEY "ADDIZIONALE REGIONALE a titolo di imposta" KEY "ADDIZIONALE REGIONALE a titolo di acconto"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD ADDREG
SPECIAL STRING TRASFER "AU001029" "NP" SPECIAL STRING TRASFER "AU001029" "NP"
END END
VALUTA 30 VALUTA 30
BEGIN BEGIN
KEY "ADDIZIONALE REGIONALE SOSPESA" KEY "ADDIZIONALE REGIONALE a titolo di imposta"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD ADDREGSOSP
SPECIAL STRING TRASFER "AU001030" "NP" SPECIAL STRING TRASFER "AU001030" "NP"
END END
VALUTA 31 VALUTA 31
BEGIN BEGIN
KEY "IMPONIBILE ANNI PRECEDENTI" KEY "ADDIZIONALE REGIONALE SOSPESA"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD IMPANNIPRE FIELD ADDREGSOSP
SPECIAL STRING TRASFER "AU001031" "NP" SPECIAL STRING TRASFER "AU001031" "NP"
END END
VALUTA 32 VALUTA 32
BEGIN BEGIN
KEY "RITENUTE ANNI PRECEDENTI" KEY "IMPONIBILE ANNI PRECEDENTI"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD RITANNIPRE FIELD IMPANNIPRE
SPECIAL STRING TRASFER "AU001032" "NP" SPECIAL STRING TRASFER "AU001032" "NP"
END END
VALUTA 33 VALUTA 33
BEGIN BEGIN
KEY "CONTRIBUTI PREVIDENZIALI A CARICO DEL SOGGETTO EROGANTE" KEY "RITENUTE ANNI PRECEDENTI"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD CTINPSEROG FIELD RITANNIPRE
SPECIAL STRING TRASFER "AU001033" "NP" SPECIAL STRING TRASFER "AU001033" "NP"
END END
VALUTA 34 VALUTA 34
BEGIN BEGIN
KEY "CONTRIBUTI PREVIDENZIALI A CARICO DEL PERCIPIENTE" KEY "CONTRIBUTI PREVIDENZIALI A CARICO DEL SOGGETTO EROGANTE"
PROMPT 109 9 "" PROMPT 109 9 ""
FIELD CTINPSPERC FIELD CTINPSEROG
SPECIAL STRING TRASFER "AU001034" "NP" SPECIAL STRING TRASFER "AU001034" "NP"
END END
VALUTA 35
BEGIN
KEY "CONTRIBUTI PREVIDENZIALI A CARICO DEL PERCIPIENTE"
PROMPT 109 9 ""
FIELD CTINPSPERC
SPECIAL STRING TRASFER "AU001035" "NP"
END
END END