public decimal ThanhTien_ThPh()
        {
            decimal  result  = 0;
            var      idEpKim = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key;
            var      epKim   = EpKim.DocTheoId(idEpKim);
            var      khuonEp = KhuonEpKim.DocTheoId(View.IdKhuonChon);
            NhuEpKim nhuEp   = null;

            nhuEp = NhuEpKim.DocTheoId(View.IdNhuEpKimChon);
            if (nhuEp == null)//không thể không có nhũ
            {
                return(0);
            }
            var mucLoiNhuan = TinhToanThanhPham.MucLoiNhuan(epKim.DaySoLuong, epKim.DayLoiNhuan, View.SoLuong);
            var giaEpKim    = new GiaEpKim(View.SoLuong, View.KhoEpRong, View.KhoEpCao,
                                           epKim, khuonEp, nhuEp, mucLoiNhuan);

            decimal tyLeMK = (decimal)this.TyLeMarkUp(View.IdHangKhachHang) / 100;



            result = giaEpKim.ThanhTienCoBan() +
                     giaEpKim.ThanhTienCoBan() * tyLeMK / (1 - tyLeMK);

            return(result);
        }
Exemple #2
0
        public decimal ThanhTien_ThPh()
        {
            decimal kq = 0;

            var epKim = EpKim.DocTheoId(View.IdThanhPhamChon);

            if (View.IdNhuEpKimChon <= 0)
            {
                return(0);//Không thể không có nhũ
            }
            var nhuEp = NhuEpKim.DocTheoId(View.IdNhuEpKimChon);
            //Lưu ý số lượng tính giá
            var giaEpKim = new GiaEpKim(View.SoLuongTinhGia, View.KhoEpRong, View.KhoEpCao,
                                        epKim, nhuEp, this.TyLeMarkUp());

            kq = giaEpKim.ThanhTienSales();

            return(kq);
        }
        public decimal ThanhTien_ThPh()
        {
            decimal result      = 0;
            var     idEpKim     = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key;
            var     epKim       = EpKim.DocTheoId(idEpKim);
            var     khuonEp     = KhuonEpKim.DocTheoId(View.IdKhuonChon);
            var     nhuEp       = NhuEpKim.DocTheoId(View.IdNhuEpKimChon);
            var     mucLoiNhuan = TinhToanThanhPham.MucLoiNhuan(epKim.DaySoLuong, epKim.DaySoLuong, View.SoLuong);
            var     giaEpKim    = new GiaEpKim(View.SoLuong, View.KhoEpRong, View.KhoEpCao,
                                               epKim, nhuEp, mucLoiNhuan);

            var     idCanPhu = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key;
            var     epKim    = EpKim.DocTheoId(idCanPhu);
            decimal tyLeMK   = (decimal)this.TyLeMarkUp(View.IdHangKhachHang) / 100;

            result = epKim.ThanhTienCoBan(View.SoLuong) +
                     epKim.ThanhTienCoBan(View.SoLuong) * tyLeMK / (1 - tyLeMK);

            return(result);
        }