#P1603
POST /v2/manual-document/view
Route Info
| Method | Endpoint | Controller |
| POST | /v2/manual-document/view | AccountingController@viewManualDocument |
شرح عملکرد (Functionality)
این مسیر جهت نمایش جزئیات یک سند دستی (Manual Document) استفاده میشود. عملکرد متد:
- دریافت شناسه سند از ورودی.
- فراخوانی تابع کمکی
AccountingController::getManualDocumentDetails(). - بازگردانی:
- اطلاعات کامل ردیفهای سند (moeen, preference, description, debit, credit)
- گزارش تراز مالی سند تحت کلید
balance
- درصورت وقوع Exception، خروجی خطا با کد 5005 باز میگردد.
پارامترهای ورودی (Request Inputs)
Body (JSON یا Form):
{
"id": 1524
}
- id: شناسه رکورد در جدول
manual_documents(الزامی)
خروجی موفق (Success Response)
پاسخ شامل دو بخش است: data و balance
{
"status": true,
"time": 1718450000,
"data": [
{
"moeen": {
"id": 1102,
"title": "بانک ملت"
},
"preference": {
"id": "colleague-5421",
"title": "علی رضایی"
},
"preference_2": false,
"preference_3": false,
"preference_4": false,
"description": "سند دستی 3125 | پرداخت نقدی",
"credit": 0,
"debit": 2500000
}
],
"balance": {
"debit_financial_past": 0,
"credit_financial_past": 0,
"debit_start_period": 0,
"credit_start_period": 0,
"debit_during_period": 2500000,
"credit_during_period": 0,
"debit_finish_period": 2500000,
"credit_finish_period": 0,
"debit_balance": 2500000,
"credit_balance": 0
}
}
خروجی خطا (Error Response)
در صورت وقوع Exception:
{
"status": false,
"time": 1718450000,
"code": 5005,
"message": "SQL error message...",
"trace": [ ... ]
}
نکات داخلی (Internal Logic Notes)
getManualDocumentDetails()بسته به نوع سند:- daily_sales
- daily_credit_debit
- manual
- opening / closing
- گزارش تراز سند در Redis ذخیره میشود:
documents:balance_report:{id}