Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Commit

Permalink
Modify dealer balance format
Browse files Browse the repository at this point in the history
  • Loading branch information
mvakili committed Jan 29, 2019
1 parent aeefc18 commit 258d664
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions frontend/client/filters/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
'balance': function (value) {
if (value < 0) {
return 'بدهکار'
} else if (value > 0) {
return 'بستانکار'
} else {
return ''
}
},
'abs': function (value) {
return Math.abs(value)
}
}
2 changes: 1 addition & 1 deletion frontend/client/views/dealer/DealList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</span>
</b-table-column>
<b-table-column field="dealTime" label="زمان خرید / فروش" sortable>
<date-picker :class="{'disable-event': !table.openedDetailed.includes(detailProps.row.id)}" type="datetime" :auto-submit="true" format="YYYY-MM-DD HH:mm" display-format="HH:mm jYYYY/jMM/jDD" v-model="detailProps.row.dealTime" disabled></date-picker>
<date-picker :class="{'disable-event': !table.openedDetailed.includes(detailProps.row.id)}" type="datetime" :auto-submit="true" format="YYYY-MM-DD HH:mm" display-format="HH:mm jYYYY/jMM/jDD" v-model="detailProps.row.dealTime"></date-picker>
</b-table-column>
<b-table-column field="dealPrice.amount" label="قیمت خرید / فروش" sortable>
<input class="input" v-if="table.openedDetailed.includes(detailProps.row.id)" type="text" placeholder="قیمت خرید" v-model="detailProps.row.dealPrice.amount" />
Expand Down
3 changes: 2 additions & 1 deletion frontend/client/views/dealer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
{{ props.row.address || ' ... ' }}
</b-table-column>
<b-table-column field="balance" label="بدهی/طلب" sortable>
{{ props.row.balance}}
{{ props.row.balance || 0 | abs |currency('', 0) }}
{{ props.row.balance || 0 | balance }}
</b-table-column>
<b-table-column label="" width="100">
<b-dropdown :mobile-modal="false" v-model="isPublic" class="control" position="is-bottom-left">
Expand Down

0 comments on commit 258d664

Please sign in to comment.