From 1d1cdd7829942984f4dcdd16e7e0d1ba9ac9d1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Tue, 2 Dec 2025 16:04:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(invoice):=20=E4=BF=AE=E6=AD=A3=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E9=87=91=E9=A2=9D=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将金额乘以100改为除以100以获得正确的数值 - 确保货币金额在存储前被正确转换为浮点数 - 保留两位小数精度以匹配财务数据标准 --- src/Infrastructure/Repository/InvoiceRepo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Infrastructure/Repository/InvoiceRepo.php b/src/Infrastructure/Repository/InvoiceRepo.php index 41e755e..e66b652 100644 --- a/src/Infrastructure/Repository/InvoiceRepo.php +++ b/src/Infrastructure/Repository/InvoiceRepo.php @@ -47,7 +47,7 @@ final class InvoiceRepo extends AbstractRepo implements InvoiceRepoInterface 'country' => $cmd->country, 'zip' => $cmd->zipCode, 'price' => [ - 'amount' => (float)bcmul($money->getAmount(), '100', 2), + 'amount' => (float)bcdiv($money->getAmount(), '100', 2), 'currency' => [ 'code' => $money->getCurrency()->getCode(), 'symbol' => $cmd->currencySymbol,