diff --git a/cg/cg4302.cpp b/cg/cg4302.cpp index 64c6f2db9..abe32df62 100755 --- a/cg/cg4302.cpp +++ b/cg/cg4302.cpp @@ -464,8 +464,10 @@ bool TLiquidazione_app::look_del(int month, int type, bool create) if (!ok && create) { _del->zero(); - _del->put("CODTAB",ctab); - + _del->put("CODTAB",ctab); + } + if (create) + { // codici ABI e CAB da anagrafica ditte TString abi = _nditte->lfile().get("ABIBAN"); TString cab = _nditte->lfile().get("CABBAN"); @@ -505,7 +507,9 @@ bool TLiquidazione_app::look_del(int month, int type, bool create) ctri = _freqviva == "M" ? 6000 + month : 6030 + (month/3); _del->put("S6", format("%d",ctri)); - _del->write(); + + if (!ok) _del->write(); + else _del->rewrite(); } return ok; }