<template>
    <theme-table :noneActions="true">
        <span slot="main-title">
            {{ $t('Daily Banknote Management') }}
        </span>
        <template slot="more-button">
            <button class="btn btn-secondary" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight">{{$t('Filter')}}</button>
            <div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel">
                <div class="offcanvas-header">
                    <h5 class="offcanvas-title" id="offcanvasRightLabel">{{$t('Filter')}}</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
                </div>
                <div class="offcanvas-body">
                    <label class="form-label">{{ $t('Date') }}</label>
                    <div class="mb-3 d-flex">
                        <date-picker class="me-1" :range="true" :placeholder="$t('Date')" v-model="params.date" valueType="format" format="YYYY-MM-DD"> </date-picker>
                        <!-- <button type="button" class="btn border btn-sm text-nowrap py-0" data-bs-toggle="modal" data-bs-target="#modalFilter">
                            <i class="fas fa-sm fa-filter"></i> {{ $t('Filter') }}
                        </button> -->
                    </div>
                    <div class="list-group mb-3">
                        <button type="button" class="btn btn-success" @click="funGetData"><i class="fa fa-search"></i> {{ $t('Search') }}</button>
                    </div>
                    <div class="list-group mb-3">
                        <button type="button" @click="printP" class="btn btn-primary"><i class="fa fa-print"></i> {{ $t('Print') }}</button>
                    </div>
                    <div class="list-group mb-3">
                        <button type="button" @click="exportExcell" class="btn btn-danger"><i class="fa fa-file-export"></i> {{ $t('Export') }}</button>
                    </div>
                </div>
            </div>
        </template>

        <div slot="body">
            <div id="show-print">
                <div class="table-responsive table_scroll report_print">
                    <header-report :title="'ការគ្រប់គ្រងក្រដាសប្រាក់ប្រចាំថ្ងៃ'" style="display: none;"></header-report>
                    <table class="table table-bordered" id="excel-table">
                        <tbody>
                            <tr class="text-nowrap text-center">
                                <th>ដាក់ក្រដាសប្រាក់</th>
                                <th>ដកក្រដាសប្រាក់</th>
                                <th>ក្រដាសប្រាក់នៅសល់</th>
                            </tr>
                            <tr v-if="currency_id==1">
                                <td>
                                    <table class="text-end">
                                        <tr>
                                        
                                            <td>100,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100000_add*100000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>50,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_50000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_50000_add*50000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>30,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_30000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_30000_add*30000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>20,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_20000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_20000_add*20000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>15,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_15000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_15000_add*15000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>10,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_10000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_10000_add*10000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>5,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_5000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_5000_add*5000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>2,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_2000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_2000_add*2000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>1,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_1000_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_1000_add*1000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>500</td>
                                            <td class="px-2">x</td>
                                           <td>{{bank.qty_500_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_500_add*500 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>200</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_200_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_200_add*200 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>100</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100_add*100 | numberFomartValue}}</td>
                                        </tr>
                                    </table>
                                    <br>
                                    <strong>Total :  {{totalAddForm | number('0,0.00')}}</strong>
                                    <br>
                                    <br>
                                </td>
                                <td>
                                    <table class="text-end">
                                         <tr>
                                            <td>100,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100000_sub*100000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>50,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_50000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_50000_sub*50000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>30,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_30000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_30000_sub*30000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>20,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_20000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_20000_sub*20000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>15,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_15000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_15000_sub*15000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>10,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_10000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_10000_sub*10000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>5,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_5000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_5000_sub*5000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>2,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_2000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_2000_sub*2000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>1,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_1000_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_1000_sub*1000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>500</td>
                                            <td class="px-2">x</td>
                                           <td>{{bank.qty_500_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_500_sub*500 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>200</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_200_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_200_sub*200 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>100</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100_sub*100 | numberFomartValue}}</td>
                                        </tr>
                                    </table>
                                    <br>
                                    <strong>Total :  {{totalSubForm | number('0,0.00')}}</strong>
                                    <br>
                                    <br>
                                </td>
                                <td>
                                    <table class="text-end">
                                         <tr>
                                            <td>100,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100000_balance*100000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>50,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_50000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_50000_balance*50000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>30,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_30000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_30000_balance*30000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>20,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_20000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_20000_balance*20000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>15,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_15000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_15000_balance*15000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>10,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_10000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_10000_balance*10000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>5,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_5000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_5000_balance*5000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>2,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_2000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_2000_balance*2000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>1,000</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_1000_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_1000_balance*1000 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>500</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_500_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_500_balance*500 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>200</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_200_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_200_balance*200 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>100</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100_balance*100 | numberFomartValue}}</td>
                                        </tr>
                                    </table>
                                    <br>
                                    <strong>Total :  {{totalBalance | number('0,0.00')}}</strong>
                                    <br>
                                    <br>
                                </td>

                            </tr>
                            <tr v-else>
                                <td>
                                    <table class="text-end">
                                        <tr>
                                            <td>100</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100_dollar_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100_dollar_add*100 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>50</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_50_dollar_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_50_dollar_add*50 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>20</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_20_dollar_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_20_dollar_add*20 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>10</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_10_dollar_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_10_dollar_add*10 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>5</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_5_dollar_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_5_dollar_add*5 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>1</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_1_dollar_add}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_1_dollar_add*1 | numberFomartValue}}</td>
                                        </tr>
                                    </table>
                                    <br>
                                    <strong>Total :  {{totalAddUSD | number('0,0.00')}}</strong>
                                    <br>
                                    <br>
                                </td>
                                <td>
                                    <table class="text-end">
                                        <tr>
                                            <td>100</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100_dollar_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100_dollar_sub*100 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>50</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_50_dollar_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_50_dollar_sub*50 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>20</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_20_dollar_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_20_dollar_sub*20 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>10</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_10_dollar_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_10_dollar_sub*10 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>5</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_5_dollar_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_5_dollar_sub*5 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>1</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_1_dollar_sub}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_1_dollar_sub*1 | numberFomartValue}}</td>
                                        </tr>
                                    </table>
                                    <br>
                                    <strong>Total :  {{totalSubUSD | number('0,0.00')}}</strong>
                                    <br>
                                    <br>
                                </td>
                                <td>
                                    <table class="text-end">
                                        <tr>
                                            <td>100</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_100_dollar_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_100_dollar_balance*100 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>50</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_50_dollar_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_50_dollar_balance*50 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>20</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_20_dollar_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_20_dollar_balance*20 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>10</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_10_dollar_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_10_dollar_balance*10 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>5</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_5_dollar_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_5_dollar_balance*5 | numberFomartValue}}</td>
                                        </tr>
                                        <tr>
                                            <td>1</td>
                                            <td class="px-2">x</td>
                                            <td>{{bank.qty_1_dollar_balance}}</td>
                                            <td class="px-2">=</td>
                                            <td>{{bank.qty_1_dollar_balance*1 | numberFomartValue}}</td>
                                        </tr>
                                    </table>
                                    <br>
                                    <strong>Total :  {{totalBalanceUSD | number('0,0.00')}}{}</strong>
                                    <br>
                                    <br>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="text-end"> <strong>សាច់ប្រាក់ចុងគ្រា </strong></td>
                                <td v-if="currency_id==1"><strong>: {{totalBalance | number('0,0.00')}} ៛</strong> </td>
                                <td v-else-if="currency_id==2"><strong>: {{totalBalanceUSD | number('0,0.00')}} $</strong> </td>
                            </tr>
                            <tr>
                                <td class="w-30 text-center">
                                    <p>ពិនិត្យ និងឯកភាពដោយ</p>
                                    <br><br>
                                    <br><br>
                                    <br><br>
                                    <p>Date : {{today |onlyDate}}</p>
                                    <!-- <p>ទទួលដោយ</p>
                                    <br><br>
                                    <p>Date : {{today |onlyDate}}</p> -->
                                </td>
                                <td class="w-30 text-center">
                                    <p>ពិនិត្យដោយ</p>
                                    <br><br>
                                    <br><br>
                                    <br><br>
                                    <p>Date : {{today |onlyDate}}</p>
                                    <!-- <p>ទទួលដោយ</p>
                                    <br><br>
                                    <p>Date : {{today |onlyDate}}</p> -->
                                </td>
                                <td class="w-30 text-center">
                                    <p>រៀបចំដោយ</p>
                                    <br><br>
                                    <br><br>
                                    <br><br>
                                    <p>Date : {{today |onlyDate}}</p>
                                    <!-- <p>ទទួលដោយ</p>
                                    <br><br>
                                    <p>Date : {{today |onlyDate}}</p> -->
                                </td>
                            </tr>

                        </tbody>

                    </table>
                </div>
            </div>
        </div>
        <!-- <div slot="modal-custom">
           <create-daily-bank-note :form="form" @submitData="submitData"></create-daily-bank-note>
        </div> -->
    </theme-table>
</template>
<script>
    import ThemeTable from "../../../components/ThemeTable.vue";
    // import CreateDailyBankNote from "./CreateDailyBankNote.vue";
    import HeaderReport from "../../../components/report/header.vue";
    import { exportTableToExcel } from "../../../exportExcel.js";

    export default {
        components: {
            ThemeTable,
            // CreateDailyBankNote,
            HeaderReport
        },
        data() {
            return {
                bank:{
                    qty_100000_add:0,
                    qty_50000_add: 0,
                    qty_30000_add: 0,
                    qty_20000_add: 0,
                    qty_15000_add: 0,
                    qty_10000_add: 0,
                    qty_5000_add: 0,
                    qty_2000_add: 0,
                    qty_1000_add: 0,
                    qty_500_add: 0,
                    qty_200_add: 0,
                    qty_100_add: 0,
                    qty_100_dollar_add: 0,
                    qty_50_dollar_add: 0,
                    qty_20_dollar_add: 0,
                    qty_10_dollar_add: 0,
                    qty_5_dollar_add: 0,
                    qty_1_dollar_add: 0,
                    qty_100000_sub: 0,
                    qty_50000_sub: 0,
                    qty_30000_sub: 0,
                    qty_20000_sub: 0,
                    qty_15000_sub: 0,
                    qty_10000_sub: 0,
                    qty_5000_sub: 0,
                    qty_2000_sub: 0,
                    qty_1000_sub: 0,
                    qty_500_sub: 0,
                    qty_200_sub: 0,
                    qty_100_sub: 0,
                    qty_100_dollar_sub: 0,
                    qty_50_dollar_sub: 0,
                    qty_20_dollar_sub: 0,
                    qty_10_dollar_sub: 0,
                    qty_5_dollar_sub: 0,
                    qty_1_dollar_sub: 0,

                    qty_100000_balance: 0,
                    qty_50000_balance: 0,
                    qty_30000_balance: 0,
                    qty_20000_balance: 0,
                    qty_15000_balance: 0,
                    qty_10000_balance: 0,
                    qty_5000_balance: 0,
                    qty_2000_balance: 0,
                    qty_1000_balance: 0,
                    qty_500_balance: 0,
                    qty_200_balance: 0,
                    qty_100_balance: 0,
                    qty_100_dollar_balance: 0,
                    qty_50_dollar_balance: 0,
                    qty_20_dollar_balance: 0,
                    qty_10_dollar_balance: 0,
                    qty_5_dollar_balance: 0,
                    qty_1_dollar_balance: 0,

                },
                today: '',
                currency_id: '',

                form: new Form({
                   
                }),
                params: {
                    page: 1,
                    per_page: 25,
                    date: [],
                },
            };
        },
        created() {
            this.funGetData();
        },
        methods: {
            funGetData() {
                axios.get('admin-api/bank-notes', {
                    params: this.params
                }).then((res) => {
                    this.today = res.data.today;
                    this.currency_id = res.data.currency_id;

                    this.bank.qty_100000_add = res.data.qty_100000_add;
                    this.bank.qty_50000_add = res.data.qty_50000_add;
                    this.bank.qty_30000_add = res.data.qty_30000_add;
                    this.bank.qty_20000_add = res.data.qty_20000_add;
                    this.bank.qty_15000_add = res.data.qty_15000_add;
                    this.bank.qty_10000_add = res.data.qty_10000_add;
                    this.bank.qty_5000_add = res.data.qty_5000_add;
                    this.bank.qty_2000_add = res.data.qty_2000_add;
                    this.bank.qty_1000_add = res.data.qty_1000_add;
                    this.bank.qty_500_add = res.data.qty_500_add;
                    this.bank.qty_200_add = res.data.qty_200_add;
                    this.bank.qty_100_add = res.data.qty_100_add;
                    this.bank.qty_100_dollar_add = res.data.qty_100_dollar_add;
                    this.bank.qty_50_dollar_add = res.data.qty_50_dollar_add;
                    this.bank.qty_20_dollar_add = res.data.qty_20_dollar_add;
                    this.bank.qty_10_dollar_add = res.data.qty_10_dollar_add;
                    this.bank.qty_5_dollar_add = res.data.qty_5_dollar_add;
                    this.bank.qty_1_dollar_add = res.data.qty_1_dollar_add;
                    this.bank.qty_100000_sub = res.data.qty_100000_sub;
                    this.bank.qty_50000_sub = res.data.qty_50000_sub;
                    this.bank.qty_30000_sub = res.data.qty_30000_sub;
                    this.bank.qty_20000_sub = res.data.qty_20000_sub;
                    this.bank.qty_15000_sub = res.data.qty_15000_sub;
                    this.bank.qty_10000_sub = res.data.qty_10000_sub;
                    this.bank.qty_5000_sub = res.data.qty_5000_sub;
                    this.bank.qty_2000_sub = res.data.qty_2000_sub;
                    this.bank.qty_1000_sub = res.data.qty_1000_sub;
                    this.bank.qty_500_sub = res.data.qty_500_sub;
                    this.bank.qty_200_sub = res.data.qty_200_sub;
                    this.bank.qty_100_sub = res.data.qty_100_sub;
                    this.bank.qty_100_dollar_sub = res.data.qty_100_dollar_sub;
                    this.bank.qty_50_dollar_sub = res.data.qty_50_dollar_sub;
                    this.bank.qty_20_dollar_sub = res.data.qty_20_dollar_sub;
                    this.bank.qty_10_dollar_sub = res.data.qty_10_dollar_sub;
                    this.bank.qty_5_dollar_sub = res.data.qty_5_dollar_sub;
                    this.bank.qty_1_dollar_sub = res.data.qty_1_dollar_sub;

                    this.bank.qty_100000_balance = res.data.qty_100000_add - res.data.qty_100000_sub;
                    this.bank.qty_50000_balance = res.data.qty_50000_add - res.data.qty_50000_sub;
                    this.bank.qty_30000_balance = res.data.qty_30000_add - res.data.qty_30000_sub;
                    this.bank.qty_20000_balance = res.data.qty_20000_add - res.data.qty_20000_sub;
                    this.bank.qty_15000_balance = res.data.qty_15000_add - res.data.qty_15000_sub;
                    this.bank.qty_10000_balance = res.data.qty_10000_add - res.data.qty_10000_sub;
                    this.bank.qty_5000_balance = res.data.qty_5000_add - res.data.qty_5000_sub;
                    this.bank.qty_2000_balance = res.data.qty_2000_add - res.data.qty_2000_sub;
                    this.bank.qty_1000_balance = res.data.qty_1000_add - res.data.qty_1000_sub;
                    this.bank.qty_500_balance = res.data.qty_500_add - res.data.qty_500_sub;
                    this.bank.qty_200_balance = res.data.qty_200_add - res.data.qty_200_sub;
                    this.bank.qty_100_balance = res.data.qty_100_add - res.data.qty_100_sub;
                    this.bank.qty_100_dollar_balance = res.data.qty_100_dollar_add - res.data.qty_100_dollar_sub;
                    this.bank.qty_50_dollar_balance = res.data.qty_50_dollar_add - res.data.qty_50_dollar_sub;
                    this.bank.qty_20_dollar_balance = res.data.qty_20_dollar_add - res.data.qty_20_dollar_sub;
                    this.bank.qty_10_dollar_balance = res.data.qty_10_dollar_add - res.data.qty_10_dollar_sub;
                    this.bank.qty_5_dollar_balance = res.data.qty_5_dollar_add - res.data.qty_5_dollar_sub;
                    this.bank.qty_1_dollar_balance = res.data.qty_1_dollar_add - res.data.qty_1_dollar_sub;
                }).catch((error) => {
                    if(error.message=='Request failed with status code 403') {
                        this.$router.push({ name: 'permissionTest' });
                    } else {
                        console.log(error.message);
                    }
                });
            },
            printP() {
                this.$htmlToPaper("show-print");
            },
            async exportExcell() {
                this.$isLoading(true)
                try {
                    await exportTableToExcel({
                        tableId: "excel-table",
                        filename: "DailyBanknoteManagementReport",
                        reportTitle: "ការគ្រប់គ្រងក្រដាសប្រាក់ប្រចាំថ្ងៃ",
                        subDate:this.params.date,
                    })
                } catch (e) {
                    this.$toast.warning(e.message);
                } finally {
                    this.$isLoading(false)
                }
            }
        },
        computed: {
            totalAddForm: function () {
                var sum=(this.bank.qty_100000_add*100000)+(this.bank.qty_50000_add*50000)+(this.bank.qty_30000_add*30000)+(this.bank.qty_20000_add*20000)+
                    (this.bank.qty_15000_add*15000)+(this.bank.qty_10000_add*10000)+(this.bank.qty_5000_add*5000)+(this.bank.qty_2000_add*2000)+(this.bank.qty_1000_add*1000)+
                    (this.bank.qty_500_add*500)+(this.bank.qty_200_add*200)+(this.bank.qty_100_add*100);
                return sum;
            },
            totalSubForm: function () {
                var sum=(this.bank.qty_100000_sub*100000)+(this.bank.qty_50000_sub*50000)+(this.bank.qty_30000_sub*30000)+(this.bank.qty_20000_sub*20000)+
                    (this.bank.qty_15000_sub*15000)+(this.bank.qty_10000_sub*10000)+(this.bank.qty_5000_sub*5000)+(this.bank.qty_2000_sub*2000)+(this.bank.qty_1000_sub*1000)+
                    (this.bank.qty_500_sub*500)+(this.bank.qty_200_sub*200)+(this.bank.qty_100_sub*100);
                return sum;
            },
            totalBalance: function () {
                var sum=(this.bank.qty_100000_balance*100000)+(this.bank.qty_50000_balance*50000)+(this.bank.qty_30000_balance*30000)+(this.bank.qty_20000_balance*20000)+
                    (this.bank.qty_15000_balance*15000)+(this.bank.qty_10000_balance*10000)+(this.bank.qty_5000_balance*5000)+(this.bank.qty_2000_balance*2000)+(this.bank.qty_1000_balance*1000)+
                    (this.bank.qty_500_balance*500)+(this.bank.qty_200_balance*200)+(this.bank.qty_100_balance*100);
                return sum;
            },
            totalAddUSD: function () {
               var sum=(this.bank.qty_100_dollar_add*100)+(this.bank.qty_50_dollar_add*50)+(this.bank.qty_20_dollar_add*20)+(this.bank.qty_10_dollar_add*10)+
                    (this.bank.qty_5_dollar_add*5)+(this.bank.qty_1_dollar_add*1);
                return sum;
            },
            totalSubUSD: function () {
               var sum=(this.bank.qty_100_dollar_sub*100)+(this.bank.qty_50_dollar_sub*50)+(this.bank.qty_20_dollar_sub*20)+(this.bank.qty_10_dollar_sub*10)+
                    (this.bank.qty_5_dollar_sub*5)+(this.bank.qty_1_dollar_sub*1);
                return sum;
            },
            totalBalanceUSD: function () {
               var sum=(this.bank.qty_100_dollar_balance*100)+(this.bank.qty_50_dollar_balance*50)+(this.bank.qty_20_dollar_balance*20)+(this.bank.qty_10_dollar_balance*10)+
                    (this.bank.qty_5_dollar_balance*5)+(this.bank.qty_1_dollar_balance*1);
                return sum;
            },
        },
    };
</script>

<style lang="scss" scoped>
    .table-input tr td{
        padding-bottom: 5px;
    }
</style>