using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Forms;
using MercatorApi;
using MercatorUi;
using System.Linq;

namespace Billing
{
    public class Customizer : MercatorUi.ICustomizers.IBillingEngineCreated, MercatorUi.ICustomizers.IBillingEngineClosed
    {
        public void BillingEngineCreated(MercatorUi.Engine.Gescom.BillingEngine billingEngine)
        {
            billingEngine.BeforeGroup += BillingEngine_BeforeGroup;
        }

        public void BillingEngineClosed(MercatorUi.Engine.Gescom.BillingEngine billingEngine)
        {
            billingEngine.BeforeGroup -= BillingEngine_BeforeGroup;
        }

        private void BillingEngine_BeforeGroup(object sender, MercatorUi.Engine.Gescom.BillingEngine.BeforeGroupEventArgs e)
        {
            e.Col_Filtre_Sup = new string[] { "CUSTOM_COL1", "CUSTOM_COL2" }; ;
            e.AdditionalConditionsOnLignes = "(q > 0) and (id_article<>'S_ID1') and (id_article<>'S_ID2')";
            e.DoNotChangePuRemises = true;
            e.KeepComments = true;
        }

    }
}