In an invoice module (“ricevute”) I need to change the value of some labels and to hide or show some field.
The method I wrote works just fine, but I can’t do the same when I load related records and try to print them in the footer.
The method is:
var tipodocumento = tipodoc
switch( tipodocumento )
{
case "Ricevuta sanitaria":
elements.IVAoRit.visible = false
elements.TitRitAcc.visible = false
elements.TotRic.text = "Tot. ricevuta"
M- break;
case "Ritenuta d'acconto":
elements.IVAoRit.visible = true
elements.TitRitAcc.visible = true
elements.TitRitAcc.text = "Tot. Ritenuta/Acc."
elements.TotRic.text = "Totale"
M- break; M- M- M- M-
case "Fattura con IVA":
elements.IVAoRit.visible = true
M- M- elements.TitRitAcc.visible = true
elements.TitRitAcc.text = "Tot. IVA"
elements.TotRic.text = "Tot. fattura"
break;
case "Fattura IVA esente":
elements.IVAoRit.visible = false
M- M- elements.TitRitAcc.visible = false
elements.TotRic.text = "Tot. fattura"
M- M- M- break;
default:
M- M- M- break;
}
I recreated the same elements into the printing form of the lineitems table (named “rigric”) and wrote a method doing erxactly the same in rigric (I called it Imposta_Etichette_Stampa). If i move manually to rigric and launch the method, everything is fine, but if I launch this method from “ricevute”:
forms.rigric.controller.loadRecords(ricevute_to_rigric)
forms.rigric.Imposta_Etichette_Stampa();
forms.rigric.controller.showPrintPreview();
the elements values are not updated. What am I missing?
Furthermore, after several experiments, I also tried a different approach: I built a form only showing the footer of ricevute and I placed it in a tabpanel inside the footer of rigric, but - even if it’s set to printable - the tabpanel remains grey when printed.