거래처 테이블 추가 중
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.ns.mobile.website.biz.dto;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import com.ns.mobile.website.biz.entity.BusinessPartner;
|
||||
import com.ns.mobile.website.biz.entity.Phone;
|
||||
import com.ns.mobile.website.biz.entity.SellInfo;
|
||||
|
||||
@@ -34,7 +36,6 @@ public class SellInfoDto extends BaseDto{
|
||||
String serialNumber;
|
||||
String insertType;
|
||||
String formula;
|
||||
String payBackYn;
|
||||
String payBackBank;
|
||||
String payBackNumber;
|
||||
|
||||
@@ -47,15 +48,66 @@ public class SellInfoDto extends BaseDto{
|
||||
long payBack;
|
||||
long factoryPrice;
|
||||
long disclosureSubsidy;
|
||||
long addRebate;
|
||||
long cashRebate;
|
||||
|
||||
boolean payBackYn;
|
||||
boolean disclosureSubsidyYn;
|
||||
|
||||
List<BusinessPartner> businessPartnerList;
|
||||
List<Phone> phoneList;
|
||||
|
||||
public static SellInfoDto of(SellInfo sellInfo) {
|
||||
|
||||
SellInfoDto sellInfoDto = SellInfoDto.builder()
|
||||
|
||||
.openingDate(sellInfo.getOpeningDate())
|
||||
.birthday(sellInfo.getBirthday())
|
||||
.pbirthday(sellInfo.getPbirthday())
|
||||
.payBackDay(sellInfo.getPayBackDay())
|
||||
.businessPartner(sellInfo.getBusinessPartner())
|
||||
.mobileCarrier(sellInfo.getMobileCarrier())
|
||||
.name(sellInfo.getName())
|
||||
.phoneNumber(sellInfo.getPhoneNumber())
|
||||
.pname(sellInfo.getPname())
|
||||
.pphoneNumber(sellInfo.getPphoneNumber())
|
||||
.mainRatePlan(sellInfo.getMainRatePlan())
|
||||
.subRatePlan(sellInfo.getSubRatePlan())
|
||||
.serialNumber(sellInfo.getSerialNumber())
|
||||
.insertType(sellInfo.getInsertType())
|
||||
.formula(sellInfo.getFormula())
|
||||
.payBackBank(sellInfo.getPayBackBank())
|
||||
.payBackNumber(sellInfo.getPayBackNumber())
|
||||
.installment(sellInfo.getInstallment())
|
||||
.phoneId(sellInfo.getPhoneId())
|
||||
.usim(sellInfo.getUsim())
|
||||
.faceValueRebate(sellInfo.getFaceValueRebate())
|
||||
.guestMoney(sellInfo.getGuestMoney())
|
||||
.introductionPay(sellInfo.getIntroductionPay())
|
||||
.payBack(sellInfo.getPayBack())
|
||||
.factoryPrice(sellInfo.getFactoryPrice())
|
||||
.disclosureSubsidy(sellInfo.getDisclosureSubsidy())
|
||||
.payBackYn(sellInfo.isPayBackYn())
|
||||
.disclosureSubsidyYn(sellInfo.isDisclosureSubsidyYn())
|
||||
.cashRebate(sellInfo.getCashRebate())
|
||||
.addRebate(sellInfo.getAddRebate())
|
||||
.build();
|
||||
sellInfoDto.base(sellInfo);
|
||||
|
||||
return sellInfoDto;
|
||||
}
|
||||
|
||||
public String getInsertTypeText(){
|
||||
switch(insertType) {
|
||||
case "move":
|
||||
return "MNP";
|
||||
case "change":
|
||||
return "기변";
|
||||
case "new":
|
||||
return "신규";
|
||||
case "other":
|
||||
return "유선";
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class SellInfo extends BaseEntity{
|
||||
private String serialNumber;
|
||||
private String insertType;
|
||||
private String formula;
|
||||
private String payBackYn;
|
||||
private String payBackBank;
|
||||
private String payBackNumber;
|
||||
|
||||
@@ -45,5 +44,9 @@ public class SellInfo extends BaseEntity{
|
||||
private long payBack;
|
||||
private long factoryPrice;
|
||||
private long disclosureSubsidy;
|
||||
private long addRebate;
|
||||
private long cashRebate;
|
||||
|
||||
private boolean payBackYn;
|
||||
private boolean disclosureSubsidyYn;
|
||||
}
|
||||
|
||||
@@ -35,12 +35,14 @@ public class SellAddInfoParameter{
|
||||
private long introductionPay;
|
||||
private long payBack;
|
||||
private String payBackDay;
|
||||
private String payBackYn;
|
||||
private String payBackBank;
|
||||
private String payBackNumber;
|
||||
|
||||
private long factoryPrice;
|
||||
private long disclosureSubsidy;
|
||||
private long addRebate;
|
||||
private long cashRebate;
|
||||
private boolean payBackYn;
|
||||
private boolean disclosureSubsidyYn;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ns.mobile.website.biz.model.sell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ns.mobile.website.biz.dto.SellInfoDto;
|
||||
import com.ns.mobile.website.biz.entity.BusinessPartner;
|
||||
import com.ns.mobile.website.biz.entity.Phone;
|
||||
import com.ns.mobile.website.biz.entity.SubRatePlan;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SellInfoModel{
|
||||
|
||||
List<BusinessPartner> businessPartnerList;
|
||||
List<Phone> phoneList;
|
||||
List<SubRatePlan> subRatePlanList;
|
||||
|
||||
List<SellInfoDto> sellInfoList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.ns.mobile.website.biz.model.sell;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SellInfoParameter{
|
||||
|
||||
private String searchDate;
|
||||
private String[] businessPartner;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ns.mobile.website.biz.repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -7,9 +8,10 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ns.mobile.website.biz.entity.SellInfo;
|
||||
import com.ns.mobile.website.biz.entity.SubRatePlan;
|
||||
|
||||
@Repository
|
||||
public interface SellInfoRepository extends JpaRepository<SellInfo, Long> {
|
||||
Optional<List<SellInfo>> findByBusinessPartnerInAndDelYnAndOpeningDateBetween(String[] businessPartner, boolean delYn, LocalDate start, LocalDate end);
|
||||
Optional<List<SellInfo>> findByDelYnAndOpeningDateBetween(boolean delYn, LocalDate start, LocalDate end);
|
||||
Optional<List<SellInfo>> findByDelYn(boolean delYn);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.ns.mobile.website.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ns.mobile.website.biz.dto.SellInfoDto;
|
||||
import com.ns.mobile.website.biz.model.sell.SellAddInfoModel;
|
||||
import com.ns.mobile.website.biz.model.sell.SellAddInfoParameter;
|
||||
import com.ns.mobile.website.biz.model.sell.SellInfoModel;
|
||||
import com.ns.mobile.website.biz.model.sell.SellInfoParameter;
|
||||
|
||||
public interface SellInfoService {
|
||||
|
||||
public List<SellInfoDto> info();
|
||||
public SellInfoModel info(SellInfoParameter parameter);
|
||||
|
||||
public SellAddInfoModel getSellAddInfo();
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.ns.mobile.website.biz.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ns.mobile.website.biz.dto.MenuDto;
|
||||
import com.ns.mobile.website.biz.dto.SellInfoDto;
|
||||
import com.ns.mobile.website.biz.entity.BusinessPartner;
|
||||
import com.ns.mobile.website.biz.entity.MainRatePlan;
|
||||
@@ -17,6 +18,8 @@ import com.ns.mobile.website.biz.entity.SubRatePlan;
|
||||
import com.ns.mobile.website.biz.exception.BizApiException;
|
||||
import com.ns.mobile.website.biz.model.sell.SellAddInfoModel;
|
||||
import com.ns.mobile.website.biz.model.sell.SellAddInfoParameter;
|
||||
import com.ns.mobile.website.biz.model.sell.SellInfoModel;
|
||||
import com.ns.mobile.website.biz.model.sell.SellInfoParameter;
|
||||
import com.ns.mobile.website.biz.repository.BusinessPartnerRepository;
|
||||
import com.ns.mobile.website.biz.repository.MainRatePlanRepository;
|
||||
import com.ns.mobile.website.biz.repository.MobileCarrierRepository;
|
||||
@@ -42,12 +45,25 @@ public class SellInfoServiceImpl implements SellInfoService{
|
||||
private final SellInfoRepository sellInfoRepository;
|
||||
|
||||
@Override
|
||||
public List<SellInfoDto> info() {
|
||||
List<SellInfo> sellInfoList = sellInfoRepository.findByDelYn(false).orElseThrow(() -> new BizApiException("판매 조회가 실패하였습니다."));
|
||||
List<SellInfoDto> result = new ArrayList<SellInfoDto>();
|
||||
public SellInfoModel info(SellInfoParameter parameter) {
|
||||
SellInfoModel result = new SellInfoModel();
|
||||
LocalDate start = LocalDate.parse(parameter.getSearchDate()+"01", DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
LocalDate end = YearMonth.from(start).atEndOfMonth();
|
||||
List<SellInfo> sellInfoList = sellInfoRepository.findByDelYnAndOpeningDateBetween(false,start,end).orElseThrow(() -> new BizApiException("판매 조회가 실패하였습니다."));
|
||||
if(parameter.getBusinessPartner().length == 0) {
|
||||
sellInfoList = sellInfoRepository.findByDelYnAndOpeningDateBetween(false,start,end).orElseThrow(() -> new BizApiException("판매 조회가 실패하였습니다."));
|
||||
}else {
|
||||
sellInfoList = sellInfoRepository.findByBusinessPartnerInAndDelYnAndOpeningDateBetween(parameter.getBusinessPartner(),false,start,end).orElseThrow(() -> new BizApiException("판매 조회가 실패하였습니다."));
|
||||
}
|
||||
List<SellInfoDto> sellInfoDtoList = new ArrayList<SellInfoDto>();
|
||||
sellInfoList.forEach(e -> {
|
||||
result.add(SellInfoDto.of(e));
|
||||
sellInfoDtoList.add(SellInfoDto.of(e));
|
||||
});
|
||||
result.setSellInfoList(sellInfoDtoList);
|
||||
List<BusinessPartner> businessPartnerList = businessPartnerRepository.findByDelYn(false).orElseThrow(() -> new BizApiException("거래처 조회가 실패하였습니다."));
|
||||
result.setBusinessPartnerList(businessPartnerList);
|
||||
List<Phone> phoneList = phoneRepository.findByDelYn(false).orElseThrow(() -> new BizApiException("핸드폰 조회가 실패하였습니다."));
|
||||
result.setPhoneList(phoneList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -88,7 +104,7 @@ public class SellInfoServiceImpl implements SellInfoService{
|
||||
.serialNumber(parameter.getSerialNumber())
|
||||
.insertType(parameter.getInsertType())
|
||||
.formula(parameter.getFormula())
|
||||
.payBackYn(parameter.getPayBackYn())
|
||||
.payBackYn(parameter.isPayBackYn())
|
||||
.payBackBank(parameter.getPayBackBank())
|
||||
.payBackNumber(parameter.getPayBackNumber())
|
||||
.installment(parameter.getInstallment())
|
||||
@@ -101,6 +117,8 @@ public class SellInfoServiceImpl implements SellInfoService{
|
||||
.factoryPrice(parameter.getFactoryPrice())
|
||||
.disclosureSubsidy(parameter.getDisclosureSubsidy())
|
||||
.disclosureSubsidyYn(parameter.isDisclosureSubsidyYn())
|
||||
.cashRebate(parameter.getCashRebate())
|
||||
.addRebate(parameter.getAddRebate())
|
||||
.build();
|
||||
|
||||
sellInfoRepository.save(sellInfo);
|
||||
|
||||
+4
-5
@@ -1,7 +1,5 @@
|
||||
package com.ns.mobile.website.web.controller.home.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
@@ -10,10 +8,11 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ns.mobile.website.biz.dto.SellInfoDto;
|
||||
import com.ns.mobile.website.biz.model.ResponseResult;
|
||||
import com.ns.mobile.website.biz.model.sell.SellAddInfoModel;
|
||||
import com.ns.mobile.website.biz.model.sell.SellAddInfoParameter;
|
||||
import com.ns.mobile.website.biz.model.sell.SellInfoModel;
|
||||
import com.ns.mobile.website.biz.model.sell.SellInfoParameter;
|
||||
import com.ns.mobile.website.biz.service.SellInfoService;
|
||||
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||
import com.ns.mobile.website.web.controller.BaseController;
|
||||
@@ -30,8 +29,8 @@ public class ApiSellInfoController extends BaseController {
|
||||
|
||||
@PublicAccess
|
||||
@PostMapping("/api/sell/info.api")
|
||||
public ResponseEntity<?> info(HttpServletRequest request, HttpSession session){
|
||||
List<SellInfoDto> result = sellInfoService.info();
|
||||
public ResponseEntity<?> info(@RequestBody SellInfoParameter parameter, HttpServletRequest request, HttpSession session){
|
||||
SellInfoModel result = sellInfoService.info(parameter);
|
||||
return ResponseResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,24 @@ function getParam(sname) {
|
||||
}
|
||||
return sval;
|
||||
}
|
||||
function moneyText(value){
|
||||
return moneyText(value,'N');
|
||||
}
|
||||
function moneyText(value,numYn){
|
||||
if(numYn == 'N')
|
||||
value = Number(value.replaceAll(',', ''));
|
||||
|
||||
if(value < 999){
|
||||
value = value*10000;
|
||||
}
|
||||
|
||||
if(isNaN(value)) { //NaN인지 판별
|
||||
return 0;
|
||||
}else { //NaN이 아닌 경우
|
||||
const formatValue = value.toLocaleString('ko-KR');
|
||||
return formatValue;
|
||||
}
|
||||
}
|
||||
//Toggle Menu 버튼
|
||||
window.addEventListener('DOMContentLoaded', event => {
|
||||
|
||||
|
||||
@@ -35,12 +35,14 @@ let appVue = new Vue({
|
||||
introductionPay: '',
|
||||
payBack: '',
|
||||
payBackDay: '',
|
||||
payBackYn: 'N',
|
||||
payBackYn: false,
|
||||
payBackBank: '',
|
||||
payBackNumber: '',
|
||||
factoryPrice: '',
|
||||
disclosureSubsidy: '',
|
||||
disclosureSubsidyYn: false
|
||||
disclosureSubsidyYn: false,
|
||||
addRebate: '',
|
||||
cashRebate: ''
|
||||
},
|
||||
mounted: function () {
|
||||
this.init();
|
||||
@@ -118,6 +120,10 @@ let appVue = new Vue({
|
||||
alert('액면가를 입력하세요');
|
||||
return false;
|
||||
}
|
||||
if($this.cashRebate== '' || $this.cashRebate== 0){
|
||||
alert('현금수납를 입력하세요');
|
||||
return false;
|
||||
}
|
||||
if($this.factoryPrice== '' ||$this.factoryPrice== 0){
|
||||
alert('출고가를 입력하세요');
|
||||
return false;
|
||||
@@ -139,6 +145,8 @@ let appVue = new Vue({
|
||||
payBack : $this.payBack.replaceAll(',', ''),
|
||||
factoryPrice : $this.factoryPrice.replaceAll(',', ''),
|
||||
disclosureSubsidy : $this.disclosureSubsidy.replaceAll(',', ''),
|
||||
cashRebate: $this.cashRebate.replaceAll(',', ''),
|
||||
addRebate: $this.addRebate.replaceAll(',', ''),
|
||||
|
||||
businessPartner : $this.businessPartner,
|
||||
mobileCarrier : $this.mobileCarrier,
|
||||
@@ -314,21 +322,10 @@ let appVue = new Vue({
|
||||
}
|
||||
}
|
||||
var value = result*10000;
|
||||
$this.faceValueRebate = $this.moneyText(value.toString());
|
||||
$this.faceValueRebate = moneyText(value.toString());
|
||||
},
|
||||
moneyText: function(value){
|
||||
value = Number(value.replaceAll(',', ''));
|
||||
|
||||
if(value < 999){
|
||||
value = value*10000;
|
||||
}
|
||||
|
||||
if(isNaN(value)) { //NaN인지 판별
|
||||
return 0;
|
||||
}else { //NaN이 아닌 경우
|
||||
const formatValue = value.toLocaleString('ko-KR');
|
||||
return formatValue;
|
||||
}
|
||||
callMoneyText: function(value){
|
||||
return moneyText(value);
|
||||
},
|
||||
payBackChange: function(){
|
||||
let $this = this;
|
||||
|
||||
@@ -3,16 +3,25 @@ let appVue = new Vue({
|
||||
el: '#vueApp',
|
||||
data: {
|
||||
info :{
|
||||
businessPartnerList: [],
|
||||
mainRatePlanList: [],
|
||||
mobileCarrierList: [],
|
||||
phoneList: [],
|
||||
subRatePlanList: []
|
||||
}
|
||||
sellInfoList: []
|
||||
},
|
||||
view :{
|
||||
settlementAmountSum: 0,
|
||||
texSum: 0,
|
||||
middleMarginSum: 0,
|
||||
realMarginSum: 0,
|
||||
bondIssuanceAmountSum: 0,
|
||||
realBondIssuanceAmountSum: 0
|
||||
},
|
||||
searchDate:'',
|
||||
businessPartner:[]
|
||||
},
|
||||
mounted: function () {
|
||||
this.init();
|
||||
},
|
||||
updated: function(){
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
init: function () {
|
||||
@@ -21,21 +30,116 @@ let appVue = new Vue({
|
||||
},
|
||||
bindData: function () {
|
||||
let $this = this;
|
||||
$this.view.settlementAmountSum = 0;
|
||||
$this.view.texSum = 0;
|
||||
$this.view.middleMarginSum = 0;
|
||||
$this.view.realMarginSum = 0;
|
||||
$this.view.bondIssuanceAmountSum = 0;
|
||||
$this.view.realBondIssuanceAmountSum = 0;
|
||||
if($this.searchDate == ''){
|
||||
$this.searchDate = new Date().format('yyyyMM');
|
||||
}
|
||||
|
||||
let parameter = '';
|
||||
let parameter = {
|
||||
searchDate : $this.searchDate,
|
||||
businessPartner : $this.businessPartner
|
||||
};
|
||||
nscompany.mobile.api.sell.info(parameter, function (success, message, data) {
|
||||
if (!success) {
|
||||
alert(message);
|
||||
return false;
|
||||
}
|
||||
$this.info.sellInfoList = data.sellInfoList;
|
||||
$this.info.businessPartnerList = data.businessPartnerList;
|
||||
$this.info.mainRatePlanList = data.mainRatePlanList;
|
||||
$this.info.mobileCarrierList = data.mobileCarrierList;
|
||||
$this.info.phoneList = data.phoneList;
|
||||
$this.info.subRatePlanList = data.subRatePlanList;
|
||||
|
||||
$this.sumData();
|
||||
console.log($this.info);
|
||||
});
|
||||
},
|
||||
sumData: function(){
|
||||
let $this = this;
|
||||
$this.info.sellInfoList.forEach(function(x, index) {
|
||||
$this.view.settlementAmountSum += Number($this.getSettlementAmount(x).replaceAll(',',''));
|
||||
$this.view.texSum += Number($this.getTex(x).replaceAll(',',''));
|
||||
$this.view.middleMarginSum += Number($this.getMiddleMargin(x).replaceAll(',',''));
|
||||
$this.view.realMarginSum += Number($this.getRealMargin(x).replaceAll(',',''));
|
||||
$this.view.bondIssuanceAmountSum += Number($this.getBondIssuanceAmount(x).replaceAll(',',''));
|
||||
$this.view.realBondIssuanceAmountSum += Number($this.getRealBondIssuanceAmount(x).replaceAll(',',''));
|
||||
});
|
||||
$this.view.settlementAmountSum = moneyText($this.view.settlementAmountSum,'Y');
|
||||
$this.view.texSum = moneyText($this.view.texSum,'Y');
|
||||
$this.view.middleMarginSum = moneyText($this.view.middleMarginSum,'Y');
|
||||
$this.view.realMarginSum = moneyText($this.view.realMarginSum,'Y');
|
||||
$this.view.bondIssuanceAmountSum = moneyText($this.view.bondIssuanceAmountSum,'Y');
|
||||
$this.view.realBondIssuanceAmountSum = moneyText($this.view.realBondIssuanceAmountSum,'Y');
|
||||
},
|
||||
getSettlementAmount: function(x){
|
||||
//(액면리베이트+고객현금)-(현금수납+유심비+수수료) = 정산금액
|
||||
var fees = 0;
|
||||
if(x.insertType == 'move'){
|
||||
fees = 800;
|
||||
}
|
||||
var settlementAmount = (x.faceValueRebate+x.guestMoney) - (x.cashRebate+x.usim+fees);
|
||||
|
||||
return moneyText(settlementAmount,'Y');
|
||||
},
|
||||
getTex: function(x){
|
||||
//정산금액 * 0.1 = 세금
|
||||
let $this = this;
|
||||
var settlementAmount = Number($this.getSettlementAmount(x).replaceAll(',',''));
|
||||
var tex = settlementAmount*0.1;
|
||||
|
||||
return moneyText(tex,'Y');
|
||||
},
|
||||
getMiddleMargin: function(x){
|
||||
//정산금액 - (페이백+치팅비+소개비+유심비) = 중간마진 //치팅비없음
|
||||
let $this = this;
|
||||
var settlementAmount = Number($this.getSettlementAmount(x).replaceAll(',',''));
|
||||
var middleMargin = (settlementAmount - (x.payBack+x.introductionPay+x.usim));
|
||||
|
||||
return moneyText(middleMargin,'Y');
|
||||
},
|
||||
getRealMargin: function(x){
|
||||
//(중간마진-세금)+세금키핑 = 실마진 //세금키핑없음
|
||||
let $this = this;
|
||||
var middleMargin = Number($this.getMiddleMargin(x).replaceAll(',',''));
|
||||
var tex = Number($this.getTex(x).replaceAll(',',''));
|
||||
var realMargin = (middleMargin-tex);
|
||||
|
||||
return moneyText(realMargin,'Y');
|
||||
},
|
||||
callMoneyText: function(value){
|
||||
return moneyText(value,'Y');
|
||||
},
|
||||
getBondIssuanceAmount: function(x){
|
||||
//(액면리베이트+추가리베이트+유심)-(현금수납+수수료+차감) = 채권발생액 //차감없음
|
||||
let $this = this;
|
||||
var fees = 0;
|
||||
if(x.insertType == 'move'){
|
||||
fees = 800;
|
||||
}
|
||||
var settlementAmount = Number($this.getSettlementAmount(x).replaceAll(',',''));
|
||||
var bondIssuanceAmount = ((settlementAmount + x.addRebate + x.usim)-(x.guestMoney+fees));
|
||||
|
||||
return moneyText(bondIssuanceAmount,'Y');
|
||||
},
|
||||
getRealBondIssuanceAmount: function(x){
|
||||
//채권발생액-유심비 = 실체권발생액
|
||||
let $this = this;
|
||||
var bondIssuanceAmount = Number($this.getBondIssuanceAmount(x).replaceAll(',',''));
|
||||
var realBondIssuanceAmount = (bondIssuanceAmount-x.usim);
|
||||
|
||||
return moneyText(realBondIssuanceAmount,'Y');
|
||||
},
|
||||
searchDateBlur: function (){
|
||||
let $this = this;
|
||||
|
||||
if($this.searchDate.length == 2){
|
||||
$this.searchDate = '2023' + $this.searchDate;
|
||||
}
|
||||
else if($this.searchDate.length == 4){
|
||||
$this.searchDate = '20' + $this.searchDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -43,37 +43,6 @@ function _isMobile() {
|
||||
return isMobile;
|
||||
}
|
||||
|
||||
// Responsive 이미지 변환
|
||||
function ResponsiveImagesNew() {
|
||||
$(".imgResponsive").each(function() {
|
||||
var winW = window.innerWidth;
|
||||
if (winW > 1023 && $(this).attr("data-media-type") != "pc") {
|
||||
var url = $(this).attr("data-src-pc");
|
||||
$(this).attr("data-media-type", "pc");
|
||||
chgImg($(this), url, "pc");
|
||||
}
|
||||
if (winW <= 1023 && $(this).attr("data-media-type") != "mobile") {
|
||||
var url = $(this).attr("data-src-mobile");
|
||||
$(this).attr("data-media-type", "mobile");
|
||||
chgImg($(this), url, "mobile");
|
||||
}
|
||||
});
|
||||
|
||||
function chgImg($target, url, type) {
|
||||
$target.attr("src", url);
|
||||
$target.attr("data-media-type", type);
|
||||
}
|
||||
|
||||
var winW = window.innerWidth;
|
||||
|
||||
if ($('#contents').length) {
|
||||
if ($('#contents').outerHeight(true) + $('#header').outerHeight(true) + $('#footer').outerHeight(true) <= window.innerHeight) {
|
||||
$('#contents').css({
|
||||
minHeight: window.innerHeight - $('#header').outerHeight(true) - $('#footer').outerHeight(true)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// LayerPopup 열기
|
||||
var idxLayPop = 0;
|
||||
@@ -133,177 +102,6 @@ function layerPop(n, target){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 아코디언
|
||||
function accodianUI() {
|
||||
var el = $('.accordianList');
|
||||
|
||||
if (el.length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
el.find('>ul>li').removeClass('on');
|
||||
|
||||
bindEvents();
|
||||
|
||||
function bindEvents() {
|
||||
el.find('>ul>li>dl>dt>a').off('click.accodianEvt').on('click.accodianEvt', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var index = $(this).closest('li').index();
|
||||
|
||||
$(this).closest(el).find('>ul>li').each(function(idx, obj) {
|
||||
if (idx == index) {
|
||||
if ($(obj).hasClass('on')) {
|
||||
$(obj).removeClass('on');
|
||||
} else {
|
||||
$(obj).addClass('on');
|
||||
}
|
||||
} else {
|
||||
$(obj).removeClass('on');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 탭 메뉴
|
||||
function tabUI() {
|
||||
var el = $('.tabsGroup');
|
||||
|
||||
if(el.length <= 0){
|
||||
return;
|
||||
}
|
||||
|
||||
el.each(function(idx, obj){
|
||||
if($(obj).find('.tabs > li').hasClass('on')){
|
||||
$(obj).find('.tabs > li').each(function(){
|
||||
var idx = $(this).filter('.on').index();
|
||||
if(idx >= 0){
|
||||
$(obj).find('.tabs > li').eq(idx).addClass('on').siblings().removeClass('on');
|
||||
$(obj).find('> .tabsCont').hide().eq(idx).show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
else{
|
||||
$(obj).find('.tabs > li').eq(0).addClass('on').siblings().removeClass('on');
|
||||
$(obj).find('> .tabsCont').hide().eq(0).show();
|
||||
}
|
||||
|
||||
bindEvents(obj);
|
||||
});
|
||||
|
||||
|
||||
function bindEvents(obj){
|
||||
var $this = $(obj);
|
||||
|
||||
$this.find('.tabs > li > a').on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var index = $(this).closest('li').index();
|
||||
|
||||
if($this.find('> .tabsCont').eq(index).length <= 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).closest(el).find('.tabs > li').eq(index).addClass('on').siblings().removeClass('on');
|
||||
$(this).closest(el).find('> .tabsCont').hide().eq(index).show();
|
||||
|
||||
$(window).scrollTop(0);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 퀵모임 탭 메뉴
|
||||
function meeTabUI() {
|
||||
var el = $('.meetListArea');
|
||||
|
||||
if(el.length <= 0){
|
||||
return;
|
||||
}
|
||||
|
||||
el.each(function(idx, obj){
|
||||
if($(obj).find('.tabMeet > a').hasClass('on')){
|
||||
$(obj).find('.tabMeet > a').each(function(){
|
||||
var idx = $(this).filter('.on').index();
|
||||
if(idx >= 0){
|
||||
$(obj).find('.tabMeet > a').eq(idx).addClass('on').siblings().removeClass('on');
|
||||
$(obj).find('> .tabMeetCont').hide().eq(idx).show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
else{
|
||||
$(obj).find('.tabMeet > a').eq(0).addClass('on').siblings().removeClass('on');
|
||||
$(obj).find('> .tabMeetCont').hide().eq(0).show();
|
||||
}
|
||||
|
||||
bindEvents(obj);
|
||||
});
|
||||
|
||||
|
||||
function bindEvents(obj){
|
||||
var $this = $(obj);
|
||||
|
||||
$this.find('.tabMeet > a').on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var index = $(this).index();
|
||||
|
||||
if($this.find('> .tabMeetCont').eq(index).length <= 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).closest(el).find('.tabMeet > a').eq(index).addClass('on').siblings().removeClass('on');
|
||||
$(this).closest(el).find('> .tabMeetCont').hide().eq(index).show();
|
||||
|
||||
$(window).scrollTop(0);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
ResponsiveImagesNew();
|
||||
$(window).resize(function() {
|
||||
ResponsiveImagesNew();
|
||||
}).resize();
|
||||
accodianUI();
|
||||
tabUI();
|
||||
meeTabUI();
|
||||
|
||||
/* 요금 안내 클릭시 아래 링크안내로 가는 부분 제거
|
||||
$(document).on('click' , '#gnb a' , function(e){
|
||||
e.preventDefault();
|
||||
if(window.location.pathname=="/home"){
|
||||
$('body, html').stop().animate({
|
||||
scrollTop : $('.section.rateSimulation').offset().top - $('#header').outerHeight(true) - 30
|
||||
});
|
||||
}else{
|
||||
location.href="/home#simulation";
|
||||
}
|
||||
});
|
||||
*/
|
||||
// 조직 선택
|
||||
$(document).on('click' , '.meetOrgList a.itemHead' , function(e){
|
||||
e.preventDefault();
|
||||
|
||||
if($(this).closest('.item').hasClass('open')){
|
||||
$(this).closest('.item').removeClass('open');
|
||||
|
||||
$(this).removeClass('on');
|
||||
}
|
||||
else{
|
||||
$(this).closest('.meetOrgList').find('.item').removeClass('open');
|
||||
$(this).closest('.item').addClass('open');
|
||||
|
||||
$(this).closest('.meetOrgList').find('.itemHead').removeClass('on');
|
||||
$(this).addClass('on');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -123,12 +123,12 @@
|
||||
<div class="row d-flex justify-content-center">
|
||||
<label for="factoryPrice" class="col-sm-2 col-form-label mb-3">출고가</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="factoryPrice" v-model="factoryPrice" value="" @blur="factoryPrice = moneyText(factoryPrice)">
|
||||
<input type="text" class="form-control" id="factoryPrice" v-model="factoryPrice" value="" @blur="factoryPrice = callMoneyText(factoryPrice)">
|
||||
</div>
|
||||
<div class="vr p-0 m-0"></div>
|
||||
<label for="disclosureSubsidy" class="col-sm-2 col-form-label mb-3">공시지원금(안적으면 선약)</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="disclosureSubsidy" v-model="disclosureSubsidy" value="" @blur="disclosureSubsidy = moneyText(disclosureSubsidy)">
|
||||
<input type="text" class="form-control" id="disclosureSubsidy" v-model="disclosureSubsidy" value="" @blur="disclosureSubsidy = callMoneyText(disclosureSubsidy)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -163,27 +163,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row d-flex justify-content-center">
|
||||
<label for="addRebate" class="col-sm-2 col-form-label mb-3">추가R/B</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="addRebate" v-model="addRebate" value="130000" @blur="addRebate = callMoneyText(addRebate)">
|
||||
</div>
|
||||
<div class="vr p-0 m-0"></div>
|
||||
<label for="cashRebate" class="col-sm-2 col-form-label mb-3">현금수납</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="cashRebate" v-model="cashRebate" value="0" @blur="cashRebate = callMoneyText(cashRebate)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row d-flex justify-content-center">
|
||||
<label for="guestMoney" class="col-sm-2 col-form-label mb-3">고객현금</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="guestMoney" v-model="guestMoney" value="130000" @blur="guestMoney = moneyText(guestMoney)">
|
||||
<input type="text" class="form-control" id="guestMoney" v-model="guestMoney" value="130000" @blur="guestMoney = callMoneyText(guestMoney)">
|
||||
</div>
|
||||
<div class="vr p-0 m-0"></div>
|
||||
<label for="usim" class="col-sm-2 col-form-label mb-3">유심비</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="usim" v-model="usim" value="7700" @blur="usim = moneyText(usim)">
|
||||
<input type="text" class="form-control" id="usim" v-model="usim" value="7700" @blur="usim = callMoneyText(usim)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row d-flex justify-content-center">
|
||||
<label for="introductionPay" class="col-sm-2 col-form-label mb-3">소개비</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="introductionPay" v-model="introductionPay" value="10000" @blur="introductionPay = moneyText(introductionPay)">
|
||||
<input type="text" class="form-control" id="introductionPay" v-model="introductionPay" value="10000" @blur="introductionPay = callMoneyText(introductionPay)">
|
||||
</div>
|
||||
<div class="vr p-0 m-0"></div>
|
||||
<label for="payBack" class="col-sm-2 col-form-label mb-3">페이백(P/B)</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<input type="text" class="form-control" id="payBack" v-model="payBack" value="30000" @input="payBackChange" @blur="payBack = moneyText(payBack)">
|
||||
<input type="text" class="form-control" id="payBack" v-model="payBack" value="30000" @input="payBackChange" @blur="payBack = callMoneyText(payBack)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -196,8 +208,8 @@
|
||||
<label for="payBackYn" class="col-sm-2 col-form-label mb-3">지급여부</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<select class="form-select" id="payBackYn" disabled v-model="payBackYn">
|
||||
<option value="N" selected>지급대기</option>
|
||||
<option value="Y">지급완료</option>
|
||||
<option value="false" selected>지급대기</option>
|
||||
<option value="true">지급완료</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,6 +21,112 @@
|
||||
<!-- header : e-->
|
||||
|
||||
<div class="container-fluid" id="vueApp">
|
||||
<div class="row d-flex justify-content">
|
||||
<div class="pt-3">
|
||||
<h3>조회 할 달1</h3>
|
||||
</div>
|
||||
<label for="businessPartner" class="col-sm-1 col-form-label mb-3">년월</label>
|
||||
<div class="col-sm-2 mb-3">
|
||||
<input type="text" class="form-control" id="searchDate" v-model="searchDate" tabindex="1" @blur="searchDateBlur">
|
||||
</div>
|
||||
<div class="col-sm-1 mb-3">
|
||||
<button type="button" class="btn btn-primary btn-round" @click="bindData">검색</button>
|
||||
</div>
|
||||
<label for="businessPartner" class="col-sm-1 col-form-label mb-3 pt-3">거래처</label>
|
||||
<div class="col-sm-3 mb-3">
|
||||
<select class="selectpicker show-tick" multiple data-width="100%" title='' data-live-search="true" id="businessPartner" v-model="businessPartner" tabindex="2" >
|
||||
<option v-for="(x, index) in info.businessPartnerList" :index="x.id" :value="x.id">{{x.partnerName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table" id="amountTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">개통일</th>
|
||||
<th scope="col">이름</th>
|
||||
<th scope="col">생년월일</th>
|
||||
<th scope="col">핸드폰번호</th>
|
||||
<th scope="col">거래처</th>
|
||||
<th scope="col">모델명</th>
|
||||
<th scope="col">일련번호</th>
|
||||
<th scope="col">가입구분</th>
|
||||
<th scope="col">부가가입여부</th>
|
||||
<th scope="col">리베이트</th>
|
||||
<th scope="col">부가차감금액</th>
|
||||
<th scope="col">현금수납금액</th>
|
||||
<th scope="col">채권발생액</th>
|
||||
<th scope="col">실마진</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(x, index) in info.sellInfoList" :index="x.id">
|
||||
<th scope="row">{{x.id}}</th>
|
||||
<td>{{x.openingDate}}</td>
|
||||
<td>{{x.name}}</td>
|
||||
<td>{{x.birthday}}</td>
|
||||
<td>{{x.phoneNumber}}</td>
|
||||
<td>{{info.businessPartnerList[x.businessPartner-1].partnerName}}</td>
|
||||
<td>{{info.phoneList[x.phoneId-1].petName}}</td>
|
||||
<td>{{x.serialNumber}}</td>
|
||||
<td>{{x.insertTypeText}}</td>
|
||||
<td>{{x.subRatePlan}}</td>
|
||||
<td>{{callMoneyText(x.faceValueRebate)}}</td>
|
||||
<td></td>
|
||||
<td>{{callMoneyText(x.cashRebate)}}</td>
|
||||
<td>{{getBondIssuanceAmount(x)}}</td>
|
||||
<td>{{getRealMargin(x)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">합계</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{{view.bondIssuanceAmountSum}}</td>
|
||||
<td>{{view.realMarginSum}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table" id="businessPartnerTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">거래처</th>
|
||||
<th scope="col">건수</th>
|
||||
<th scope="col">정산금액</th>
|
||||
<th scope="col">VAT</th>
|
||||
<th scope="col">실마진</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(x, index) in info.businessPartnerList" :index="x.id">
|
||||
<th scope="row">{{x.id}}</th>
|
||||
<td>{{x.partnerName}}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">합계</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{{view.bondIssuanceAmountSum}}</td>
|
||||
<td>{{view.realMarginSum}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user