Migliorata gestione reverse charge
git-svn-id: svn://10.65.10.50/branches/R_10_00@23132 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fe5e28c2d7
commit
57565a44ac
@ -1545,7 +1545,7 @@ void TPrimanota_application::genera_automatico(int tipo, const char* causimm)
|
||||
// Solo regolarizzazioni IVA
|
||||
if (_automatico->_tipo == 2)
|
||||
{
|
||||
_automatico->_totale += m.get_real(F_REVCHARGE);
|
||||
_automatico->_totale += m.get_real(F_REVCHARGE) + m.get_real(F_RITFIS);
|
||||
_automatico->_codiva = m.get(F_CODIVA);
|
||||
if (_automatico->_codiva.blank() && _rel->iva_items() > 0)
|
||||
_automatico->_codiva = _rel->iva(0).get(RMI_CODIVA);
|
||||
|
@ -395,8 +395,7 @@ bool TConti_array::remove_iva(bool det)
|
||||
|
||||
real TMovimentoPN::indetraibile_al(const TString& codind, const TCausale& caus, int annodoc) const
|
||||
{
|
||||
int tipodet;
|
||||
|
||||
int tipodet = 0;
|
||||
return ::indetraibile_al(codind, caus, annodoc, tipodet);
|
||||
}
|
||||
|
||||
|
@ -272,9 +272,11 @@ TImporto TPrimanota_application::real2imp(const real& r, char row_type)
|
||||
switch (row_type)
|
||||
{
|
||||
case 'S':
|
||||
case 'V':
|
||||
dare = causale().sezione_ritsoc() == 'D';
|
||||
break;
|
||||
case 'V':
|
||||
dare = causale().sezione_revcharge() == 'D';
|
||||
break;
|
||||
default:
|
||||
dare = causale().sezione_clifo() == 'D';
|
||||
if (row_type != 'T' && row_type != 'F')
|
||||
@ -1283,12 +1285,10 @@ bool TPrimanota_application::codiva_handler(TMask_field& f, KEY key)
|
||||
|
||||
}
|
||||
|
||||
TString4 det;
|
||||
if (app().iva() == iva_acquisti)
|
||||
{
|
||||
const int det = iva.detraibilita();
|
||||
if (det > 0)
|
||||
m.set(103, det);
|
||||
}
|
||||
det = iva.indetraibilita();
|
||||
m.set(103, det);
|
||||
|
||||
TMask_field& im = m.field(101);
|
||||
im.set_dirty();
|
||||
@ -2243,6 +2243,8 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
|
||||
const TCausale c(cau, ann);
|
||||
if (!c.ok())
|
||||
return false;
|
||||
|
||||
bool init_provv_rev = false;
|
||||
|
||||
TPrimanota_application& a = app();
|
||||
const TCausale& k = a.causale();
|
||||
@ -2253,28 +2255,21 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
// Cambio la maschera al volo
|
||||
if (a.force_mask_swap(k, c))
|
||||
{
|
||||
TString4 provv;
|
||||
|
||||
provv << c.provvisorio();
|
||||
m.set(F_PROVVISORIO, provv);
|
||||
if (c.iva() != nessuna_iva && m.id2pos(F_SOLAIVA) > 0)
|
||||
{
|
||||
m.set(F_SOLAIVA, c.soloiva() ? "X" : " ");
|
||||
m.efield(F_REVCHARGE).show(c.iva() == iva_acquisti && c.reverse_charge());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
init_provv_rev = true;
|
||||
}
|
||||
return error_box(msg);
|
||||
if (!init_provv_rev)
|
||||
return error_box(msg);
|
||||
}
|
||||
|
||||
if (key == K_TAB)
|
||||
{
|
||||
a.read_caus(cau, ann);
|
||||
a.cgs().force_update();
|
||||
|
||||
TString4 provv; provv << c.provvisorio();
|
||||
a.cgs().force_update();
|
||||
}
|
||||
|
||||
if (init_provv_rev)
|
||||
{
|
||||
TString4 provv; provv << c.provvisorio();
|
||||
m.set(F_PROVVISORIO, provv);
|
||||
if (c.iva() != nessuna_iva)
|
||||
{
|
||||
@ -2282,7 +2277,7 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
|
||||
m.efield(F_REVCHARGE).show(c.iva() == iva_acquisti && c.reverse_charge());
|
||||
a.activate_split_payment(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -2952,18 +2947,26 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key)
|
||||
TPrimanota_application& a = app();
|
||||
const real imp(a.ivas().row(1).get(0));
|
||||
|
||||
//if (a.iva() == iva_acquisti && a.causale().intra())
|
||||
if (a.iva() == iva_acquisti && a.causale().reverse_charge()) // 16-06-2015
|
||||
if (a.iva() == iva_acquisti)
|
||||
{
|
||||
const real iva = f.mask().get(F_REVCHARGE);
|
||||
if (iva.is_zero())
|
||||
{
|
||||
TMask& mm = f.mask(); // Main mask
|
||||
const TCodiceIVA codiva(f.get());
|
||||
const real totale = mm.get_real(F_TOTALE);
|
||||
const real imposta = codiva.imposta(totale);
|
||||
mm.set(F_REVCHARGE, imposta, true);
|
||||
}
|
||||
TMask& mm = f.mask(); // Main mask
|
||||
const TCodiceIVA codiva(f.get());
|
||||
if (a.causale().intra())
|
||||
{
|
||||
const real iva = f.mask().get(F_RITFIS); // Le ritenute fiscali vengono usate come IVA intra
|
||||
if (iva.is_zero())
|
||||
{
|
||||
const real totale = mm.get_real(F_TOTALE);
|
||||
const real imposta = codiva.imposta(totale);
|
||||
mm.set(F_RITFIS, imposta, true);
|
||||
}
|
||||
} else
|
||||
if (a.causale().reverse_charge())
|
||||
{
|
||||
const real totale = mm.get_real(F_TOTALE) + mm.get_real(F_RITFIS);
|
||||
const real imposta = codiva.imposta(totale);
|
||||
mm.set(F_REVCHARGE, imposta, true);
|
||||
}
|
||||
}
|
||||
if (imp.is_zero()) // Se il totale documento non è stato spezzato
|
||||
{
|
||||
@ -2972,7 +2975,7 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key)
|
||||
|
||||
const TCodiceIVA iva(f.get());
|
||||
const bool corr = a.causale().corrispettivi();
|
||||
const bool acq3 = (a.iva() == iva_acquisti) && (row.get_int(2) == 3);
|
||||
const bool acq3 = (a.iva() == iva_acquisti) && (iva.tipo_indetraibilita() == 3 || row.get_int(2) == 3);
|
||||
|
||||
real tot = a.totale_documento(); // Calcola totale documento
|
||||
real imposta; // Calcola imposta
|
||||
@ -2986,8 +2989,10 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
row.add(iva.codice(), 1); // Aggiorna codice IVA
|
||||
|
||||
const int det = iva.detraibilita();
|
||||
if (det > 0) row.add(det, 2);
|
||||
TString4 det;
|
||||
if (a.iva() == iva_acquisti)
|
||||
det = iva.indetraibilita();
|
||||
row.add(det, 2);
|
||||
|
||||
TBill bill; // Aggiorna conto della prima riga IVA
|
||||
a.IVA2bill(iva, bill);
|
||||
|
@ -14,8 +14,9 @@
|
||||
TCausale::TCausale(const char* cod, int year)
|
||||
: TArray(12), _rec(LF_CAUSALI),
|
||||
_iva(iva_errata), _corrisp(false),
|
||||
_sezione_clifo(' '), _sezione_ritsoc(' '), _sezione_ritfis(' '),
|
||||
_provvisorio(' ')
|
||||
_sezione_clifo(' '), _provvisorio(' '),
|
||||
_sezione_ritsoc(' '), _sezione_ritfis(' '), _sezione_revcharge(' ')
|
||||
|
||||
{
|
||||
if (cod && *cod)
|
||||
read(cod, year);
|
||||
@ -202,26 +203,36 @@ char TCausale::sezione_ritsoc() const
|
||||
{
|
||||
if (_sezione_ritsoc <= ' ')
|
||||
{
|
||||
// Fatture o Pagamenti?
|
||||
const int tm = _rec.get_int(CAU_TIPOMOV);
|
||||
(char&)_sezione_ritsoc = sezione(tm <= 2 ? 9 : 14);
|
||||
const tipo_movimento tm = tipo_movimento();
|
||||
(char&)_sezione_ritsoc = sezione(tm<=tm_nota_credito ? RIGA_RITENUTE_SOCIALI : RIGA_PAG_RITSOC);
|
||||
}
|
||||
return _sezione_ritsoc;
|
||||
}
|
||||
|
||||
char TCausale::sezione_ritfis()
|
||||
|
||||
char TCausale::sezione_ritfis() const
|
||||
{
|
||||
if (_sezione_ritfis == ' ')
|
||||
{
|
||||
if (_rec.get_int(CAU_TIPOMOV) <= 2)
|
||||
_sezione_ritfis = sezione(8); // Fatture
|
||||
else
|
||||
_sezione_ritfis = sezione(12); // Pagamenti
|
||||
const tipo_movimento tm = tipo_movimento();
|
||||
(char&)_sezione_ritfis = sezione(tm<=tm_nota_credito ? RIGA_RITENUTE_FISCALI : RIGA_PAG_RITFIS); // Fatture o Pagamenti
|
||||
if (_sezione_ritfis < 'A')
|
||||
(char&)_sezione_ritfis = sezione_clifo();
|
||||
}
|
||||
return _sezione_ritfis;
|
||||
}
|
||||
|
||||
char TCausale::sezione_revcharge() const
|
||||
{
|
||||
if (_sezione_revcharge <= ' ')
|
||||
{
|
||||
(char&)_sezione_revcharge = sezione(RIGA_REVERSE_CHARGE);
|
||||
if (_sezione_revcharge < 'A')
|
||||
(char&)_sezione_revcharge = sezione_clifo();
|
||||
}
|
||||
return _sezione_revcharge;
|
||||
}
|
||||
|
||||
|
||||
void TCausale::calcIVA()
|
||||
{
|
||||
TipoIVA i = nessuna_iva; // Tipo IVA di default
|
||||
|
@ -13,7 +13,7 @@ class TCausale : public TArray
|
||||
|
||||
TipoIVA _iva;
|
||||
bool _corrisp;
|
||||
char _sezione_clifo, _sezione_ritsoc, _sezione_ritfis, _provvisorio;
|
||||
char _sezione_clifo, _sezione_ritsoc, _sezione_ritfis, _sezione_revcharge, _provvisorio;
|
||||
|
||||
protected:
|
||||
const TRectype* row(int num) const { return (const TRectype*)objptr(num); }
|
||||
@ -65,8 +65,9 @@ public:
|
||||
|
||||
char sezione(int riga) const;
|
||||
char sezione_clifo() const;
|
||||
char sezione_ritsoc() const ;
|
||||
char sezione_ritfis();
|
||||
char sezione_ritsoc() const;
|
||||
char sezione_ritfis() const;
|
||||
char sezione_revcharge() const ;
|
||||
|
||||
virtual bool read(const char* cod, int year);
|
||||
|
||||
|
@ -33,7 +33,7 @@ class TGame_mask : public TMask
|
||||
int _riga_partite; // Riga corrente delle partite
|
||||
bool _changed; // Flag di modifica partite
|
||||
bool _valfirst; // La colonna della valuta precede le lire
|
||||
bool _ignore_next_select; // Flag per ignorare la select(0) iniziale sulle partite
|
||||
//bool _ignore_next_select; // Flag per ignorare la select(0) iniziale sulle partite
|
||||
|
||||
protected:
|
||||
static bool annopart_handler(TMask_field& f, KEY k);
|
||||
@ -664,7 +664,7 @@ void TGame_mask::init(const TBill& bill, long numreg, int riga)
|
||||
}
|
||||
|
||||
TGame_mask::TGame_mask(const TBill& bill, long numreg, int riga)
|
||||
: TMask("cg2100p"), _valfirst(FALSE), _ignore_next_select(FALSE)
|
||||
: TMask("cg2100p"), _valfirst(FALSE)//, _ignore_next_select(false)
|
||||
{
|
||||
init(bill, numreg, riga);
|
||||
}
|
||||
@ -677,7 +677,7 @@ bool TGame_mask::annopart_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_TAB && f.focusdirty() && f.get().not_empty())
|
||||
{
|
||||
TMask_field& n = f.mask().field(P_NUMERO);
|
||||
TEdit_field& n = f.mask().efield(P_NUMERO);
|
||||
n.set_dirty();
|
||||
numpart_handler(n, k);
|
||||
}
|
||||
@ -692,7 +692,7 @@ bool TGame_mask::numpart_handler(TMask_field& f, KEY k)
|
||||
const int anno = m.get_int(P_ANNO); // Anno partita da cercare
|
||||
if (anno > 0)
|
||||
{
|
||||
const TString key = f.get(); // Numero partita da cercare
|
||||
const TNumero_partita key = f.get(); // Numero partita da cercare
|
||||
int best_match = 0; // Partita piu' somigliante
|
||||
long min_dist = 10000000L; // Livello di somiglianza migliore
|
||||
|
||||
@ -722,9 +722,7 @@ bool TGame_mask::show_all_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TGame_mask& gm = (TGame_mask&)f.mask();
|
||||
if (k == K_SPACE && gm.is_running())
|
||||
{
|
||||
gm.fill_partite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -844,8 +842,8 @@ TPartita* TGame_mask::partita_corrente() const
|
||||
if (_riga_partite < 0)
|
||||
return NULL;
|
||||
TToken_string& row = partite().row(_riga_partite);
|
||||
const int anno = row.get_int(0); // Anno partita
|
||||
const TString16 num = row.get(); // Numero partita
|
||||
const int anno = row.get_int(0); // Anno partita
|
||||
const TNumero_partita num = row.get(); // Numero partita
|
||||
const TBill& zio = conto();
|
||||
TPartita* game = app().partite().exist(zio, anno, num);
|
||||
return game;
|
||||
@ -856,12 +854,14 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
|
||||
TGame_mask& gm = (TGame_mask&)partite.mask();
|
||||
|
||||
if (k == K_TAB)
|
||||
{
|
||||
{
|
||||
/*
|
||||
if (gm._ignore_next_select)
|
||||
{
|
||||
gm._ignore_next_select = false;
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
const bool changing_row = gm._riga_partite != r;
|
||||
if (!changing_row)
|
||||
@ -876,7 +876,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
|
||||
|
||||
TToken_string& row = partite.row(r);
|
||||
const int anno = row.get_int(0); // Anno partita
|
||||
const TString16 num = row.get(); // Numero partita
|
||||
const TNumero_partita num = row.get(); // Numero partita
|
||||
gm.set(P_ANNO, anno); // Aggiorna campi di ricerca
|
||||
gm.set(P_NUMERO, num);
|
||||
|
||||
@ -1462,9 +1462,9 @@ bool TGame_mask::edit_scadenza_handler(TMask_field& f, KEY k)
|
||||
const TValuta curval(gm, P_VALUTA, P_DATACAMBIO, P_CAMBIO);
|
||||
if (parval != curval)
|
||||
{
|
||||
TString16 c = parval.codice();
|
||||
if (c.empty()) c = TCurrency::get_firm_val();
|
||||
|
||||
TString4 c = parval.codice();
|
||||
if (c.empty())
|
||||
c = TCurrency::get_firm_val();
|
||||
if (was == NULL) giochi.destroy(game);
|
||||
return f.error_box(FR("La fattura deve essere pagata in %s."), (const char*)c);
|
||||
}
|
||||
@ -1900,7 +1900,7 @@ void TGame_mask::fill_partite()
|
||||
TWait_cursor hourglass;
|
||||
|
||||
const int annorif = get_int(P_ANNO); // Anno corrente
|
||||
const TString16 numrif = get(P_NUMERO); // Partita corrente
|
||||
const TNumero_partita numrif = get(P_NUMERO); // Partita corrente
|
||||
const bool all = get(P_SHOWALL).not_empty(); // Visualizza anche partite chiuse
|
||||
|
||||
partite().destroy();
|
||||
@ -1968,23 +1968,25 @@ void TGame_mask::fill_partite()
|
||||
{
|
||||
TToken_string& row = a.row(r);
|
||||
const int anno = row.get_int(0);
|
||||
const TString16 numero = row.get(1);
|
||||
|
||||
if (found < 0 && annorif == anno && same_number(numrif, numero))
|
||||
found = r;
|
||||
|
||||
TPartita* gioco = app().partite().exist(conto(), anno, numero);
|
||||
if (gioco != NULL && gioco->mov2rig(_numreg, _numrig) > 0)
|
||||
const TNumero_partita numero = row.get(1);
|
||||
if (anno > 0 && numero.full())
|
||||
{
|
||||
COLOR back, fore;
|
||||
app().type2colors('X', back, fore);
|
||||
partite().set_back_and_fore_color(back, fore, r);
|
||||
if (found < 0 && annorif == anno && same_number(numrif, numero))
|
||||
found = r;
|
||||
|
||||
TPartita* gioco = app().partite().exist(conto(), anno, numero);
|
||||
if (gioco != NULL && gioco->mov2rig(_numreg, _numrig) > 0)
|
||||
{
|
||||
COLOR back, fore;
|
||||
app().type2colors('X', back, fore);
|
||||
partite().set_back_and_fore_color(back, fore, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found < 0) found = 0;
|
||||
_ignore_next_select = false;
|
||||
//_ignore_next_select = false;
|
||||
partite().select(found, true);
|
||||
_ignore_next_select = !is_running();
|
||||
//_ignore_next_select = !is_running() && !scadenze().empty();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -31,11 +31,12 @@ END
|
||||
|
||||
STRING IVA_INDETRAIBILE 1
|
||||
BEGIN
|
||||
PROMPT 2 3 "Indetraibilita' "
|
||||
PROMPT 2 3 "Indetraibilità "
|
||||
USE %DET
|
||||
INPUT CODTAB IVA_INDETRAIBILE
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Tipo" I0
|
||||
DISPLAY "Percentuale@R" R0
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT IVA_INDETRAIBILE CODTAB
|
||||
OUTPUT 99 S0
|
||||
|
@ -1091,7 +1091,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
const bool isreg = look_reg(reg);
|
||||
const TString4 tipodoc = _mov->get(MOV_TIPODOC);
|
||||
const bool corrisp = _reg->get_bool("B0");
|
||||
const tiporeg tipomov = (tiporeg)_reg->get_int("I0");
|
||||
const tiporeg tipomov = (tiporeg)_reg->get_int("I0"); // 1=Vendite; 2=Acquisti
|
||||
|
||||
tipo_movimento tm = (tipo_movimento)_mov->get_int(MOV_TIPOMOV);
|
||||
if (tm == tm_nessuno)
|
||||
@ -1103,7 +1103,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (_mov->get_long(MOV_NUMREG) >= 132)
|
||||
if (_mov->get_long(MOV_NUMREG) == 113678)
|
||||
int cazzone = 1;
|
||||
#endif
|
||||
|
||||
@ -1334,7 +1334,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
const TString4 tipoiva = _iva->get("S1");
|
||||
const TString4 tipoes_v = _iva->get("S2");
|
||||
const TString4 tipoes_a = _iva->get("S9");
|
||||
const int tipoagr = _iva->get_int("S4");
|
||||
const int tipoagr = _iva->get_int("I4"); // 2/9/2015 was S4
|
||||
const int tipoag = _iva->get_int("S5");
|
||||
const int tipopla = _iva->get_int("S3");
|
||||
int isrimbinfr = _iva->get_bool("B3"); // vale per calcolo rimborso se ES o NI
|
||||
@ -2335,11 +2335,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
start = 2;
|
||||
stop = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (year_int < 1998)
|
||||
stop = 0; // Solo PIM
|
||||
}
|
||||
|
||||
for (int i=start; i<=stop; i++) // Ciclo per le tabelle
|
||||
{
|
||||
if (i == 1 || i == 3) //Is it a valid PIS/PRP (vedi anche sel. cursore & date_ok())?
|
||||
@ -2568,7 +2564,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
|
||||
// E'una questione molto dibattuta il fatti di escludere i beni ammortizzabili o no:
|
||||
// Nella versione precedente (10.0) non venivano esclusi, poi dal 4-9-2014 sono stati esclusi ed infine nuovamente ignorati dal 17-2-2015
|
||||
// aaa -= ammort_det_iva; // Scarta gli acquisti di beni ammortizzabili
|
||||
// Arriviamo al 17-09-2015 (data epica per altri motivi) e torniamo a tenerne conto per Pragma
|
||||
aaa -= ammort_det_iva; // Scarta gli acquisti di beni ammortizzabili
|
||||
|
||||
if (percentuale1 != INVALID_PRORATA && percentuale1 != INVALID_PRORATA_ASSERT)
|
||||
aaa -= rr1 ? *rr1 : ZERO;
|
||||
@ -2761,7 +2758,7 @@ void TLiquidazione_app::iva11_set_arr_phase_1(const TString& codatt)
|
||||
const real ali = _iva->get_real("R0");
|
||||
const TString4 tipoes_v = _iva->get("S2");
|
||||
const TString4 tipoes_a = _iva->get("S9");
|
||||
const int tipoagr = _iva->get_int("S4");
|
||||
const int tipoagr = _iva->get_int("I4"); // 2/9/2015 was S4
|
||||
const TRectype& rcs = _cur->curr(LF_CAUSALI);
|
||||
const bool autofattura = rcs.get_bool("AUTOFATT");
|
||||
const bool valintra = rcs.get_bool("VALINTRA");
|
||||
@ -3143,7 +3140,7 @@ void TLiquidazione_app::iva11_set_arr_phase_2(const TString& codatt)
|
||||
look_iva(codiva); look_reg(reg); // posiziona la tabella registri e quella IVA
|
||||
tiva = _iva->get("S1"); // tipo IVA
|
||||
tpla = _iva->get("S3"); // tipo gestione plafond
|
||||
tagr = _iva->get_int("S4"); // tipo gestione regime agricolo
|
||||
tagr = _iva->get_int("I4"); // tipo gestione regime agricolo 2/9/2015 was S4
|
||||
tvia = _iva->get("S5"); // tipo gestione ag. viaggio
|
||||
v11 = _iva->get("S2"); // n.ro riga vendite per mod. IVA11
|
||||
a11 = _iva->get("S9"); // n.ro riga acquisti per mod. IVA11
|
||||
|
@ -98,7 +98,7 @@ const char* TStampa_registri_app::descr_iva(const char* cod)
|
||||
const char* TStampa_registri_app::tipo_attivita()
|
||||
{
|
||||
TString16 key;
|
||||
key.format("%ld|%s", get_firm(), (const char *) _codatt);
|
||||
key.format("%ld|%s", get_firm(), (const char*)_codatt);
|
||||
return cache().get(LF_ATTIV, key, ATT_TIPOATT);
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ bool TStampa_registri_app::compila_reg(const TMask& m)
|
||||
_tabreg->first();
|
||||
if (!_tabreg->eof())
|
||||
{
|
||||
const TString16 codtab = _tabreg->get("CODTAB");
|
||||
const TString& codtab = _tabreg->get("CODTAB");
|
||||
const int anno = atoi(codtab.mid(0,4));
|
||||
if (anno > _annoes)
|
||||
{
|
||||
@ -295,7 +295,7 @@ bool TStampa_registri_app::compila_reg(const TMask& m)
|
||||
else // stampa un solo registro
|
||||
{
|
||||
_stampa_tutti_i_registri = false;
|
||||
TString16 codtab; codtab << _annoes << _codreg;
|
||||
TString8 codtab; codtab << _annoes << _codreg;
|
||||
_tabreg->zero();
|
||||
_tabreg->put("CODTAB", codtab);
|
||||
if (_tabreg->read() != NOERR)
|
||||
@ -591,7 +591,7 @@ bool TStampa_registri_app::mask_libun (TMask_field& f, KEY k)
|
||||
|
||||
TProgind* p = new TProgind(2,TR("Verifica parametri in corso..."),false,true);
|
||||
|
||||
TString16 cod(f.mask().get(CODICE_LIBRO_IVA));
|
||||
const TString& cod = f.mask().get(CODICE_LIBRO_IVA);
|
||||
int fino_a_mese = f.mask().get_int(MESE);
|
||||
int anno = f.mask().get_int(ANNO);
|
||||
bool ok = false;
|
||||
@ -647,8 +647,7 @@ bool TStampa_registri_app::mask_libun (TMask_field& f, KEY k)
|
||||
if (last_mese == 13)
|
||||
last_mese = 0; //l'ultima data di stampa sul/sui registri specificati e' vuota
|
||||
//(cioe' non sono ancora stati stampati sul libro unico specificato)
|
||||
TString16 me;
|
||||
me.format("%02d", last_mese);
|
||||
TString4 me; me.format("%02d", last_mese);
|
||||
f.mask().set(ULTIMO_MESE, me);
|
||||
delete p;
|
||||
}
|
||||
@ -660,16 +659,15 @@ bool TStampa_registri_app::mask_cod (TMask_field& f, KEY k)
|
||||
if (k == K_TAB)
|
||||
{
|
||||
TTable TabLbu ("%LBU");
|
||||
TString codtab;
|
||||
int anno;
|
||||
TString8 codtab;
|
||||
|
||||
TString16 codlib(f.get());
|
||||
anno = f.mask().get_int(ANNO);
|
||||
int anno = f.mask().get_int(ANNO);
|
||||
TabLbu.zero();
|
||||
codtab.format ("%04d%-3s", anno, (const char*)codlib);
|
||||
TabLbu.put ("CODTAB", codtab);
|
||||
TabLbu.put("CODTAB", codtab);
|
||||
TabLbu.read();
|
||||
if ( TabLbu.good() )
|
||||
if (TabLbu.good())
|
||||
{
|
||||
f.mask().set(ULTIMA_PAGINA,TabLbu.get_long("I1"));
|
||||
app()._codice_vidi = TabLbu.get("S4");
|
||||
@ -1292,7 +1290,8 @@ int TStampa_registri_app::stampa_prospetto_IVA(int rr, int tipo_prosp)
|
||||
riga << TR("; 4=liquidazione differita");
|
||||
if (has_module(ICAUT))
|
||||
riga << TR("; 5=IVA per cassa");
|
||||
riga << TR("; 6=Scissione pagamenti art.17 ter");
|
||||
if (_annoes >= 2015)
|
||||
riga << TR("; 6=Scissione pagamenti art.17 ter");
|
||||
set_row(rr++, riga);
|
||||
|
||||
_stampa = _st_tot_fin;
|
||||
@ -1422,7 +1421,7 @@ int TStampa_registri_app::stampa_acquisti(int row)
|
||||
set_row(rw++, TR("----- Indetraibile su op.es. -----"));
|
||||
set_row(rw, TR("Cod."));
|
||||
rw++;
|
||||
set_row(rw, FR("iva Descrizione@34gImponibile@53gImposta"));
|
||||
set_row(rw, FR("IVA Descrizione@34gImponibile@53gImposta"));
|
||||
if (_tipo_stampa != prova) set_row(rw, FR("@86gImponibile@106gImposta"));
|
||||
rw+=2;
|
||||
}
|
||||
@ -1452,7 +1451,7 @@ int TStampa_registri_app::stampa_acquisti(int row)
|
||||
set_row(rw++, TR("----- Passaggi interni -----"));
|
||||
set_row(rw, TR("Cod."));
|
||||
rw++;
|
||||
set_row(rw, FR("iva Descrizione@34gImponibile@53gImposta"));
|
||||
set_row(rw, FR("IVA Descrizione@34gImponibile@53gImposta"));
|
||||
if (_tipo_stampa != prova)
|
||||
set_row(rw, FR("@86gImponibile@106gImposta"));
|
||||
rw+=2;
|
||||
@ -1483,7 +1482,7 @@ int TStampa_registri_app::stampa_acquisti(int row)
|
||||
set_row(rw++, TR("----- N.D. 9 - acquisti indeducibili per ART.19 -----"));
|
||||
set_row(rw, TR("Cod."));
|
||||
rw++;
|
||||
set_row(rw, FR("iva Descrizione@34gImponibile@53gImposta"));
|
||||
set_row(rw, FR("IVA Descrizione@34gImponibile@53gImposta"));
|
||||
if (_tipo_stampa != prova)
|
||||
set_row(rw, FR("@86gImponibile@106gImposta"));
|
||||
rw+=2;
|
||||
@ -2765,7 +2764,7 @@ int TStampa_registri_app::stampa_intestazione()
|
||||
}
|
||||
|
||||
TString80 tmp;
|
||||
tmp.format(FR("Partita iva %s Codice fiscale %s"), (const char*)_paiva, (const char*)_cofi);
|
||||
tmp.format(FR("Partita IVA %s Codice fiscale %s"), (const char*)_paiva, (const char*)_cofi);
|
||||
riga.overwrite(tmp);
|
||||
set_header (r, riga);
|
||||
|
||||
@ -2848,13 +2847,13 @@ void TStampa_registri_app::preprocess_header()
|
||||
key.format("%ld|%s", _ditta, (const char *)_codatt);
|
||||
const TString16 codateco = cache().get(LF_ATTIV, key, ATT_CODATECO);
|
||||
|
||||
set_header(r, FR("Registro IVA: %s %s %s Attivita\' %s %s"),
|
||||
set_header(r, FR("Registro IVA: %s %s %s Attività %s %s"),
|
||||
(const char*) _codreg, (const char*) _desc_lib,
|
||||
(const char*) data, (const char*) codateco,
|
||||
(const char*) _attivita);
|
||||
}
|
||||
else
|
||||
set_header(r, FR("Registro IVA: %s %s %s Attivita\' %s %s"),
|
||||
set_header(r, FR("Registro IVA: %s %s %s Attività %s %s"),
|
||||
(const char*) _codreg, (const char*) _desc_lib,
|
||||
(const char*) data, (const char*) _codatt,
|
||||
(const char*) _attivita);
|
||||
@ -2906,14 +2905,14 @@ void TStampa_registri_app::preprocess_header()
|
||||
{
|
||||
set_header(r,FR("@10gNum.@19gDocumento@61gMese@66gT Tipo@102gCod %c@123gT %c@128gNum"), nd1, tipo);
|
||||
r++;
|
||||
set_header(r, FR("Data reg. prot.@17gData@24gNumero Codice Ragione sociale/descr. liq.@66gO Doc.@74gTotale doc.@90gImponibile Iva %c@115gImposta@123g%c %c@128gReg"), nd2, cor, type);
|
||||
set_header(r, FR("Data reg. prot.@17gData@24gNumero Codice Ragione sociale/descr. liq.@66gO Doc.@74gTotale doc.@90gImponibile IVA %c@115gImposta@123g%c %c@128gReg"), nd2, cor, type);
|
||||
r++;
|
||||
}
|
||||
else //stampa a 198
|
||||
{
|
||||
set_header(r,FR("Registrazione Documento@61gMese@66gT Tipo@110gCod %c@132g%c T@139gNum."), nd1, tipo, cor);
|
||||
r++;
|
||||
set_header(r, FR("Data Protocollo Data@24gNumero Codice Ragione sociale/descr. liq.@66gO Documento@80gTot.Documento@98gImponibile Iva %c@124gImposta@132g%c %c@139gReg."), nd2, type, cor);
|
||||
set_header(r, FR("Data Protocollo Data@24gNumero Codice Ragione sociale/descr. liq.@66gO Documento@80gTot.Documento@98gImponibile IVA %c@124gImposta@132g%c %c@139gReg."), nd2, type, cor);
|
||||
r++;
|
||||
}
|
||||
}
|
||||
@ -2930,7 +2929,7 @@ void TStampa_registri_app::preprocess_header()
|
||||
if (_tipo_stampa == rif_giornale) //stampa definitiva con rif. al libro giornale
|
||||
set_header(r, FR("@128gNum."));
|
||||
r++;
|
||||
set_header(r, FR("Data reg. prot.@17gData@24gNumero Codice Ragione sociale/descr. liq.@66gO Doc.@74gTotale doc.@90gImponibile Iva %c@115gImposta@123g%c %c"),
|
||||
set_header(r, FR("Data reg. prot.@17gData@24gNumero Codice Ragione sociale/descr. liq.@66gO Doc.@74gTotale doc.@90gImponibile IVA %c@115gImposta@123g%c %c"),
|
||||
nd2, cor, type);
|
||||
if (_tipo_stampa == rif_giornale)
|
||||
set_header(r, FR("@128gop."));
|
||||
@ -2942,7 +2941,7 @@ void TStampa_registri_app::preprocess_header()
|
||||
if (_tipo_stampa == rif_giornale)
|
||||
set_header(r, FR("@139gNum."));
|
||||
r++;
|
||||
set_header(r, FR("Data Protocollo Data@24gNumero Codice Ragione sociale/descr. liq.@66gO Documento@80gTot.Documento@98gImponibile Iva %c@124gImposta@132g%c %c"), nd2, type, cor);
|
||||
set_header(r, FR("Data Protocollo Data@24gNumero Codice Ragione sociale/descr. liq.@66gO Documento@80gTot.Documento@98gImponibile IVA %c@124gImposta@132g%c %c"), nd2, type, cor);
|
||||
if (_tipo_stampa == rif_giornale)
|
||||
set_header(r, FR("@139gop. @144gCodice conto @159gDescrizione sottoconto"));
|
||||
r++;
|
||||
@ -2959,7 +2958,7 @@ void TStampa_registri_app::preprocess_header()
|
||||
|
||||
if (_tipo_reg != riepilogativo)
|
||||
if (_stampa_ind_comp && !_intesta_vidi)
|
||||
set_header(r++, FR("@38gGeneralita'"));
|
||||
set_header(r++, FR("@38gGeneralità"));
|
||||
|
||||
set_header(r++, riga);
|
||||
|
||||
@ -4136,7 +4135,7 @@ void TStampa_registri_app::stampa_prospetto_riepilogo(tiporeg tipo, const TStrin
|
||||
}
|
||||
pr.print(row);
|
||||
row.reset();
|
||||
row.put(TR("iva Descrizione"), 0);
|
||||
row.put(TR("IVA Descrizione"), 0);
|
||||
row.put(TR("Imponibile"), 34);
|
||||
row.put(TR("Imposta"), 53);
|
||||
if (tipo == vendita && _tabreg->get_bool("B0"))
|
||||
@ -4161,7 +4160,7 @@ void TStampa_registri_app::stampa_progressivi(TRiga_array& vect,
|
||||
TPrintrow riga;
|
||||
|
||||
riga.reset();
|
||||
//ordinamento per codice iva
|
||||
//ordinamento per codice IVA
|
||||
vect.sort(compare_rows);
|
||||
for (int k=0; k<vect.items(); k++)
|
||||
{
|
||||
@ -4263,7 +4262,7 @@ void TStampa_registri_app::stampa_progressivi(TRiga_array& vect,
|
||||
riga.put(TR("Cod."), 0);
|
||||
printer().print(riga);
|
||||
riga.reset();
|
||||
riga.put(TR("iva Descrizione"), 0);
|
||||
riga.put(TR("IVA Descrizione"), 0);
|
||||
riga.put(TR("Imponibile"), 34);
|
||||
riga.put(TR("Imposta"), 53);
|
||||
if (_tipo_stampa != prova)
|
||||
@ -4329,7 +4328,7 @@ void TStampa_registri_app::stampa_progressivi(TRiga_array& vect,
|
||||
riga.put(TR("Cod."), 0);
|
||||
printer().print(riga);
|
||||
riga.reset();
|
||||
riga.put(TR("iva Descrizione"), 0);
|
||||
riga.put(TR("IVA Descrizione"), 0);
|
||||
riga.put(TR("Imponibile"), 34);
|
||||
riga.put(TR("Imposta"), 53);
|
||||
if (_tipo_stampa != prova)
|
||||
@ -4396,7 +4395,7 @@ void TStampa_registri_app::stampa_progressivi(TRiga_array& vect,
|
||||
riga.put(TR("Cod."), 0);
|
||||
printer().print(riga);
|
||||
riga.reset();
|
||||
riga.put(TR("iva Descrizione"), 0);
|
||||
riga.put(TR("IVA Descrizione"), 0);
|
||||
riga.put(TR("Imponibile"), 34);
|
||||
riga.put(TR("Imposta"), 53);
|
||||
if (_tipo_stampa != prova)
|
||||
|
@ -107,7 +107,7 @@ const TVariant& TProrata_set::get_field(int logic, const char* fldname) const
|
||||
const TVariant& var = TISAM_recordset::get_field(logic, fldname);
|
||||
if (logic == 0 || logic == LF_RMOVIVA)
|
||||
{
|
||||
if (xvt_str_compare_ignoring_case(fldname, RMI_IMPOSTA) == 0)
|
||||
if (xvt_str_same(fldname, RMI_IMPOSTA))
|
||||
{
|
||||
const real pd = perc_det();
|
||||
if (pd < CENTO)
|
||||
@ -116,7 +116,7 @@ const TVariant& TProrata_set::get_field(int logic, const char* fldname) const
|
||||
return get_tmp_var() = i.round(2);
|
||||
}
|
||||
} else
|
||||
if (xvt_str_compare_ignoring_case(fldname, "PERCDET") == 0)
|
||||
if (xvt_str_same(fldname, "PERCDET"))
|
||||
{
|
||||
return get_tmp_var() = perc_det();
|
||||
}
|
||||
@ -183,14 +183,14 @@ class TProrata_msk : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
real calc_prorata();
|
||||
real get_perc_prorata();
|
||||
bool genera_mov(TFilename& ininame);
|
||||
|
||||
public:
|
||||
TProrata_msk() : TAutomask("cg5900a") {}
|
||||
};
|
||||
|
||||
real TProrata_msk::calc_prorata()
|
||||
real TProrata_msk::get_perc_prorata()
|
||||
{
|
||||
const long f = get_long(F_CODDITTA);
|
||||
const int y = get_date(F_DATAFIN).year();
|
||||
@ -233,7 +233,7 @@ bool TProrata_msk::genera_mov(TFilename& ininame)
|
||||
TAssoc_array mconti;
|
||||
TString80 key;
|
||||
|
||||
const real prorata = calc_prorata();
|
||||
const real prorata = get_perc_prorata();
|
||||
|
||||
for (bool good = recset.move_first(); good; good = recset.move_next())
|
||||
{
|
||||
@ -347,7 +347,7 @@ bool TProrata_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
|
||||
o.disable();
|
||||
}
|
||||
if (!o.empty() && (e == fe_init || e == fe_modify))
|
||||
calc_prorata();
|
||||
get_perc_prorata();
|
||||
break;
|
||||
case F_DATAINI:
|
||||
if (e == fe_init)
|
||||
@ -361,7 +361,7 @@ bool TProrata_msk::on_field_event(TOperable_field& o, TField_event e, long jolly
|
||||
break;
|
||||
case F_DATAFIN:
|
||||
if (!o.empty() && (e == fe_init || e == fe_modify))
|
||||
calc_prorata();
|
||||
get_perc_prorata();
|
||||
break;
|
||||
case DLG_ELABORA:
|
||||
if (e == fe_button)
|
||||
|
@ -74,8 +74,7 @@ public:
|
||||
|
||||
HIDDEN TRic_archivi& app() { return (TRic_archivi &) main_app(); }
|
||||
|
||||
TRic_archivi::TRic_archivi(char ric_trasfer,char ric_auto) :
|
||||
_scelta(toupper(ric_trasfer)), _ric_auto(toupper(ric_auto))
|
||||
TRic_archivi::TRic_archivi(char ric_trasfer,char ric_auto) : _scelta(toupper(ric_trasfer)), _ric_auto(toupper(ric_auto))
|
||||
{
|
||||
if (_scelta == 'S')
|
||||
_titolo = TR("Ricezione archivi da sistema");
|
||||
@ -230,7 +229,7 @@ bool TRic_archivi::leggi_marker()
|
||||
{
|
||||
_dittaric = leggi_tabella_tras();
|
||||
|
||||
if (_dittaric != 0)
|
||||
if (_dittaric > 0)
|
||||
{
|
||||
if (!prefix().exist(_dittaric))
|
||||
return error_box(FR("Archivi ditta %ld non presente su disco"), _dittaric);
|
||||
@ -363,7 +362,7 @@ void TRic_archivi::main_loop()
|
||||
if (_disketto)
|
||||
{
|
||||
char drive = maskera.get(F_DRIVE)[0];
|
||||
if (yesno_box(FR("Inserire il dischetto %d nell' unita' %c"), _numdisk,drive))
|
||||
if (yesno_box(FR("Inserire il dischetto %d nell'unità %c"), _numdisk,drive))
|
||||
{
|
||||
if (!leggi_marker())
|
||||
return;
|
||||
@ -484,7 +483,15 @@ void TRic_archivi::leggi_trasfer(const char* nome)
|
||||
|
||||
if (_tras_file->exist())
|
||||
{
|
||||
if (_scelta == 'S')
|
||||
if (_scelta == 'P')
|
||||
{
|
||||
if (_tras_file->read_control_rec())
|
||||
{
|
||||
_nultras = _tras_file->nultras();
|
||||
_dataultras = _tras_file->dataultras();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_tras_file->read_control_rec_t())
|
||||
{
|
||||
@ -492,15 +499,6 @@ void TRic_archivi::leggi_trasfer(const char* nome)
|
||||
_dataultras = _tras_file->dataultras();
|
||||
}
|
||||
}
|
||||
else
|
||||
if (_scelta == 'P')
|
||||
{
|
||||
if (_tras_file->read_control_rec())
|
||||
{
|
||||
_nultras = _tras_file->nultras();
|
||||
_dataultras = _tras_file->dataultras();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -545,10 +543,10 @@ bool TRic_archivi::ripartenza()
|
||||
{
|
||||
if (_stato_ripartenza == 1)
|
||||
return error_box(TR("Rilevato stato di RIPARTENZA CON DATI CONTRADDITORI:\n"
|
||||
"presente file HEADER nei dati ditta e FlgStTra=* o nullo"));
|
||||
"presente file HEADER nei dati ditta e FlgStTra=* o nullo in ditta.ini"));
|
||||
|
||||
if (_stato_ripartenza == 2)
|
||||
return error_box(TR("Trasferimento precedente NON COMPLETATO: completarlo prima di questo"));
|
||||
return error_box(TR("Trasferimento precedente NON COMPLETATO: completarlo prima di procedere"));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -653,12 +651,10 @@ void TRic_archivi::trasfer2tempfile()
|
||||
{
|
||||
_trasfhard = _tras_file->path(_dittaric);
|
||||
_trasfhard.add(HEADER);
|
||||
switch (_scelta)
|
||||
{
|
||||
case 'S': _tras_file->fcopytemp(_trasf,_trasfhard); break;
|
||||
case 'P': _tras_file->fcopytemp_PC(_trasf,_trasfhard); break;
|
||||
default: break;
|
||||
}
|
||||
if (_scelta == 'P')
|
||||
_tras_file->fcopytemp_PC(_trasf,_trasfhard);
|
||||
else
|
||||
_tras_file->fcopytemp(_trasf,_trasfhard);
|
||||
}
|
||||
|
||||
void TRic_archivi::ditta_ricevente()
|
||||
|
@ -640,6 +640,21 @@ TCodiceIVA::TCodiceIVA(const char* cod) : TRectype(LF_TABCOM)
|
||||
read(cod);
|
||||
}
|
||||
|
||||
int TCodiceIVA::tipo_indetraibilita() const
|
||||
{
|
||||
int tipo = 0;
|
||||
const TString& codind = indetraibilita(); // Codice indetraibilità alfanumerico (ex. 1, 3, 9)
|
||||
if (codind.full())
|
||||
{
|
||||
const TRectype& det = cache().get("%DET", codind);
|
||||
if (det.empty())
|
||||
tipo = atoi(codind);
|
||||
else
|
||||
tipo = det.get_int("I0");
|
||||
}
|
||||
return tipo; // Tipo indetraibilità: 1,3,9
|
||||
}
|
||||
|
||||
bool TCodiceIVA::read(const char* cod)
|
||||
{
|
||||
if (cod && *cod)
|
||||
|
@ -150,7 +150,9 @@ public: // TObject
|
||||
const TString& descrizione() const { return get("S0"); }
|
||||
const real percentuale() const { return get_real("R0"); }
|
||||
const TString& tipo() const { return get("S1"); }
|
||||
int detraibilita() const { return get_int("I2"); }
|
||||
const TString& indetraibilita() const { return get("S4"); } // Codice indetraibilità alfanumerico (ex. 1, 3, 9)
|
||||
int tipo_indetraibilita() const; // Tipo indetraibilità: 1,3,9
|
||||
|
||||
int allegato(char tipocf) const { return get_int(tipocf == 'F' ? "S8" : "S7"); }
|
||||
bool has_plafond() const { return get_int("S3") > 0; }
|
||||
|
||||
|
@ -37,7 +37,7 @@ static int codind2tipodet(const TString & codind, real& perc)
|
||||
return tipodet;
|
||||
}
|
||||
|
||||
real indetraibile_al(const TString& codind, const TCausale& caus, int /*annodoc*/, int & tipodet,const bool is_liq)
|
||||
real indetraibile_al(const TString& codind, const TCausale& caus, int /*annodoc*/, int & tipodet,const bool /*is_liq*/)
|
||||
{
|
||||
real perc;
|
||||
|
||||
@ -176,7 +176,7 @@ bool is_split_payment(const TRectype& mov)
|
||||
mov.get_real(MOV_RITFIS).is_zero() && mov_has_imposte(mov))
|
||||
{
|
||||
const TRectype& clifo = cache().get_rec(LF_CLIFO, "C", mov.get(MOV_CODCF));
|
||||
if (clifo.get_bool(CLI_SPLITPAY)) // Ente pubblico con split payment
|
||||
if (clifo.get_bool(CLI_SPLITPAY) && clifo.get_int(CLI_ALLEG) == 7) // Ente pubblico con split payment
|
||||
{
|
||||
yes = !is_reverse_charge(mov);
|
||||
if (yes && get_tipo_movimento(mov) == tm_nota_credito) // Controlla le N.C.
|
||||
@ -251,11 +251,10 @@ bool is_IVAxCassa(const TRectype& mov)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Anticamente TIPODET conteneva in tipo di indetraibilita,
|
||||
// Anticamente TIPODET conteneva in tipo di indetraibilità,
|
||||
// ora invece trattasi di un codice di indetraibilità
|
||||
// associato ad un motivo ed una percentuale di indetraibilita'
|
||||
int get_tipodet_from_rmi(const TRectype& rmi, const TRectype& mov,real& percind, const bool is_liq)
|
||||
// associato ad un motivo ed una percentuale di indetraibilità
|
||||
int get_tipodet_from_rmi(const TRectype& rmi, const TRectype& mov, real& percind, const bool is_liq)
|
||||
{
|
||||
const int annodoc = mov.get_date(MOV_DATAREG).year();
|
||||
const TCausale caus(mov.get(MOV_CODCAUS), annodoc);
|
||||
|
@ -1479,12 +1479,7 @@ void TTransfer_file::negativo(TString& importo)
|
||||
}
|
||||
}
|
||||
|
||||
// Controlla se la ditta è in euro
|
||||
static bool ditta_in_euro()
|
||||
{
|
||||
return is_euro_value(NULL);
|
||||
}
|
||||
|
||||
|
||||
void TTransfer_file::write_tmp_movPN(TString& record)
|
||||
{
|
||||
TString key,str,codreg;
|
||||
@ -1507,7 +1502,7 @@ void TTransfer_file::write_tmp_movPN(TString& record)
|
||||
const TString4 sigla = record.mid(0,2);
|
||||
key.format("%2s%d", (const char*)sigla,numfield);
|
||||
|
||||
if (trc.is_key((const char *) key))
|
||||
if (trc.is_key((const char*)key))
|
||||
{
|
||||
int logicnum_p = 0;
|
||||
|
||||
@ -1563,7 +1558,7 @@ void TTransfer_file::write_tmp_movPN(TString& record)
|
||||
negativo(field);
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()==sizeT && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()==sizeT)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -1864,7 +1859,7 @@ void TTransfer_file::write_tmp_movIVA(const TString& record)
|
||||
negativo(field);
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()==sizeT && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()==sizeT)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -2083,8 +2078,7 @@ void TTransfer_file::calcola_imposta(const TString& field, real& imposta)
|
||||
|
||||
app = buffer.sub(34,43);
|
||||
negativo(app);
|
||||
if (ditta_in_euro())
|
||||
app.insert(".", app.len()-2);
|
||||
app.insert(".", app.len()-2);
|
||||
|
||||
const real imp = app;
|
||||
imposta += imp;
|
||||
@ -2208,7 +2202,7 @@ void TTransfer_file::partita(TString& record)
|
||||
negativo(field);
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()==sizeT && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()==sizeT)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -2391,7 +2385,7 @@ void TTransfer_file::scadenza(TString& record)
|
||||
negativo(field);
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -2796,7 +2790,7 @@ void TTransfer_file::pagsca(TString& record)
|
||||
{
|
||||
negativo(field);
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -3421,6 +3415,8 @@ void TTransfer_file::scrivi_PN(long nrec)
|
||||
|
||||
void TTransfer_file::scrivi_IVA(long nrec)
|
||||
{
|
||||
TString buffer(sizeT);
|
||||
|
||||
_prog = new TProgind(nrec,TR("Trasferimento Movimenti IVA"),false, true);
|
||||
|
||||
const TRic_recfield recf(_ttab->curr(), "S0", 0, sizeT);
|
||||
@ -3430,10 +3426,11 @@ void TTransfer_file::scrivi_IVA(long nrec)
|
||||
for (int err = _ttab->read(_isgteq); err == NOERR; err = _ttab->next())
|
||||
{
|
||||
const TString& trec = _ttab->get("CODTAB");
|
||||
if (!trec.starts_with("U1"))
|
||||
break;
|
||||
|
||||
const TFixed_string buffer((const char*)recf, sizeT);
|
||||
if (!trec.starts_with("U1")) break;
|
||||
|
||||
buffer = (const char*) recf;
|
||||
|
||||
write_tmp_movIVA(buffer);
|
||||
}
|
||||
delete _prog;
|
||||
@ -4373,7 +4370,7 @@ void TTransfer_file::write_righe_contabili(const TString& record)
|
||||
field = importo;
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -4510,7 +4507,7 @@ void TTransfer_file::write_righe_IVA(TString& record)
|
||||
field = importo;
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -4718,7 +4715,7 @@ void TTransfer_file::write_partite(const TString& record)
|
||||
field = importo;
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -4857,7 +4854,7 @@ void TTransfer_file::write_scadenze(const TString& record)
|
||||
field = importo;
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
@ -5012,7 +5009,7 @@ void TTransfer_file::write_pagsca(const TString& record)
|
||||
field = importo;
|
||||
|
||||
// Cerco di riconoscere gli importi in euro
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024 && ditta_in_euro())
|
||||
if (dec == 0 && (to-from) >= 8 && record.size()<1024)
|
||||
{
|
||||
flag = 3;
|
||||
dec = 2;
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <pagsca.h>
|
||||
#endif
|
||||
|
||||
|
||||
class TTree_rectype : public TRectype
|
||||
{
|
||||
protected:
|
||||
@ -223,11 +222,13 @@ public:
|
||||
TRiga_partite_array() : TRecord_array(LF_PARTITE, PART_NRIGA) {}
|
||||
};
|
||||
|
||||
typedef TString8 TNumero_partita;
|
||||
|
||||
class TPartita : public TSortable
|
||||
{
|
||||
TBill _conto;
|
||||
int _anno;
|
||||
TString16 _num;
|
||||
TNumero_partita _num;
|
||||
|
||||
TRiga_partite_array _part;
|
||||
TRecord_array _unassigned;
|
||||
@ -295,7 +296,7 @@ public:
|
||||
|
||||
const TBill& conto() const { return _conto; }
|
||||
int anno() const { return _anno; }
|
||||
const TString& numero() const { return _num; }
|
||||
const TNumero_partita& numero() const { return _num; }
|
||||
//const TString& descrizione() const;
|
||||
const char* build_key(TString& key) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user