fix bugs and added some feature for withdraw handling
This commit is contained in:
@@ -5,10 +5,34 @@ import { usePrice } from '@core/utils/usePrice'
|
||||
import { getCashBalance } from '@/components/mobile/utils/wallet'
|
||||
import { customerWalletMetalBalanceTitle } from '@/utils/adminMetalLabels'
|
||||
import { formatMetalDisplayValue, metalCellValue } from '@/utils/metalWeight'
|
||||
import type { AccountingProvider } from '@/utils/config'
|
||||
|
||||
export type CustomerMetalColumn = { metal_id: number; label: string; display_unit?: string }
|
||||
|
||||
export function buildCustomerColumns(metals: CustomerMetalColumn[] = []): BaseTableColumn[] {
|
||||
export type CustomerColumnOptions = {
|
||||
accountingProvider?: AccountingProvider
|
||||
}
|
||||
|
||||
function accountingCodeColumn(provider: AccountingProvider | undefined): BaseTableColumn | null {
|
||||
if (provider === 'pargar' || provider === 'tahesab') {
|
||||
return {
|
||||
title: 'کد حسابداری',
|
||||
dataIndex: provider === 'pargar' ? 'pargar_account_id' : 'moshtari_code',
|
||||
key: 'accounting_code',
|
||||
type: 'Text',
|
||||
filterable: false,
|
||||
slot: 'accountingCode'
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export function buildCustomerColumns(
|
||||
metals: CustomerMetalColumn[] = [],
|
||||
options: CustomerColumnOptions = {}
|
||||
): BaseTableColumn[] {
|
||||
const accountingColumn = accountingCodeColumn(options.accountingProvider)
|
||||
|
||||
const baseColumns: BaseTableColumn[] = [
|
||||
{
|
||||
title: 'ردیف',
|
||||
@@ -26,6 +50,7 @@ export function buildCustomerColumns(metals: CustomerMetalColumn[] = []): BaseTa
|
||||
key: 'id',
|
||||
type: 'Number'
|
||||
},
|
||||
...(accountingColumn ? [accountingColumn] : []),
|
||||
{
|
||||
title: 'نام و نام خانوادگی',
|
||||
dataIndex: 'name',
|
||||
|
||||
Reference in New Issue
Block a user