diff --git a/src/cg/cg2102.cpp b/src/cg/cg2102.cpp index bbe903822..91421db9c 100755 --- a/src/cg/cg2102.cpp +++ b/src/cg/cg2102.cpp @@ -2328,12 +2328,17 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key) TString4 provv; provv << c.provvisorio(); m.set(F_PROVVISORIO, provv); if (c.iva() != nessuna_iva && mask_ok) - { m.set(F_SOLAIVA, c.soloiva() ? "X" : " "); - m.efield(F_REVCHARGE).show(c.iva() == iva_acquisti && c.reverse_charge()); - a.activate_split_payment(m); - } } + if (c.iva() != nessuna_iva && mask_ok) + { + m.efield(F_REVCHARGE).show(c.iva() == iva_acquisti && c.reverse_charge()); + m.efield(F_MOVCOLL).show((c.iva() == iva_acquisti && c.reverse_charge()) || + (c.iva() == iva_vendite && c.causale_reg_iva())); + // m.efield(F_GOCOLL).show((c.iva() == iva_acquisti && c.reverse_charge()) || + // (c.iva() == iva_vendite && c.causale_reg_iva())); + a.activate_split_payment(m); + } // Se la causale ha come tipo documento una bolla doganale, se si abilito i campi per collegare il fornitore if(m.find_by_id(F_BOLLACODCLI) != NULL) { @@ -2544,10 +2549,32 @@ bool TPrimanota_application::datacomp_handler(TMask_field& f, KEY key) return f.error_box(FR("%s non appartiene a nessun esercizio"), data); } } - return true; } +// Handler of the F_DATACOMP field on the modify mask +// Certified 90% +bool TPrimanota_application::datacompcr_handler(TMask_field& f, KEY key) +{ + TMask& m = f.mask(); + + if (key == K_ENTER) + { + const TDate dr(m.get(F_DATAREG)); // Data operazione + TDate datacompcr(f.get()); + + if (datacompcr.empty()) + { + f.set(dr); + datacompcr = dr; + } + + if (datacompcr > dr) + return f.message_box(TR("La data di competenze costi/ricavi maggiore di %s"), dr.stringa()); + } + return true; +} + // Handler of the F_DATA74TER field on the modify mask // Certified 90% bool TPrimanota_application::data74ter_handler(TMask_field& f, KEY key)