Patch level : 2.1 72
Files correlati : cg0.exe cg2.exe cg2100s.msk cg6.exe sc0.exe f28.dir f28.trr f30.dir f30.trr Ricompilazione Demo : [ ] Commento : 0000070 Implementare nella maschera di pagamento un nuovo campo per il pagamento delle ritenute sociali. git-svn-id: svn://10.65.10.50/trunk@12207 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a24894fd1c
commit
2f5a8118b2
@ -246,19 +246,20 @@ void TCaus_app::causale_inc_pag()
|
|||||||
if (_tipo_des != incasso_pagamento)
|
if (_tipo_des != incasso_pagamento)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
set_descr(i++, TR("C Clienti/Fornitori"));
|
set_descr(i++, TR("C Clienti/Fornitori")); // 2
|
||||||
set_descr(i++, TR("C Cassa o banca"));
|
set_descr(i++, TR("C Cassa o banca"));
|
||||||
set_descr(i++, TR("C Tratta"));
|
set_descr(i++, TR("C Tratta")); // 4
|
||||||
set_descr(i++, TR("C Ricevuta bancaria"));
|
set_descr(i++, TR("C Ricevuta bancaria"));
|
||||||
set_descr(i++, TR("C Cessione"));
|
set_descr(i++, TR("C Cessione")); // 6
|
||||||
set_descr(i++, TR("C Paghero'"));
|
set_descr(i++, TR("C Paghero'"));
|
||||||
set_descr(i++, TR("C Lettera di credito"));
|
set_descr(i++, TR("C Lettera di credito"));// 8
|
||||||
set_descr(i++, TR("C Tratta accettata"));
|
set_descr(i++, TR("C Tratta accettata"));
|
||||||
set_descr(i++, TR("C Abbuoni pass./sc."));
|
set_descr(i++, TR("C Abbuoni pass./sc."));
|
||||||
set_descr(i++, TR("C Abbuoni att./sc."));
|
set_descr(i++, TR("C Abbuoni att./sc.")); // 10
|
||||||
set_descr(i++, TR("C Spese e rimborsi"));
|
set_descr(i++, TR("C Spese e rimborsi"));
|
||||||
set_descr(i++, TR("C Ritenute fiscali"));
|
set_descr(i++, TR("C Ritenute fiscali")); // 12
|
||||||
set_descr(i++, TR("C Differenza cambio"));
|
set_descr(i++, TR("C Differenza cambio"));
|
||||||
|
set_descr(i++, TR("C Ritenute sociali")); // 14
|
||||||
_tipo_des = incasso_pagamento;
|
_tipo_des = incasso_pagamento;
|
||||||
carica_righe_libere(i);
|
carica_righe_libere(i);
|
||||||
}
|
}
|
||||||
@ -700,11 +701,7 @@ void TCaus_app::load_rcaus(TMask& m)
|
|||||||
d = r.get(RCA_CODDESC);
|
d = r.get(RCA_CODDESC);
|
||||||
da.cut(0);
|
da.cut(0);
|
||||||
if (d.not_empty())
|
if (d.not_empty())
|
||||||
{
|
da = cache().get("%DPN", d, "S0");
|
||||||
const TRectype & dpn = cache().get("%DPN", d);
|
|
||||||
|
|
||||||
da = dpn.get("S0");
|
|
||||||
}
|
|
||||||
|
|
||||||
TBill tc(g,c,s,cf);
|
TBill tc(g,c,s,cf);
|
||||||
add_riga(i-1, sz, tc, d, da);
|
add_riga(i-1, sz, tc, d, da);
|
||||||
|
@ -2149,7 +2149,7 @@ bool TStampa_IVdirettiva::devo_stampare_risultato_prima_delle_imposte() const
|
|||||||
if (_let_da_stamp != 'E')
|
if (_let_da_stamp != 'E')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (atoi(_num_da_stamp) <= 21)
|
if (atoi(_num_da_stamp) < 22)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -2174,13 +2174,21 @@ void TStampa_IVdirettiva::stampa_risultato_prima_delle_imposte()
|
|||||||
// _totale_economico += _sale; // Guy was here 18/02/2004: Altrimenti ignora la prima imposta
|
// _totale_economico += _sale; // Guy was here 18/02/2004: Altrimenti ignora la prima imposta
|
||||||
|
|
||||||
// Guy was here 05/03/2004: La prima imposta e' gia' stata sommata
|
// Guy was here 05/03/2004: La prima imposta e' gia' stata sommata
|
||||||
const real te = _totale_economico-_sale;
|
// const real te = _totale_economico -_sale;
|
||||||
|
|
||||||
|
// Guy was here 08/06/2004: Nuova moda non capibile
|
||||||
|
const real te = _totale_economico;
|
||||||
|
|
||||||
set_row (_i,"@4g%s@81g%r", TR("Risultato prima delle imposte"), &te);
|
set_row (_i,"@4g%s@81g%r", TR("Risultato prima delle imposte"), &te);
|
||||||
|
|
||||||
if (raff)
|
if (raff)
|
||||||
{
|
{
|
||||||
// Guy was here 10/03/2004: La prima imposta e' gia' stata sommata anche qui
|
// Guy was here 10/03/2004: La prima imposta e' gia' stata sommata anche qui
|
||||||
const real te = _totale_economico_raf-_salerafr;
|
// const real te = _totale_economico_raf -_salerafr;
|
||||||
|
|
||||||
|
// Guy was here 08/06/2004: Nuova moda non capibile
|
||||||
|
const real te = _totale_economico_raf;
|
||||||
|
|
||||||
set_row (_i,"@111g%r", &te);
|
set_row (_i,"@111g%r", &te);
|
||||||
}
|
}
|
||||||
_i++;
|
_i++;
|
||||||
|
@ -350,7 +350,7 @@ bool TPrimanota_application::read_caus(const char* cod, int year)
|
|||||||
char tipr = ' ';
|
char tipr = ' ';
|
||||||
if (is_pagamento())
|
if (is_pagamento())
|
||||||
{
|
{
|
||||||
if (nriga <= RIGA_DIFFCAM && nriga != RIGA_SPESE)
|
if (nriga <= RIGA_PAG_RITSOC && nriga != RIGA_SPESE)
|
||||||
continue; // Si considerano solo le spese
|
continue; // Si considerano solo le spese
|
||||||
tipr = 'G';
|
tipr = 'G';
|
||||||
}
|
}
|
||||||
@ -510,7 +510,7 @@ void TPrimanota_application::init_mask(TMask& m)
|
|||||||
{
|
{
|
||||||
const TPartita* game = partite().first();
|
const TPartita* game = partite().first();
|
||||||
_scad_free = game == NULL || !game->esistono_abbuoni_diffcam(m.get_long(F_NUMREG));
|
_scad_free = game == NULL || !game->esistono_abbuoni_diffcam(m.get_long(F_NUMREG));
|
||||||
if (m.edit_mode())
|
if (m.edit_mode() && !_scad_free)
|
||||||
m.enable(DLG_DELREC, _scad_free); // Disabilita tasto elimina
|
m.enable(DLG_DELREC, _scad_free); // Disabilita tasto elimina
|
||||||
m.enable(-1, _scad_free); // Disabilita cliente
|
m.enable(-1, _scad_free); // Disabilita cliente
|
||||||
m.enable(-2, _scad_free);
|
m.enable(-2, _scad_free);
|
||||||
@ -1059,7 +1059,6 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
const int rimp = clint2pos(c, 'I')+1;
|
const int rimp = clint2pos(c, 'I')+1;
|
||||||
r.put(RMI_RIGAIMP, rimp);
|
r.put(RMI_RIGAIMP, rimp);
|
||||||
c.put(r);
|
c.put(r);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#define S_IMPORTOVAL 115
|
#define S_IMPORTOVAL 115
|
||||||
#define S_SALDOACC 116
|
#define S_SALDOACC 116
|
||||||
#define S_RESIDUORATA 117
|
#define S_RESIDUORATA 117
|
||||||
|
#define S_RITSOC 118
|
||||||
#define S_DATAPAG 119
|
#define S_DATAPAG 119
|
||||||
#define S_TIPOPAG 120
|
#define S_TIPOPAG 120
|
||||||
#define S_TIPO 121
|
#define S_TIPO 121
|
||||||
|
@ -74,7 +74,7 @@ END
|
|||||||
|
|
||||||
STRING S_CODVAL 3
|
STRING S_CODVAL 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 41 9 "Codice valuta "
|
PROMPT 41 10 "Codice valuta "
|
||||||
FLAGS "DU"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -118,6 +118,13 @@ BEGIN
|
|||||||
MESSAGE DIRTY,S_IMPORTO|K_TAB,S_IMPORTO
|
MESSAGE DIRTY,S_IMPORTO|K_TAB,S_IMPORTO
|
||||||
END
|
END
|
||||||
|
|
||||||
|
CURRENCY S_RITSOC 18
|
||||||
|
BEGIN
|
||||||
|
PROMPT 41 9 "Ritenute sociali "
|
||||||
|
FIELD RITSOC
|
||||||
|
MESSAGE DIRTY,S_IMPORTO|K_TAB,S_IMPORTO
|
||||||
|
END
|
||||||
|
|
||||||
CURRENCY S_IMPORTOVAL 18
|
CURRENCY S_IMPORTOVAL 18
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 9 "Importo in valuta "
|
PROMPT 2 9 "Importo in valuta "
|
||||||
@ -137,7 +144,7 @@ END
|
|||||||
|
|
||||||
LIST S_TIPOPAG 1 33
|
LIST S_TIPOPAG 1 33
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 27 10 "Tipo pagamento "
|
PROMPT 26 11 "Tipo pagamento "
|
||||||
ITEM "1|Rimessa Diretta"
|
ITEM "1|Rimessa Diretta"
|
||||||
ITEM "2|Tratta"
|
ITEM "2|Tratta"
|
||||||
ITEM "3|Ricevuta Bancaria"
|
ITEM "3|Ricevuta Bancaria"
|
||||||
|
@ -436,7 +436,7 @@ void TMovimentoPN::adjust_rowtypes()
|
|||||||
|
|
||||||
if (!ritfis && importo == mov.get_real(MOV_RITFIS))
|
if (!ritfis && importo == mov.get_real(MOV_RITFIS))
|
||||||
{
|
{
|
||||||
TBill conto_rit; causale.bill(RIGA_RITENUTE_FISCALI, conto_rit);
|
TBill conto_rit; causale.bill(RIGA_PAG_RITFIS, conto_rit);
|
||||||
if (!conto_rit.ok() || conto_rit == bill)
|
if (!conto_rit.ok() || conto_rit == bill)
|
||||||
{
|
{
|
||||||
row.put(RMV_ROWTYPE, 'F');
|
row.put(RMV_ROWTYPE, 'F');
|
||||||
@ -447,7 +447,7 @@ void TMovimentoPN::adjust_rowtypes()
|
|||||||
|
|
||||||
if (!ritsoc && importo == mov.get_real(MOV_RITSOC))
|
if (!ritsoc && importo == mov.get_real(MOV_RITSOC))
|
||||||
{
|
{
|
||||||
TBill conto_rit; causale.bill(RIGA_RITENUTE_SOCIALI, conto_rit);
|
TBill conto_rit; causale.bill(RIGA_PAG_RITSOC, conto_rit);
|
||||||
if (!conto_rit.ok() || conto_rit == bill)
|
if (!conto_rit.ok() || conto_rit == bill)
|
||||||
{
|
{
|
||||||
row.put(RMV_ROWTYPE, 'S');
|
row.put(RMV_ROWTYPE, 'S');
|
||||||
|
@ -103,17 +103,19 @@ real TPrimanota_application::totale_documento()
|
|||||||
{
|
{
|
||||||
const TMask& m = curr_mask();
|
const TMask& m = curr_mask();
|
||||||
|
|
||||||
const bool swapt = test_swap(FALSE); // Totale invertito ?
|
|
||||||
const bool swaps = test_swap(TRUE); // Ritenute sociali invertite ?
|
|
||||||
|
|
||||||
real tot(m.get(F_TOTALE)); // Legge totale
|
real tot(m.get(F_TOTALE)); // Legge totale
|
||||||
const real ritfis(m.get(F_RITFIS));
|
const real ritfis(m.get(F_RITFIS));
|
||||||
tot += ritfis; // Somma ritenute fiscali
|
tot += ritfis; // Somma ritenute fiscali
|
||||||
|
|
||||||
real ritsoc(m.get(F_RITSOC));
|
const real ritsoc(m.get(F_RITSOC));
|
||||||
if (swapt ^ swaps)
|
|
||||||
ritsoc = -ritsoc;
|
const bool swapt = test_swap(FALSE); // Totale invertito ?
|
||||||
tot += ritsoc; // Somma ritenute sociali con segno
|
const bool swaps = test_swap(TRUE); // Ritenute sociali invertite ?
|
||||||
|
if (swapt ^ swaps) // Somma ritenute sociali con segno
|
||||||
|
tot -= ritsoc;
|
||||||
|
else
|
||||||
|
tot += ritsoc;
|
||||||
|
|
||||||
return tot;
|
return tot;
|
||||||
}
|
}
|
||||||
@ -421,7 +423,7 @@ int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
|
|||||||
TSheet_field& cg = cgs();
|
TSheet_field& cg = cgs();
|
||||||
if (n < 0) n = cg.first_empty();
|
if (n < 0) n = cg.first_empty();
|
||||||
TToken_string& row = cg.row(n);
|
TToken_string& row = cg.row(n);
|
||||||
row = "";
|
row.cut(0);
|
||||||
imp.add_to(row, 0);
|
imp.add_to(row, 0);
|
||||||
row.add(conto.string(0x3));
|
row.add(conto.string(0x3));
|
||||||
row.add(""); // Codice decrizione
|
row.add(""); // Codice decrizione
|
||||||
@ -694,7 +696,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
|||||||
TImporto saldaconto, saldaconto_val;
|
TImporto saldaconto, saldaconto_val;
|
||||||
|
|
||||||
TSheet_field& cg = a.cgs();
|
TSheet_field& cg = a.cgs();
|
||||||
bool empty = TRUE;
|
bool empty = true;
|
||||||
for (int i = 0; i < cg.items(); i++)
|
for (int i = 0; i < cg.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string& r = cg.row(i);
|
TToken_string& r = cg.row(i);
|
||||||
@ -724,7 +726,7 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
|||||||
return f.error_box("Il conto di contropartita della riga %d non esiste", i+1);
|
return f.error_box("Il conto di contropartita della riga %d non esiste", i+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
empty = FALSE;
|
empty = false;
|
||||||
if (paga || nota)
|
if (paga || nota)
|
||||||
{
|
{
|
||||||
const char tipo = row_type(r);
|
const char tipo = row_type(r);
|
||||||
@ -2927,7 +2929,7 @@ bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
|
|
||||||
// Handler of the F_RITFIS
|
// Handler of the F_RITFIS
|
||||||
// Certified 99%
|
// Certified 100%
|
||||||
bool TPrimanota_application::ritfis_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::ritfis_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_TAB && f.focusdirty())
|
if (key == K_TAB && f.focusdirty())
|
||||||
@ -2937,7 +2939,7 @@ bool TPrimanota_application::ritfis_handler(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
|
|
||||||
// Handler of F_RITSOC
|
// Handler of F_RITSOC
|
||||||
// Certified 99%
|
// Certified 100%
|
||||||
bool TPrimanota_application::ritsoc_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::ritsoc_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_TAB && f.focusdirty())
|
if (key == K_TAB && f.focusdirty())
|
||||||
|
@ -184,7 +184,12 @@ char TCausale::sezione_clifo()
|
|||||||
char TCausale::sezione_ritsoc()
|
char TCausale::sezione_ritsoc()
|
||||||
{
|
{
|
||||||
if (_sezione_ritsoc == ' ')
|
if (_sezione_ritsoc == ' ')
|
||||||
_sezione_ritsoc = sezione(9);
|
{
|
||||||
|
if (_rec.get_int(CAU_TIPOMOV) <= 2)
|
||||||
|
_sezione_ritsoc = sezione(9); // Fatture
|
||||||
|
else
|
||||||
|
_sezione_ritsoc = sezione(14); // Pagamenti
|
||||||
|
}
|
||||||
return _sezione_ritsoc;
|
return _sezione_ritsoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,13 +68,16 @@ public:
|
|||||||
#define RIGA_IVA_DETRAIBILE 3
|
#define RIGA_IVA_DETRAIBILE 3
|
||||||
#define RIGA_IVA_NON_DETRAIBILE 4
|
#define RIGA_IVA_NON_DETRAIBILE 4
|
||||||
|
|
||||||
|
// Fatture
|
||||||
#define RIGA_RITENUTE_FISCALI 8
|
#define RIGA_RITENUTE_FISCALI 8
|
||||||
#define RIGA_RITENUTE_SOCIALI 9
|
#define RIGA_RITENUTE_SOCIALI 9
|
||||||
|
|
||||||
|
// Pagamenti
|
||||||
#define RIGA_ABBUONI_PASSIVI 9
|
#define RIGA_ABBUONI_PASSIVI 9
|
||||||
#define RIGA_ABBUONI_ATTIVI 10
|
#define RIGA_ABBUONI_ATTIVI 10
|
||||||
#define RIGA_SPESE 11
|
#define RIGA_SPESE 11
|
||||||
#define RIGA_RITENUTE 12
|
#define RIGA_PAG_RITFIS 12
|
||||||
#define RIGA_DIFFCAM 13
|
#define RIGA_DIFFCAM 13
|
||||||
|
#define RIGA_PAG_RITSOC 14
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1176,8 +1176,6 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
|||||||
set_cgs_row(old_riga, imp, old_conto, "", 'I');
|
set_cgs_row(old_riga, imp, old_conto, "", 'I');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Importo della contropartita
|
// Importo della contropartita
|
||||||
if (!new_importo.is_zero() && new_conto.ok())
|
if (!new_importo.is_zero() && new_conto.ok())
|
||||||
{
|
{
|
||||||
@ -1210,7 +1208,7 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aggiornamento ritenute
|
// Aggiornamento ritenute fiscali
|
||||||
const real old_ritenute(old_pag.get(PAGSCA_RITENUTE));
|
const real old_ritenute(old_pag.get(PAGSCA_RITENUTE));
|
||||||
const real new_ritenute(new_pag.get(PAGSCA_RITENUTE));
|
const real new_ritenute(new_pag.get(PAGSCA_RITENUTE));
|
||||||
if (old_ritenute != new_ritenute)
|
if (old_ritenute != new_ritenute)
|
||||||
@ -1219,8 +1217,8 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
|||||||
const int riga = type2pos('F');
|
const int riga = type2pos('F');
|
||||||
if (riga < 0)
|
if (riga < 0)
|
||||||
{
|
{
|
||||||
TBill conto_rit; causale().bill(RIGA_RITENUTE, conto_rit);
|
TBill conto_rit; causale().bill(RIGA_PAG_RITFIS, conto_rit);
|
||||||
const TString desc(causale().desc_agg(RIGA_RITENUTE));
|
const TString desc(causale().desc_agg(RIGA_PAG_RITFIS));
|
||||||
set_cgs_row(riga, grow_ritenute, conto_rit, desc, 'F');
|
set_cgs_row(riga, grow_ritenute, conto_rit, desc, 'F');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1229,6 +1227,26 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
|||||||
if (empty) sheet.destroy(riga);
|
if (empty) sheet.destroy(riga);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Aggiornamento ritenute sociali
|
||||||
|
const real old_ritsoc(old_pag.get(PAGSCA_RITSOC));
|
||||||
|
const real new_ritsoc(new_pag.get(PAGSCA_RITSOC));
|
||||||
|
if (old_ritsoc != new_ritsoc)
|
||||||
|
{
|
||||||
|
const TImporto grow_ritenute(causale().sezione_ritsoc(), new_ritsoc-old_ritsoc);
|
||||||
|
const int riga = type2pos('S');
|
||||||
|
if (riga < 0)
|
||||||
|
{
|
||||||
|
TBill conto_rit; causale().bill(RIGA_PAG_RITSOC, conto_rit);
|
||||||
|
const TString desc(causale().desc_agg(RIGA_PAG_RITSOC));
|
||||||
|
set_cgs_row(riga, grow_ritenute, conto_rit, desc, 'S');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const bool empty = add_cgs_imp(riga, grow_ritenute);
|
||||||
|
if (empty) sheet.destroy(riga);
|
||||||
|
}
|
||||||
|
}
|
||||||
} // if (deleting >= 0)
|
} // if (deleting >= 0)
|
||||||
|
|
||||||
char old_ap, new_ap;
|
char old_ap, new_ap;
|
||||||
@ -1339,6 +1357,7 @@ bool TPrimanota_application::notify_cgline_deletion(TPartita& partita, long nreg
|
|||||||
nul_pag.zero(PAGSCA_IMPORTO);
|
nul_pag.zero(PAGSCA_IMPORTO);
|
||||||
nul_pag.zero(PAGSCA_IMPORTOVAL);
|
nul_pag.zero(PAGSCA_IMPORTOVAL);
|
||||||
nul_pag.zero(PAGSCA_RITENUTE);
|
nul_pag.zero(PAGSCA_RITENUTE);
|
||||||
|
nul_pag.zero(PAGSCA_RITSOC);
|
||||||
nul_pag.put(PAGSCA_ACCSAL, 'A');
|
nul_pag.put(PAGSCA_ACCSAL, 'A');
|
||||||
const TValuta val; // Non cambiare valuta
|
const TValuta val; // Non cambiare valuta
|
||||||
notify_edit_pagamento(partita, nul_pag, val, numrig);
|
notify_edit_pagamento(partita, nul_pag, val, numrig);
|
||||||
@ -1361,6 +1380,7 @@ bool TPrimanota_application::notify_cgline_deletion(TPartita& partita, long nreg
|
|||||||
nul_pag.zero(PAGSCA_IMPORTO);
|
nul_pag.zero(PAGSCA_IMPORTO);
|
||||||
nul_pag.zero(PAGSCA_IMPORTOVAL);
|
nul_pag.zero(PAGSCA_IMPORTOVAL);
|
||||||
nul_pag.zero(PAGSCA_RITENUTE);
|
nul_pag.zero(PAGSCA_RITENUTE);
|
||||||
|
nul_pag.zero(PAGSCA_RITSOC);
|
||||||
nul_pag.put(PAGSCA_ACCSAL, 'A'); // Inutile, ma l'ho copiato da sopra
|
nul_pag.put(PAGSCA_ACCSAL, 'A'); // Inutile, ma l'ho copiato da sopra
|
||||||
const TValuta val; // Non cambiare valuta
|
const TValuta val; // Non cambiare valuta
|
||||||
notify_edit_pagamento(partita, nul_pag, val, numrig);
|
notify_edit_pagamento(partita, nul_pag, val, numrig);
|
||||||
|
@ -106,6 +106,7 @@ class TPay_mask : public TMask
|
|||||||
|
|
||||||
bool _assigned;
|
bool _assigned;
|
||||||
bool _can_solder;
|
bool _can_solder;
|
||||||
|
bool _swap_ritsoc;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static bool importo_handler(TMask_field& f, KEY k);
|
static bool importo_handler(TMask_field& f, KEY k);
|
||||||
@ -206,11 +207,13 @@ void TPay_mask::attiva_valuta(bool in_valuta)
|
|||||||
set_handler(S_IMPORTO, importo_handler);
|
set_handler(S_IMPORTO, importo_handler);
|
||||||
|
|
||||||
enable(S_RITENUTE, !in_valuta); // dis/abilita ritenute
|
enable(S_RITENUTE, !in_valuta); // dis/abilita ritenute
|
||||||
|
enable(S_RITSOC, !in_valuta);
|
||||||
enable(S_IMPORTOVAL, in_valuta);
|
enable(S_IMPORTOVAL, in_valuta);
|
||||||
|
|
||||||
if (in_valuta)
|
if (in_valuta)
|
||||||
{
|
{
|
||||||
reset(S_RITENUTE);
|
reset(S_RITENUTE);
|
||||||
|
reset(S_RITSOC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -227,6 +230,7 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
|
|||||||
const TRiga_partite& sum = p.riga(nrigp);
|
const TRiga_partite& sum = p.riga(nrigp);
|
||||||
_assigned = oldpag.get_int(PAGSCA_NRIGA) != TPartita::UNASSIGNED;
|
_assigned = oldpag.get_int(PAGSCA_NRIGA) != TPartita::UNASSIGNED;
|
||||||
_tipomov = (tipo_movimento)sum.get_int(PART_TIPOMOV);
|
_tipomov = (tipo_movimento)sum.get_int(PART_TIPOMOV);
|
||||||
|
_swap_ritsoc = sum.sezione() != sum.sezione_ritsoc();
|
||||||
|
|
||||||
const TRiga_partite& fatt = _assigned ? scad.riga() : sum;
|
const TRiga_partite& fatt = _assigned ? scad.riga() : sum;
|
||||||
|
|
||||||
@ -312,8 +316,15 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
|
|||||||
|
|
||||||
real oldimp = oldpag.get_real(in_valuta ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);
|
real oldimp = oldpag.get_real(in_valuta ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);
|
||||||
if (!in_valuta)
|
if (!in_valuta)
|
||||||
|
{
|
||||||
oldimp += oldpag.get_real(PAGSCA_RITENUTE);
|
oldimp += oldpag.get_real(PAGSCA_RITENUTE);
|
||||||
|
|
||||||
|
if (_swap_ritsoc)
|
||||||
|
oldimp -= oldpag.get_real(PAGSCA_RITSOC);
|
||||||
|
else
|
||||||
|
oldimp += oldpag.get_real(PAGSCA_RITSOC);
|
||||||
|
}
|
||||||
|
|
||||||
// Ricorda l'importo da pagare
|
// Ricorda l'importo da pagare
|
||||||
_da_pagare += oldimp;
|
_da_pagare += oldimp;
|
||||||
|
|
||||||
@ -365,6 +376,7 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
|
|||||||
|
|
||||||
const bool mostra_ritenute = !sum.is_nota_credito();
|
const bool mostra_ritenute = !sum.is_nota_credito();
|
||||||
show(S_RITENUTE, mostra_ritenute);
|
show(S_RITENUTE, mostra_ritenute);
|
||||||
|
show(S_RITSOC, mostra_ritenute);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPay_mask::get_pag(TRectype& newpag, TRectype& sum) const
|
void TPay_mask::get_pag(TRectype& newpag, TRectype& sum) const
|
||||||
@ -437,7 +449,14 @@ bool TPay_mask::importo_handler(TMask_field& f, KEY k)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m.field(S_RITENUTE).active())
|
if (m.field(S_RITENUTE).active())
|
||||||
imp -= real(m.get(S_RITENUTE));
|
imp -= m.get_real(S_RITENUTE);
|
||||||
|
if (m.field(S_RITSOC).active())
|
||||||
|
{
|
||||||
|
if (m._swap_ritsoc)
|
||||||
|
imp += m.get_real(S_RITSOC);
|
||||||
|
else
|
||||||
|
imp -= m.get_real(S_RITSOC);
|
||||||
|
}
|
||||||
|
|
||||||
f.set(imp.string());
|
f.set(imp.string());
|
||||||
k = K_TAB;
|
k = K_TAB;
|
||||||
@ -451,7 +470,14 @@ bool TPay_mask::importo_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
real i(f.get());
|
real i(f.get());
|
||||||
if (m.field(S_RITENUTE).active())
|
if (m.field(S_RITENUTE).active())
|
||||||
i += real(m.get(S_RITENUTE));
|
i += m.get_real(S_RITENUTE);
|
||||||
|
if (m.field(S_RITSOC).active())
|
||||||
|
{
|
||||||
|
if (m._swap_ritsoc)
|
||||||
|
i -= m.get_real(S_RITSOC);
|
||||||
|
else
|
||||||
|
i += m.get_real(S_RITSOC);
|
||||||
|
}
|
||||||
|
|
||||||
TMask_field& sa = m.field(S_SALDOACC);
|
TMask_field& sa = m.field(S_SALDOACC);
|
||||||
TMaskmode mod = (TMaskmode)m.mode();
|
TMaskmode mod = (TMaskmode)m.mode();
|
||||||
@ -980,6 +1006,15 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
|
|||||||
gm.add_importo(rrit, rit, FALSE);
|
gm.add_importo(rrit, rit, FALSE);
|
||||||
rrit.add(sum.get(PART_TIPOMOV), 11);
|
rrit.add(sum.get(PART_TIPOMOV), 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TImporto soc(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC));
|
||||||
|
if (!soc.is_zero())
|
||||||
|
{
|
||||||
|
TToken_string& rrit = gm.add_colored_row(sheet, 'R');
|
||||||
|
rrit.add(TR("Ritenute sociali"), 4);
|
||||||
|
gm.add_importo(rrit, soc, FALSE);
|
||||||
|
rrit.add(sum.get(PART_TIPOMOV), 11);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gli abbuoni e le differenze cambio esistono solo se e' a saldo
|
// Gli abbuoni e le differenze cambio esistono solo se e' a saldo
|
||||||
@ -1026,13 +1061,13 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
|
|||||||
rsal.add(TR("Saldo rata "), 4); rsal << ra;
|
rsal.add(TR("Saldo rata "), 4); rsal << ra;
|
||||||
if (!scad.chiusa())
|
if (!scad.chiusa())
|
||||||
{
|
{
|
||||||
TImporto sl = scad.residuo(FALSE);
|
TImporto sl = scad.residuo(false);
|
||||||
gm.add_importo(rsal, sl);
|
gm.add_importo(rsal, sl);
|
||||||
tot_lit += sl;
|
tot_lit += sl;
|
||||||
|
|
||||||
if (in_valuta)
|
if (in_valuta)
|
||||||
{
|
{
|
||||||
sl = scad.residuo(TRUE, 0xB);
|
sl = scad.residuo(true, 0xB);
|
||||||
gm.add_importo(rsal, sl, prima_valuta.codice());
|
gm.add_importo(rsal, sl, prima_valuta.codice());
|
||||||
tot_val += sl;
|
tot_val += sl;
|
||||||
}
|
}
|
||||||
@ -1087,6 +1122,16 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
|
|||||||
row.add(sum.get(PART_TIPOMOV), 11);
|
row.add(sum.get(PART_TIPOMOV), 11);
|
||||||
tot_lit += rit;
|
tot_lit += rit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TImporto soc(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC));
|
||||||
|
if (!soc.is_zero())
|
||||||
|
{
|
||||||
|
TToken_string& row = gm.add_colored_row(sheet, 'R');
|
||||||
|
row.add(TR("Ritenute sociali"), 4);
|
||||||
|
gm.add_importo(row, soc, FALSE);
|
||||||
|
row.add(sum.get(PART_TIPOMOV), 11);
|
||||||
|
tot_lit += soc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastrow > 0)
|
if (lastrow > 0)
|
||||||
@ -1823,7 +1868,8 @@ bool TGame_mask::edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp) co
|
|||||||
|
|
||||||
const bool nuovo = oldpag.get(PAGSCA_ACCSAL) != "S" &&
|
const bool nuovo = oldpag.get(PAGSCA_ACCSAL) != "S" &&
|
||||||
oldpag.get_real(PAGSCA_IMPORTO).is_zero() &&
|
oldpag.get_real(PAGSCA_IMPORTO).is_zero() &&
|
||||||
oldpag.get_real(PAGSCA_RITENUTE).is_zero();
|
oldpag.get_real(PAGSCA_RITENUTE).is_zero() &&
|
||||||
|
oldpag.get_real(PAGSCA_RITSOC).is_zero();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TPay_mask m(this, nuovo ? MODE_INS : MODE_MOD);
|
TPay_mask m(this, nuovo ? MODE_INS : MODE_MOD);
|
||||||
@ -1876,6 +1922,7 @@ bool TGame_mask::edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp) co
|
|||||||
newpag.zero(PAGSCA_IMPORTO); // Azzera importo ...
|
newpag.zero(PAGSCA_IMPORTO); // Azzera importo ...
|
||||||
newpag.zero(PAGSCA_IMPORTOVAL); // .. anche in valuta
|
newpag.zero(PAGSCA_IMPORTOVAL); // .. anche in valuta
|
||||||
newpag.zero(PAGSCA_RITENUTE); // Azzera ritenute
|
newpag.zero(PAGSCA_RITENUTE); // Azzera ritenute
|
||||||
|
newpag.zero(PAGSCA_RITSOC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ TContoOccas::TContoOccas()
|
|||||||
const TContoOccas& TContoOccas::set(int g, int c, long s, char t, const char* occfpi)
|
const TContoOccas& TContoOccas::set(int g, int c, long s, char t, const char* occfpi)
|
||||||
{
|
{
|
||||||
TBill::set(g,c,s,t);
|
TBill::set(g,c,s,t);
|
||||||
_occfpi = occfpi;
|
_occfpi = t > ' ' ? occfpi : "";
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1097,7 +1097,6 @@ void TStampa_giornale::set_rows (int file, int counter)
|
|||||||
else
|
else
|
||||||
_tc.set(g,c,s,cf,"");
|
_tc.set(g,c,s,cf,"");
|
||||||
|
|
||||||
|
|
||||||
TParagraph_string descr_conto("", 198);
|
TParagraph_string descr_conto("", 198);
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
descr_conto.set_width (WCONTO132);
|
descr_conto.set_width (WCONTO132);
|
||||||
|
@ -1451,6 +1451,7 @@ void TRic_tab::ricevi_movSC(TString& key, char uselab)
|
|||||||
partita.put(PART_IMPTOTDOC, _tpart->get_real(PART_IMPTOTDOC));
|
partita.put(PART_IMPTOTDOC, _tpart->get_real(PART_IMPTOTDOC));
|
||||||
partita.put(PART_IMPTOTVAL, _tpart->get_real(PART_IMPTOTVAL));
|
partita.put(PART_IMPTOTVAL, _tpart->get_real(PART_IMPTOTVAL));
|
||||||
partita.put(PART_RITENUTE, _tpart->get_real(PART_RITENUTE));
|
partita.put(PART_RITENUTE, _tpart->get_real(PART_RITENUTE));
|
||||||
|
partita.put(PART_RITSOC, _tpart->get_real(PART_RITSOC));
|
||||||
partita.put(PART_SEZABB, _tpart->get (PART_SEZABB));
|
partita.put(PART_SEZABB, _tpart->get (PART_SEZABB));
|
||||||
partita.put(PART_ABBUONI, _tpart->get_real(PART_ABBUONI));
|
partita.put(PART_ABBUONI, _tpart->get_real(PART_ABBUONI));
|
||||||
partita.put(PART_SEZDIFCAM, _tpart->get (PART_SEZDIFCAM));
|
partita.put(PART_SEZDIFCAM, _tpart->get (PART_SEZDIFCAM));
|
||||||
@ -1547,6 +1548,7 @@ void TRic_tab::ricevi_movSC(TString& key, char uselab)
|
|||||||
pag.put(PAGSCA_IMPORTO, _tpagsca->get_real(PAGSCA_IMPORTO));
|
pag.put(PAGSCA_IMPORTO, _tpagsca->get_real(PAGSCA_IMPORTO));
|
||||||
pag.put(PAGSCA_IMPORTOVAL, _tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
pag.put(PAGSCA_IMPORTOVAL, _tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
||||||
pag.put(PAGSCA_RITENUTE, _tpagsca->get_real(PAGSCA_RITENUTE));
|
pag.put(PAGSCA_RITENUTE, _tpagsca->get_real(PAGSCA_RITENUTE));
|
||||||
|
pag.put(PAGSCA_RITSOC, _tpagsca->get_real(PAGSCA_RITSOC));
|
||||||
|
|
||||||
pag.put(PAGSCA_TIPOCC, _tpagsca->get(PAGSCA_TIPOCC));
|
pag.put(PAGSCA_TIPOCC, _tpagsca->get(PAGSCA_TIPOCC));
|
||||||
pag.put(PAGSCA_GRUPPOC, _tpagsca->get(PAGSCA_GRUPPOC));
|
pag.put(PAGSCA_GRUPPOC, _tpagsca->get(PAGSCA_GRUPPOC));
|
||||||
|
@ -65,6 +65,10 @@ class TRic_ListaMov : public TPrintapp
|
|||||||
TString _numpart_prec;
|
TString _numpart_prec;
|
||||||
int _tipopag_pag;
|
int _tipopag_pag;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
char sezione_ritsoc(const TRectype& part) const;
|
||||||
|
real segno_ritsoc(const TRectype& part) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool check_autorization() const
|
virtual bool check_autorization() const
|
||||||
{return FALSE;}
|
{return FALSE;}
|
||||||
@ -119,7 +123,8 @@ public:
|
|||||||
void calcola_imposta(long numreg, real& imposta);
|
void calcola_imposta(long numreg, real& imposta);
|
||||||
bool calcola_impdocval(long nreg,int nrig,char tipo,int g,int c, long s,int anno,TString& numpart,int nriga,real& doc,real& val);
|
bool calcola_impdocval(long nreg,int nrig,char tipo,int g,int c, long s,int anno,TString& numpart,int nriga,real& doc,real& val);
|
||||||
void calcola_importo(char tipo,int g,int c,long s,int anno,TString& numpart,int nriga);
|
void calcola_importo(char tipo,int g,int c,long s,int anno,TString& numpart,int nriga);
|
||||||
void aggiorna_partita(real& importo,real& importoval,real& abbuoni,real& diffcam,real& ritenute,TString& sez,TString& sezabb,TString& sezdc);
|
void aggiorna_partita(real& importo,real& importoval,real& abbuoni,real& diffcam,
|
||||||
|
real& ritfis,real& ritsoc,TString& sez,TString& sezabb,TString& sezdc);
|
||||||
void azzera_impdocval();
|
void azzera_impdocval();
|
||||||
int cerca_anno_solare_esercizio(int codice_esercizio);
|
int cerca_anno_solare_esercizio(int codice_esercizio);
|
||||||
bool esiste_rata();
|
bool esiste_rata();
|
||||||
@ -1983,28 +1988,30 @@ bool TRic_ListaMov::controlla_pagsca()
|
|||||||
void TRic_ListaMov::stampa_errori_pagsca(int riga)
|
void TRic_ListaMov::stampa_errori_pagsca(int riga)
|
||||||
{
|
{
|
||||||
TCursor* cur = current_cursor();
|
TCursor* cur = current_cursor();
|
||||||
|
const TRectype& pagsca = cur->curr(LF_PAGSCA);
|
||||||
|
|
||||||
int nrigp = cur->curr(LF_PAGSCA).get_int (PAGSCA_NRIGP);
|
int nrigp = pagsca.get_int (PAGSCA_NRIGP);
|
||||||
if (nrigp == _nriga)
|
if (nrigp == _nriga)
|
||||||
{
|
{
|
||||||
int nriga = cur->curr(LF_PAGSCA).get_int (PAGSCA_NRIGA);
|
int nriga = pagsca.get_int (PAGSCA_NRIGA);
|
||||||
int nrata = cur->curr(LF_PAGSCA).get_int (PAGSCA_NRATA);
|
int nrata = pagsca.get_int (PAGSCA_NRATA);
|
||||||
char accsaldo = cur->curr(LF_PAGSCA).get_char(PAGSCA_ACCSAL);
|
char accsaldo = pagsca.get_char(PAGSCA_ACCSAL);
|
||||||
real importo = cur->curr(LF_PAGSCA).get_real(PAGSCA_IMPORTO);
|
real importo = pagsca.get_real(PAGSCA_IMPORTO);
|
||||||
real importoval = cur->curr(LF_PAGSCA).get_real(PAGSCA_IMPORTOVAL);
|
real importoval = pagsca.get_real(PAGSCA_IMPORTOVAL);
|
||||||
real abbuoni = cur->curr(LF_PAGSCA).get_real(PAGSCA_ABBUONI);
|
real abbuoni = pagsca.get_real(PAGSCA_ABBUONI);
|
||||||
real ritenute = cur->curr(LF_PAGSCA).get_real(PAGSCA_RITENUTE);
|
real ritenute = pagsca.get_real(PAGSCA_RITENUTE);
|
||||||
real diffcam = cur->curr(LF_PAGSCA).get_real(PAGSCA_DIFFCAM);
|
real ritsoc = pagsca.get_real(PAGSCA_RITSOC);
|
||||||
char passat = cur->curr(LF_PAGSCA).get_char(PAGSCA_PASSATT);
|
real diffcam = pagsca.get_real(PAGSCA_DIFFCAM);
|
||||||
long abins = cur->curr(LF_PAGSCA).get_long(PAGSCA_CODABIPR);
|
char passat = pagsca.get_char(PAGSCA_PASSATT);
|
||||||
long cabns = cur->curr(LF_PAGSCA).get_long(PAGSCA_CODCABPR);
|
long abins = pagsca.get_long(PAGSCA_CODABIPR);
|
||||||
long abivs = cur->curr(LF_PAGSCA).get_long(PAGSCA_CODABI);
|
long cabns = pagsca.get_long(PAGSCA_CODCABPR);
|
||||||
long cabvs = cur->curr(LF_PAGSCA).get_long(PAGSCA_CODCAB);
|
long abivs = pagsca.get_long(PAGSCA_CODABI);
|
||||||
TString codag = cur->curr(LF_PAGSCA).get (PAGSCA_CODAG);
|
long cabvs = pagsca.get_long(PAGSCA_CODCAB);
|
||||||
char tipoc = cur->curr(LF_PAGSCA).get_char(PAGSCA_TIPOCC);
|
TString codag = pagsca.get (PAGSCA_CODAG);
|
||||||
int gruppoc = cur->curr(LF_PAGSCA).get_int (PAGSCA_GRUPPOC);
|
char tipoc = pagsca.get_char(PAGSCA_TIPOCC);
|
||||||
int contoc = cur->curr(LF_PAGSCA).get_int (PAGSCA_CONTOC);
|
int gruppoc = pagsca.get_int (PAGSCA_GRUPPOC);
|
||||||
long sottocc = cur->curr(LF_PAGSCA).get_long(PAGSCA_SOTTOCONTC);
|
int contoc = pagsca.get_int (PAGSCA_CONTOC);
|
||||||
|
long sottocc = pagsca.get_long(PAGSCA_SOTTOCONTC);
|
||||||
|
|
||||||
controlla_anaCF_Pcon(tipoc,gruppoc,contoc,sottocc);
|
controlla_anaCF_Pcon(tipoc,gruppoc,contoc,sottocc);
|
||||||
|
|
||||||
@ -2603,6 +2610,18 @@ void TRic_ListaMov::postclose_print()
|
|||||||
} // if (esegui)
|
} // if (esegui)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char TRic_ListaMov::sezione_ritsoc(const TRectype& part) const
|
||||||
|
{
|
||||||
|
TString16 key; key << part.get(PART_CODCAUS) << "|14"; // Riga ritenute sociali
|
||||||
|
const char sezrs = cache().get(LF_RCAUSALI, key, RCA_SEZIONE)[0];
|
||||||
|
return sezrs > ' ' ? (sezrs == 'D' ? 'A' : 'D') : part.get_char(PART_SEZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
real TRic_ListaMov::segno_ritsoc(const TRectype& part) const
|
||||||
|
{
|
||||||
|
return part.get_char(PART_SEZ) == sezione_ritsoc(part) ? UNO : -UNO;
|
||||||
|
}
|
||||||
|
|
||||||
void TRic_ListaMov::esamina_partite()
|
void TRic_ListaMov::esamina_partite()
|
||||||
{
|
{
|
||||||
bool prima_volta = TRUE;
|
bool prima_volta = TRUE;
|
||||||
@ -2613,7 +2632,7 @@ void TRic_ListaMov::esamina_partite()
|
|||||||
part.setkey(2);
|
part.setkey(2);
|
||||||
part.zero();
|
part.zero();
|
||||||
part.put(PART_NREG, _numero);
|
part.put(PART_NREG, _numero);
|
||||||
TRectype partita (part.curr());
|
const TRectype partita (part.curr());
|
||||||
|
|
||||||
for (part.read(_isgteq); !part.eof(); part.next())
|
for (part.read(_isgteq); !part.eof(); part.next())
|
||||||
{
|
{
|
||||||
@ -2653,6 +2672,8 @@ void TRic_ListaMov::esamina_partite()
|
|||||||
if (nrigp != nriga) continue;
|
if (nrigp != nriga) continue;
|
||||||
|
|
||||||
doc += pagsca.get_real(PAGSCA_IMPORTO) + pagsca.get_real(PAGSCA_RITENUTE);
|
doc += pagsca.get_real(PAGSCA_IMPORTO) + pagsca.get_real(PAGSCA_RITENUTE);
|
||||||
|
doc += pagsca.get_real(PAGSCA_RITSOC) * segno_ritsoc(part.curr());
|
||||||
|
|
||||||
val += pagsca.get_real(PAGSCA_IMPORTOVAL);
|
val += pagsca.get_real(PAGSCA_IMPORTOVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2872,7 +2893,7 @@ bool TRic_ListaMov::calcola_impdocval(long nreg,int nrig,char tipoc,int gruppo,i
|
|||||||
pagsca.put(PAGSCA_NUMPART, numpart);
|
pagsca.put(PAGSCA_NUMPART, numpart);
|
||||||
// pagsca.put(PAGSCA_NRIGA, nriga);
|
// pagsca.put(PAGSCA_NRIGA, nriga);
|
||||||
|
|
||||||
TRectype pagamenti (pagsca.curr());
|
const TRectype pagamenti (pagsca.curr());
|
||||||
|
|
||||||
for (pagsca.read(_isgteq); !pagsca.eof(); pagsca.next())
|
for (pagsca.read(_isgteq); !pagsca.eof(); pagsca.next())
|
||||||
{
|
{
|
||||||
@ -2886,6 +2907,16 @@ bool TRic_ListaMov::calcola_impdocval(long nreg,int nrig,char tipoc,int gruppo,i
|
|||||||
if (nrigp != nriga) continue;
|
if (nrigp != nriga) continue;
|
||||||
|
|
||||||
doc += pagsca.get_real(PAGSCA_IMPORTO) + pagsca.get_real(PAGSCA_RITENUTE);
|
doc += pagsca.get_real(PAGSCA_IMPORTO) + pagsca.get_real(PAGSCA_RITENUTE);
|
||||||
|
const real ritsoc = pagsca.get(PAGSCA_RITSOC);
|
||||||
|
if (!ritsoc.is_zero())
|
||||||
|
{
|
||||||
|
TToken_string key;
|
||||||
|
key.add(tipoc); key.add(gruppo); key.add(conto); key.add(sottoc);
|
||||||
|
key.add(anno); key.add(numpart);
|
||||||
|
const TRectype& part = cache().get(LF_PARTITE, key);
|
||||||
|
doc += ritsoc * segno_ritsoc(part);
|
||||||
|
}
|
||||||
|
|
||||||
val += pagsca.get_real(PAGSCA_IMPORTOVAL);
|
val += pagsca.get_real(PAGSCA_IMPORTOVAL);
|
||||||
}
|
}
|
||||||
_tpagsca->readat(recn);
|
_tpagsca->readat(recn);
|
||||||
@ -2956,7 +2987,7 @@ void TRic_ListaMov::calcola_importo(char tipoc,int gruppo,int conto,long sottoc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TRic_ListaMov::aggiorna_partita(real& importo,real& importoval,real& abbuoni,real& diffcam,
|
void TRic_ListaMov::aggiorna_partita(real& importo,real& importoval,real& abbuoni,real& diffcam,
|
||||||
real& ritenute,TString& sez,TString& sezabb,TString& sezdc)
|
real& ritfis,real& ritsoc, TString& sez,TString& sezabb,TString& sezdc)
|
||||||
{
|
{
|
||||||
TRecnotype recn = _tpagsca->recno();
|
TRecnotype recn = _tpagsca->recno();
|
||||||
TIsamtempfile& pagsca = *_tpagsca;
|
TIsamtempfile& pagsca = *_tpagsca;
|
||||||
@ -2989,7 +3020,8 @@ void TRic_ListaMov::aggiorna_partita(real& importo,real& importoval,real& abbuon
|
|||||||
|
|
||||||
importo += pagsca.get_real(PAGSCA_IMPORTO);
|
importo += pagsca.get_real(PAGSCA_IMPORTO);
|
||||||
importoval += pagsca.get_real(PAGSCA_IMPORTOVAL);
|
importoval += pagsca.get_real(PAGSCA_IMPORTOVAL);
|
||||||
ritenute += pagsca.get_real(PAGSCA_RITENUTE);
|
ritfis += pagsca.get_real(PAGSCA_RITENUTE);
|
||||||
|
ritsoc += pagsca.get_real(PAGSCA_RITSOC);
|
||||||
|
|
||||||
abb = pagsca.get_real(PAGSCA_ABBUONI);
|
abb = pagsca.get_real(PAGSCA_ABBUONI);
|
||||||
if (abb != ZERO)
|
if (abb != ZERO)
|
||||||
@ -3090,18 +3122,20 @@ void TRic_ListaMov::aggiorna_partite()
|
|||||||
{
|
{
|
||||||
real importo = ZERO;
|
real importo = ZERO;
|
||||||
real importoval = ZERO;
|
real importoval = ZERO;
|
||||||
real ritenute = ZERO;
|
real ritfis = ZERO;
|
||||||
|
real ritsoc = ZERO;
|
||||||
real abbuoni = ZERO;
|
real abbuoni = ZERO;
|
||||||
real diffcam = ZERO;
|
real diffcam = ZERO;
|
||||||
TString sez = part.get(PART_SEZ);
|
TString sez = part.get(PART_SEZ);
|
||||||
TString sezabb = part.get(PART_SEZABB);
|
TString sezabb = part.get(PART_SEZABB);
|
||||||
TString sezdc = part.get(PART_SEZDIFCAM);
|
TString sezdc = part.get(PART_SEZDIFCAM);
|
||||||
|
|
||||||
aggiorna_partita(importo,importoval,abbuoni,diffcam,ritenute,sez,sezabb,sezdc);
|
aggiorna_partita(importo,importoval,abbuoni,diffcam,ritfis,ritsoc,sez,sezabb,sezdc);
|
||||||
|
|
||||||
part.put(PART_IMPORTO, importo);
|
part.put(PART_IMPORTO, importo);
|
||||||
part.put(PART_IMPORTOVAL, importoval);
|
part.put(PART_IMPORTOVAL, importoval);
|
||||||
part.put(PART_RITENUTE, ritenute);
|
part.put(PART_RITENUTE, ritfis);
|
||||||
|
part.put(PART_RITSOC, ritsoc);
|
||||||
part.put(PART_SEZABB, sezabb);
|
part.put(PART_SEZABB, sezabb);
|
||||||
part.put(PART_ABBUONI, abbuoni);
|
part.put(PART_ABBUONI, abbuoni);
|
||||||
part.put(PART_SEZDIFCAM, sezdc);
|
part.put(PART_SEZDIFCAM, sezdc);
|
||||||
|
@ -424,9 +424,11 @@ void TAnn_mov::sgancia_pagamenti(char tipo,int g,int c,long s,int anno,TString&
|
|||||||
real importo = pagsca.get_real(PAGSCA_IMPORTO) + pag.get_real(PAGSCA_IMPORTO);
|
real importo = pagsca.get_real(PAGSCA_IMPORTO) + pag.get_real(PAGSCA_IMPORTO);
|
||||||
real impval = pagsca.get_real(PAGSCA_IMPORTOVAL) + pag.get_real(PAGSCA_IMPORTOVAL);
|
real impval = pagsca.get_real(PAGSCA_IMPORTOVAL) + pag.get_real(PAGSCA_IMPORTOVAL);
|
||||||
real ritenute = pagsca.get_real(PAGSCA_RITENUTE) + pag.get_real(PAGSCA_RITENUTE);
|
real ritenute = pagsca.get_real(PAGSCA_RITENUTE) + pag.get_real(PAGSCA_RITENUTE);
|
||||||
|
real ritsoc = pagsca.get_real(PAGSCA_RITSOC) + pag.get_real(PAGSCA_RITSOC);
|
||||||
pagsca.put(PAGSCA_IMPORTO, importo);
|
pagsca.put(PAGSCA_IMPORTO, importo);
|
||||||
pagsca.put(PAGSCA_IMPORTOVAL, impval);
|
pagsca.put(PAGSCA_IMPORTOVAL, impval);
|
||||||
pagsca.put(PAGSCA_RITENUTE, ritenute);
|
pagsca.put(PAGSCA_RITENUTE, ritenute);
|
||||||
|
pagsca.put(PAGSCA_RITSOC, ritsoc);
|
||||||
pagsca.put(PAGSCA_ACCSAL, "A");
|
pagsca.put(PAGSCA_ACCSAL, "A");
|
||||||
pagsca.rewrite();
|
pagsca.rewrite();
|
||||||
}
|
}
|
||||||
|
@ -515,6 +515,7 @@ void TVar_sc::setta_mask_pagsca(char tipo,int gruppo,int conto,long sottoc,
|
|||||||
TString16 accsal (_tpagsca->get (PAGSCA_ACCSAL));
|
TString16 accsal (_tpagsca->get (PAGSCA_ACCSAL));
|
||||||
real importo (_tpagsca->get_real(PAGSCA_IMPORTO));
|
real importo (_tpagsca->get_real(PAGSCA_IMPORTO));
|
||||||
real ritenute (_tpagsca->get_real(PAGSCA_RITENUTE));
|
real ritenute (_tpagsca->get_real(PAGSCA_RITENUTE));
|
||||||
|
real ritsoc (_tpagsca->get_real(PAGSCA_RITSOC));
|
||||||
real abbuoni (_tpagsca->get_real(PAGSCA_ABBUONI));
|
real abbuoni (_tpagsca->get_real(PAGSCA_ABBUONI));
|
||||||
real diffcam (_tpagsca->get_real(PAGSCA_DIFFCAM));
|
real diffcam (_tpagsca->get_real(PAGSCA_DIFFCAM));
|
||||||
real impval (_tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
real impval (_tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
||||||
@ -617,6 +618,7 @@ void TVar_sc::setta_mask_pagsca(char tipo,int gruppo,int conto,long sottoc,
|
|||||||
row.add(codag);
|
row.add(codag);
|
||||||
str.format("%c", passat);
|
str.format("%c", passat);
|
||||||
row.add(str);
|
row.add(str);
|
||||||
|
row.add(ritsoc.string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2098,9 +2100,11 @@ void TVar_sc::sgancia_pagamenti(char tipo,int g,int c,long s,int anno,TString& n
|
|||||||
real importo = pagsca.get_real(PAGSCA_IMPORTO) + pag.get_real(PAGSCA_IMPORTO);
|
real importo = pagsca.get_real(PAGSCA_IMPORTO) + pag.get_real(PAGSCA_IMPORTO);
|
||||||
real impval = pagsca.get_real(PAGSCA_IMPORTOVAL) + pag.get_real(PAGSCA_IMPORTOVAL);
|
real impval = pagsca.get_real(PAGSCA_IMPORTOVAL) + pag.get_real(PAGSCA_IMPORTOVAL);
|
||||||
real ritenute = pagsca.get_real(PAGSCA_RITENUTE) + pag.get_real(PAGSCA_RITENUTE);
|
real ritenute = pagsca.get_real(PAGSCA_RITENUTE) + pag.get_real(PAGSCA_RITENUTE);
|
||||||
|
real ritsoc = pagsca.get_real(PAGSCA_RITSOC) + pag.get_real(PAGSCA_RITSOC);
|
||||||
pagsca.put(PAGSCA_IMPORTO, importo);
|
pagsca.put(PAGSCA_IMPORTO, importo);
|
||||||
pagsca.put(PAGSCA_IMPORTOVAL, impval);
|
pagsca.put(PAGSCA_IMPORTOVAL, impval);
|
||||||
pagsca.put(PAGSCA_RITENUTE, ritenute);
|
pagsca.put(PAGSCA_RITENUTE, ritenute);
|
||||||
|
pagsca.put(PAGSCA_RITSOC, ritsoc);
|
||||||
pagsca.put(PAGSCA_ACCSAL, "A");
|
pagsca.put(PAGSCA_ACCSAL, "A");
|
||||||
pagsca.rewrite();
|
pagsca.rewrite();
|
||||||
}
|
}
|
||||||
@ -2443,6 +2447,7 @@ void TVar_sc::registra_pagamenti(TMask& m)
|
|||||||
long vsabi = row.get_long(27);
|
long vsabi = row.get_long(27);
|
||||||
long vscab = row.get_long(28);
|
long vscab = row.get_long(28);
|
||||||
TString codag = row.get (29);
|
TString codag = row.get (29);
|
||||||
|
real ritsoc (row.get (31));
|
||||||
|
|
||||||
TString codval = "";
|
TString codval = "";
|
||||||
char sez = sezione(tipo,gruppo,conto,sottoc,anno,numpart,nriga,codval,*_mask);
|
char sez = sezione(tipo,gruppo,conto,sottoc,anno,numpart,nriga,codval,*_mask);
|
||||||
@ -2489,6 +2494,7 @@ void TVar_sc::registra_pagamenti(TMask& m)
|
|||||||
_tpagsca->put(PAGSCA_ACCSAL, accsal);
|
_tpagsca->put(PAGSCA_ACCSAL, accsal);
|
||||||
_tpagsca->put(PAGSCA_IMPORTO, importo);
|
_tpagsca->put(PAGSCA_IMPORTO, importo);
|
||||||
_tpagsca->put(PAGSCA_RITENUTE, ritenute);
|
_tpagsca->put(PAGSCA_RITENUTE, ritenute);
|
||||||
|
_tpagsca->put(PAGSCA_RITSOC, ritsoc);
|
||||||
_tpagsca->put(PAGSCA_ABBUONI, abbuoni);
|
_tpagsca->put(PAGSCA_ABBUONI, abbuoni);
|
||||||
_tpagsca->put(PAGSCA_DIFFCAM, diffcam);
|
_tpagsca->put(PAGSCA_DIFFCAM, diffcam);
|
||||||
_tpagsca->put(PAGSCA_IMPORTOVAL, impval);
|
_tpagsca->put(PAGSCA_IMPORTOVAL, impval);
|
||||||
@ -2519,6 +2525,7 @@ void TVar_sc::registra_pagamenti(TMask& m)
|
|||||||
_tpagsca->put(PAGSCA_ACCSAL, accsal);
|
_tpagsca->put(PAGSCA_ACCSAL, accsal);
|
||||||
_tpagsca->put(PAGSCA_IMPORTO, importo);
|
_tpagsca->put(PAGSCA_IMPORTO, importo);
|
||||||
_tpagsca->put(PAGSCA_RITENUTE, ritenute);
|
_tpagsca->put(PAGSCA_RITENUTE, ritenute);
|
||||||
|
_tpagsca->put(PAGSCA_RITSOC, ritsoc);
|
||||||
_tpagsca->put(PAGSCA_ABBUONI, abbuoni);
|
_tpagsca->put(PAGSCA_ABBUONI, abbuoni);
|
||||||
_tpagsca->put(PAGSCA_DIFFCAM, diffcam);
|
_tpagsca->put(PAGSCA_DIFFCAM, diffcam);
|
||||||
_tpagsca->put(PAGSCA_IMPORTOVAL, impval);
|
_tpagsca->put(PAGSCA_IMPORTOVAL, impval);
|
||||||
|
@ -2027,6 +2027,13 @@ bool TInv_cont::invio_mov_SC()
|
|||||||
partita2trasfer(record,FALSE);
|
partita2trasfer(record,FALSE);
|
||||||
pagsca2trasfer(record,ritenute,imp);
|
pagsca2trasfer(record,ritenute,imp);
|
||||||
}
|
}
|
||||||
|
real ritsoc (_tpagsca->get_real(PAGSCA_RITSOC));
|
||||||
|
if (ritsoc != ZERO)
|
||||||
|
{
|
||||||
|
real imp = ZERO;
|
||||||
|
partita2trasfer(record,FALSE);
|
||||||
|
pagsca2trasfer(record,ritsoc,imp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1329,7 +1329,18 @@ void TInv_cont::invio_partite()
|
|||||||
else
|
else
|
||||||
record.overwrite("+",285);
|
record.overwrite("+",285);
|
||||||
str.format("%014s", (const char*) ritenute.string());
|
str.format("%014s", (const char*) ritenute.string());
|
||||||
record.overwrite(str,286); //Ritenute
|
record.overwrite(str,286); //Ritenute fiscali
|
||||||
|
|
||||||
|
real ritsoc (_tpart->get_real(PART_RITSOC));
|
||||||
|
if (ritsoc.sign() < 0)
|
||||||
|
{
|
||||||
|
record.overwrite("-",341);
|
||||||
|
ritsoc = -ritsoc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
record.overwrite("+",341);
|
||||||
|
str.format("%014s", (const char*) ritsoc.string());
|
||||||
|
record.overwrite(str,342); //Ritenute sociali
|
||||||
|
|
||||||
TString sezabb = _tpart->get(PART_SEZABB);
|
TString sezabb = _tpart->get(PART_SEZABB);
|
||||||
record.overwrite(sezabb,300); //Sezione abbuoni
|
record.overwrite(sezabb,300); //Sezione abbuoni
|
||||||
@ -1661,7 +1672,18 @@ void TInv_cont::invio_pagsca()
|
|||||||
else
|
else
|
||||||
record.overwrite("+",126);
|
record.overwrite("+",126);
|
||||||
str.format("%014s", (const char*) ritenute.string());
|
str.format("%014s", (const char*) ritenute.string());
|
||||||
record.overwrite(str,127); //Ritenute
|
record.overwrite(str,127); //Ritenute fiscali
|
||||||
|
|
||||||
|
real ritsoc (_tpagsca->get_real(PAGSCA_RITSOC));
|
||||||
|
if (ritsoc.sign() < 0)
|
||||||
|
{
|
||||||
|
record.overwrite("-",178);
|
||||||
|
ritsoc = -ritsoc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
record.overwrite("+",178);
|
||||||
|
str.format("%014s", (const char*) ritsoc.string());
|
||||||
|
record.overwrite(str,179); //Ritenute sociali
|
||||||
|
|
||||||
char tipoc = _tpagsca->get_char(PAGSCA_TIPOCC);
|
char tipoc = _tpagsca->get_char(PAGSCA_TIPOCC);
|
||||||
str.format("%c", tipoc);
|
str.format("%c", tipoc);
|
||||||
|
@ -2680,8 +2680,9 @@ char TTransfer_file::what_is_this(TString& record,TString& tipo)
|
|||||||
return caso;
|
return caso;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void TTransfer_file::aggiorna_partita(TString& record,TString& tipo,real& importo,real& importoval,
|
void TTransfer_file::aggiorna_partita(TString& record,TString& tipo,real& importo,real& importoval,
|
||||||
real& abbuoni,real& diffcam,real& ritenute)
|
real& abbuoni,real& diffcam,real& ritenute,real& ritsoc)
|
||||||
{
|
{
|
||||||
TRecnotype rec = _tpart->recno();
|
TRecnotype rec = _tpart->recno();
|
||||||
TIsamtempfile& part = *_tpart;
|
TIsamtempfile& part = *_tpart;
|
||||||
@ -2713,8 +2714,11 @@ void TTransfer_file::aggiorna_partita(TString& record,TString& tipo,real& import
|
|||||||
part.put(PART_IMPORTO, imp);
|
part.put(PART_IMPORTO, imp);
|
||||||
part.put(PART_IMPORTOVAL, val);
|
part.put(PART_IMPORTOVAL, val);
|
||||||
|
|
||||||
real rit = part.get_real(PART_RITENUTE) + ritenute;
|
real ritf = part.get_real(PART_RITENUTE) + ritenute;
|
||||||
part.put(PART_RITENUTE, rit);
|
part.put(PART_RITENUTE, ritf);
|
||||||
|
|
||||||
|
real rits = part.get_real(PART_RITSOC) + ritsoc;
|
||||||
|
part.put(PART_RITSOC, rits);
|
||||||
|
|
||||||
if (abbuoni != ZERO)
|
if (abbuoni != ZERO)
|
||||||
{
|
{
|
||||||
@ -2769,7 +2773,7 @@ void TTransfer_file::aggiorna_partita(TString& record,TString& tipo,real& import
|
|||||||
}
|
}
|
||||||
_tpart->readat(rec);
|
_tpart->readat(rec);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
char TTransfer_file::leggi_sez_partita(TString& record,TString& tipo)
|
char TTransfer_file::leggi_sez_partita(TString& record,TString& tipo)
|
||||||
{
|
{
|
||||||
@ -2927,7 +2931,7 @@ void TTransfer_file::pagsca(TString& record)
|
|||||||
else
|
else
|
||||||
if (fname == "IMP")
|
if (fname == "IMP")
|
||||||
{
|
{
|
||||||
TString codval = record.sub(79,82);
|
TString4 codval = record.sub(79,82);
|
||||||
codval.trim();
|
codval.trim();
|
||||||
|
|
||||||
if (caso == 'a' || caso == 'd')
|
if (caso == 'a' || caso == 'd')
|
||||||
@ -3017,6 +3021,7 @@ void TTransfer_file::pagsca(TString& record)
|
|||||||
real abbuoni = _tpagsca->get_real(PAGSCA_ABBUONI) + _deppagsca->get_real(PAGSCA_ABBUONI);
|
real abbuoni = _tpagsca->get_real(PAGSCA_ABBUONI) + _deppagsca->get_real(PAGSCA_ABBUONI);
|
||||||
real diffcam = _tpagsca->get_real(PAGSCA_DIFFCAM) + _deppagsca->get_real(PAGSCA_DIFFCAM);
|
real diffcam = _tpagsca->get_real(PAGSCA_DIFFCAM) + _deppagsca->get_real(PAGSCA_DIFFCAM);
|
||||||
real ritenute = _tpagsca->get_real(PAGSCA_RITENUTE) + _deppagsca->get_real(PAGSCA_RITENUTE);
|
real ritenute = _tpagsca->get_real(PAGSCA_RITENUTE) + _deppagsca->get_real(PAGSCA_RITENUTE);
|
||||||
|
real ritsoc = _tpagsca->get_real(PAGSCA_RITSOC) + _deppagsca->get_real(PAGSCA_RITSOC);
|
||||||
|
|
||||||
if (accsal != "S")
|
if (accsal != "S")
|
||||||
_tpagsca->put(PAGSCA_ACCSAL, _deppagsca->get(PAGSCA_ACCSAL));
|
_tpagsca->put(PAGSCA_ACCSAL, _deppagsca->get(PAGSCA_ACCSAL));
|
||||||
@ -3027,6 +3032,7 @@ void TTransfer_file::pagsca(TString& record)
|
|||||||
_tpagsca->put(PAGSCA_ABBUONI, abbuoni);
|
_tpagsca->put(PAGSCA_ABBUONI, abbuoni);
|
||||||
_tpagsca->put(PAGSCA_DIFFCAM, diffcam);
|
_tpagsca->put(PAGSCA_DIFFCAM, diffcam);
|
||||||
_tpagsca->put(PAGSCA_RITENUTE, ritenute);
|
_tpagsca->put(PAGSCA_RITENUTE, ritenute);
|
||||||
|
_tpagsca->put(PAGSCA_RITSOC, ritsoc);
|
||||||
|
|
||||||
_tpagsca->rewrite();
|
_tpagsca->rewrite();
|
||||||
}
|
}
|
||||||
@ -4772,6 +4778,14 @@ void TTransfer_file::write_partite(TString& record)
|
|||||||
else
|
else
|
||||||
field = importo;
|
field = importo;
|
||||||
}
|
}
|
||||||
|
if (fname == PART_RITSOC)
|
||||||
|
{
|
||||||
|
sign = record.sub(341,342);
|
||||||
|
if (sign == "-")
|
||||||
|
field = sign << importo;
|
||||||
|
else
|
||||||
|
field = importo;
|
||||||
|
}
|
||||||
if (fname == PART_ABBUONI)
|
if (fname == PART_ABBUONI)
|
||||||
{
|
{
|
||||||
sign = record.sub(301,302);
|
sign = record.sub(301,302);
|
||||||
@ -5073,6 +5087,14 @@ void TTransfer_file::write_pagsca(TString& record)
|
|||||||
else
|
else
|
||||||
field = importo;
|
field = importo;
|
||||||
}
|
}
|
||||||
|
if (fname == PAGSCA_RITSOC)
|
||||||
|
{
|
||||||
|
sign = record.sub(178,179);
|
||||||
|
if (sign == "-")
|
||||||
|
field = sign << importo;
|
||||||
|
else
|
||||||
|
field = importo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
field = importo;
|
field = importo;
|
||||||
|
@ -225,7 +225,7 @@ private:
|
|||||||
void calcola_importo(TString& record);
|
void calcola_importo(TString& record);
|
||||||
int recupera_scadenze(TString& record,TString& tipo);
|
int recupera_scadenze(TString& record,TString& tipo);
|
||||||
char what_is_this(TString& record,TString& tipo);
|
char what_is_this(TString& record,TString& tipo);
|
||||||
void aggiorna_partita(TString& record,TString& tipo,real& importo,real& importoval,real& abbuoni,real& diffcam,real& ritenute);
|
// void aggiorna_partita(TString& record,TString& tipo,real& importo,real& importoval,real& abbuoni,real& diffcam,real& ritenute,real& ritsoc);
|
||||||
char leggi_sez_partita(TString& record,TString& tipo);
|
char leggi_sez_partita(TString& record,TString& tipo);
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
|
#include <rcausali.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TTree_rectype
|
// TTree_rectype
|
||||||
@ -332,7 +333,10 @@ TImporto TRiga_scadenze::importo_pagato(bool val, int mode) const
|
|||||||
if (mode & 0x1)
|
if (mode & 0x1)
|
||||||
totale += TImporto(sez, pag.get_real(imp_field));
|
totale += TImporto(sez, pag.get_real(imp_field));
|
||||||
if (!in_val && (mode & 0x8)) // Le ritenute non esistono nei pagamenti in valuta
|
if (!in_val && (mode & 0x8)) // Le ritenute non esistono nei pagamenti in valuta
|
||||||
|
{
|
||||||
totale += TImporto(sez, pag.get_real(PAGSCA_RITENUTE));
|
totale += TImporto(sez, pag.get_real(PAGSCA_RITENUTE));
|
||||||
|
totale += TImporto(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC));
|
||||||
|
}
|
||||||
|
|
||||||
if (mode & 0x2) // Voglio anche gli abbuoni
|
if (mode & 0x2) // Voglio anche gli abbuoni
|
||||||
{
|
{
|
||||||
@ -516,10 +520,12 @@ bool TRiga_scadenze::modifica_pagamento(const TRectype& new_pag, const TValuta&
|
|||||||
sum.update(old_pag, new_pag, PART_IMPORTO);
|
sum.update(old_pag, new_pag, PART_IMPORTO);
|
||||||
sum.update(old_pag, new_pag, PART_IMPORTOVAL);
|
sum.update(old_pag, new_pag, PART_IMPORTOVAL);
|
||||||
sum.update(old_pag, new_pag, PART_RITENUTE);
|
sum.update(old_pag, new_pag, PART_RITENUTE);
|
||||||
|
sum.update(old_pag, new_pag, PART_RITSOC);
|
||||||
|
|
||||||
const bool empty = new_pag.get_char(PAGSCA_ACCSAL) != 'S' &&
|
const bool empty = new_pag.get_char(PAGSCA_ACCSAL) != 'S' &&
|
||||||
new_pag.get_real(PAGSCA_IMPORTO).is_zero() &&
|
new_pag.get_real(PAGSCA_IMPORTO).is_zero() &&
|
||||||
new_pag.get_real(PAGSCA_RITENUTE).is_zero();
|
new_pag.get_real(PAGSCA_RITENUTE).is_zero() &&
|
||||||
|
new_pag.get_real(PAGSCA_RITSOC).is_zero();
|
||||||
if (empty)
|
if (empty)
|
||||||
rows_array().destroy_row(nrigp);
|
rows_array().destroy_row(nrigp);
|
||||||
|
|
||||||
@ -557,6 +563,7 @@ bool TRiga_scadenze::elimina_pagamento(int p)
|
|||||||
old_pag.zero(PAGSCA_IMPORTO);
|
old_pag.zero(PAGSCA_IMPORTO);
|
||||||
old_pag.zero(PAGSCA_IMPORTOVAL);
|
old_pag.zero(PAGSCA_IMPORTOVAL);
|
||||||
old_pag.zero(PAGSCA_RITENUTE);
|
old_pag.zero(PAGSCA_RITENUTE);
|
||||||
|
old_pag.zero(PAGSCA_RITSOC);
|
||||||
TValuta val;
|
TValuta val;
|
||||||
return partita().modifica_pagamento(old_pag, val, TRUE);
|
return partita().modifica_pagamento(old_pag, val, TRUE);
|
||||||
}
|
}
|
||||||
@ -583,7 +590,6 @@ TRiga_partite::TRiga_partite(const TRiga_partite& r)
|
|||||||
TRiga_partite::~TRiga_partite()
|
TRiga_partite::~TRiga_partite()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void TRiga_partite::update_rigaptr()
|
void TRiga_partite::update_rigaptr()
|
||||||
{
|
{
|
||||||
for (int i = rate(); i >= 0; i--)
|
for (int i = rate(); i >= 0; i--)
|
||||||
@ -638,6 +644,14 @@ tipo_movimento TRiga_partite::tipo() const
|
|||||||
return tm;
|
return tm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calcola il segno delle ritenute sociali in base alla causale
|
||||||
|
char TRiga_partite::sezione_ritsoc() const
|
||||||
|
{
|
||||||
|
TString16 key; key << get(PART_CODCAUS) << "|14"; // Riga ritenute sociali
|
||||||
|
const char sezrs = cache().get(LF_RCAUSALI, key, RCA_SEZIONE)[0];
|
||||||
|
return sezrs > ' ' ? (sezrs == 'D' ? 'A' : 'D') : sezione();
|
||||||
|
}
|
||||||
|
|
||||||
// Legge le rate relative ad una riga di fattura
|
// Legge le rate relative ad una riga di fattura
|
||||||
// Certified 99%
|
// Certified 99%
|
||||||
int TRiga_partite::read(TBaseisamfile& f, word op, word lock)
|
int TRiga_partite::read(TBaseisamfile& f, word op, word lock)
|
||||||
@ -754,7 +768,7 @@ TImporto TRiga_partite::importo(bool valuta, int mode) const
|
|||||||
CHECKD(mode > 0x0 && mode <= 0xF, "Bad importo mode ", mode);
|
CHECKD(mode > 0x0 && mode <= 0xF, "Bad importo mode ", mode);
|
||||||
const bool in_lire = !in_valuta(); // Partita in lire
|
const bool in_lire = !in_valuta(); // Partita in lire
|
||||||
if (valuta && in_lire)
|
if (valuta && in_lire)
|
||||||
valuta = FALSE;
|
valuta = false;
|
||||||
|
|
||||||
TImporto i;
|
TImporto i;
|
||||||
if (mode & 0x1)
|
if (mode & 0x1)
|
||||||
@ -777,7 +791,13 @@ TImporto TRiga_partite::importo(bool valuta, int mode) const
|
|||||||
else // Desidero gli abbuoni in lire
|
else // Desidero gli abbuoni in lire
|
||||||
{
|
{
|
||||||
if (in_lire && (mode & 0x8))
|
if (in_lire && (mode & 0x8))
|
||||||
|
{
|
||||||
i.valore() += get_real(PART_RITENUTE);
|
i.valore() += get_real(PART_RITENUTE);
|
||||||
|
if (sezione() == sezione_ritsoc())
|
||||||
|
i.valore() += get_real(PART_RITSOC);
|
||||||
|
else
|
||||||
|
i.valore() -= get_real(PART_RITSOC);
|
||||||
|
}
|
||||||
|
|
||||||
if (mode & 0x2)
|
if (mode & 0x2)
|
||||||
{
|
{
|
||||||
@ -1340,6 +1360,7 @@ bool TPartita::elimina_pagamento(int nriga, int nrata, int nrigp)
|
|||||||
old_pag.zero(PAGSCA_IMPORTO);
|
old_pag.zero(PAGSCA_IMPORTO);
|
||||||
old_pag.zero(PAGSCA_IMPORTOVAL);
|
old_pag.zero(PAGSCA_IMPORTOVAL);
|
||||||
old_pag.zero(PAGSCA_RITENUTE);
|
old_pag.zero(PAGSCA_RITENUTE);
|
||||||
|
old_pag.zero(PAGSCA_RITSOC);
|
||||||
const TValuta val;
|
const TValuta val;
|
||||||
modifica_pagamento(old_pag, val, TRUE);
|
modifica_pagamento(old_pag, val, TRUE);
|
||||||
}
|
}
|
||||||
@ -1644,7 +1665,10 @@ TImporto TPartita::importo_pagato_unassigned(bool val, int mode) const
|
|||||||
if (mode & 0x1)
|
if (mode & 0x1)
|
||||||
totale += TImporto(sez, pag.get_real(imp_field));
|
totale += TImporto(sez, pag.get_real(imp_field));
|
||||||
if (!in_val && (mode & 0x8)) // Le ritenute non esistono nei pagamenti in valuta
|
if (!in_val && (mode & 0x8)) // Le ritenute non esistono nei pagamenti in valuta
|
||||||
|
{
|
||||||
totale += TImporto(sez, pag.get_real(PAGSCA_RITENUTE));
|
totale += TImporto(sez, pag.get_real(PAGSCA_RITENUTE));
|
||||||
|
totale += TImporto(sum.sezione_ritsoc(), pag.get_real(PAGSCA_RITSOC));
|
||||||
|
}
|
||||||
|
|
||||||
if (mode & 0x2) // Voglio anche gli abbuoni
|
if (mode & 0x2) // Voglio anche gli abbuoni
|
||||||
{
|
{
|
||||||
@ -1669,7 +1693,6 @@ TImporto TPartita::importo_pagato_unassigned(bool val, int mode) const
|
|||||||
return totale.normalize();
|
return totale.normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Controlla se esistono pagamenti riferiti alla riga nrigp
|
// Controlla se esistono pagamenti riferiti alla riga nrigp
|
||||||
bool TPartita::utilizzata(int nrigp) const
|
bool TPartita::utilizzata(int nrigp) const
|
||||||
{
|
{
|
||||||
@ -1712,6 +1735,7 @@ bool TPartita::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta
|
|||||||
empty = sum.update(old_pag, new_pag, PART_IMPORTO);
|
empty = sum.update(old_pag, new_pag, PART_IMPORTO);
|
||||||
sum.update(old_pag, new_pag, PART_IMPORTOVAL);
|
sum.update(old_pag, new_pag, PART_IMPORTOVAL);
|
||||||
sum.update(old_pag, new_pag, PART_RITENUTE);
|
sum.update(old_pag, new_pag, PART_RITENUTE);
|
||||||
|
sum.update(old_pag, new_pag, PART_RITSOC);
|
||||||
|
|
||||||
if (new_pag.get_real(PAGSCA_IMPORTO).is_zero())
|
if (new_pag.get_real(PAGSCA_IMPORTO).is_zero())
|
||||||
_unassigned.destroy_row(nrigp);
|
_unassigned.destroy_row(nrigp);
|
||||||
@ -1829,6 +1853,7 @@ void TPartita::sposta_riga(int from_row, TPartita& part, int to_row)
|
|||||||
nuova.zero(PART_ABBUONI);
|
nuova.zero(PART_ABBUONI);
|
||||||
nuova.zero(PART_DIFFCAM);
|
nuova.zero(PART_DIFFCAM);
|
||||||
nuova.zero(PART_RITENUTE);
|
nuova.zero(PART_RITENUTE);
|
||||||
|
nuova.zero(PART_RITSOC);
|
||||||
address[j] = nuova.get_int(PART_NRIGA);
|
address[j] = nuova.get_int(PART_NRIGA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1847,6 +1872,7 @@ void TPartita::sposta_riga(int from_row, TPartita& part, int to_row)
|
|||||||
somma(pag, npg, PART_IMPORTO);
|
somma(pag, npg, PART_IMPORTO);
|
||||||
somma(pag, npg, PART_IMPORTOVAL);
|
somma(pag, npg, PART_IMPORTOVAL);
|
||||||
somma(pag, npg, PART_RITENUTE);
|
somma(pag, npg, PART_RITENUTE);
|
||||||
|
somma(pag, npg, PART_RITSOC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -191,6 +191,8 @@ public:
|
|||||||
int ultima_rata_con_abbuoni_diffcam() const;
|
int ultima_rata_con_abbuoni_diffcam() const;
|
||||||
|
|
||||||
char sezione() const { return get_char(PART_SEZ); }
|
char sezione() const { return get_char(PART_SEZ); }
|
||||||
|
char sezione_ritsoc() const;
|
||||||
|
|
||||||
TImporto importo(bool valuta, int mode = 0xF) const;
|
TImporto importo(bool valuta, int mode = 0xF) const;
|
||||||
TImporto esposto(bool valuta, const TDate & data_scad, const TDate & data_rischio, bool & sbf) const;
|
TImporto esposto(bool valuta, const TDate & data_scad, const TDate & data_rischio, bool & sbf) const;
|
||||||
|
|
||||||
|
@ -239,6 +239,7 @@ B1|36|335|335|28|CHIUSA|||
|
|||||||
B1|37|336|336|28|RICARICATA|||
|
B1|37|336|336|28|RICARICATA|||
|
||||||
B1|38|337|339|28|GRUPPOCL|||
|
B1|38|337|339|28|GRUPPOCL|||
|
||||||
B1|39|340|342|28|CONTOCL|||
|
B1|39|340|342|28|CONTOCL|||
|
||||||
|
B1|40|343|356|28|RITSOC|||
|
||||||
B2|1|3|3|29|TIPOC|||
|
B2|1|3|3|29|TIPOC|||
|
||||||
B2|2|4|6|29|GRUPPO|||
|
B2|2|4|6|29|GRUPPO|||
|
||||||
B2|3|7|9|29|CONTO|||
|
B2|3|7|9|29|CONTO|||
|
||||||
@ -290,3 +291,4 @@ B3|22|160|164|30|CODCAB|||
|
|||||||
B3|23|165|169|30|CODABIPR|||
|
B3|23|165|169|30|CODABIPR|||
|
||||||
B3|24|170|174|30|CODCABPR|||
|
B3|24|170|174|30|CODCABPR|||
|
||||||
B3|25|175|179|30|CODAG|||
|
B3|25|175|179|30|CODAG|||
|
||||||
|
B3|26|180|193|30|RITSOC|||
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
28
|
28
|
||||||
0
|
0
|
||||||
$part|0|0|334|0|Partite aperte|NPART||
|
$part|0|0|352|0|Partite aperte|NPART||
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
28
|
28
|
||||||
40
|
41
|
||||||
ANNO|2|4|0|Anno partita
|
ANNO|2|4|0|Anno partita
|
||||||
NUMPART|1|7|0|Numero partita
|
NUMPART|1|7|0|Numero partita
|
||||||
NRIGA|2|4|0|Numero riga
|
NRIGA|2|4|0|Numero riga
|
||||||
@ -31,6 +31,7 @@ SOTTOCONTO|3|6|0|Sottoconto o codice cliente / fornitore
|
|||||||
IMPTOTDOC|4|18|3|Importo totale documento
|
IMPTOTDOC|4|18|3|Importo totale documento
|
||||||
IMPTOTVAL|4|18|3|Importo totale documento in valuta
|
IMPTOTVAL|4|18|3|Importo totale documento in valuta
|
||||||
RITENUTE|4|18|3|Ritenute fiscali sul pagamento
|
RITENUTE|4|18|3|Ritenute fiscali sul pagamento
|
||||||
|
RITSOC|4|18|3|Ritenute sociali sul pagamento
|
||||||
SEZABB|1|1|0|Sezione degli abbuoni
|
SEZABB|1|1|0|Sezione degli abbuoni
|
||||||
ABBUONI|4|18|3|Abbuoni
|
ABBUONI|4|18|3|Abbuoni
|
||||||
SEZDIFCAM|1|1|0|Sezione delle differenze cambi
|
SEZDIFCAM|1|1|0|Sezione delle differenze cambi
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
30
|
30
|
||||||
0
|
0
|
||||||
$pagsca|0|0|167|0|Pagamenti scadenze|||
|
$pagsca|0|0|185|0|Pagamenti scadenze|||
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
30
|
30
|
||||||
25
|
26
|
||||||
TIPOC|1|1|0|Tipo (<C>liente, <F>ornitore)
|
TIPOC|1|1|0|Tipo (<C>liente, <F>ornitore)
|
||||||
GRUPPO|2|3|0|Gruppo
|
GRUPPO|2|3|0|Gruppo
|
||||||
CONTO|2|3|0|Conto
|
CONTO|2|3|0|Conto
|
||||||
@ -15,7 +15,8 @@ IMPORTOVAL|4|18|3|Importo in valuta
|
|||||||
PASSATT|1|1|0|Abbuono passivo o attivo
|
PASSATT|1|1|0|Abbuono passivo o attivo
|
||||||
ABBUONI|4|18|3|Abbuoni
|
ABBUONI|4|18|3|Abbuoni
|
||||||
DIFFCAM|4|18|3|Differenza cambio
|
DIFFCAM|4|18|3|Differenza cambio
|
||||||
RITENUTE|4|18|3|Ritenute
|
RITENUTE|4|18|3|Ritenute fiscali
|
||||||
|
RITSOC|4|18|3|Ritenute Sociali
|
||||||
TIPOCC|1|1|0|Tipo conto di contropartita
|
TIPOCC|1|1|0|Tipo conto di contropartita
|
||||||
GRUPPOC|2|3|0|Gruppo di contropartita
|
GRUPPOC|2|3|0|Gruppo di contropartita
|
||||||
CONTOC|2|3|0|Conto di contropartita
|
CONTOC|2|3|0|Conto di contropartita
|
||||||
|
Loading…
x
Reference in New Issue
Block a user