Si le mode de gestion des reliquats de Mercator est sur ASK (= choix possible pour l'utilisateur), alors MercatorPenguinServer transforme ce choix en OUI (=conserver les reliquats), puisque la boîte de dialogue ne peut être soumise à l'utilisateur de MercatorPenguin. Il est possible de déroger à ce comportement via ce paramétrage.
Il faut d'abord ajouter une colonne booléenne dans la table des pieds (PIEDS_V ou PIEDS_A).
alter table PIEDS_V add KEEP_BO bit not null default 0
Ensuite, dans le paramétrage XAML de la séquence concernée, il suffit d'ajouter un EditSwitch dont la source est KEEP_BO.
<m:EditSwitch Source="keep_bo" BackgroundColor="%ThemeColor%" />
Enfin, dans la séquence de destination, il faut ajouter ce customizer :
namespace Billing
{
public class Customizer : MercatorUi.ICustomizers.IBillingEngineCreated, MercatorUi.ICustomizers.IBillingEngineClosed
{
public void BillingEngineCreated(MercatorUi.Engine.Gescom.BillingEngine billingEngine)
{
billingEngine.BeforeSave += BillingEngine_BeforeSave;
}
public void BillingEngineClosed(MercatorUi.Engine.Gescom.BillingEngine billingEngine)
{
billingEngine.BeforeSave -= BillingEngine_BeforeSave;
}
void BillingEngine_BeforeSave(object sender, MercatorUi.Engine.Gescom.BillingEngine.BeforeSaveEventArgs e)
{
MercatorUi.Engine.Gescom.BillingEngine billingEngine = (MercatorUi.Engine.Gescom.BillingEngine)sender;
if (MercatorUi.Globals.IsMercatorPenguinServer)
billingEngine.ForcedBackOrders = billingEngine.PiedsVRecord.KEEP_BO ? MercatorUi.Engine.Gescom.BillingEngine.ForcedBackOrdersEnum.Yes : MercatorUi.Engine.Gescom.BillingEngine.ForcedBackOrdersEnum.No;
}
}
}