2 Commits fa30aee4f7 ... 3b4d28e3e9

Author SHA1 Message Date
  Atul 3b4d28e3e9 Merge branch 'master' of http://103.205.66.47:3000/Efacto/Efacto.API_V2 2 years ago
  Atul 3d018a0b77 Stock Journal. 2 years ago

+ 9 - 2
Efacto.Data/Repositories/SARepositoryAsync.cs

@@ -24,11 +24,13 @@ namespace Efacto.Data.Repositories
         private readonly DbSet<SaDetail> _SaDetail;
         private readonly DbSet<Samain> _samain;
         private readonly DbSet<SaDetailTemp> _satemp;
+        private readonly DbSet<Warehouse> _wrh;
         private readonly DbSet<Loghistory> _Loghistory;
         private readonly DbSet<Vouchertype> _vouchertype;
         private readonly IBookTypeRepository _booktypeRepository;
         public SARepositoryAsync(ApplicationDbContext dbContext, IVtypeseqRepository vtypeseqRepository, IEdithistoryRepository edithistoryRepository, 
-            IStockRepository StockRepository, IBarcodeRepository barcodeRepository, IBookTypeRepository booktypeRepository) : base(dbContext)
+            IStockRepository StockRepository, IBarcodeRepository barcodeRepository, IBookTypeRepository booktypeRepository,
+            IWarehouseRepository warehouseRepository) : base(dbContext)
         {
             _dbContext = dbContext;
             _dbContext.ChangeTracker.AutoDetectChangesEnabled = false;
@@ -42,6 +44,7 @@ namespace Efacto.Data.Repositories
             _satemp = dbContext.Set<SaDetailTemp>();
             _Loghistory = dbContext.Set<Loghistory>();
             _vouchertype = dbContext.Set<Vouchertype>();
+            _wrh = dbContext.Set<Warehouse>();
         }
         public async Task<IEnumerable<TrnWithoutParty>> GetAllList(Parameter param)
         {
@@ -50,6 +53,8 @@ namespace Efacto.Data.Repositories
 
             return await (from g in _samain
                           join v in _vouchertype on g.SamVtype equals v.VtpType
+                          join wareHouse in _wrh on g.SamWrhId equals wareHouse.WrhId into wareHousejoin
+                          from wareHouseResult in wareHousejoin.DefaultIfEmpty()
                           where g.SamCmpId == param.CmpId
                           && g.SamBrnId == param.BrnId
                           && g.SamFyrId == param.FyrId
@@ -70,6 +75,8 @@ namespace Efacto.Data.Repositories
                               Billno = g.SamRefNo ?? "",
                               Gsttype = g.SamGstType ?? "",
                               Amt = g.SamNetAmt,
+                              Warehouse = wareHouseResult.WrhName ?? "",
+                              Reason = g.SamReasons ?? "",
                               Stscode = g.SamStsCode,
                               Adduser = g.SamAddUser ?? "",
                               Adddate = g.SamAddDate,
@@ -541,7 +548,7 @@ namespace Efacto.Data.Repositories
                         obj.StkPackUntId = row.SadUntId;
                         obj.StkPack = row.SadPack;
                         obj.StkBatchNo = row.SadBatchNo;
-                        obj.StkOrdType = "I";
+                        obj.StkOrdType = "O";
                         await _StockRepository.Add(obj);
                         //if (!string.IsNullOrEmpty(model.SamDocNo))
                         //{

+ 1 - 0
Efacto.Domain/ViewModels/TrnWithoutParty.cs

@@ -25,5 +25,6 @@ namespace Efacto.Application.ViewModels
         public string Moduser { get; set; }
         public DateTime? Moddate { get; set; }
         public string Warehouse { get; set; }
+        public string Reason { get; set; }
     }
 }