public List <GetDetailPSASListOfKuasaDireksiListDto> GetDropdownPSASListOfKuasaDireksi(string bookCode, int docID) { GetPSASParamsDto inputUnitID = new GetPSASParamsDto(); inputUnitID.bookCode = bookCode; var getUnitID = _ipriceAppService.GetParameter(inputUnitID); var getProjectID = (from A in _msUnitRepo.GetAll() where A.entityID == 1 && A.Id == getUnitID.unitID select A.projectID).FirstOrDefault(); var getKuasaDireksi = (from A in _msKuasaDireksiRepo.GetAll() join B in _msKuasaDireksiPeopleRepo.GetAll() on A.Id equals B.kuasaDireksiID where A.entityID == 1 && A.docID == docID && A.projectID == getProjectID && A.isActive select new GetDetailPSASListOfKuasaDireksiListDto { namePosition = B.signeeName + "-" + B.signeePosition, docID = A.docID, kuasaDireksiPeopleID = B.Id, kuasaDireksiID = A.Id, entityID = A.entityID, isActive = A.isActive, projectID = A.projectID, remarks = A.remarks, linkSignature = B.signeeSignImage }).ToList(); return(getKuasaDireksi); }
public GetPSASTermDto GetTermByBookCode(GetPSASParamsDto input) { var unitID = _iPriceAppService.GetParameter(input); var getData = (from bh in _trBookingHeaderRepo.GetAll() join b in _msBankRepo.GetAll() on bh.KPRBankCode equals b.bankCode into l1 from b in l1.DefaultIfEmpty() join t in _msTermRepo.GetAll() on bh.termID equals t.Id into l2 from t in l2.DefaultIfEmpty() join pt in _msTermPmtRepo.GetAll() on t.Id equals pt.termID into l3 from pt in l3.DefaultIfEmpty() join ft in _lkFinTypeRepo.GetAll() on pt.finTypeID equals ft.Id into l4 from ft in l4.DefaultIfEmpty() where bh.unitID == unitID.unitID && bh.cancelDate == null select new GetPSASTermDto { termCode = t == null ? null : t.termCode, termNo = t == null ? Convert.ToInt16(0) : t.termNo, remarksTerm = t == null ? null : t.remarks, PPJBDue = bh.PPJBDue, bankName = b == null ? null : b.bankName, DPCalcType = bh.DPCalcType, finType = ft == null ? null : ft.finTypeDesc, finStatrtDue = pt == null ? Convert.ToInt16(0) : pt.finStartDue, unitID = unitID.unitID, termID = t == null ? 0 : t.Id }).FirstOrDefault(); return(getData); }
public GetRenovListDto GetDataChangeRenov(GetPSASParamsDto input) { var bookingHeaderId = _iPriceAppService.GetParameter(input).bookingHeaderID; var getDataUnit = (from bh in _trBookingHeaderRepo.GetAll() join bd in _trBookingDetailRepo.GetAll() on bh.Id equals bd.bookingHeaderID join i in _lkItemRepo.GetAll() on bd.itemID equals i.Id join u in _msUnitRepo.GetAll() on bh.unitID equals u.Id join uc in _msUnitCodeRepo.GetAll() on u.unitCodeID equals uc.Id where bh.Id == bookingHeaderId && !i.itemName.Contains("Tanah") && !i.itemName.Contains("Bangunan") select new GetRenovListDto { bookingHeaderId = bh.Id, bookCode = bh.bookCode, unitNo = u.unitNo, unitCode = uc.unitCode, itemID = bd.itemID, renovCode = i.itemCode, termID = bh.termID }).FirstOrDefault(); return(getDataUnit); }
public List <GetPSASPaymentDto> GetOtherPaymentByBookCode(GetPSASParamsDto input) { var bhID = _iPriceAppService.GetParameter(input); var getData = (from pda in _trPaymentDetailAllocRepo.GetAll() join pd in _trPaymentDetailRepo.GetAll() on new { S1 = pda.paymentDetailID, S2 = "C" } equals new { S1 = pd.Id, S2 = pd.status }// into l1 //from pd in l1.DefaultIfEmpty() join ph in _trPaymentHeaderRepo.GetAll() on new { S1 = pd.paymentHeaderID, S2 = bhID.bookingHeaderID } equals new { S1 = ph.Id, S2 = ph.bookingHeaderID } into l2 from ph in l2.DefaultIfEmpty() join pf in _lkPayForRepo.GetAll() on ph.payForID equals pf.Id join b in _msBankRepo.GetAll() on pd.bankName equals b.bankCode into l3 from b in l3.DefaultIfEmpty() join bb in _msBankBranchRepo.GetAll() on b.Id equals bb.bankID into l4 from bb in l4.DefaultIfEmpty() join a in _msAccountRepo.GetAll() on ph.accountID equals a.Id into l5 from a in l5.DefaultIfEmpty() join pt in _lkPayTypeRepo.GetAll() on pd.payTypeID equals pt.Id into l6 from pt in l6.DefaultIfEmpty() where pf.payForCode == "OTP" select new { paymentDate = ph.paymentDate == null ? default(DateTime) : ph.paymentDate, clearDate = ph.clearDate == null ? null : ph.clearDate, accCode = a.accCode == null ? null : a.accCode, transNo = ph.transNo == null ? null : ph.transNo, payForCode = pf.payForCode == null ? null : pf.payForCode, othersTypeCode = pd.othersTypeCode == null ? null : pd.othersTypeCode, payTypeCode = pt.payTypeCode == null ? null : pt.payTypeCode, bankName = pd.bankName == null ? null : pd.bankName, bankBranchName = bb.bankBranchName == null ? null : bb.bankBranchName, pda.netAmt, pda.vatAmt } into pda group pda by new { pda.paymentDate, pda.clearDate, pda.accCode, pda.transNo, pda.payForCode, pda.othersTypeCode, pda.payTypeCode, pda.bankName, pda.bankBranchName } into G select new { bankName = G.Key.bankName == null ? String.Empty : G.Key.bankName, bankBranchName = G.Key.bankBranchName == null ? String.Empty : G.Key.bankBranchName, accCode = G.Key.accCode == null ? null : G.Key.accCode, transNo = G.Key.transNo == null ? null : G.Key.transNo, paymentDate = G.Key.paymentDate == null ? default(DateTime) : G.Key.paymentDate, clearDate = G.Key.clearDate == null ? null : G.Key.clearDate, payForCode = G.Key.payForCode == null ? null : G.Key.payForCode, payTypeCode = G.Key.payTypeCode == null ? null : G.Key.payTypeCode, othersTypeCode = G.Key.othersTypeCode == null ? null : G.Key.othersTypeCode, netAmount = G.Sum(X => X.netAmt), vatAmount = G.Sum(x => x.vatAmt) }).ToList(); List <GetPSASPaymentDto> listResult = new List <GetPSASPaymentDto>(); foreach (var item in getData) { TypeDto type = new TypeDto { payFor = item.payForCode, payType = item.payTypeCode, otherType = item.othersTypeCode }; GetPSASPaymentDto result = new GetPSASPaymentDto { bankName = item.bankName, bankBranch = item.bankBranchName, account = item.accCode, transNo = item.transNo, PMTDate = item.paymentDate, clearDate = item.clearDate, type = type, netAmount = item.netAmount, vatAmt = item.vatAmount }; listResult.Add(result); } return(listResult); }
public GetUniversalMainListDto GetPSASMain(GetPSASParamsDto input) { var UnitID = _ipriceAppService.GetParameter(input); var getAllHeaderMain = (from x in _trBookingDetailRepo.GetAll() join y in _lkItemRepo.GetAll() on x.itemID equals y.Id where x.bookingHeaderID == UnitID.bookingHeaderID select new GetPSASMainHeaderListDto { itemName = y.itemName, coCode = x.coCode, area = x.area, netPriceMKT = x.netPriceMKT, netPriceComm = x.netPriceComm, netNetPrice = x.netNetPrice } ).ToList(); //var getAllPersonals = _personalsRepo.GetAllList(); //var getAllPersonalsMember = _personalMemberRepo.GetAllList(); //var getAllAddress = _trAddressRepo.GetAllList(); //var getAllPhone = _trPhoneRepo.GetAllList(); //var getAllSchema = _msSchemaRepo.GetAllList(); var getDataPersonal = (from x in _contextPers.PERSONAL join a in _trBookingHeaderRepo.GetAll().ToList() on x.psCode equals a.psCode join b in _contextPers.TR_Address on a.psCode equals b.psCode into address from b in address.DefaultIfEmpty() join c in _contextPers.TR_Phone on a.psCode equals c.psCode into phone from c in phone.DefaultIfEmpty() where a.Id == UnitID.bookingHeaderID select new { dataPsCode = a.psCode, npwp = x.NPWP, nama = x.name, address = (b == null ? "-" : b.address), phone = (c == null ? "-" : c.number) }).ToList(); var getMainData = (from a in _contextProp.TR_BookingHeader join b in _contextProp.MS_Unit on a.unitID equals b.Id into unit from b in unit.DefaultIfEmpty() join d in _contextProp.MS_Area on b.areaID equals d.Id into area from d in area.DefaultIfEmpty() join e in _contextProp.MS_Project on b.projectID equals e.Id into project from e in project.DefaultIfEmpty() join f in _contextProp.MS_Product on b.productID equals f.Id into product from f in product.DefaultIfEmpty() join j in _contextProp.MS_Term on a.termID equals j.Id into term from j in term.DefaultIfEmpty() join l in getDataPersonal on a.psCode equals l.dataPsCode join m in _contextProp.LK_PayType on a.BFPayTypeCode equals m.payTypeCode into payType from m in payType.DefaultIfEmpty() join n in _contextProp.MS_Transfrom on a.transID equals n.Id into transform from n in transform.DefaultIfEmpty() join o in _contextNew.MS_Schema.ToList() on a.scmCode equals o.scmCode into schema from o in schema.DefaultIfEmpty() join q in _contextProp.MS_SalesEvent on a.eventID equals q.Id into salesEvent from q in salesEvent.DefaultIfEmpty() join r in _contextProp.LK_SADStatus on a.SADStatusID equals r.Id into SADStatus from r in SADStatus.DefaultIfEmpty() join t in _contextProp.TR_BookingDetail on a.Id equals t.bookingHeaderID join v in _contextProp.TR_BookingCancel on a.Id equals v.bookingHeaderID into bookingCancel from v in bookingCancel.DefaultIfEmpty() join z in _contextProp.LK_Reason on v.reasonID equals z.Id into lkReason from z in lkReason.DefaultIfEmpty() where a.Id == UnitID.bookingHeaderID group t by new { e.projectName, f.productName, d.regionName, j.termCode, j.termNo, termRemarks = j.remarks, a.memberName, l.address, l.npwp, l.phone, a.psCode, q.eventName, n.transCode, n.transName, m.payTypeDesc, a.bankName, a.bankNo, o.scmName, o.scmCode, r.statusDesc, a.memberCode, l.nama, a.bookDate, a.cancelDate, a.remarks, z.reasonDesc, reasonRemarks = v.remarks } into G select new GetPSASMainListDto { projectName = (G.Key.projectName == null ? "-" : G.Key.projectName), productName = (G.Key.productName == null ? "-" : G.Key.productName), territory = (G.Key.regionName == null ? "-" : G.Key.regionName), termCode = (G.Key.termCode == null ? "-" : G.Key.termCode), termNo = (G.Key.termCode == null ? "-" : G.Key.termNo + " - " + G.Key.termRemarks), name = (G.Key.nama == null ? "-" : G.Key.nama), address = (G.Key.address == null ? "-" : G.Key.address), NPWP = (G.Key.npwp == null ? "-" : G.Key.npwp), phone = (G.Key.phone == null ? "-" : G.Key.phone), psCode = (G.Key.psCode == null ? "" : G.Key.psCode), salesEvent = (G.Key.eventName == null ? "-" : G.Key.eventName), transactionCome = (G.Key.transCode == null ? "-" : G.Key.transCode + " | " + G.Key.transName), payType = (G.Key.payTypeDesc == null ? "-" : G.Key.payTypeDesc), bankName = (G.Key.bankName == null ? "" : G.Key.bankName), amount = G.Sum(d => d.BFAmount), noRekening = (G.Key.bankNo == null ? "" : G.Key.bankNo), schema = (G.Key.scmCode == null ? null : G.Key.scmCode) + " - " + (G.Key.scmName == null ? null : G.Key.scmName), memberID = (G.Key.memberCode == null ? "" : G.Key.memberCode), memberName = (G.Key.memberName == null ? "" : G.Key.memberName), bookDate = G.Key.bookDate, bookedStatus = (G.Key.cancelDate == null ? "-" : "Cancel"), cancelDate = G.Key.cancelDate, remarks = (G.Key.remarks == null ? "-" : G.Key.remarks), status = (G.Key.statusDesc == null ? "-" : G.Key.statusDesc), reason = (G.Key.reasonDesc == null ? "-" : G.Key.reasonDesc), reasonRemarks = (G.Key.reasonRemarks == null ? "-" : G.Key.reasonRemarks) } ).FirstOrDefault(); var getDataUnit = (from bh in _trBookingHeaderRepo.GetAll() join u in _msUnitRepo.GetAll() on bh.unitID equals u.Id join uc in _msUnitCodeRepo.GetAll() on u.unitCodeID equals uc.Id where u.Id == UnitID.unitID select new { bh.bookCode, u.unitNo, uc.unitCode }).FirstOrDefault(); var getAllData = new GetUniversalMainListDto { GetAllPSASMainHeaderDto = getAllHeaderMain, GetPSASMainDto = getMainData, unitCode = getDataUnit.unitCode, unitNo = getDataUnit.unitNo, bookCode = getDataUnit.bookCode }; return(getAllData); }