Merge remote-tracking branch 'origin/R_10_00' into R_10_00

This commit is contained in:
Simone Palacino 2020-02-10 17:21:38 +01:00
commit 13a2cc7403
25 changed files with 612 additions and 364 deletions

7
cd/test/cg0938.txt Normal file
View File

@ -0,0 +1,7 @@
cg5.exe
cg5500c.msk
cg5500b.msk
Attivati acconto e interessi con ricalcolo nei trimestrali.
Aggiunta 13 nei trimestrali e sistemata la visualizzazione dei trimestrali.

100
cd/test/cg0938a.ini Normal file
View File

@ -0,0 +1,100 @@
[Main]
Demo=0
[cg5]
File(108) = cg5.exe|X
File(117) = cg5500b.msk|X
File(119) = cg5500c.msk|X
Patch = 938
Versione = 21511200
[cg99]
Kill(0) = batbzon.msk|x
Kill(1) = bastdpn.rep|x
Kill(2) = batbinl.msk|x
Kill(3) = bastzon.msk|x
Kill(4) = bastcve.rep|x
Kill(5) = bastntb.rep|x
Kill(6) = bastpdb.rep|x
Kill(7) = bastnot.msk|x
Kill(8) = batbarb.msk|x
Kill(9) = batbnot.msk|x
Kill(10) = batbcve.msk|x
Kill(11) = cg2fppro.msk|x
Kill(12) = bastmsp.rep|x
Kill(13) = bastcco.msk|x
Kill(14) = batbtra.msk|x
Kill(15) = bastvet.msk|x
Kill(16) = batbleg.msk|x
Kill(17) = bastmsp.msk|x
Kill(18) = bastleg.msk|x
Kill(19) = bastnot.rep|x
Kill(20) = batbind.msk|x
Kill(21) = bastesc.msk|x
Kill(22) = bastpor.msk|x
Kill(23) = batbesc.msk|x
Kill(24) = batbscc.msk|x
Kill(25) = batbdel.msk|x
Kill(26) = bastcve.msk|x
Kill(27) = cgtbcon.msk|x
Kill(28) = batblia.msk|x
Kill(29) = bastarb.rep|x
Kill(30) = batbcam.msk|x
Kill(31) = bastreg.msk|x
Kill(32) = batbver.msk|x
Kill(33) = batbcco.msk|x
Kill(34) = batblbu.msk|x
Kill(35) = bastcam.msk|x
Kill(36) = bastdpn.msk|x
Kill(37) = bastscc.msk|x
Kill(38) = batbcfi.msk|x
Kill(39) = bastver.rep|x
Kill(40) = batbntb.msk|x
Kill(41) = bastntb.msk|x
Kill(42) = batbreg.msk|x
Kill(43) = bastver.msk|x
Kill(44) = bastndo.rep|x
Kill(45) = batbdpn.msk|x
Kill(46) = batbvet.msk|x
Kill(47) = batbpor.msk|x
Kill(48) = bastcam.rep|x
Kill(49) = bastndo.msk|x
Kill(50) = batbins.msk|x
Kill(51) = batbmsp.msk|x
Kill(52) = bastpdb.msk|x
Kill(53) = bastivd.msk|x
Kill(54) = batblia.msk|x
Kill(55) = batbivd.msk|x
Kill(56) = bastpor.rep|x
Kill(57) = batbpdb.msk|x
Kill(58) = bastivd.rep|x
Kill(59) = batbtit.msk|x
Kill(60) = bastcfi.msk|x
Kill(61) = bastvet.rep|x
Kill(62) = batbndo.msk|x
Kill(63) = bastesc.rep|x
Kill(64) = bastreg.rep|x
Kill(65) = bastcfi.rep|x
Kill(66) = bastleg.rep|x
Kill(67) = bastzon.rep|x
Kill(68) = bastarb.msk|x
Kill(69) = bastcco.rep|x
Kill(70) = bastscc.rep|x
[cg]
Data = 31-01-2020
Descrizione = Contabilita' Generale
Dischi = 1
Edit_19 = cg0 -0
Edit_20 = cg0 -1
Edit_26 = cg0 -4
Edit_5 = cg0 -5
Moduli = ba
OEM =
Patch = 938
PostProcess = bainst -0 CG
PreProcess =
Prezzo(1) =
Prezzo(2) =
Versione = 21511200

BIN
cd/test/cg0938a1.zip Normal file

Binary file not shown.

4
cd/test/fp0780.txt Normal file
View File

@ -0,0 +1,4 @@
fp0.exe
fp1.exe
Corretto invio mail mancata consegna quando pdf già esistente

20
cd/test/fp0780a.ini Normal file
View File

@ -0,0 +1,20 @@
[Main]
Demo=0
[fp1]
File(1) = fp0.exe|X
File(7) = fp1.exe|X
Patch = 0780
Versione = 21511200
[fp]
Data = 29-04-2019
Descrizione = Fattura Elettronica
Dischi = 1
Moduli = cg,ve
OEM =
Patch = 780
PostProcess =
PreProcess =
Versione = 21511200

BIN
cd/test/fp0780a1.zip Normal file

Binary file not shown.

4
cd/test/fp0938.txt Normal file
View File

@ -0,0 +1,4 @@
fp0.exe
Sistemata fatturazione con ritenute e casse professionali
Corretta contabilizzazione per importi a 0: problema scadenzario

19
cd/test/fp0938a.ini Normal file
View File

@ -0,0 +1,19 @@
[Main]
Demo=0
[fp0]
File(0) = fp0.exe|X
Patch = 0938
Versione = 21511200
[fp]
Data = 06-02-2020
Descrizione = Fattura Elettronica
Dischi = 1
Moduli = cg,ve
OEM =
Patch = 938
PostProcess =
PreProcess =
Versione = 21511200

BIN
cd/test/fp0938a1.zip Normal file

Binary file not shown.

1
cd/test/lv0938.txt Normal file
View File

@ -0,0 +1 @@
lv2.exe

21
cd/test/lv0938a.ini Normal file
View File

@ -0,0 +1,21 @@
[Main]
Demo=0
[lv2]
File(121) = lv2.exe|X
Patch = 938
Versione = 21511200
[lv]
Data = 02-01-2020
Descrizione = Gestione lavanderie
Dischi = 1
Moduli = ve,mg
OEM = 2
Patch = 938
PostProcess = bainst -0 LV
PreProcess =
Prezzo(1) =
Prezzo(2) =
Versione = 21511200

BIN
cd/test/lv0938a1.zip Normal file

Binary file not shown.

View File

@ -398,6 +398,9 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
_pla->zero("R16");
_pla->zero("R17");
_pla->zero("R18");
_pla->zero("R19");
_pla->zero("R20");
_pla->zero("R21");
_pla->put("S1","0");
_pla->put("S2","0");
_pla->put("S3", "0");
@ -917,6 +920,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
real esenti_c1a = ZERO;
real esenti_c3_bam = ZERO; // Beni ammorizzabili esenti c3
real esenti_c1a_bam = ZERO; // Beni ammorizzabili esenti c1a
real esenti_num_amm;
real esenti_b14 = ZERO;
real vendite_rev = ZERO; // Vendire in reverse charge (da escludere in prorata)
real cred_fattrit;
@ -1499,6 +1503,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
int isrimbinfr = _iva->get_bool("B3"); // vale per calcolo rimborso se ES o NI
const real perciva = _iva->get_real("R0") / CENTO;
int ivarimb = !_iva->get_bool("B4"); // non escluso calcolo rimb. per al. media
const bool den_prorata = _iva->get_bool("B7"); // denominatore prorata nel caso di calcolo pro rata con numeratore e denominatore
const TString4 tipocr_s = _rmoviva->get(RMI_TIPOCR);
const int tipocr = atoi(tipocr_s);
@ -2207,28 +2212,31 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
}
// operazioni esenti
if (tipoiva == "ES" && !imponibile.is_zero())
{
if (tipomov == vendita)
{
if (sosp_imp != normale && sosp_imp != vol_affari) // CM500308
{
if (tipoes_v == "B1") // C1
if (tipoes_v == "B1")
esenti_c1 += imponibile;
else if (tipoes_v == "B2") // C2
else if (tipoes_v == "B2")
esenti_c2 += imponibile;
else if (tipoes_v == "B3") // C3
else if (tipoes_v == "B3")
{
esenti_c3 += imponibile;
if (tipocr == 4)
esenti_c3_bam += imponibile;
}
else if (tipoes_v == "B4") // C1A
else if (tipoes_v == "B4")
{
esenti_c1a += imponibile;
if (tipocr == 4)
esenti_c1a_bam += imponibile;
}
if (den_prorata && tipocr == 4)
esenti_num_amm += imponibile;
// se e' il caso sommare esenti per rimborso
if (isrimbinfr)
esni_rimb += imponibile;
@ -2922,11 +2930,11 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
// Somma i vari prorata calcolati per gli anni precedenti
prorata += prorata_precedente1 + prorata_precedente2;
prorata += prorata_diff;
if (!lia.get_bool("B7"))
prorata = ZERO;
acquisti_iva -= prorata; // Rettifica acquisti_iva
fdiffinc_iva_acq -= prorata_diff; // Rettifica acquisti_iva differiti incassati
prorata += prorata_diff;
/* if (!lia.get_bool("B7"))
prorata = ZERO; */
acquisti_iva -= prorata; // Rettifica acquisti_iva
fdiffinc_iva_acq -= prorata_diff; // Rettifica acquisti_iva differiti incassati
}
look_plm(month, codatt, true);
@ -3029,7 +3037,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
_pum->put("R6", esenti_c3);
_pum->put("R13", esenti_c1a);
_pum->put("S4", esenti_c3_bam);
_pum->put("S5", esenti_c1a_bam);
_pum->put("S5", esenti_c1a_bam);
_pum->put("S6", esenti_num_amm);
_pum->put("R7", esenti_b14);
_pum->put("R12", esni_rimb);
_pum->put("R28", vendite_rev); // Vendite in reverse charge da escludere da prorata
@ -4251,37 +4260,36 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
vol_aff_2 += vf2;
vol_aff_l += _pla->get_real("R0"); // volume affari lordo
real es_c1 = _pla->get_real("R1"); // Tipo esenzione B1
real es_c2 = _pla->get_real("R2");
real es_c3 = _pla->get_real("R3");
real es_c1a = _pla->get_real("R15");
real es_c3_am = _pla->get_real("R16");
real es_c1a_am = _pla->get_real("R17");
real es_b1 = _pla->get_real("R1"); // Tipo esenzione B1
real es_b2 = _pla->get_real("R2");
real es_b3 = _pla->get_real("R3");
real es_b4 = _pla->get_real("R15");
real es_b3_am = _pla->get_real("R16");
real es_b4_am = _pla->get_real("R17");
real csamm = _pla->get_real("R4");
real ven_rev = _pla->get_real("R18");
real num_amm = _pla->get_real("R21");
real prorata;
real conguaglio;
real topay;
real ris; // gia' esclusi: NS, B3, cess. amm
real rsd;
real rsn;
// calcola nuovo prorata dal 1998 per ogni attivita' (miste: 1+2)
if (_prorata_nd)
{
const real rsd = _pla->get_real("R20");
const real rsn = _pla->get_real("R19");
if (rsd != ZERO)
prorata = CENTO - (rsn * CENTO / rsd); // Percentuale di indetraibilita: reciproco della percentuale di detraibilita'
rsd = _pla->get_real("R20") + num_amm;
rsn = _pla->get_real("R19");
}
else
{
const real ris = vf1 + vf2; // gia' esclusi: NS, B3, cess. amm
const real rsd = ris - (es_c1a - es_c1a_am) - (es_c3 - es_c3_am) - ven_rev;
const real rsn = rsd - es_c1;
if (!rsd.is_zero())
prorata = CENTO - (rsn * CENTO / rsd); // Percentuale di indetraibilità: reciproco della detraibilità
ris = vf1 + vf2; // gia' esclusi: NS, B3, cess. amm
rsd = ris - (es_b4 - es_b4_am) - (es_b3 - es_b3_am) - ven_rev;
rsn = rsd - es_b1;
}
if (rsd != ZERO)
prorata = CENTO - (rsn * CENTO / rsd); // Percentuale di indetraibilita: reciproco della percentuale di detraibilita'
prorata.round(0);
// calcolo conguaglio -- se positivo e' a debito
if (prorata > ZERO && lia.get_bool("B7"))
@ -4614,6 +4622,7 @@ void TLiquidazione_app::recalc_annual(const char* att, bool & first)
real volaff1;
real volaff2;
real ven_rev;
real num_amm;
TString4 codiva,reg,tiva;
TToken_string va7("",'!');
@ -4638,6 +4647,8 @@ void TLiquidazione_app::recalc_annual(const char* att, bool & first)
iva_acq = _pla->get_real("R11");
ven_rev = _pla->get_real("R18");
volaff1 -= _pla->get_real("R34");
num_amm = _pla->get_real("R21");;
// Per avere un risultato corretto, si deve totalizzare PIM->R3 per codice iva
// e quindi effettuare lo scorporo dell'imponibile e aggiungere al relativo volume d'affari
@ -4746,6 +4757,7 @@ void TLiquidazione_app::recalc_annual(const char* att, bool & first)
es_c1a += _pum->get_real("R13");
es_c3_am += _pum->get_real("S4");
es_c1a_am += _pum->get_real("S5");
num_amm += _pum->get_real("S6");
cess_amm += _pum->get_real("R0");
ven_rev += _pum->get_real("R28");
@ -4840,6 +4852,7 @@ void TLiquidazione_app::recalc_annual(const char* att, bool & first)
{
_pla->put("R19", num_pro_rata);
_pla->put("R20", den_pro_rata);
_pla->put("R21", num_amm);
}
_pla->rewrite();
}

View File

@ -1098,16 +1098,17 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
real v1 = _pla->get_real("R14"); // Volume d'affari I attività
real v2 = _pla->get_real("S1"); // Volume d'affari II attività
real ris = v1 + v2;
real e1 = _pla->get_real("R1"); // Totale vendite esenti C1
real e2 = _pla->get_real("R2"); // Totale vendite esenti C2
real e3 = _pla->get_real("R3"); // Totale vendite esenti C3
real e4 = _pla->get_real("R15"); // Totale vendite esenti C1A
real e5 = _pla->get_real("R16"); // Totale vendite beni ammortizzabili esenti C3
real e6 = _pla->get_real("R17"); // Totale vendite beni ammortizzabili esenti C1A
real e1 = _pla->get_real("R1"); // Totale vendite esenti B1
real e2 = _pla->get_real("R2"); // Totale vendite esenti B2
real e3 = _pla->get_real("R3"); // Totale vendite esenti B3
real e4 = _pla->get_real("R15"); // Totale vendite esenti B4
real e5 = _pla->get_real("R16"); // Totale vendite beni ammortizzabili esenti B3
real e6 = _pla->get_real("R17"); // Totale vendite beni ammortizzabili esenti B4
real bam = _pla->get_real("R4"); // Cessione beni ammortizzabili
real vrc = _pla->get_real("R18"); // Vendite reverse charge
real iaq = _pla->get_real("R11"); // IVA acquisti
real ppg = _pla->get_real("R12"); // pro-rata pagato
real num_amm = _pla->get_real("R21");
// calcola nuovo prorata per ogni attivita' (miste: 1+2)
real prorata;
real rsd;
@ -1115,20 +1116,16 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
if (_prorata_nd)
{
rsd = _pla->get_real("R20");
rsd = _pla->get_real("R20") + num_amm;
rsn = _pla->get_real("R19");
if (!rsd.is_zero())
prorata = CENTO - (rsn * CENTO / rsd); // Percentuale di indetraibilita: reciproco della percentuale di detraibilita'
}
else
{
rsd = ris - (e3 - e5) - (e4 - e6) - vrc;
rsn = rsd - e1;
if (!rsd.is_zero())
prorata = CENTO - (rsn * CENTO / rsd); // Percentuale di indetraibilita: reciproco della percentuale di detraibilita'
}
if (!rsd.is_zero())
prorata = CENTO - (rsn * CENTO / rsd); // Percentuale di indetraibilita: reciproco della percentuale di detraibilita'
prorata.round(0);
real co = 0.0;
@ -1149,7 +1146,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
_DescrItem* dd = new _DescrItem(ANNUAL);
// MonsterFish: arrotonda all'Euro C1,C2,C3,C1A
// MonsterFish: arrotonda all'Euro B1,B2,B3,B4
round_imposta(e1);
round_imposta(e2);
round_imposta(e3);
@ -1159,6 +1156,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
round_imposta(bam);
round_imposta(ris);
round_imposta(vrc);
round_imposta(num_amm);
// segna flag prorata
if ((e1+e2+e3+e4) > ZERO)
@ -1180,6 +1178,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
dd->_ra0 = rsn;
dd->_ra1 = rsd;
dd->_ra2 = vrc;
dd->_ra3 = num_amm;
t->_arr.add(dd);
}
}
@ -2834,45 +2833,52 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
row++;
if (_prorata_nd)
{
set_row(row++, FR("Numeratore pro-rata @69g%r"), &(d._ra0));
set_row(row++, FR("Denominatore @69g%r"), &(d._ra1));
set_row(row++, FR(" - Numeratore pro-rata @69g%r"), &d._ra0);
set_row(row++, FR(" - cessioni esenti di beni ammortizzabili @69g%r"), &d._ra3);
const real tot = d._ra0 + d._ra3;
if (tot != ZERO)
{
set_row(row++, FR("@69g----------------"));
set_row(row++, FR("@6gTotale @69g%r"), &tot);
row++;
}
set_row(row++, FR(" - Denominatore @69g%r"), &d._ra1);
}
else
{
set_row(row++, FR(" - Volume d'affari @69g%r"), &(vol_aff));
set_row(row++, FR("C1 - Operazioni esenti escluse da nr. 1 a 9 e 11 art. 10 @69g%r"), &(d._r1));
set_row(row++, FR("C2 - Operazioni esenti di cui nr. 11 art. 10 @69g%r"), &(d._r4));
set_row(row++, FR("C3 - Operazioni esenti da nr. 1 a 9 art. 10 @69g%r"), &(d._r5));
set_row(row++, FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r8));
set_row(row++, FR(" - Volume d'affari @69g%r"), &vol_aff);
set_row(row++, FR("B1 - Operazioni esenti escluse da nr. 1 a 9 e 11 art. 10 @69g%r"), &d._r1);
set_row(row++, FR("B2 - Operazioni esenti di cui nr. 11 art. 10 @69g%r"), &d._r4);
set_row(row++, FR("B3 - Operazioni esenti da nr. 1 a 9 art. 10 @69g%r"), &d._r5);
set_row(row++, FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &d._r8);
const real diff1 = d._r5 - d._r8;
if (diff1 != ZERO)
{
set_row(row++, FR("@69g----------------"));
set_row(row++, FR("6g Differenza @69g%r"), &(diff1));
set_row(row++, FR("6gDifferenza @69g%r"), &diff1);
row++;
}
set_row(row++, FR("C1A - Operazioni esenti di cui all'art.10 n. 27 quinquies @69g%r"), &(d._r7));
set_row(row++, FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r9));
set_row(row++, FR("B4 - Operazioni esenti di cui all'art.10 n. 27 quinquies @69g%r"), &d._r7);
set_row(row++, FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &d._r9);
const real diff2 = d._r7 - d._r9;
if (diff2 != ZERO)
{
set_row(row++, FR("@69g----------------"));
set_row(row++, FR("6g Differenza @69g%r"), &(diff2));
set_row(row++, FR("6gDifferenza @69g%r"), &diff2);
row++;
}
set_row(row++, FR(" - Vendite Reverse Charge @69g%r"), &(d._ra2));
set_row(row++, FR("Numeratore pro-rata @69g%r"), &(d._ra0));
set_row(row++, FR(" Volume d'affari - C3(senza beni amm.) - C1A(senza beni amm.) - vendite reverse charge "));
set_row(row++, FR("Denominatore @69g%r"), &(d._ra1));
set_row(row++, FR(" Denominatore - C1 "));
set_row(row++, FR(" - Vendite Reverse Charge @69g%r"), &d._ra2);
row++;
set_row(row++, FR(" - Numeratore pro-rata @69g%r"), &d._ra0);
set_row(row++, FR(" Volume d'affari - B3(senza beni amm.) - B4(senza beni amm.) - vendite reverse charge "));
set_row(row++, FR(" - Denominatore @69g%r"), &d._ra1);
set_row(row++, FR(" Denominatore - B1 "));
}
// set_row(row++, FR("Volume d'affari @69g%r"), &vol_aff);
// set_row(row++, FR("Totale vendite al fine del calcolo del pro-rata @69g%r"), &vol_aff);
set_print_zero(false);
}
return ret;

View File

@ -382,70 +382,73 @@ bool Visliq_app::print_handler(TMask_field& f, KEY k)
bool Visliq_app::sel_mese_sh1 (TMask_field& f, KEY k)
{
if (k != K_SPACE) return true;
TMask& m = *(app().get_main_mask());
TSheet_field& sh = m.sfield(F_VISLIQ1);
TSheet_field& sv = m.sfield(F_VISLIQ2);
int sel = sh.selected();
int month = sh.selected()+1;
TToken_string& tt = sh.row(sh.selected());
TMask& sm = sh.sheet_mask();
if (k == K_SPACE)
{
TMask& m = *(app().get_main_mask());
TSheet_field& sh = m.sfield(F_VISLIQ1);
TSheet_field& sv = m.sfield(F_VISLIQ2);
int sel = sh.selected();
int month = sh.selected() + 1;
TToken_string& tt = sh.row(sh.selected());
TMask& sm = sh.sheet_mask();
if (sh.items() == 4)
month *= 3;
if (sm.is_running() && !sm.stop_run(K_ENTER))
return true;
bool ok = true;
//if (m.dirty() || sh.sheet_mask().dirty())
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty || sm.dirty())
{
KEY k = yesnocancel_box(TR("Registrare le modifiche effettuate?"));
if (k == K_YES)
app().write_general(m);
else if (k == K_NO)
app().read_general(m);
ok = (k == K_YES || k == K_NO);
}
if (sh.items() == 5)
month *= 3;
if (month >13)
month = 13;
if (sm.is_running() && !sm.stop_run(K_ENTER))
return true;
bool ok = true;
//if (m.dirty() || sh.sheet_mask().dirty())
if (m.field(F_CREDPREC).dirty() || app()._sh_dirty || app()._sv_dirty || sm.dirty())
{
KEY k = yesnocancel_box(TR("Registrare le modifiche effettuate?"));
if (k == K_YES)
app().write_general(m);
else if (k == K_NO)
app().read_general(m);
ok = (k == K_YES || k == K_NO);
}
if (ok)
{
app().vis_one(month);
app().read_general(m);
}
app().set_liq_rows(sh);
if (sm.is_running())
{
// TBC controllare se sono i dati giusti in tt
sm.field(S_RISULTATO).set(tt.get(cid2index(S_RISULTATO)));
sm.field(S_DEBCRED1 ).set(tt.get(cid2index(S_DEBCRED1)));
sm.field(S_RIMBORSO).set(tt.get(cid2index(S_RIMBORSO)));
sm.field(S_RETTIFICHE).set(tt.get(cid2index(S_RETTIFICHE)));
sm.field(S_DEBCRED2).set(tt.get(cid2index(S_DEBCRED2)));
}
sh.row(sel) = tt;
sh.force_update(sel);
if (ok)
{
app().vis_one(month);
app().read_general(m);
}
if (app().look_del(month,1))
{
const int nrow = sel == (sh.items() - 1) ? sel - 1 : sel;
app().set_liq_rows(sh);
sv.set_row_cell(S_DATA, app().del()->get("D0"), nrow);
sv.set_row_cell(S_ABI, app().del()->get("S7"), nrow);
sv.set_row_cell(S_CAB, app().del()->get("S8"),nrow);
sv.set_row_cell(S_CONC, app().del()->get("S9"),nrow);
sv.set_row_cell(S_VERSAMENTO, app().del()->get("R0"), nrow);
sv.force_update(nrow);
}
if (sm.is_running())
{
// TBC controllare se sono i dati giusti in tt
sm.field(S_RISULTATO).set(tt.get(cid2index(S_RISULTATO)));
sm.field(S_DEBCRED1).set(tt.get(cid2index(S_DEBCRED1)));
sm.field(S_RIMBORSO).set(tt.get(cid2index(S_RIMBORSO)));
sm.field(S_RETTIFICHE).set(tt.get(cid2index(S_RETTIFICHE)));
sm.field(S_DEBCRED2).set(tt.get(cid2index(S_DEBCRED2)));
}
sh.row(sel) = tt;
sh.force_update(sel);
if (app().look_del(month, 1))
{
const int nrow = sel == (sh.items() - 1) ? sel - 1 : sel;
sv.set_row_cell(S_DATA, app().del()->get("D0"), nrow);
sv.set_row_cell(S_ABI, app().del()->get("S7"), nrow);
sv.set_row_cell(S_CAB, app().del()->get("S8"), nrow);
sv.set_row_cell(S_CONC, app().del()->get("S9"), nrow);
sv.set_row_cell(S_VERSAMENTO, app().del()->get("R0"), nrow);
sv.force_update(nrow);
}
}
return true;
}
@ -471,8 +474,16 @@ bool Visliq_app::check_date(TMask_field& f, KEY k)
if (d.year() != app().year())
return f.error_box(FR("L'anno deve essere %d"), app().year());
if (d.month() != row + 1)
return f.error_box(FR("Il mese deve essere %s"), itom(row + 1));
if (app()._freqviva == "M")
{
if (d.month() != row + 1)
return f.error_box(FR("Il mese deve essere %s"), itom(row + 1));
}
else
{
if (d.month() != (row + 1) * 3)
return f.error_box(FR("Il mese deve essere %s"), itom((row + 1) * 3));
}
}
return true;
}
@ -487,12 +498,11 @@ bool Visliq_app::sel_mese_sh2 (TMask_field& f, KEY k)
int month = sh.selected()+1;
if (sh.items() < 12)
month *= 3;
if (month > 13)
month = 13;
TMask& sv = sh.sheet_mask();
// click su acconto
if (month > 12) return true;
if (sv.is_running() && !sv.stop_run(K_ENTER))
return true;
@ -913,7 +923,7 @@ bool Visliq_app::vis_one(int m)
if (k == K_SAVE)
{
{ write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); }
if (d_mod) { write_del(); }
if (d_mod) { write_del(m); }
l_mod = d_mod = false;
recorded = true;
}
@ -925,7 +935,7 @@ bool Visliq_app::vis_one(int m)
if (kk == K_YES)
{
if (l_mod) { write_liq(); recalc_next_liq(m, _liq_sheet, _vers_sheet); }
if (d_mod) { write_del(); }
if (d_mod) { write_del(m); }
l_mod = d_mod = false;
recorded = true;
}
@ -1550,65 +1560,57 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field
look_lim(start_month);
}
void Visliq_app::write_liq()
void Visliq_app::write_del(const int month, const char * codabi, const char * codcab, const char * codcon,
const TDate & d, const real& v, const real& i, bool stampato)
{
// piccola, ma simpatica
// naturalmente era much bigger
_lim->rewrite();
}
int tipodel = 1;
void Visliq_app::write_del(const real& v)
{
bool wasdel = false;
int month = atoi(*_lim_mese);
TString8 abi(_lim->get("S4"));
TString8 cab(_lim->get("S5"));
TString4 con(_lim->get("S6"));
TDate date(_lim->get("D0"));
real vers = v;
if (month == 12)
tipodel = 7;
else
if (month == 13)
tipodel = 2;
const bool wasdel = look_del(month, tipodel);
TString8 abi(codabi == nullptr ? _lim->get("S4") : codabi);
TString8 cab(codcab == nullptr ? _lim->get("S5") : codcab);
TString4 con(codcon == nullptr ? _lim->get("S6") : codcon);
TDate date(d == TDate(NULLDATE) ? _lim->get_date("D0") : d);
const real vers(v >= ZERO ? v : _lim->get_real("R8"));
if (vers == ZERO)
vers = _lim->get_real("R8");
real intr(_lim->get_real("R10"));
if (!wasdel)
{
if (vers.is_zero() && (wasdel = look_del(month,1)))
{
_del->remove();
//_del->rewrite(); // ???
return;
}
if (!wasdel)
look_del(month,1,true); // Crea delega
look_del(month, tipodel, true); // Crea delega
}
real inter;
if (vers == ZERO)
_del->remove();
else
{
real inter = i;
if (!intr.is_zero())
{
// riapplica il tasso di interesse
// se trimestrale e' stato scorporato rispetto all'eventuale input utente
TExchange c;
real vers_netto = vers * CENTO / (intr + CENTO);
if (i == ZERO)
{
real percint = _lim->get_real("R10");
vers_netto.round(c.decimals());
inter = vers - vers_netto;
round_imposta(inter);
vers = vers_netto + inter;
}
_del->put("R0",vers);
_del->put("R1",inter);
_del->put("D0",date);
_del->put("S7",abi);
_del->put("S8",cab);
_del->put("S9",con);
_del->put("B0", true); // Preimposta flag di stampato, altrimenti viene ignorato dalla liquidazione 04-12-2014
// riapplica il tasso di interesse
// se trimestrale e' stato scorporato rispetto all'eventuale input utente
inter = v - (v * CENTO / (percint + CENTO));
round_imposta(inter);
}
_del->put("R0", vers);
_del->put("R1", inter);
_del->put("D0", date);
_del->put("S7", abi);
_del->put("S8", cab);
_del->put("S9", con);
_del->put("B0", stampato); // Preimposta flag di stampato, altrimenti viene ignorato dalla liquidazione 04-12-2014
const int ctri = _freqviva == "M" ? 6000 + month : 6030 + (month/3);
_del->put("S6", ctri);
_del->rewrite();
const int ctri = _freqviva == "M" ? 6000 + month : 6030 + (month / 3);
_del->put("S6", ctri);
_del->rewrite();
}
}
@ -1636,13 +1638,17 @@ void Visliq_app::read_general(TMask& m)
cr_res -= cr_util;
int last_month = freq_ver_IVA() == "M" ? 14 : 16;
// set sheet
for (int i = step; i < 13; i+=step)
{
if (is_month_ok(i))
for (int i = step; i < last_month; i+=step)
{
int m = (i > 12) ? 13 : i;
if (is_month_ok(m) || m == 13)
{
const int row = (i/step) - 1;
if (!look_lim(i))
if (!look_lim(m))
{
sh.set_row_cell(S_MESE, itoname(i), row);
sh.disable_cell(row, -1);
@ -1658,7 +1664,7 @@ void Visliq_app::read_general(TMask& m)
real r0 = _lim->get_real("R0");
const TString debcred3 = r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C");
sh.set_row_cell(S_MESE, itoname(i), row);
sh.set_row_cell(S_MESE, itoname(m), row);
sh.set_row_cell(S_IVA, abs(r0), row);
sh.set_row_cell(S_DEBCRED3, debcred3, row);
sh.set_row_cell(S_RISULTATO, abs(ris), row);
@ -1713,14 +1719,17 @@ void Visliq_app::read_general(TMask& m)
real interessi[13];
TDate date[13];
TToken_string banche[13];
bool stampato[13] = { false, false, false, false, false, false, false, false, false, false, false, false, false};
for (_del->first(); !_del->eof(); _del->next())
{
if (atol(*_del_ditta) == get_firm() && atoi(*_del_anno) == _year)
{
// uso solo deleghe normali (tipo == 1) e acconti (tipo == 7)
// uso solo deleghe normali (tipo == 1), annuali (tipo == 2) e acconti (tipo == 7)
int tipod = atoi(*_del_tipo);
if (tipod == 1 || tipod == 7)
if (tipod < 3 || tipod == 7)
{
// somma versamenti nel mese adeguato
@ -1738,6 +1747,7 @@ void Visliq_app::read_general(TMask& m)
b.add(_del->get("S7"), 0);
b.add(_del->get("S8"), 1);
b.add(_del->get("S9"), 2);
stampato[m - 1] = _del->get_bool("B0");
}
}
}
@ -1746,27 +1756,32 @@ void Visliq_app::read_general(TMask& m)
// Sheet versamenti
TString nomemese;
sv.destroy();
for (int i = 1; i <= 13; i++)
// for (int i = 1; i <= 13; i++)
for (int i = step; i < last_month; i += step)
{
if (!is_month_ok(i) && i != 13)
continue;
nomemese = itoname(i == 13 ? 12 : i);
if (nomemese == "4 Trimestre")
nomemese = TR("4 Tr.");
if (i == 12) nomemese << TR(" acconto");
if (i == 13) nomemese << TR(" saldo");
int m = (i > 12) ? 13 : i;
const int row = sv.set_row_cell(S_MESE, nomemese); // mese
sv.set_row_cell(S_DATA, date[i - 1], row); // data vers.
sv.set_row_cell(S_ABI, banche[i - 1].get(0), row); // azienda
sv.set_row_cell(S_CAB, banche[i - 1].get(1), row); // dipendenza
sv.set_row_cell(S_CONC, banche[i - 1].get(2), row); // concessionaria
sv.set_row_cell(S_VERSAMENTO, versamenti[i - 1], row);// versamenti
sv.set_row_cell(S_INTERESSI, interessi[i - 1], row);// interessi
if (is_month_ok(m) || m == 13)
{
nomemese = itoname(m == 13 ? 12 : i);
if (nomemese == "4 Trimestre")
nomemese = TR("4 Tr.");
if (m == 12) nomemese << TR(" acconto");
if (m == 13) nomemese << TR(" saldo");
if (i == 12)
sv.disable_cell(sv.items() - 1, -1);
const int row = sv.set_row_cell(S_MESE, nomemese); // mese
sv.set_row_cell(S_DATA, date[m - 1], row); // data vers.
sv.set_row_cell(S_ABI, banche[m - 1].get(0), row); // azienda
sv.set_row_cell(S_CAB, banche[m - 1].get(1), row); // dipendenza
sv.set_row_cell(S_CONC, banche[m - 1].get(2), row); // concessionaria
sv.set_row_cell(S_VERSAMENTO, versamenti[m - 1], row);// versamenti
sv.set_row_cell(S_INTERESSI, interessi[m - 1], row);// interessi
sv.set_row_cell(S_STAMPATO, stampato[m - 1], row);// stampato
// if (i == 12)
// sv.disable_cell(11, cid2index(S_INTERESSI));
}
}
sv.force_update();
@ -1802,15 +1817,19 @@ void Visliq_app::write_general(TMask& m)
else
cr_res = rstart;
// indicatore ricalcolo crediti e debiti OK
int step = _freqviva == "M" ? 1 : 3;
const int row_acc = freq_ver_IVA() == "M" ? 11 : 3;
// indicatore ricalcolo crediti e debiti OK
int step = freq_ver_IVA() == "M" ? 1 : 3;
bool carry = true;
bool was_lim;
TMask& shm = sh.sheet_mask();
TMask& svm = sv.sheet_mask();
int last_month = freq_ver_IVA() == "M" ? 14 : 16;
for (int i = step; i < 13; i += step)
for (int i = step; i < last_month; i += step)
{
int m = (i > 12) ? 13 : i;
// this is a true bordel
const int row = (i/step) - 1;
@ -1818,21 +1837,21 @@ void Visliq_app::write_general(TMask& m)
bool vfrommask = sv.selected() == (i == 12 ? row + 1 : row) && svm.is_running();
TToken_string& tt_lo = (TToken_string&)_liq_rows[row];
// TToken_string& tt_ln = sh.row(row);
// risolve menata del dettaglio si'/no
if (lfrommask)
for (int i = 1; i <= 13; i++)
sh.set_row_cell(101 + i, shm.get(101+i), row);
for (int j = 1; j <= 13; j++)
sh.set_row_cell(101 + j, shm.get(101 + j), row);
// saltare una riga se dicembre (riga 11 == acconto)
TToken_string& tt_vo = (TToken_string&)_vers_rows[i == 12 ? row + 1 : row];
TToken_string& tt_vn = sv.row(i == 12 ? row + 1 : row);
// saltare una riga se dicembre (riga 11 == acconto)
TToken_string& tt_vo = (TToken_string&)_vers_rows[row];
TToken_string& tt_vn = sv.row(row);
if (vfrommask)
{
for (int i = 1; i <= 5; i++)
sh.set_row_cell(101 + i, svm.get(101+i), row);
for (int j = 1; j <= 5; j++)
sh.set_row_cell(101 + j, svm.get(101+j), row);
}
// traduci contenuto righe in real pila
@ -1850,6 +1869,8 @@ void Visliq_app::write_general(TMask& m)
real overs(tt_vo.get(cid2index(S_VERSAMENTO)));
real nvers(sv.get_real_row_cell(row, S_VERSAMENTO));
real oint(tt_vo.get(cid2index(S_INTERESSI)));
real nint(sv.get_real_row_cell(row, S_INTERESSI));
TDate odate(tt_vo.get(cid2index(S_DATA)));
TDate ndate(sv.get_date_row_cell(row, S_DATA));
TString8 oabi(tt_vo.get(cid2index(S_ABI)));
@ -1858,85 +1879,54 @@ void Visliq_app::write_general(TMask& m)
TString8 ncab(sv.get_str_row_cell(row, S_CAB));
TString ocon(tt_vo.get(cid2index(S_CONC)));
TString ncon(sv.get_str_row_cell(row, S_CONC));
bool osta(tt_vo.get_bool(cid2index(S_STAMPATO)));
bool nsta(sv.get_bool_row_cell(row, S_STAMPATO));
if (odbcr == "C") orett = -orett;
if (ndbcr == "C") nrett = -nrett;
// acconto (si considererà solo a dicembre)
TToken_string& vo = (TToken_string&)_vers_rows[_freqviva == "M" ? 11 : 3];
const int row_acc = _freqviva == "M" ? 11 : 3;
real oacct(tt_vo.get(cid2index(S_VERSAMENTO)));
real nacct(sv.get_real_row_cell(row_acc, S_VERSAMENTO));
TDate aodate(tt_vo.get(cid2index(S_DATA)));
TDate andate(sv.get_date_row_cell(row_acc, S_DATA));
TString8 aoabi(tt_vo.get(cid2index(S_ABI)));
TString8 anabi(sv.get_str_row_cell(row_acc, S_ABI));
TString8 aocab(tt_vo.get(cid2index(S_CAB)));
TString8 ancab(sv.get_str_row_cell(row_acc, S_CAB));
TString aocon(tt_vo.get(cid2index(S_CONC)));
TString ancon(sv.get_str_row_cell(row_acc, S_CONC));
was_lim = look_lim(i);
was_lim = look_lim(m);
if (!was_lim)
carry = false; // blocca riporto crediti e debiti
// ricalcola crediti e debiti se non ci sono
// liquidazioni non calcolate in mezzo
// non calcolate in mezzo
if (carry)
{
bool rt_mod = false, rm_mod = false, vr_mod = false;
real risl = _lim->get_real("R0");
real vers = _lim->get_real("R8");
real risc = _lim->get_real("R12");
real risd = _lim->get_real("R13");
// ricalcola acconto se occorre
// e crea/aggiorna la delega
if (i == 12)
{
bool ac_mod = false;
if (oacct != nacct)
{
risc -= oacct;
risc += nacct;
risl += oacct;
risl -= nacct;
_lim->put("R11", nacct);
ac_mod = true;
}
if (ndate != odate || anabi != aoabi || ancab != aocab || ancon != aocon)
ac_mod = true;
// write delega acconto
if (ac_mod)
{
look_del(12,7,true);
_del->put("R0",nacct);
_del->put("R1","");
_del->put("S7",anabi);
_del->put("S8",ancab);
_del->put("S9",ancon);
_del->put("S6","6013");
_del->rewrite();
}
}
// ricalcola versamenti se occorre
// e crea/aggiorna le deleghe
if (nvers != overs)
vr_mod = true;
if (row == row_acc)
{
if (overs != nvers)
{
risc -= overs;
risc += nvers;
risl += overs;
risl -= nvers;
_lim->put("R11", nvers);
}
}
// ricalcola versamenti se occorre
// e crea/aggiorna le deleghe
if (vr_mod || ndate != odate || nabi != oabi || ncab != ocab || ncon != ocon)
{
_lim->put("R8", nvers);
_lim->put("D0", ndate);
_lim->put("S4", nabi);
_lim->put("S5", ncab);
_lim->put("S6", ncon);
write_del(nvers);
vr_mod = true;
}
if (nvers != overs || nint != oint|| ndate != odate || nabi != oabi || ncab != ocab || ncon != ocon || osta != nsta)
{
_lim->put("R8", nvers);
real percint = (nint / (nvers - nint)) * CENTO;
percint.round(2);
_lim->put("R10", percint);
_lim->put("D0", ndate);
_lim->put("S4", nabi);
_lim->put("S5", ncab);
_lim->put("S6", ncon);
write_del(m, nabi, ncab, ncon, ndate, nvers, nint, nsta);
}
// se modificate rettifiche
// sistemare

View File

@ -68,6 +68,7 @@ protected:
static bool sheet_action(TSheet_field& s, int r, KEY k);
static bool vers_action(TSheet_field& s, int r, KEY k);
virtual void print();
public:
@ -85,12 +86,14 @@ public:
void read_general(TMask& m);
void write_general(TMask& m);
void write_liq();
void write_del(const real &v = ZERO);
void write_liq() { _lim->rewrite(); }
void write_del(const int month, const char * codabi = nullptr, const char * codcab = nullptr, const char * codcon = nullptr,
const TDate & d = TDate(NULLDATE), const real &v = MENOUNO, const real &i = ZERO, bool stampato = false);
void set_freqviva();
void set_freqviva(const char* f) { _freqviva = f; }
void set_mask_freq(TMask&);
const TString & freq_ver_IVA() const { return _freqviva; }
void set_mask_freq(TMask&);
void set_year(const char* y) { _year = atoi(y); }
void set_year(int y) { _year = y; }
void reset_fields();

View File

@ -56,3 +56,4 @@
#define S_CONC 105
#define S_VERSAMENTO 106
#define S_INTERESSI 107
#define S_STAMPATO 108

View File

@ -63,8 +63,8 @@ SPREADSHEET F_VISLIQ1 -2 -1
BEGIN
PROMPT 0 7 "Liquidazione"
ITEM "Mese@10"
ITEM "IVA dovuta o\na credito@15"
ITEM "D/C@3"
ITEM "IVA dovuta o\na credito@15"
ITEM "D/C@3"
ITEM "Risultato@15"
ITEM "D/C@3"
ITEM "IVA rimborso@15"
@ -108,7 +108,8 @@ BEGIN
ITEM "CAB@5"
ITEM "Conc.@5"
ITEM "Versamenti@15"
ITEM "Interessi@15"
ITEM "Interessi@15"
ITEM "Stampato"
END
ENDPAGE
@ -120,7 +121,7 @@ TOOLBAR "topbar" 0 0 0 2
ENDPAGE
PAGE "Prospetto mensile" -1 -1 75 22
PAGE "Prospetto mensile" -1 -1 -1 -1
STRING S_MESE 20
BEGIN
@ -129,13 +130,13 @@ BEGIN
END
CURRENCY S_RISULTATO 15
CURRENCY S_IVA 15
BEGIN
PROMPT 1 2 "Risultato "
PROMPT 1 2 "IVA dovuta o credito "
FLAGS "D"
END
LIST S_DEBCRED1 1 10
LIST S_DEBCRED3 1 10
BEGIN
PROMPT 57 2 ""
ITEM " | "
@ -144,22 +145,37 @@ BEGIN
FLAGS "DU"
END
CURRENCY S_RISULTATO 15
BEGIN
PROMPT 1 3 "Risultato "
FLAGS "D"
END
LIST S_DEBCRED1 1 10
BEGIN
PROMPT 57 3 ""
ITEM " | "
ITEM "D|Debito"
ITEM "C|Credito"
FLAGS "DU"
END
CURRENCY S_RIMBORSO 15
BEGIN
PROMPT 1 3 "IVA rimborso "
PROMPT 1 4 "IVA rimborso "
PICTURE "."
GROUP 11
END
CURRENCY S_RETTIFICHE 15
BEGIN
PROMPT 1 4 "IVA rettifiche "
PROMPT 1 5 "IVA rettifiche "
GROUP 11
END
LIST S_DEBCRED2 1 10
BEGIN
PROMPT 57 4 ""
PROMPT 57 5 ""
ITEM " | "
ITEM "D|Debito"
ITEM "C|Credito"
@ -169,28 +185,28 @@ END
CURRENCY S_CREDIVA 15
BEGIN
PROMPT 1 5 "Credito utilizzato IVA "
PROMPT 1 6 "Credito utilizzato IVA "
FLAGS "D"
GROUP 12
END
CURRENCY S_CREDF24PRE 15
BEGIN
PROMPT 1 6 "Credito utilizzato F24 anno precedente "
PROMPT 1 7 "Credito utilizzato F24 anno precedente "
GROUP 12
FLAGS "D"
END
CURRENCY S_CREDF24 15
BEGIN
PROMPT 1 7 "Credito autorizzato F24 anno in corso "
PROMPT 1 8 "Credito autorizzato F24 anno in corso "
GROUP 12
FLAGS "D"
END
DATE S_DATAAUT
BEGIN
PROMPT 1 8 "Data di autorizzazione "
PROMPT 1 9 "Data di autorizzazione "
GROUP 12
CHECTYPE REQUIRED
WARNING "La data è obbligatoria"
@ -199,27 +215,11 @@ END
CURRENCY S_CREDRES 15
BEGIN
PROMPT 1 9 "Credito IVA residuo "
FLAGS "D"
PROMPT 1 10 "Credito IVA residuo "
FLAGS "D"
GROUP 12
END
CURRENCY S_IVA 15
BEGIN
PROMPT 1 10 "IVA dovuta o credito "
FLAGS "D"
GROUP 12
END
LIST S_DEBCRED3 1 10
BEGIN
PROMPT 57 10 ""
ITEM " | "
ITEM "D|Debito"
ITEM "C|Credito"
FLAGS "UD"
GROUP 11
END
STRING S_DESCR 50 35
BEGIN
@ -230,7 +230,7 @@ END
BUTTON 100 10 2
BEGIN
PROMPT -11 -1 "Dettaglio"
PROMPT -11 -2 "<D>ettaglio"
END
ENDPAGE
@ -242,7 +242,7 @@ TOOLBAR "topbar" 0 0 0 2
ENDPAGE
PAGE "Prospetto versamenti" -1 -1 50 12
PAGE "Prospetto versamenti" -1 -1 -1 -1
STRING S_MESE 20
BEGIN
@ -314,12 +314,27 @@ END
CURRENCY S_INTERESSI 15
BEGIN
PROMPT 1 7 "Interessi "
FLAGS "RD"
FLAGS "R"
END
BOOLEAN S_STAMPATO
BEGIN
PROMPT 1 8 "Stampato"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -2 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -2 ""
END
BUTTON 100 10 2
BEGIN
PROMPT -11 -1 "Dettaglio"
PROMPT -11 -2 "<D>ettaglio"
END
ENDPAGE

View File

@ -58,10 +58,12 @@ BEGIN
PROMPT 1 6 "Credito utilizzato a Gennaio "
END
SPREADSHEET F_VISLIQ1 -2 7
SPREADSHEET F_VISLIQ1 -2 -1
BEGIN
PROMPT 0 7 "Liquidazione"
ITEM "Mese@10"
ITEM "IVA dovuta o\na credito@15"
ITEM "D/C@3"
ITEM "Risultato@15"
ITEM "D/C@3"
ITEM "IVA rimborso@15"
@ -78,56 +80,72 @@ END
SPREADSHEET F_VISLIQ2 -2 7
BEGIN
PROMPT 0 16 "Versamenti"
ITEM "Mese@10"
ITEM "Mese@15"
ITEM "Data@10"
ITEM "ABI@5"
ITEM "CAB@5"
ITEM "Conc.@5"
ITEM "Versamenti@15"
ITEM "Interessi@15"
ITEM "Interessi@15"
ITEM "Stampato"
END
ENDPAGE
ENDMASK
PAGE "Prospetto mensile" -1 -1 50 10
PAGE "Prospetto mensile" -1 -1 -1 -1
STRING 101 20
STRING S_MESE 20
BEGIN
PROMPT 1 1 "Mese "
FLAGS "D"
END
CURRENCY 102 15
CURRENCY S_IVA 15
BEGIN
PROMPT 1 2 "Risultato "
PROMPT 1 2 "IVA dovuta o credito "
FLAGS "D"
END
LIST 103 1 10
LIST S_DEBCRED3 1 10
BEGIN
PROMPT 35 2 ""
PROMPT 57 2 ""
ITEM " | "
ITEM "D|Debito"
ITEM "C|Credito"
FLAGS "DU"
END
CURRENCY 104 15
CURRENCY S_RISULTATO 15
BEGIN
PROMPT 1 3 "IVA rimborso "
PROMPT 1 3 "Risultato "
FLAGS "D"
END
LIST S_DEBCRED1 1 10
BEGIN
PROMPT 57 3 ""
ITEM " | "
ITEM "D|Debito"
ITEM "C|Credito"
FLAGS "DU"
END
CURRENCY S_RIMBORSO 15
BEGIN
PROMPT 1 4 "IVA rimborso "
GROUP 11
END
CURRENCY 105 15
CURRENCY S_RETTIFICHE 15
BEGIN
PROMPT 1 4 "IVA rettifiche "
PROMPT 1 5 "IVA rettifiche "
GROUP 11
END
LIST 106 1 10
LIST S_DEBCRED2 1 10
BEGIN
PROMPT 35 4 ""
PROMPT 57 5 ""
ITEM " | "
ITEM "D|Debito"
ITEM "C|Credito"
@ -135,80 +153,80 @@ BEGIN
GROUP 11
END
CURRENCY 107 15
CURRENCY S_CREDIVA 15
BEGIN
PROMPT 1 3 "Credito utilizzato IVA "
PROMPT 1 6 "Credito utilizzato IVA "
FLAGS "D"
GROUP 12
END
CURRENCY 108 15
CURRENCY S_CREDF24PRE 15
BEGIN
PROMPT 1 4 "Credito utilizzato F24 "
PROMPT 1 7 "Credito utilizzato F24 "
GROUP 12
END
CURRENCY 109 15
CURRENCY S_CREDF24 15
BEGIN
PROMPT 1 7 "Credito autorizzato F24 anno in corso "
PROMPT 1 8 "Credito autorizzato F24 anno in corso "
GROUP 12
FLAGS "D"
END
DATE 110
DATE S_DATAAUT
BEGIN
PROMPT 1 8 "Data di autorizzazione "
PROMPT 1 9 "Data di autorizzazione "
GROUP 12
CHECTYPE REQUIRED
WARNING "La data è obbligatoria"
FLAGS "D"
END
CURRENCY 111 15
CURRENCY S_CREDRES 15
BEGIN
PROMPT 1 5 "Credito IVA residuo "
PROMPT 1 10 "Credito IVA residuo "
FLAGS "D"
GROUP 12
END
STRING 112 50 35
STRING S_DESCR 50 35
BEGIN
PROMPT 1 6 "Descr. "
PROMPT 1 11 "Descr. "
GROUP 12
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
PROMPT -13 -2 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
PROMPT -23 -2 ""
END
BUTTON 100 10 2
BEGIN
PROMPT -33 -1 "Dettaglio"
PROMPT -33 -2 "<D>ettaglio"
END
ENDPAGE
ENDMASK
PAGE "Prospetto versamenti" -1 -1 50 12
PAGE "Prospetto versamenti" -1 -1 -1 -1
STRING 101 20
STRING S_MESE 20
BEGIN
PROMPT 1 1 "Mese "
FLAGS "D"
END
DATE 102
DATE S_DATA
BEGIN
PROMPT 1 2 "Data "
END
NUMBER 103 5
NUMBER S_ABI 5
BEGIN
PROMPT 1 3 "Codice ABI "
HELP "Codice ABI banca di appoggio"
@ -224,8 +242,7 @@ BEGIN
WARNING "Codice ABI assente"
END
NUMBER 104 5
NUMBER S_CAB 5
BEGIN
PROMPT 1 4 "Codice CAB "
HELP "Codice CAB banca di appoggio"
@ -244,42 +261,44 @@ BEGIN
WARNING "Banca assente"
END
NUMBER 105 3
NUMBER S_CONC 3
BEGIN
PROMPT 1 5 "Concessione "
HELP "Codice Concessione del Comune di residenza fiscale"
// FIELD S9
FLAGS "RZ"
END
CURRENCY 106 15
CURRENCY S_VERSAMENTO 15
BEGIN
PROMPT 1 6 "Versamenti "
FLAGS "R"
END
CURRENCY 107 15
CURRENCY S_INTERESSI 15
BEGIN
PROMPT 1 6 "Interessi "
FLAGS "RD"
PROMPT 1 7 "Interessi "
FLAGS "R"
END
BOOLEAN S_STAMPATO
BEGIN
PROMPT 1 8 "Stampato"
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -13 -1 ""
PROMPT -13 -2 ""
END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -23 -1 ""
PROMPT -23 -2 ""
END
BUTTON 100 10 2
BEGIN
PROMPT -33 -1 "Dettaglio"
// FLAGS "H"
PROMPT -33 -2 "<D>ettaglio"
END
ENDPAGE

View File

@ -3135,6 +3135,17 @@ int TSheet_field::set_row_cell(short id, const TDate& value, int nrow)
return nrow;
}
int TSheet_field::set_row_cell(short id, const bool value, int nrow)
{
if (nrow < 0)
nrow = first_empty();
set_row_cell(row(nrow), id, value);
#ifdef DBG
const TToken_string & r = row(nrow);
#endif
return nrow;
}
// Certified 100%
// Ritorna l'indice della prima riga vuota dello sheet
int TSheet_field::first_empty() const

View File

@ -157,6 +157,7 @@ public:
virtual void set_row_cell(TToken_string & row, short id, int value) { row.add(value, cid2index(id)); }
virtual void set_row_cell(TToken_string & row, short id, const real& value) { row.add(value, cid2index(id)); }
virtual void set_row_cell(TToken_string & row, short id, const TDate& value) { row.add(value, cid2index(id)); }
virtual void set_row_cell(TToken_string & row, short id, const bool value) { row.add(value ? "X" : "", cid2index(id)); }
virtual int set_row_cell(short id, const char * value, int nrow = -1);
virtual int set_row_cell(short id, char value, int nrow = -1);
@ -164,6 +165,7 @@ public:
virtual int set_row_cell(short id, int value, int nrow = -1);
virtual int set_row_cell(short id, const real& value, int nrow = -1);
virtual int set_row_cell(short id, const TDate& value, int nrow = -1);
virtual int set_row_cell(short id, const bool value, int nrow = -1);
virtual const char * get_str_row_cell(int nrow, short id) { return row(nrow).get(cid2index(id)); }
virtual char get_char_row_cell(int nrow, short id) { return row(nrow).get_char(cid2index(id)); }
@ -171,6 +173,7 @@ public:
virtual int get_int_row_cell(int nrow, short id) { return row(nrow).get_int(cid2index(id)); }
virtual real get_real_row_cell(int nrow, short id) { return real(row(nrow).get(cid2index(id))); }
virtual TDate get_date_row_cell(int nrow, short id) { return TDate(row(nrow).get(cid2index(id))); }
virtual bool get_bool_row_cell(int nrow, short id) { const TString s = get_str_row_cell(nrow, id); return s == "X"; }
char separator() const { return _separator; }

View File

@ -2,6 +2,7 @@
#include <real.h>
#include <strings.h>
const real MENOUNO(-1.0);
const real ZERO(0.0);
const real PUNTO_UNO(UNO/DIECI);
const real PUNTO_DUE(DUE/DIECI);

View File

@ -11,6 +11,7 @@
class real;
extern const real MENOUNO;
extern const real ZERO;
extern const real PUNTO_UNO;
extern const real PUNTO_DUE;

View File

@ -1679,6 +1679,13 @@ long TToken_string::get_long(int n)
return num ? atol(num) : 0L;
}
bool TToken_string::get_bool(int n)
{
const TString s = get(n);
return s == "X";
}
// const TToken_string new age!

View File

@ -673,7 +673,9 @@ public:
int get_int(int n = -1);
// @cmember Ritorna un intero esteso (chiama <mf TToken_string::get>)
long get_long(int n = -1);
// @cmember Ritorna un booleano (chiama <mf TToken_string::get>)
bool get_bool(int n = -1);
// TToken_string new age: const methods;
// @cmember Ritorna l'ennesimo token
bool get(int n, TString& tok) const;