<!-- Transaction Details Modal Basic -->
<div class="modal fade modalbox" id="ModalBasic" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Transaction Details</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="table-responsive">
                    <table class="table">
                        <tbody id="dailyrep"></tbody>
                        <tbody id="dailyrep1"></tbody>
                        <tbody id="dailyrep2"></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- * Transaction Details Modal Basic -->

<!-- Modal Basic 1 -->
<div class="modal fade modalbox" id="ModalBasic_1" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                 <div class="col-10">
                         <div class="form-group basic balance">
                      <div class="input-wrapper">
                <h5 class="modal-title"> <input type="text" id="form_title_1" name="form_title_1" class="form-control title text-dark" value="<?php echo $form_title_1 ?>" readonly></h5>
                </div>
                </div>
            </div>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
            </div>
            <div class="modal-body">
                <label for="field3" class="form-label" style="font-weight: bold; font-size: 14px; color: #000;"></label>

                  <div class="card-responsive">
                    <table class="card">
                      
                       <tbody id="Modalreport_1">
                          
                        </tbody>
                    </table>
                </div>
                    
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- *  Modal Basic 1 -->

<!-- Modal Basic 2 -->
<div class="modal fade modalbox" id="ModalBasic_2" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                 <div class="col-10">
                         <div class="form-group basic balance">
                      <div class="input-wrapper">
                <h5 class="modal-title"> <input type="text" id="form_title_2" name="form_title_2" class="form-control title text-dark" value="<?php echo $form_title_2 ?>" readonly></h5>
                </div>
                </div>
            </div>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
            </div>
            <div class="modal-body">
                <label for="field3" class="form-label" style="font-weight: bold; font-size: 14px; color: #000;"></label>

                  <div class="card-responsive">
                    <table class="card">
                      
                       <tbody id="Modalreport_2">
                          
                        </tbody>
                    </table>
                </div>
                    
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- *  Modal Basic 2 -->

<!-- Modal Basic 3 -->
<div class="modal fade modalbox" id="ModalBasic_3" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                 <div class="col-10">
                         <div class="form-group basic balance">
                      <div class="input-wrapper">
                <h5 class="modal-title"> <input type="text" id="form_title_3" name="form_title_3" class="form-control title text-dark" value="<?php echo $form_title_3 ?>" readonly></h5>
                </div>
                </div>
            </div>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
            </div>
            <div class="modal-body">
                <label for="field3" class="form-label" style="font-weight: bold; font-size: 14px; color: #000;"></label>

                  <div class="card-responsive">
                    <table class="card">
                      
                       <tbody id="Modalreport_3">
                          
                        </tbody>
                    </table>
                </div>
                    
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- *  Modal Basic 3 -->

<!-- Modal Basic 4 -->
<div class="modal fade modalbox" id="ModalBasic_4" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                 <div class="col-10">
                         <div class="form-group basic balance">
                      <div class="input-wrapper">
                <h5 class="modal-title"> <input type="text" id="form_title_4" name="form_title_4" class="form-control title text-dark" value="Transaction Details" readonly></h5>
                </div>
                </div>
            </div>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
            </div>
            <div class="modal-body">
                <label for="field3" class="form-label" style="font-weight: bold; font-size: 14px; color: #000;"></label>

                  <div class="modal-body">
                <div class="table-responsive">
                    <table class="table">
                        <tbody id="header"></tbody>
                        <tbody id="body"></tbody>
                        <tbody id="entry"></tbody>
                    </table>
                </div>
            </div>
                    
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- *  Modal Basic 4 -->

<!--Cash Adjustment Modal  -->
        <div class="modal fade modalbox" id="cashadjModal" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Account Balance Adjustment</h5>
                        <a href="javascript:;" data-dismiss="modal">Close</a>
                    </div>
                    <div class="modal-body">
                <form id="cshadjForm">

                <div id="permissionRows">

                    <!-- First Row -->
                    <div class="perm-row row mb-2">
                       
                          <div class="form-group   col-md-3">
                            <div class="live-search-wrapper"
                                     data-endpoint="fetch_scripts/get_account.php"
                                     data-hidden-name="acc1_id"
                                     data-display-fields="acc_name"
                                     data-value-field="id">
                                
                                    <label class="label">Account</label>
                                
                                    <!-- ❌ REMOVE name from text input -->
                                    <input type="text"
                                           class="form-control liveSearchInput"
                                           placeholder="Search..."
                                           autocomplete="on">
                                
                                    <!-- ✅ ADD name here instead -->
                                    <input type="hidden"
                                           class="liveHiddenInput"
                                           name="acc1_id">
                                
                                    <div class="liveResults"></div>
                                </div>
                        </div>
                        
                        <div class="form-group   col-md-2">
                            <div class="input-wrapper">
                            <label class="label" for="name2">Date</label>
                              <input type="date"  name="date_adj" class="form-control text-dark"  required>
                            </div>
                        </div>
                        
                        <div class="form-group   col-md-3">
                            <div class="input-wrapper">
                            <label class="label" for="name2">To Credit By</label>
                              <input type="text"  name="adj_credit" class="form-control text-dark"  >
                            </div>
                        </div>
                        
                        <div class="form-group   col-md-3">
                            <div class="input-wrapper">
                            <label class="label" for="name2">To Debit By</label>
                              <input type="text"  name="adj_debit" class="form-control text-dark"  >
                            </div>
                        </div>
                     
                        <div class="form-group basic col-md-2 d-flex align-items-center">
                           
                        </div>
                    </div>

                </div>

                <div class="form-group basic mt-2">
                    <div class="right" style="position: fixed; right: 20px; center: 20px; z-index: 9999;">
                    <div id="liveToastContainer"></div>
                </div>
                   
                </div>

                <div class="mt-3">
                    <button type="submit" class="btn btn-primary btn-block">
                        Adjust account Balance
                    </button>
                </div>

            </form>

        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- * Cash Adjustment Modal -->
        
<!--Cosing Cash Modal  -->
        <div class="modal fade modalbox" id="closecashModal" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Closing Cash</h5>
                        <a href="javascript:;" data-dismiss="modal">Close</a>
                    </div>
                    <div class="modal-body">
                <form id="closecashForm">

                <div id="permissionRows">

                    <!-- First Row -->
                    <div class="perm-row row mb-2">
                        
                        <div class="form-group   col-md-2">
                            <div class="input-wrapper">
                            <label class="label" for="name2">Date</label>
                              <input type="date"  name="date_close" class="form-control text-dark"  required>
                            </div>
                        </div>
                       
                          <div class="form-group   col-md-3">
                            <div class="live-search-wrapper"
                                     data-endpoint="fetch_scripts/get_cash_accounts.php"
                                     data-hidden-name="acc2_id"
                                     data-display-fields="acc_name"
                                     data-value-field="id">
                                
                                    <label class="label">Account</label>
                                
                                    <!-- ❌ REMOVE name from text input -->
                                    <input type="text"
                                           class="form-control liveSearchInput"
                                           placeholder="Search..."
                                           autocomplete="on">
                                
                                    <!-- ✅ ADD name here instead -->
                                    <input type="hidden"
                                           class="liveHiddenInput"
                                           name="acc2_id">
                                
                                    <div class="liveResults"></div>
                                </div>
                        </div>
                        
                        
                        
                        <div class="form-group   col-md-3">
                            <div class="input-wrapper">
                            <label class="label" for="name2">Amount</label>
                              <input type="text"  name="bal_credit" class="form-control text-dark"  >
                            </div>
                        </div>
                        
                        
                     
                        <div class="form-group basic col-md-2 d-flex align-items-center">
                           
                        </div>
                    </div>

                </div>

                <div class="form-group basic mt-2">
                    <div class="right" style="position: fixed; right: 20px; center: 20px; z-index: 9999;">
                    <div id="liveToastContainer"></div>
                </div>
                   
                </div>

                <div class="mt-3">
                    <button type="submit" class="btn btn-primary btn-block">
                        Submit
                    </button>
                </div>

            </form>

        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- *END  Close Cash  Modal -->

<!-- Statement Basic 5 -->
<div class="modal fade modalbox" id="Statement_run" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                 <div class="col-4">
                         <div class="form-group basic balance">
                      <div class="input-wrapper">
                <h5 class="modal-title"> <input type="text" id="statement_run_title" name="statement_run_title" class="form-control title text-dark" value="<?php echo $statement_run_title ?>" readonly></h5>
                </div>
                </div>
            </div>
            <input type="hidden" id="accountno" name="accountno" class="hidden hidden-fields"  readonly>
            <input type="hidden" id="stt_type" name="stt_type" class="hidden hidden-fields"  readonly>
            <div class="mb-2">
    <button id="exportExcel" class="btn btn-success btn-sm">Excel</button>
    <button id="exportPDF" class="btn btn-danger btn-sm">PDF</button>
</div>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
            </div>
            <div class="modal-body">
                  <div class="table-responsive" id="sttrunScroll" style="max-height:600px; overflow-y:auto;">
                    <table class="table">
                         <thead>
                        <tr>
                            <th>Date</th>
                            <th>Doc No.</th>
                            <th>Particulars</th>
                            <th>T.Type</th>
                            <th>Credit</th>
                            <th>Debit</th>
                            <th>Balance</th>
                        </tr>
                    </thead>
                      
                       <tbody id="statementrun">
                          
                        </tbody>
                    </table>
                </div>
                    
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- * Statement Modal Basic 5 -->

<!-- Search Statement Basic 6 -->
<div class="modal fade modalbox" id="Search_Statement_run" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                 <div class="col-4">
                         <div class="form-group basic balance">
                      <div class="input-wrapper">
                <h5 class="modal-title"> <input type="text" id="report1" name="report1" class="form-control title text-dark"  readonly></h5>
                <div class="input-wrapper mt-0">
                <input style="width: 40%;" type="date" id="datestt1" name="datestt1"  class="form-control" >
                
                </div>
                </div>
                </div>
            </div>
            <input type="hidden" id="acc_def1" name="acc_def1" class="hidden hidden-fields"  readonly>
            <input type="hidden" id="stt_type" name="stt_type" class="hidden hidden-fields"  readonly>
            
            <div class="form-group basic balance">
            <input style="width: 40%;" type="text" id="accnm1" name="accnm1"  class="form-control title text-dark" >
            </div>
                    <div class="mb-2">
    <button id="Excelcshmvt" class="btn btn-success btn-sm">Excel</button>
    <button id="PDFcshmvt" class="btn btn-danger btn-sm">PDF</button>
</div>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
            </div>
            <div class="modal-body">
                <div class="card mt-5">
                  <div class="table-responsive" id="srch_sttrunScroll" style="max-height:600px; overflow-y:auto;">
                   <table class="table">
                        
                      <thead id="dynamic_header"></thead>
                       <tbody id="search_statementrun">
                          
                        </tbody>
                    </table>
                </div>
                     </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- * Search Statement Modal Basic 6 -->

<!-- Select Bank Or Transfer Form -->
        <div class="modal fade dialogbox" id="Bnk_TFR_SelectFormModal" data-backdrop="static" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Select Action</h5>
                    </div>
                    <form id="InvoiceSelector">
                        <div class="modal-body text-left mb-2">
                            
                            <div class="form-group basic">
                                    <button type="button" class="btn btn-success btn-block btn-md" id="bnkLink"> Banking</button>
                                </div>

                                 <div class="form-group basic">
                                    <button type="button" class="btn btn-info btn-block btn-md" id="ctfrLink"> Transfer</button>
                                </div>

                           
                        </div>
                        <div class="modal-footer">
                            <div class="btn-inline">
                                
                                <button type="button" class="btn btn-text-primary cancelbnkTFRselect" >Cancel</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- * Select Bank Or Transfer Form -->


<!-- Select Invoice Type Form -->
        <div class="modal fade dialogbox" id="InvoiceSelectFormModal" data-backdrop="static" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Select Invoice Type</h5>
                    </div>
                    <form id="InvoiceSelector">
                        <div class="modal-body text-left mb-2">
                            
                            <div class="form-group basic">
                                    <button type="button" class="btn btn-warning btn-block btn-md" id="csinvLink">Cash Invoice</button>
                                </div>

                                 <div class="form-group basic">
                                    <button type="button" class="btn btn-danger btn-block btn-md" id="stkinvLink">Stock Invoice</button>
                                </div>

                           
                        </div>
                        <div class="modal-footer">
                            <div class="btn-inline">
                                
                                <button type="button" class="btn btn-text-primary cancelinvoiceselect" >Cancel</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- * Select Invoice Type Form -->    
        
        
        <!-- Select Cash Movement Report Account -->
        <div class="modal fade dialogbox" id="AccountSelectFormModal" data-backdrop="static" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Select Account</h5>
                    </div>
                    <div class="table-responsive">
                    <table class="table">
                      
                       <tbody id="Accountselect">
                          
                        </tbody>
                    </table>
                    <div class="modal-footer">
                        <div class="btn-inline">
                            <button type="button" class="btn btn-text-primary cancel_csh_mvt_select" >Cancel</button>
                        </div>
                    </div>
                </div>
                </div>
            </div>
        </div>
        <!-- * Select Cash Movement Report Account-->  