public static void makeNewAdjustmentVoucher(List <MakeAdjustmentItem> adjustmentList)
        {
            AdjustmentVoucher adjustmentVoucher = new AdjustmentVoucher();

            adjustmentVoucher.DateCreated = DateTime.Now;
            EntityCollection <AdjustmentVoucherDetail> voucherDetailsCollection = new EntityCollection <AdjustmentVoucherDetail>();

            foreach (MakeAdjustmentItem item in adjustmentList)
            {
                Product p                   = ProductDAO.getSearchProductbyid(item.ItemNumber);
                double  totalPrice          = (double)p.AdjustmentVoucherPrice * item.Quantity;
                AdjustmentVoucherDetail avd = new AdjustmentVoucherDetail();
                avd.ItemNumber     = item.ItemNumber;
                avd.Status         = item.Status.Equals("Excess") ? AdjustmentVoucherEFFacade.STATUS_DECREASE : AdjustmentVoucherEFFacade.STATUS_INCREASE;
                avd.TotalPrice     = totalPrice;
                avd.Comment        = item.Comment;
                avd.ApprovalStatus = AdjustmentVoucherEFFacade.APPROVAL_STATUS_PENDING;
                avd.Quantity       = item.Quantity;

                voucherDetailsCollection.Add(avd);
            }

            adjustmentVoucher.AdjustmentVoucherDetails = voucherDetailsCollection;

            AdjustmentVoucherEFFacade.addNewAdjustVoucherWithArrayVoucherDetails(adjustmentVoucher);
        }
        //////////////////////****************AShwin//////////////////////
        public static List <AdjustmentVoucher> CheckEmployeeRole(String Role)
        {
            List <AdjustmentVoucher> adjustvouch = new List <AdjustmentVoucher>();

            if (Role == EMPLOYEE_ROLE_SUPERVISOR)
            {
                adjustvouch = AdjustmentVoucherEFFacade.getAllVouchersForStoreSupervisor();
            }
            else
            {
                adjustvouch = AdjustmentVoucherEFFacade.getAllVouchersForStoreManager();
            }
            return(adjustvouch);
        }
Exemplo n.º 3
0
        //To get the list voucher number pending adjustment
        public AdjustmentVoucherWCF[] adjustmentvoucherlist(String role)
        {
            List <AdjustmentVoucher> adjustvouch =
                AdjustmentVoucherEFFacade.CheckEmployeeRole(role);
            List <AdjustmentVoucherWCF> adjustvouchnew = new List <AdjustmentVoucherWCF>();

            foreach (AdjustmentVoucher ad in adjustvouch)
            {
                AdjustmentVoucherWCF a = new AdjustmentVoucherWCF();
                a.VoucherNumber = ad.VoucherNumber;
                a.Date          = Convert.ToString(ad.DateCreated);
                adjustvouchnew.Add(a);
            }
            return(adjustvouchnew.ToArray <AdjustmentVoucherWCF>());
        }
Exemplo n.º 4
0
        public AdjustmentVoucherDetailsWCF[] adjsutmentvoucheritemssupervisor(String vouchernumber)
        {
            int voucher = Convert.ToInt32(vouchernumber);
            List <AdjustmentVoucherDetail>     adjustvouchdet    = AdjustmentVoucherEFFacade.getItemsForSupervisorApproval(voucher);
            List <AdjustmentVoucherDetailsWCF> adjustvouchdetnew = new List <AdjustmentVoucherDetailsWCF>();

            foreach (AdjustmentVoucherDetail ad in adjustvouchdet)
            {
                AdjustmentVoucherDetailsWCF adju = new AdjustmentVoucherDetailsWCF();
                adju.VoucherNumber  = ad.VoucherNumber;
                adju.Status         = ad.Status;
                adju.Comment        = ad.Comment;
                adju.Quantity       = Convert.ToInt32(ad.Quantity);
                adju.TotalPrice     = Convert.ToDouble(ad.TotalPrice);
                adju.ApprovalStatus = ad.ApprovalStatus;
                adju.ItemNumber     = ad.ItemNumber;
                adjustvouchdetnew.Add(adju);
            }
            return(adjustvouchdetnew.ToArray <AdjustmentVoucherDetailsWCF>());
        }
        /**added by lee
         * */
        public static void makeNewAdjustmentVoucher(AdjustmentItemWCF[] adjustmentList)
        {
            AdjustmentVoucher adjustmentVoucher = new AdjustmentVoucher();

            adjustmentVoucher.DateCreated = DateTime.Now;
            EntityCollection <AdjustmentVoucherDetail> voucherDetailsCollection = new EntityCollection <AdjustmentVoucherDetail>();

            foreach (AdjustmentItemWCF item in adjustmentList)
            {
                AdjustmentVoucherDetail avd = new AdjustmentVoucherDetail();
                avd.ItemNumber     = item.ItemNumber;
                avd.Status         = item.Status.Equals("reduce") ? AdjustmentVoucherEFFacade.STATUS_DECREASE : AdjustmentVoucherEFFacade.STATUS_INCREASE;
                avd.TotalPrice     = item.TotalPrice;
                avd.Comment        = item.Comment;
                avd.ApprovalStatus = AdjustmentVoucherEFFacade.APPROVAL_STATUS_PENDING;
                avd.Quantity       = item.Quantity;

                voucherDetailsCollection.Add(avd);
            }

            adjustmentVoucher.AdjustmentVoucherDetails = voucherDetailsCollection;

            AdjustmentVoucherEFFacade.addNewAdjustVoucherWithArrayVoucherDetails(adjustmentVoucher);
        }
Exemplo n.º 6
0
 //added by ashwin
 public static void approveitems(List <AdjustmentVoucherDetail> list)
 {
     // List<AdjustmentVoucherDetail> list = AdjustmentVoucherEFFacade.getitemsforapproval(voucher);
     updatestockfromadjustment(list);
     AdjustmentVoucherEFFacade.approvestatusadjustmentvoucher(list);
 }