新增财务仪表盘并统一金额到角
This commit is contained in:
@@ -46,13 +46,13 @@ export function getListingDisplayPrice(item: Listing) {
|
||||
|
||||
export function getListingRentPrice(item: Listing) {
|
||||
const buyerCoinBasePrice = readPriceBreakdownNumber(item, 'buyer_coin_base_price')
|
||||
if (buyerCoinBasePrice > 0) return Math.round(buyerCoinBasePrice)
|
||||
return Math.max(0, Math.round(getListingDisplayPrice(item) - getListingConsumablePrice(item)))
|
||||
if (buyerCoinBasePrice > 0) return roundMoney(buyerCoinBasePrice)
|
||||
return Math.max(0, roundMoney(getListingDisplayPrice(item) - getListingConsumablePrice(item)))
|
||||
}
|
||||
|
||||
export function getListingConsumablePrice(item: Listing) {
|
||||
const consumablePrice = readPriceBreakdownNumber(item, 'consumable_price')
|
||||
if (consumablePrice > 0) return Math.round(consumablePrice)
|
||||
if (consumablePrice > 0) return roundMoney(consumablePrice)
|
||||
return getListingResources(item).reduce((sum, resource) => sum + resource.amount, 0)
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ export function getListingResources(item: Listing): ListingDisplayResource[] {
|
||||
mode: typeof row.mode === 'string' ? row.mode : '',
|
||||
amount:
|
||||
row.mode === '收费'
|
||||
? Math.round(
|
||||
? roundMoney(
|
||||
readUnknownNumber(row.quantity) *
|
||||
readUnitPrice(typeof row.price === 'string' ? row.price : '')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user