From 3b7aa87dea8d9e0ae067257452f4551c51e46ea3 Mon Sep 17 00:00:00 2001 From: AlexBonazzi Date: Tue, 2 Jul 2019 00:42:25 +0200 Subject: [PATCH] Patch level : 12.0 848 Files correlati : cg1.exe cg2.exe cg4.exe f23.dir f23.trr cg1500a.msk cg2100b.msk cg2100c.msk cg2200a.msk cg5500b.msk Commento : Aggiunta data competenza costi ricavi Issue #15 Aggiunto tipo provvisorio "B" Bilancio costi/ricavi (Prima nota, Stampa Bilancio, Apertura Chiusura conti) --- src/cg/cg2102.cpp | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) 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)