fix some bugs from accounting
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user