fix some bugs from accounting

This commit is contained in:
2026-07-28 17:44:24 +03:30
parent 91f6b24da4
commit d81cea3d4f
7 changed files with 995 additions and 247 deletions
@@ -593,6 +593,29 @@ class WalletController extends Controller
], 6, false);
}
foreach ($data['wallets'] as $walletRow) {
$product = $walletRow['wallet']['product'] ?? null;
if (!$product) {
continue;
}
$productModel = $product instanceof Product ? $product : Product::find($product['id'] ?? 0);
if (!$productModel) {
continue;
}
try {
app(\App\Services\AccountingWalletPush::class)->pushProductWalletGold(
$data['customer'],
$productModel,
(float) $walletRow['value'],
false,
(int) $data['withdraw']->id,
'برداشت فیزیکی ' . $productModel->title
);
} catch (\Throwable $e) {
report($e);
}
}
return response()->json($data['withdraw']['id']);
}
public function indexWithdraw(Request $request){