progress in bank card
This commit is contained in:
parent
ee5d644358
commit
189bf9fbdd
|
@ -64,7 +64,16 @@ class BankController extends AbstractController
|
|||
}
|
||||
$data->setBalance($bd - $bs);
|
||||
}
|
||||
return $this->json($provider->ArrayEntity2Array($datas, 0));
|
||||
$result = [];
|
||||
foreach ($datas as $data) {
|
||||
$bankData = $provider->ArrayEntity2Array([$data], 0)[0];
|
||||
if (isset($data->tempData)) {
|
||||
$bankData['bs'] = $data->tempData['bs'];
|
||||
$bankData['bd'] = $data->tempData['bd'];
|
||||
}
|
||||
$result[] = $bankData;
|
||||
}
|
||||
return $this->json($result);
|
||||
}
|
||||
|
||||
#[Route('/api/bank/search', name: 'app_bank_search')]
|
||||
|
@ -115,14 +124,28 @@ class BankController extends AbstractController
|
|||
->getQuery()
|
||||
->getResult();
|
||||
foreach ($items as $item) {
|
||||
$bs += $item->getBs();
|
||||
$bd += $item->getBd();
|
||||
$bs += (float) $item->getBs();
|
||||
$bd += (float) $item->getBd();
|
||||
}
|
||||
$data->setBalance($bd - $bs);
|
||||
// اضافه کردن مقادیر به array برای انتقال به frontend
|
||||
$data->tempData = [
|
||||
'bs' => $bs,
|
||||
'bd' => $bd
|
||||
];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
foreach ($datas as $data) {
|
||||
$bankData = $provider->ArrayEntity2Array([$data], 0)[0];
|
||||
if (isset($data->tempData)) {
|
||||
$bankData['bs'] = $data->tempData['bs'];
|
||||
$bankData['bd'] = $data->tempData['bd'];
|
||||
}
|
||||
$result[] = $bankData;
|
||||
}
|
||||
return $this->json([
|
||||
'items' => $provider->ArrayEntity2Array($datas, 0),
|
||||
'items' => $result,
|
||||
'total' => count($datas)
|
||||
]);
|
||||
}
|
||||
|
@ -203,15 +226,15 @@ class BankController extends AbstractController
|
|||
throw $this->createNotFoundException();
|
||||
}
|
||||
$data->setBid($acc['bid']);
|
||||
$data->setname($params['name']);
|
||||
$data->setDes($params['des']);
|
||||
$data->setOwner($params['owner']);
|
||||
$data->setAccountNum($params['accountNum']);
|
||||
$data->setCardNum($params['cardNum']);
|
||||
$data->setShaba($params['shaba']);
|
||||
$data->setShobe($params['shobe']);
|
||||
$data->setPosNum($params['posNum']);
|
||||
$data->setMobileInternetBank($params['mobileInternetbank']);
|
||||
$data->setName($params['name'] ?? '');
|
||||
$data->setDes($params['des'] ?? null);
|
||||
$data->setOwner($params['owner'] ?? null);
|
||||
$data->setAccountNum($params['accountNum'] ?? null);
|
||||
$data->setCardNum($params['cardNum'] ?? null);
|
||||
$data->setShaba($params['shaba'] ?? null);
|
||||
$data->setShobe($params['shobe'] ?? null);
|
||||
$data->setPosNum($params['posNum'] ?? null);
|
||||
$data->setMobileInternetBank($params['mobileInternetbank'] ?? null);
|
||||
$entityManager->persist($data);
|
||||
$entityManager->flush();
|
||||
$log->insert('بانک', 'حساب بانکی با نام ' . $params['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
|
||||
|
@ -283,8 +306,8 @@ class BankController extends AbstractController
|
|||
->getResult();
|
||||
|
||||
foreach ($items as $item) {
|
||||
$bs += $item->getBs();
|
||||
$bd += $item->getBd();
|
||||
$bs += (float) $item->getBs();
|
||||
$bd += (float) $item->getBd();
|
||||
}
|
||||
|
||||
return $this->json([
|
||||
|
|
|
@ -19,6 +19,7 @@ const en_lang = {
|
|||
presell_info: "Presell Information",
|
||||
financial_info: "Financial Information",
|
||||
invoice_items: "Invoice Items",
|
||||
bank_selection: 'Select Bank',
|
||||
},
|
||||
app:{
|
||||
name:"Hesabix",
|
||||
|
@ -102,6 +103,102 @@ const en_lang = {
|
|||
warranty_system: 'Warranty System',
|
||||
warranty_serials: 'Warranty Serials',
|
||||
business_switcher: 'Switch Business',
|
||||
bankaccounts_transactions: 'Bank Account Transactions',
|
||||
banks: 'Banks',
|
||||
banks_account: 'Bank Account',
|
||||
banks_accounts: 'Bank Accounts',
|
||||
bank_label: 'Banking',
|
||||
},
|
||||
pages: {
|
||||
bank_card: {
|
||||
title: 'Bank Account Card',
|
||||
bank_info: 'Bank Information',
|
||||
account_status: 'Account Status',
|
||||
transactions: 'Transactions',
|
||||
no_results: 'No results found!',
|
||||
no_data: 'No data to display',
|
||||
no_items_selected: 'No items selected.',
|
||||
accounting_code: 'Accounting Code',
|
||||
bank_name: 'Bank Name',
|
||||
card_number: 'Card Number',
|
||||
account_number: 'Account Number',
|
||||
shaba_number: 'Shaba Number',
|
||||
owner: 'Account Owner',
|
||||
branch: 'Branch',
|
||||
pos_number: 'POS Number',
|
||||
internet_bank_phone: 'Internet Bank Phone',
|
||||
description: 'Description',
|
||||
balance: 'Balance',
|
||||
accounting_balance: 'Accounting Balance',
|
||||
credit: 'Credit',
|
||||
debit: 'Debit',
|
||||
deposit: 'Deposit',
|
||||
withdrawal: 'Withdrawal',
|
||||
creditor: 'Creditor',
|
||||
debtor: 'Debtor',
|
||||
settled: 'Settled',
|
||||
accounting_status: 'Accounting Status',
|
||||
detail: 'Detail',
|
||||
settlement: 'Settlement',
|
||||
running_balance: 'Running Balance',
|
||||
available_balance: 'Available Balance',
|
||||
sell_invoice: 'Sales Invoice',
|
||||
buy_invoice: 'Purchase Invoice',
|
||||
return_buy: 'Purchase Return',
|
||||
return_sell: 'Sales Return',
|
||||
payment: 'Payment',
|
||||
receipt: 'Receipt',
|
||||
cost: 'Cost',
|
||||
income: 'Income',
|
||||
sell_receive: 'Sales Receipt',
|
||||
buy_send: 'Purchase Payment',
|
||||
reject_cheque: 'Cheque Rejection',
|
||||
modify_cheque: 'Cheque Registration',
|
||||
modify_cheque_output: 'Cheque Receipt',
|
||||
pass_cheque: 'Cheque Transfer',
|
||||
transfer_cheque: 'Cheque Transfer',
|
||||
transfer: 'Transfer',
|
||||
accounting_doc: 'Accounting Document',
|
||||
calculation: 'Calculation',
|
||||
open_balance: 'Opening Balance'
|
||||
},
|
||||
person_card: {
|
||||
title: 'Person Account Card',
|
||||
account_card: 'Account Card',
|
||||
account_status: 'Account Status',
|
||||
transactions: 'Transactions',
|
||||
no_bank_accounts: 'No bank accounts registered.',
|
||||
no_results: 'No results found!',
|
||||
no_data: 'No data to display',
|
||||
no_items_selected: 'No items selected.',
|
||||
accounting_code: 'Accounting Code',
|
||||
balance: 'Balance',
|
||||
accounting_balance: 'Accounting Balance',
|
||||
credit: 'Credit',
|
||||
debit: 'Debit',
|
||||
deposit: 'Deposit',
|
||||
withdrawal: 'Withdrawal',
|
||||
creditor: 'Creditor',
|
||||
debtor: 'Debtor',
|
||||
settled: 'Settled',
|
||||
sell_invoice: 'Sales Invoice',
|
||||
buy_invoice: 'Purchase Invoice',
|
||||
return_buy: 'Purchase Return',
|
||||
return_sell: 'Sales Return',
|
||||
payment: 'Payment',
|
||||
receipt: 'Receipt',
|
||||
cost: 'Cost',
|
||||
income: 'Income',
|
||||
sell_receive: 'Sales Receipt',
|
||||
buy_send: 'Purchase Payment',
|
||||
detail: 'Detail',
|
||||
reject_cheque: 'Cheque Rejection',
|
||||
modify_cheque: 'Cheque Registration',
|
||||
modify_cheque_output: 'Cheque Receipt',
|
||||
pass_cheque: 'Cheque Transfer',
|
||||
settlement: 'Settlement',
|
||||
running_balance: 'Running Balance'
|
||||
}
|
||||
}
|
||||
};
|
||||
export default en_lang
|
||||
|
|
|
@ -332,6 +332,7 @@ const fa_lang = {
|
|||
"share_social": "اشتراکگذاری در شبکههای اجتماعی",
|
||||
"invoice_link": "پیوند فاکتور",
|
||||
banks_accounts: 'حسابهای بانکی',
|
||||
bank_selection: 'انتخاب بانک',
|
||||
add: 'افزودن',
|
||||
confirm: 'قبول',
|
||||
attach_download: 'دریافت فایل ضمیمه',
|
||||
|
@ -839,6 +840,8 @@ const fa_lang = {
|
|||
"accounting_balance": "تراز حسابداری",
|
||||
"credit": "بستانکار",
|
||||
"debit": "بدهکار",
|
||||
"deposit": "واریز",
|
||||
"withdrawal": "برداشت",
|
||||
"creditor": "بستانکار",
|
||||
"debtor": "بدهکار",
|
||||
"settled": "تسویهشده",
|
||||
|
@ -858,7 +861,66 @@ const fa_lang = {
|
|||
"modify_cheque_output": "دریافت چک",
|
||||
"pass_cheque": "واگذاری چک",
|
||||
"settlement": "تشخیص",
|
||||
"running_balance": "باقیمانده"
|
||||
"running_balance": "تراز",
|
||||
"available_balance": "موجودی",
|
||||
"transfer": "انتقال",
|
||||
"accounting_doc": "سند حسابداری",
|
||||
"calculation": "محاسبه",
|
||||
"open_balance": "تراز افتتاحیه",
|
||||
"walletPay": "پرداخت کیف پول"
|
||||
},
|
||||
"bank_card": {
|
||||
"title": "کارت حساب بانک",
|
||||
"bank_info": "اطلاعات بانک",
|
||||
"account_status": "وضعیت حساب",
|
||||
"transactions": "تراکنشها",
|
||||
"no_results": "نتیجهای یافت نشد!",
|
||||
"no_data": "اطلاعاتی برای نمایش وجود ندارد",
|
||||
"no_items_selected": "هیچ آیتمی انتخاب نشده است.",
|
||||
"accounting_code": "کد حسابداری",
|
||||
"bank_name": "نام بانک",
|
||||
"card_number": "شماره کارت",
|
||||
"account_number": "شماره حساب",
|
||||
"shaba_number": "شماره شبا",
|
||||
"owner": "صاحب حساب",
|
||||
"branch": "شعبه",
|
||||
"pos_number": "شماره دستگاه پوز",
|
||||
"internet_bank_phone": "تلفن اینترنت بانک",
|
||||
"description": "توضیحات",
|
||||
"balance": "تراز",
|
||||
"accounting_balance": "تراز حسابداری",
|
||||
"credit": "بستانکار",
|
||||
"debit": "بدهکار",
|
||||
"deposit": "واریز",
|
||||
"withdrawal": "برداشت",
|
||||
"creditor": "بستانکار",
|
||||
"debtor": "بدهکار",
|
||||
"settled": "تسویهشده",
|
||||
"accounting_status": "وضعیت حسابداری",
|
||||
"detail": "تفضیل",
|
||||
"settlement": "تشخیص",
|
||||
"running_balance": "باقیمانده",
|
||||
"available_balance": "موجودی",
|
||||
"sell_invoice": "فاکتور فروش",
|
||||
"buy_invoice": "فاکتور خرید",
|
||||
"return_buy": "برگشت از خرید",
|
||||
"return_sell": "برگشت از فروش",
|
||||
"payment": "دریافت",
|
||||
"receipt": "پرداخت",
|
||||
"cost": "هزینه",
|
||||
"income": "درآمد",
|
||||
"sell_receive": "دریافت فاکتور فروش",
|
||||
"buy_send": "پرداخت فاکتور فروش",
|
||||
"reject_cheque": "برگشت چک",
|
||||
"modify_cheque": "ثبت چک",
|
||||
"modify_cheque_output": "دریافت چک",
|
||||
"pass_cheque": "واگذاری چک",
|
||||
"transfer_cheque": "واگذاری چک",
|
||||
"transfer": "انتقال",
|
||||
"accounting_doc": "سند حسابداری",
|
||||
"calculation": "محاسبه",
|
||||
"open_balance": "تراز افتتاحیه",
|
||||
"walletPay": "پرداخت کیف پول"
|
||||
},
|
||||
dashboard: {
|
||||
admin_area: "ناحیه مدیریت",
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
<template>
|
||||
<v-toolbar color="toolbar" :title="$t('drawer.bankaccounts_transactions')">
|
||||
<template v-slot:prepend>
|
||||
<v-tooltip :text="$t('dialog.back')" location="bottom">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-btn v-bind="props" @click="$router.back()" class="d-none d-sm-flex" variant="text"
|
||||
icon="mdi-arrow-right" />
|
||||
</template>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<v-spacer></v-spacer>
|
||||
<v-toolbar color="toolbar" dense flat>
|
||||
<v-btn icon @click="$router.back()" class="d-none d-md-flex">
|
||||
<v-icon>mdi-arrow-right</v-icon>
|
||||
</v-btn>
|
||||
<v-toolbar-title class="text-primary-dark">
|
||||
{{ $t('drawer.bankaccounts_transactions') }}
|
||||
</v-toolbar-title>
|
||||
<v-spacer />
|
||||
<v-menu>
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-btn v-bind="props" icon="" color="red">
|
||||
|
@ -52,107 +50,208 @@
|
|||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
<v-row class="pa-1">
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<v-card :loading="loading">
|
||||
<v-card-text>
|
||||
<v-row class="">
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<small class="mb-2">بانک</small>
|
||||
<v-cob dir="rtl" :options="objectItems" label="name" v-model="selectedObjectItem"
|
||||
@option:selected="updateRoute(selectedObjectItem.code)">
|
||||
<template #no-options="{ search, searching, loading }">
|
||||
نتیجهای یافت نشد!
|
||||
</template>
|
||||
</v-cob>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="4">
|
||||
<div class="fw-bold mb-2">کد حسابداری: <small class="text-primary">{{ selectedObjectItem.code }}</small>
|
||||
</div>
|
||||
<div class="fw-bold mb-2">نام : <small class="text-primary">{{ selectedObjectItem.name }}</small></div>
|
||||
<div class="fw-bold mb-2">شماره کارت: <small class="text-primary">{{ selectedObjectItem.cardNum
|
||||
}}</small>
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="4">
|
||||
<div class="fw-bold mb-2">شبا: <small class="text-primary">{{ selectedObjectItem.shaba }}</small></div>
|
||||
<div class="fw-bold mb-2">صاحب حساب: <small class="text-primary">{{ selectedObjectItem.owner }}</small>
|
||||
</div>
|
||||
<div class="fw-bold mb-2">تلفن اینترنت بانک: <small class="text-primary">{{
|
||||
selectedObjectItem.mobileInternetBank }}</small></div>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="4">
|
||||
<div class="fw-bold mb-2">شماره دستگاه پوز: <small class="text-primary">{{ selectedObjectItem.posNum
|
||||
}}</small></div>
|
||||
<div class="fw-bold mb-2">شعبه: <small class="text-primary">{{ selectedObjectItem.shobe }}</small></div>
|
||||
<div class="fw-bold mb-2">توضیحات: <small class="text-primary">{{ selectedObjectItem.des }}</small>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<v-text-field :loading="loading" color="green" class="mb-0 pt-0 rounded-0" hide-details="auto" density="compact"
|
||||
:placeholder="$t('dialog.search_txt')" v-model="searchValue" type="text" clearable>
|
||||
<template v-slot:prepend-inner>
|
||||
<v-tooltip location="bottom" :text="$t('dialog.search')">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-icon v-bind="props" color="danger" icon="mdi-magnify"></v-icon>
|
||||
</template>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
</v-text-field>
|
||||
<EasyDataTable table-class-name="customize-table" show-index alternating v-model:items-selected="itemsSelected"
|
||||
:search-value="searchValue" :headers="headers" :items="items" theme-color="#1d90ff"
|
||||
header-text-direction="center" body-text-direction="center" rowsPerPageMessage="تعداد سطر"
|
||||
emptyMessage="اطلاعاتی برای نمایش وجود ندارد" rowsOfPageSeparatorMessage="از" :loading="loading">
|
||||
<template #item-operation="{ code }">
|
||||
<router-link class="text-success" :to="'/acc/accounting/view/' + code">
|
||||
<i class="fa fa-eye px-1"></i>
|
||||
</router-link>
|
||||
</template>
|
||||
</EasyDataTable>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-container fluid class="pa-4">
|
||||
<!-- انتخاب بانک -->
|
||||
<v-row dense>
|
||||
<v-col cols="12" md="12">
|
||||
<v-autocomplete v-model="selectedObjectItem" :items="objectItems" item-title="name" item-value="code"
|
||||
return-object :label="$t('dialog.bank_selection')" dense hide-details prepend-inner-icon="mdi-bank"
|
||||
:loading="loading" @update:model-value="updateRoute" class="rounded-lg elevation-2">
|
||||
<template v-slot:no-data>
|
||||
{{ $t('pages.bank_card.no_results') }}
|
||||
</template>
|
||||
<template v-slot:item="{ props, item }">
|
||||
<v-list-item v-bind="props">
|
||||
<v-list-item-title>
|
||||
<v-icon small left>mdi-bank</v-icon>
|
||||
{{ item.raw.name }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-subtitle>
|
||||
<v-row dense>
|
||||
<v-col cols="6">
|
||||
<v-icon small left>mdi-credit-card</v-icon>
|
||||
{{ item.raw.cardNum || 'بدون کارت' }}
|
||||
</v-col>
|
||||
<v-col cols="6">
|
||||
<v-icon small left>mdi-account</v-icon>
|
||||
{{ item.raw.owner || 'نامشخص' }}
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item-subtitle>
|
||||
</v-list-item>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- کارت اطلاعات بانک -->
|
||||
<v-row dense>
|
||||
<v-col cols="12" md="6">
|
||||
<v-card flat outlined class="rounded-lg elevation-2">
|
||||
<v-toolbar color="primary-dark" dense flat class="rounded-t-lg">
|
||||
<v-toolbar-title class="text-white">
|
||||
{{ $t('pages.bank_card.bank_info') }}
|
||||
<small class="text-info-light" v-if="selectedObjectItem">{{ selectedObjectItem.name }}</small>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-2">
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.accounting_code') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.code || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.bank_name') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.name || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.card_number') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.cardNum || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.account_number') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.accountNum || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.shaba_number') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.shaba || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.owner') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.owner || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.branch') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.shobe || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.pos_number') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.posNum || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.internet_bank_phone') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.mobileInternetBank || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.description') }}: <span class="text-primary">{{
|
||||
selectedObjectItem.des || '-' }}</span></div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-col cols="12" md="6">
|
||||
<v-card flat outlined class="rounded-lg elevation-2">
|
||||
<v-toolbar color="primary-dark" dense flat class="rounded-t-lg">
|
||||
<v-toolbar-title class="text-white">
|
||||
{{ $t('pages.bank_card.account_status') }}
|
||||
<small class="text-info-light" v-if="selectedObjectItem">{{ selectedObjectItem.name }}</small>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-2">
|
||||
<div class="text-subtitle-2">
|
||||
{{ $t('pages.bank_card.accounting_status') }}:
|
||||
<span :class="{
|
||||
'text-success': selectedObjectItem.balance > 0,
|
||||
'text-danger': selectedObjectItem.balance < 0,
|
||||
'text-dark': selectedObjectItem.balance == 0
|
||||
}">
|
||||
{{ selectedObjectItem.balance > 0 ? $t('pages.bank_card.creditor') : selectedObjectItem.balance < 0 ?
|
||||
$t('pages.bank_card.debtor') : $t('pages.bank_card.settled') }} </span>
|
||||
</div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.withdrawal') }}: <span class="text-primary">{{
|
||||
$filters.formatNumber(selectedObjectItem.bs) || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.deposit') }}: <span class="text-primary">{{
|
||||
$filters.formatNumber(selectedObjectItem.bd) || '-' }}</span></div>
|
||||
<div class="text-subtitle-2">{{ $t('pages.bank_card.accounting_balance') }}: <span class="text-primary">{{
|
||||
$filters.formatNumber(selectedObjectItem.balance) || '-' }}</span></div>
|
||||
<v-divider class="my-2" />
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- جدول تراکنشها -->
|
||||
<v-row dense>
|
||||
<v-col cols="12">
|
||||
<v-data-table v-model="itemsSelected" :headers="headers" :items="items" :search="searchValue" :loading="loading"
|
||||
show-select dense :items-per-page="25" class="elevation-2 rounded-lg" :header-props="{ class: 'custom-header' }">
|
||||
<template v-slot:top>
|
||||
<v-toolbar flat dense color="grey-lighten-4" class="rounded-t-lg">
|
||||
<v-toolbar-title class="text-subtitle-1">{{ $t('pages.bank_card.transactions') }}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-text-field v-model="searchValue" dense hide-details
|
||||
prepend-inner-icon="mdi-magnify" />
|
||||
</v-toolbar>
|
||||
</template>
|
||||
<template v-slot:item.operation="{ item }">
|
||||
<v-btn variant="plain" icon size="small" :to="'/acc/accounting/view/' + item.code" color="success">
|
||||
<v-icon small>mdi-eye</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<template v-slot:item.code="{ item }">
|
||||
{{ $filters.formatNumber(item.code) }}
|
||||
</template>
|
||||
<template v-slot:item.type="{ item }">
|
||||
<v-btn variant="plain" text size="small" :to="getTypeRoute(item.type, item.code)" class="text-none">
|
||||
{{ getTypeLabel(item.type) }}
|
||||
</v-btn>
|
||||
</template>
|
||||
<template v-slot:item.bd="{ item }">
|
||||
{{ $filters.formatNumber(item.bd) }}
|
||||
</template>
|
||||
<template v-slot:item.bs="{ item }">
|
||||
{{ $filters.formatNumber(item.bs) }}
|
||||
</template>
|
||||
<template v-slot:item.settlement="{ item }">
|
||||
<v-chip
|
||||
:color="item.settlement === 'بستانکار' ? 'success' : item.settlement === 'بدهکار' ? 'error' : item.settlement === 'تسویهشده' ? 'info' : 'default'"
|
||||
size="small"
|
||||
variant="outlined"
|
||||
>
|
||||
{{ item.settlement }}
|
||||
</v-chip>
|
||||
</template>
|
||||
<template v-slot:item.balance="{ item }">
|
||||
<span :class="{
|
||||
'text-success': -item.balance > 0,
|
||||
'text-danger': -item.balance < 0,
|
||||
'text-dark': item.balance == 0
|
||||
}">
|
||||
{{ $filters.formatNumber(-item.balance) }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot:no-data>
|
||||
{{ $t('pages.bank_card.no_data') }}
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
<v-overlay :value="loading" contained class="align-center justify-center">
|
||||
<v-progress-circular indeterminate size="64" />
|
||||
</v-overlay>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import Swal from "sweetalert2";
|
||||
import { ref } from "vue";
|
||||
|
||||
export default {
|
||||
name: "card",
|
||||
data: () => {
|
||||
data() {
|
||||
return {
|
||||
searchValue: '',
|
||||
itemsSelected: [],
|
||||
items: [],
|
||||
selectedObjectItem: {
|
||||
id: '',
|
||||
code: 0,
|
||||
name: '',
|
||||
},
|
||||
items: [],
|
||||
selectedObjectItem: { balance: 0, bs: 0, bd: 0 },
|
||||
objectItems: [],
|
||||
loading: true,
|
||||
loading: ref(false),
|
||||
headers: [
|
||||
{ text: "عملیات", value: "operation" },
|
||||
{ text: "تاریخ", value: "date", 'sortable': true },
|
||||
{ text: "شرح", value: "des" },
|
||||
{ text: "تفضیل", value: "ref", 'sortable': true },
|
||||
{ text: "واریز", value: "bd", 'sortable': true },
|
||||
{ text: "برداشت", value: "bs", 'sortable': true },
|
||||
]
|
||||
}
|
||||
{ title: this.$t('dialog.operation'), key: "operation", align: "center", sortable: false },
|
||||
{ title: this.$t('dialog.type'), key: "type", align: "center", sortable: true },
|
||||
{ title: this.$t('dialog.invoice_num'), key: "code", align: "center", sortable: true },
|
||||
{ title: this.$t('dialog.date'), key: "date", align: "center", sortable: true },
|
||||
{ title: this.$t('app.body'), key: "des", align: "center" },
|
||||
{ title: this.$t('pages.bank_card.detail'), key: "ref", align: "center", sortable: true },
|
||||
{ title: this.$t('pages.bank_card.deposit'), key: "bd", align: "center", sortable: true },
|
||||
{ title: this.$t('pages.bank_card.withdrawal'), key: "bs", align: "center", sortable: true },
|
||||
{ title: this.$t('pages.bank_card.settlement'), key: "settlement", align: "center", sortable: true },
|
||||
{ title: this.$t('pages.bank_card.available_balance'), key: "balance", align: "center", sortable: true },
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
updateRoute(id) {
|
||||
this.$router.push(id);
|
||||
this.loadData();
|
||||
updateRoute(selectedItem) {
|
||||
if (selectedItem && selectedItem.code) {
|
||||
this.$router.push(`/acc/banks/card/view/${selectedItem.code}`);
|
||||
this.loadData();
|
||||
this.loadBankBalance();
|
||||
}
|
||||
},
|
||||
loadData() {
|
||||
this.loading = true;
|
||||
|
@ -168,10 +267,20 @@ export default {
|
|||
});
|
||||
} else {
|
||||
this.selectedObjectItem = response.data[0];
|
||||
this.loadObject(this.selectedObjectItem.code);
|
||||
}
|
||||
this.loadObject(this.selectedObjectItem.code);
|
||||
this.loadBankBalance();
|
||||
});
|
||||
},
|
||||
loadBankBalance() {
|
||||
if (this.selectedObjectItem && this.selectedObjectItem.code) {
|
||||
axios.get(`/api/bank/balance/${this.selectedObjectItem.code}`).then((response) => {
|
||||
this.selectedObjectItem.bs = parseFloat(response.data.credit) || 0;
|
||||
this.selectedObjectItem.bd = parseFloat(response.data.debit) || 0;
|
||||
this.selectedObjectItem.balance = parseFloat(response.data.balance) || 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
loadObject(id) {
|
||||
this.loading = true;
|
||||
axios.post('/api/accounting/rows/search',
|
||||
|
@ -188,6 +297,56 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getTypeRoute(type, code) {
|
||||
const routes = {
|
||||
sell: '/acc/sell/view/',
|
||||
buy: '/acc/buy/view/',
|
||||
rfbuy: '/acc/rfbuy/view/',
|
||||
rfsell: '/acc/rfsell/view/',
|
||||
person_send: '/acc/accounting/view/',
|
||||
person_receive: '/acc/accounting/view/',
|
||||
cost: '/acc/accounting/view/',
|
||||
income: '/acc/accounting/view/',
|
||||
sell_receive: '/acc/accounting/view/',
|
||||
buy_send: '/acc/accounting/view/',
|
||||
reject_cheque: '/acc/accounting/view/',
|
||||
modify_cheque: '/acc/accounting/view/',
|
||||
modify_cheque_output: '/acc/accounting/view/',
|
||||
pass_cheque: '/acc/accounting/view/',
|
||||
transfer_cheque: '/acc/accounting/view/',
|
||||
transfer: '/acc/accounting/view/',
|
||||
doc: '/acc/accounting/view/',
|
||||
calc: '/acc/accounting/view/',
|
||||
open_balance: '/acc/accounting/view/',
|
||||
walletPay: '/acc/accounting/view/',
|
||||
};
|
||||
return routes[type] + code;
|
||||
},
|
||||
getTypeLabel(type) {
|
||||
const labels = {
|
||||
sell: this.$t('pages.bank_card.sell_invoice'),
|
||||
buy: this.$t('pages.bank_card.buy_invoice'),
|
||||
rfbuy: this.$t('pages.bank_card.return_buy'),
|
||||
rfsell: this.$t('pages.bank_card.return_sell'),
|
||||
person_send: this.$t('pages.bank_card.payment'),
|
||||
person_receive: this.$t('pages.bank_card.receipt'),
|
||||
cost: this.$t('pages.bank_card.cost'),
|
||||
income: this.$t('pages.bank_card.income'),
|
||||
sell_receive: this.$t('pages.bank_card.sell_receive'),
|
||||
buy_send: this.$t('pages.bank_card.buy_send'),
|
||||
reject_cheque: this.$t('pages.bank_card.reject_cheque'),
|
||||
modify_cheque: this.$t('pages.bank_card.modify_cheque'),
|
||||
pass_cheque: this.$t('pages.bank_card.pass_cheque'),
|
||||
modify_cheque_output: this.$t('pages.bank_card.modify_cheque_output'),
|
||||
transfer_cheque: this.$t('pages.bank_card.transfer_cheque'),
|
||||
transfer: this.$t('pages.bank_card.transfer'),
|
||||
doc: this.$t('pages.bank_card.accounting_doc'),
|
||||
calc: this.$t('pages.bank_card.calculation'),
|
||||
open_balance: this.$t('pages.bank_card.open_balance'),
|
||||
walletPay: this.$t('pages.bank_card.walletPay'),
|
||||
};
|
||||
return labels[type] || type;
|
||||
},
|
||||
excellOutput(AllItems = true) {
|
||||
if (AllItems) {
|
||||
this.loading = true;
|
||||
|
@ -233,7 +392,7 @@ export default {
|
|||
var fileLink = document.createElement('a');
|
||||
|
||||
fileLink.href = fileURL;
|
||||
fileLink.setAttribute('download', 'persons-list.xlsx');
|
||||
fileLink.setAttribute('download', 'bank-card-view.xlsx');
|
||||
document.body.appendChild(fileLink);
|
||||
fileLink.click();
|
||||
})
|
||||
|
@ -278,10 +437,28 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.custom-header {
|
||||
background-color: #f5f5f5 !important;
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
||||
.v-data-table {
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.v-card {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.v-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
||||
}
|
||||
</style>
|
Loading…
Reference in a new issue