using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LQKJ.K3.MFG.PRD.App.ServicePlugIn
{
    [Kingdee.BOS.Util.HotUpdate]
    [Description("单位转换")]
    public class UnitSaveService : AbstractOperationServicePlugIn
    {
        public override void BeginOperationTransaction(BeginOperationTransactionArgs e)
        {
            if (this.Context.ServiceType == Kingdee.BOS.WebType.WebSite) return;

            foreach (DynamicObject dObj in e.DataEntitys)
            {
                var receiveEntrys = dObj["PUR_ReceiveEntry"] as DynamicObjectCollection;
                foreach (DynamicObject receiveEntry in receiveEntrys)
                {
                    receiveEntry["SupDelQty"] = receiveEntry["ActReceiveQty"];
                }
            }
            base.BeginOperationTransaction(e);
        }
    }
}
