diff --git a/src/cg/cg5500.cpp b/src/cg/cg5500.cpp index 1eadb6cef..fb4812c0e 100755 --- a/src/cg/cg5500.cpp +++ b/src/cg/cg5500.cpp @@ -367,7 +367,7 @@ void Visliq_app::print() book.add(rep); rep.load("cg5500b"); r = rep.recordset(); - r->set_var("#FILTER", key, true); + r->set_var("#FILTER", key1, true); r->set_var("#ANNO", TVariant((long)year()), true); book.add(rep); book.print_or_preview(); @@ -613,7 +613,7 @@ bool Visliq_app::vis_all() for (int id = 108; shm.id2pos(id) > 0; id++) { - if ((id > 107 && id <= 110) || id == 112) + if ((id > 107 && id <= 110) || id == 114) sh.enable_column(id, true); } } @@ -1436,18 +1436,20 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field TToken_string& t = sl->row(row); t.add(itoname(i),0); - const real r0 = _lim->get_real("R0"); + + const real iva_ven = _lam->get_real("R0"); // IVA acquisti + const real iva_acq = _lam->get_real("R1"); // IVA vendite + const real ris = iva_ven - iva_acq; + + t.add(abs(ris).string(), 1); const real r1 = _lim->get_real("R1"); bool enable_date = !r1.is_zero(); const real r5 = _lim->get_real("R5"); - real absv = abs(r0); - t.add(absv, 1); - if (!r0.is_zero()) - t.add(r0 > ZERO ? "D" : "C", 2); + + t.add(ris == ZERO ? "" : (ris > ZERO ? "D" : "C"), 2); t.add(r1, 3); - absv = abs(r5); - t.add(absv, 4); + t.add(abs(r5), 4); if (!r5.is_zero()) t.add(r5 >ZERO ? "D" : "C", 5); @@ -1480,7 +1482,14 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field } else t.add("", 10); - t.add(_lim->get("S3"), 11); + + real r0 = _lim->get_real("R0"); + + if (compensabile) + r0 += autf24; + t.add(abs(r0).string(), 11); + t.add(r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C"), 12); + t.add(_lim->get("S3"), 13); for (int kk = 3; kk < 6 ; kk++) sl->enable_cell(row, kk); @@ -1488,7 +1497,7 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field sl->enable_cell(row, 8); sl->enable_cell(row, 9); sl->enable_cell(row, 9, enable_date); - sl->enable_cell(row, 12); + sl->enable_cell(row, 14); } } sl->force_update(); @@ -1600,17 +1609,21 @@ void Visliq_app::read_general(TMask& m) else tt = &(sh.row(row)); - const real r0abs = abs(_lim->get_real("R0")); + + const real iva_ven = _lam->get_real("R0"); // IVA acquisti + const real iva_acq = _lam->get_real("R1"); // IVA vendite + const real ris = iva_ven -iva_acq; + const real r1 = _lim->get_real("R1"); const real r5abs = abs(_lim->get_real("R5")); tt->add(itoname(i),0); - tt->add(r0abs.string(),1); + tt->add(abs(ris).string(),1); - int sr0 = (_lim->get_real("R0")).sign(); - int sr5 = (_lim->get_real("R5")).sign(); + const int sris = ris.sign(); + const int sr5 = (_lim->get_real("R5")).sign(); - tt->add(sr0 == 0 ? "" : (sr0 > 0 ? "D" : "C"),2); + tt->add(sris == 0 ? "" : (sris > 0 ? "D" : "C"),2); tt->add(r1.string(),3); tt->add(r5abs.string(),4); bool enable_date = !r1.is_zero(); @@ -1629,8 +1642,6 @@ void Visliq_app::read_general(TMask& m) sh.enable_cell(row, 9, enable_date); if (compensabile) { -// if (cr_res > ZERO) -// { cr_res += autf24; cr_res -= crf24; cr_res -= criva; @@ -1647,9 +1658,15 @@ void Visliq_app::read_general(TMask& m) } else tt->add("", 10); - tt->add(_lim->get("S3"), 11); + + real r0 = _lim->get_real("R0"); + + if (compensabile) + r0 += autf24; + tt->add(abs(r0).string(), 11); + tt->add(r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C"), 12); + tt->add(_lim->get("S3"), 13); sh.row(row) = (*tt); - // sh.force_update(row); } sh.force_update(); @@ -1708,7 +1725,7 @@ void Visliq_app::read_general(TMask& m) tt.add(versamenti[i-1].string(),5);// versamenti sv.row(-1) = tt; - if (i == 12) + if (i == 11) sv.enable_cell(sv.items() - 1, -1, false); } @@ -1771,7 +1788,7 @@ void Visliq_app::write_general(TMask& m) // risolve menata del dettaglio si'/no if (lfrommask) { - for (int i = 1; i <= 11; i++) + for (int i = 1; i <= 13; i++) tt_ln.add(shm.get(101+i),i); } @@ -1806,7 +1823,7 @@ void Visliq_app::write_general(TMask& m) TString8 ncab (tt_vn.get(3)); TString ocon (tt_vo.get(4)); TString ncon (tt_vn.get(4)); - TString descr(tt_ln.get(11)); + TString descr(tt_ln.get(13)); if (odbcr == "C") orett = -orett; if (ndbcr == "C") nrett = -nrett; @@ -1997,14 +2014,10 @@ void Visliq_app::write_general(TMask& m) if (compensabile) { const real criva(tt_ln.get(6)); -// if (cr_res > ZERO) -// { - cr_res += autf24; - cr_res -= crf24; - cr_res -= criva; -// } -// if (cr_res < ZERO) -// cr_res = ZERO; + + cr_res += autf24; + cr_res -= crf24; + cr_res -= criva; if (cr_res < ZERO) sh.set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, 7); else @@ -2039,23 +2052,31 @@ void Visliq_app::write_general(TMask& m) // Rimetti a posto righe sheet se serve if (was_lim) { - int sr0 = (_lim->get_real("R0")).sign(); - int sr5 = (_lim->get_real("R5")).sign(); - - real r0abs = abs(_lim->get_real("R0")); - real r5abs = abs(_lim->get_real("R5")); - - tt_ln.add(r0abs.string(),1); - tt_ln.add(sr0 == 0 ? "" : (sr0 > 0 ? "D" : "C"), 2); + + const real iva_ven = _lam->get_real("R0"); // IVA acquisti + const real iva_acq = _lam->get_real("R1"); // IVA vendite + const real ris = iva_ven - iva_acq; + + tt_ln.add(abs(ris).string(), 1); + tt_ln.add(ris == 0 ? "" : (ris > 0 ? "D" : "C"), 2); tt_ln.add((_lim->get_real("R1")).string(),3); - tt_ln.add(r5abs.string(),4); + + int sr5 = (_lim->get_real("R5")).sign(); + real r5abs = abs(_lim->get_real("R5")); + + tt_ln.add(r5abs.string(),4); tt_ln.add(sr5 == 0 ? "" : (sr5 > 0 ? "D" : "C"),5); if ( cr_res < ZERO) tt_ln.add("",10); else - tt_ln.add(cr_res.string(),10); - } + tt_ln.add(cr_res.string(), 10); + + real r0 = _lim->get_real("R0"); + + tt_ln.add(abs(r0).string(), 11); + tt_ln.add(r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C"), 12); + } _from_one = false; } // for mese liq. (riga sheet) diff --git a/src/cg/cg5500a.rep b/src/cg/cg5500a.rep index a13aeffde..6545aaaec 100644 --- a/src/cg/cg5500a.rep +++ b/src/cg/cg5500a.rep @@ -1,9 +1,12 @@ Stampa prospetto liquidazione - +
+ + + "Stampa Prospetto Liquidazione " @@ -11,9 +14,6 @@ + #THIS ! - - - #SYSTEM.DATE @@ -37,52 +37,65 @@ GET_FIRM_DATA "!IVA" GET_FIRM_DATA - - - - - - - - - - - -
- - - - - - - - - - - - + + + + + + + + + + + + + CODTAB[5,7]
  • @@ -100,67 +113,118 @@ TABLE_READ
  • - - R0 - #THIS @ + + "201@.R0" @ +"201@.R1" @ +- +#THIS ! +#THIS @ 0 E; IF "D" +#201 ! ELSE +#THIS @ +0 C; +IF 0 #THIS @ - #THIS ! "C" +#201 ! THEN -#201 ! +THEN - + R1 - + R5 #THIS @ 0 E; IF "D" +#202 ! ELSE +#THIS @ +0 C; +IF 0 #THIS @ - #THIS ! "C" +#202 ! THEN -#202 ! +THEN - + R15 - + R16 - + R20 - + D1 - + #H0.110 @ +#H0.111 @ +"CM" += +IF #113 @ - #114 @ - #115 @ + +ELSE +#119 @ +0 +C; +IF +0 +#119 @ +- +ELSE +0 +THEN +THEN DUP #THIS ! #H0.110 ! - + S3 - - + + R0 + #THIS @ +0 +E; +IF +"D" +#203 ! +ELSE +#THIS @ +0 C; +IF +0 +#THIS @ +- +#THIS ! +"C" +#203 ! +THEN +THEN + + + +
  • @@ -178,20 +242,22 @@ DUP
    - - - - - - - - - - - - + + + + + + + + + + + + +
    USE LIM +JOIN LAM ALIAS 201 INTO CODTAB==CODTAB FROM CODTAB=#ANNO TO CODTAB=#ANNO \ No newline at end of file diff --git a/src/cg/cg5500b.uml b/src/cg/cg5500b.uml index dc07523e8..ca88f3dcf 100755 --- a/src/cg/cg5500b.uml +++ b/src/cg/cg5500b.uml @@ -73,6 +73,8 @@ BEGIN ITEM "Credito anno in corso\nautorizzato F24@20" ITEM "Data autorizzazione@20" ITEM "Credito IVA\nresiduo@15" + ITEM "IVA dovuta o\na credito@15" + ITEM "D/C@3" ITEM "Descrizione@50" END @@ -201,9 +203,26 @@ BEGIN GROUP 12 END -STRING 112 50 35 +CURRENCY 112 15 BEGIN - PROMPT 1 10 "Descr. " + PROMPT 1 10 "IVA dovuta o credito " + FLAGS "D" + GROUP 12 +END + +LIST 113 1 10 +BEGIN + PROMPT 57 10 "" + ITEM " | " + ITEM "D|Debito" + ITEM "C|Credito" + FLAGS "UD" + GROUP 11 +END + +STRING 114 50 35 +BEGIN + PROMPT 1 11 "Descr. " GROUP 12 FLAGS "D" END diff --git a/src/cg/cg5500d.uml b/src/cg/cg5500d.uml index 5675dda03..e21f53802 100755 --- a/src/cg/cg5500d.uml +++ b/src/cg/cg5500d.uml @@ -251,7 +251,7 @@ END CURRENCY F_CREDAUT 15 BEGIN - PROMPT 2 22 "Credito IVA autorizzato in F24 : " + PROMPT 2 21 "Credito IVA autorizzato in F24 :" GROUP 10 FLAGS "H" PICTURE "." diff --git a/src/cg/cglib02.cpp b/src/cg/cglib02.cpp index 0862cf819..ff6027379 100755 --- a/src/cg/cglib02.cpp +++ b/src/cg/cglib02.cpp @@ -700,7 +700,7 @@ bool TSaldo::saldo_cont_sep(int g, int c, long s, const int codes, TDate al, if (ok) { - if (mov.get(MOV_CONTSEP) == cont_sep) + if (( cont_sep != NULL && *cont_sep == '\0') || mov.get(MOV_CONTSEP) == cont_sep) { _codcaus = mov.get(MOV_CODCAUS); _datareg = mov.get(MOV_DATAREG);