Patch level : 12.0

Files correlati     : cg

Commento:
In prima nota corretta leggermente la logica che fa accendere i pulsanti "Collega" e "Scollega" fattura elettronica
This commit is contained in:
smen 2023-02-22 14:14:06 +01:00
parent 871064ce02
commit 587d4015b0
2 changed files with 36 additions and 2 deletions

View File

@ -139,7 +139,11 @@ TMask* TPrimanota_application::load_mask(int n)
if (!has_module(FPAUT))
{
if (m->find_by_id(F_COLFPPRO) != nullptr)
{
m->hide(F_COLFPPRO);
m->disable(DLG_LINK);
m->enable(DLG_EDIT);
}
if (m->find_by_id(DLG_LINK) != nullptr)
{
m->disable(DLG_LINK);
@ -1012,7 +1016,29 @@ void TPrimanota_application::f1_init(TMask& m, const bool fe_enabled, const bool
m.field(F_COLFPPRO).show(fe_enabled);
m.field(DLG_LINK).enable(fe_enabled);
bool int_td16 = reverse_charge && app().causale().reg().iva() == iva_vendite && cache().get(LF_MOV, _rel->lfile().get(MOV_MOVCOLL), MOV_KEYFPPRO).full();
m.set(F_COLFPPRO, fe_enabled && (f1_linked || int_td16) ? "X" : "", 0x3);
bool acq = _causale->reg().tipo_registro() == acquisto;
if (fe_enabled && acq)
{
if (m.get(MOV_KEYFPPRO).full())
{
m.set(F_COLFPPRO, "X");
m.enable(DLG_LINK, false);
m.enable(DLG_EDIT, true);
}
else
{
m.set(F_COLFPPRO, " ");
m.enable(DLG_LINK, true);
m.enable(DLG_EDIT, false);
}
}
else
{
m.enable(DLG_LINK, false);
m.enable(DLG_EDIT, false);
}
//m.set(F_COLFPPRO, fe_enabled && (f1_linked || int_td16) ? "X" : "", 0x3);
//bool a = m.get(F_COLFPPRO);
}
void TPrimanota_application::init_modify_mode(TMask& m)

View File

@ -4225,6 +4225,9 @@ bool TPrimanota_application::scollega_handler(TMask_field& f, KEY key)
{
app().curr_mask().reset(F_PROKEY);
app().curr_mask().reset(F_COLFPPRO);
//m.set(F_COLFPPRO, "X");
app().curr_mask().enable(DLG_LINK, true);
app().curr_mask().enable(DLG_EDIT, false);
}
message_box("Il movimento e' stato scollegato dalla fattura elettronica\nin ingresso, precedentemente associata.");
}
@ -4323,6 +4326,11 @@ bool TPro_msk::riporta(TMask_field& f)
sf.force_update();
if (!ok)
message_box("Nessun documento selezionato.");
else
{
app().curr_mask().enable(DLG_LINK, false);
app().curr_mask().enable(DLG_EDIT, true);
}
msk.stop_run(K_QUIT);
return true;
}