|
@@ -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))
|
|
|
//{
|