라이브 정산, 일자별 콘텐츠 정산, 콘텐츠별 누적 현황, 후원정산, 커뮤니티 정산
- float 대신 bigdecimal로 변경
This commit is contained in:
parent
2c77143fc2
commit
d3483c8062
|
@ -14,15 +14,24 @@ data class GetCalculateCommunityPostQueryData @QueryProjection constructor(
|
|||
val settlementRatio: Int?
|
||||
) {
|
||||
fun toGetCalculateCommunityPostResponse(): GetCalculateCommunityPostResponse {
|
||||
val totalKrw = BigDecimal(totalCan) * BigDecimal(100)
|
||||
val paymentFee = totalKrw * BigDecimal(0.066)
|
||||
// 원화 = totalCoin * 100 ( 캔 1개 = 100원 )
|
||||
val totalKrw = BigDecimal(totalCan).multiply(BigDecimal(100))
|
||||
|
||||
// 결제수수료 : 6.6%
|
||||
val paymentFee = totalKrw.multiply(BigDecimal(0.066))
|
||||
|
||||
// 정산금액 = (원화 - 결제수수료) 의 70%
|
||||
val settlementAmount = if (settlementRatio != null) {
|
||||
(totalKrw - paymentFee) * (BigDecimal(settlementRatio) / BigDecimal(100.0))
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(settlementRatio).divide(BigDecimal(100.0)))
|
||||
} else {
|
||||
(totalKrw - paymentFee) * BigDecimal(0.7)
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(0.7))
|
||||
}
|
||||
val tax = settlementAmount * BigDecimal(0.033)
|
||||
val depositAmount = settlementAmount - tax
|
||||
|
||||
// 원천세 = 정산금액의 3.3%
|
||||
val tax = settlementAmount.multiply(BigDecimal(0.033))
|
||||
|
||||
// 입금액
|
||||
val depositAmount = settlementAmount.subtract(tax)
|
||||
|
||||
return GetCalculateCommunityPostResponse(
|
||||
nickname = nickname,
|
||||
|
|
|
@ -22,25 +22,25 @@ data class GetCalculateContentDonationQueryData @QueryProjection constructor(
|
|||
) {
|
||||
fun toGetCalculateContentDonationResponse(): GetCalculateContentDonationResponse {
|
||||
// 원화 = totalCoin * 100 ( 캔 1개 = 100원 )
|
||||
val totalKrw = BigDecimal(totalCan) * BigDecimal(100)
|
||||
val totalKrw = BigDecimal(totalCan).multiply(BigDecimal(100))
|
||||
|
||||
// 결제수수료 : 6.6%
|
||||
val paymentFee = totalKrw * BigDecimal(0.066)
|
||||
val paymentFee = totalKrw.multiply(BigDecimal(0.066))
|
||||
|
||||
// 정산금액
|
||||
// 유료콘텐츠 (원화 - 결제수수료) 의 90%
|
||||
// 무료콘텐츠 (원화 - 결제수수료) 의 70%
|
||||
val settlementAmount = if (price > 0) {
|
||||
(totalKrw - paymentFee) * BigDecimal(0.9)
|
||||
(totalKrw - paymentFee).multiply(BigDecimal(0.9))
|
||||
} else {
|
||||
(totalKrw - paymentFee) * BigDecimal(0.7)
|
||||
(totalKrw - paymentFee).multiply(BigDecimal(0.7))
|
||||
}
|
||||
|
||||
// 원천세 = 정산금액의 3.3%
|
||||
val tax = settlementAmount * BigDecimal(0.033)
|
||||
val tax = settlementAmount.multiply(BigDecimal(0.033))
|
||||
|
||||
// 입금액
|
||||
val depositAmount = settlementAmount - tax
|
||||
val depositAmount = settlementAmount.subtract(tax)
|
||||
|
||||
val paidOrFree = if (price > 0) {
|
||||
"유료"
|
||||
|
|
|
@ -32,15 +32,23 @@ data class GetCalculateContentQueryData @QueryProjection constructor(
|
|||
"소장"
|
||||
}
|
||||
|
||||
val totalKrw = BigDecimal(totalCan) * BigDecimal(100)
|
||||
val paymentFee = totalKrw * BigDecimal(0.066)
|
||||
// 원화 = totalCoin * 100 ( 캔 1개 = 100원 )
|
||||
val totalKrw = BigDecimal(totalCan).multiply(BigDecimal(100))
|
||||
|
||||
// 결제수수료 : 6.6%
|
||||
val paymentFee = totalKrw.multiply(BigDecimal(0.066))
|
||||
|
||||
// 정산금액 = (원화 - 결제수수료) 의 70%
|
||||
val settlementAmount = if (settlementRatio != null) {
|
||||
(totalKrw - paymentFee) * (BigDecimal(settlementRatio) / BigDecimal(100.0))
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(settlementRatio).divide(BigDecimal(100.0)))
|
||||
} else {
|
||||
(totalKrw - paymentFee) * BigDecimal(0.7)
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(0.7))
|
||||
}
|
||||
val tax = settlementAmount * BigDecimal(0.033)
|
||||
val depositAmount = settlementAmount - tax
|
||||
|
||||
// 원천세 = 정산금액의 3.3%
|
||||
val tax = settlementAmount.multiply(BigDecimal(0.033))
|
||||
|
||||
val depositAmount = settlementAmount.subtract(tax)
|
||||
|
||||
return GetCalculateContentResponse(
|
||||
nickname = nickname,
|
||||
|
|
|
@ -43,23 +43,23 @@ data class GetCalculateLiveQueryData @QueryProjection constructor(
|
|||
}
|
||||
|
||||
// 원화 = totalCoin * 100 ( 캔 1개 = 100원 )
|
||||
val totalKrw = BigDecimal(totalAmount) * BigDecimal(100)
|
||||
val totalKrw = BigDecimal(totalAmount).multiply(BigDecimal(100))
|
||||
|
||||
// 결제수수료 : 6.6%
|
||||
val paymentFee = totalKrw * BigDecimal(0.066)
|
||||
val paymentFee = totalKrw.multiply(BigDecimal(0.066))
|
||||
|
||||
// 정산금액 = (원화 - 결제수수료) 의 70%
|
||||
val settlementAmount = if (settlementRatio != null) {
|
||||
(totalKrw - paymentFee) * (BigDecimal(settlementRatio) / BigDecimal(100.0))
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(settlementRatio).divide(BigDecimal(100.0)))
|
||||
} else {
|
||||
(totalKrw - paymentFee) * BigDecimal(0.7)
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(0.7))
|
||||
}
|
||||
|
||||
// 원천세 = 정산금액의 3.3%
|
||||
val tax = settlementAmount * BigDecimal(0.033)
|
||||
val tax = settlementAmount.multiply(BigDecimal(0.033))
|
||||
|
||||
// 입금액
|
||||
val depositAmount = settlementAmount - tax
|
||||
val depositAmount = settlementAmount.subtract(tax)
|
||||
|
||||
return GetCalculateLiveResponse(
|
||||
email = email,
|
||||
|
|
|
@ -32,24 +32,23 @@ data class GetCumulativeSalesByContentQueryData @QueryProjection constructor(
|
|||
}
|
||||
|
||||
// 원화 = totalCoin * 100 ( 캔 1개 = 100원 )
|
||||
val totalKrw = BigDecimal(totalCan) * BigDecimal(100)
|
||||
val totalKrw = BigDecimal(totalCan).multiply(BigDecimal(100))
|
||||
|
||||
// 결제수수료 : 6.6%
|
||||
val paymentFee = totalKrw * BigDecimal(0.066)
|
||||
val paymentFee = totalKrw.multiply(BigDecimal(0.066))
|
||||
|
||||
// 정산금액 = (원화 - 결제수수료) 의 70%
|
||||
// 정산금액 = (원화 - 결제수수료) 의 70%
|
||||
val settlementAmount = if (settlementRatio != null) {
|
||||
(totalKrw - paymentFee) * (BigDecimal(settlementRatio) / BigDecimal(100.0))
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(settlementRatio).divide(BigDecimal(100.0)))
|
||||
} else {
|
||||
(totalKrw - paymentFee) * BigDecimal(0.7)
|
||||
totalKrw.subtract(paymentFee).multiply(BigDecimal(0.7))
|
||||
}
|
||||
|
||||
// 원천세 = 정산금액의 3.3%
|
||||
val tax = settlementAmount * BigDecimal(0.033)
|
||||
val tax = settlementAmount.multiply(BigDecimal(0.033))
|
||||
|
||||
// 입금액
|
||||
val depositAmount = settlementAmount - tax
|
||||
val depositAmount = settlementAmount.subtract(tax)
|
||||
|
||||
return CumulativeSalesByContentItem(
|
||||
nickname = nickname,
|
||||
|
|
Loading…
Reference in New Issue