sync
This commit is contained in:
@@ -71,11 +71,13 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
|
||||
// Calculate price
|
||||
// ppu is stored as integer where 1000 = $1.00, so divide by 1000 to get actual price
|
||||
const pricePerUnit = drop.ppu / 1000
|
||||
let priceAmount = 0
|
||||
if (drop.unit === 'kg') {
|
||||
priceAmount = (size / 1000) * drop.ppu
|
||||
priceAmount = (size / 1000) * pricePerUnit
|
||||
} else {
|
||||
priceAmount = size * drop.ppu
|
||||
priceAmount = size * pricePerUnit
|
||||
}
|
||||
|
||||
// Round to 2 decimal places
|
||||
|
||||
Reference in New Issue
Block a user