added some feature for accounting and price
This commit is contained in:
@@ -44,7 +44,7 @@ class SingleOrderController extends Controller
|
||||
}
|
||||
$config = app(ConfigService::class);
|
||||
|
||||
$config->assertTradingOpen();
|
||||
// فیلتر ساعت معامله per-product (سراسری یا override محصول) پایینتر در assertProductTradingOpen اعمال میشود.
|
||||
|
||||
// throw new UnprocessableEntityHttpException('به دلیل نوسانات سفارشات بسته میباشد.');
|
||||
$transactionType = $data['direction'] == 1 ? "خرید" : "فروش";
|
||||
@@ -192,6 +192,15 @@ class SingleOrderController extends Controller
|
||||
$response['sell'] = $this->processSellTransaction($data, $wallet, $wallet_interface);
|
||||
}
|
||||
}
|
||||
// دفترکل داخلی همیشه ثبت شود — مستقل از اتصال به حسابداری بیرونی
|
||||
if (isset($data['order'])) {
|
||||
try {
|
||||
app(\App\Services\AccountingLedgerService::class)->recordTrade($data['order']);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
if ($config->getString('send_to_tahesab', 'false') === 'true') {
|
||||
try {
|
||||
$data['tahesab'] = app(TahesabController::class)->storeTrade($data);
|
||||
|
||||
Reference in New Issue
Block a user