File: /var/www/html/taxicamera/applicationold/views/admin/daily_settlement/daily_settlement.php
<style>
.chk_custom_box .checkmark {
position: absolute;
top: -10px;
left: 0;
height: 18px;
width: 18px;
background-color: #dad7d7;
}
</style>
<div class="main-content">
<div class="content-wrapper">
<div class="container-fluid">
<?php if ($this->session->flashdata('success_msg')) : ?>
<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
<?php echo $this->session->flashdata('success_msg') ?>
</div>
<?php endif ?>
<?php if ($this->session->flashdata('error_msg')) : ?>
<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
<?php echo $this->session->flashdata('error_msg') ?>
</div>
<?php endif ?><!-- Basic form layout section start -->
<section id="basic-form-layouts">
<div class="row">
<!--<div class="col-sm-12">
<h2 class="content-header">Company Master</h2>
</div>-->
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="page-title-wrap">
<h4 class="card-title">Daily Settlement</h4>
<!--<h5 class="card_date"><span>Date</span> : 28-08-2019</h5>-->
<form id="date_wise_settlement" action="<?=base_url('admin/dailysettlement')?>" method="POST">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label>Date</label>
<div class="input-group">
<input type="text" class="form-control pickadate" id="settlement_date" name="settlement_date" placeholder="" value="<?=($transaction_date)?$transaction_date:''?>"/>
<div class="input-group-append">
<span class="input-group-text">
<span class="fa fa-calendar-o"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</form>
<!--<a class="title_btn t_btn_list" href="company-master-list.html"><span><i class="fa fa-list-ul" aria-hidden="true"></i></span> Company List</a>-->
</div>
</div>
<div class="card-body">
<div class="px-3">
<form id="daily_settlement_submit" method="POST" class="form custom_form_style" action=<?=base_url('admin/dailysettlement/daily_settle_submit')?>>
<input type="hidden" id="settlement_date_hid" name="settlement_date_hid" value="">
<div class="form-body">
<!--<h4 class="form-section">
<i class="icon-user"></i> Personal Details</h4>-->
<div class="daily_settlement_top">
<div class="row ">
<div class="col-md-6">
<div class="daily_stl_top_box">
<h4 class="cash_summary">Opening Balance
<span class="pull-right">
$<?=isset($opening_balance['total_amount'])?number_format($opening_balance['total_amount'],2):'0.00'?>
</span>
</h4>
<h4 class="cash_summary">Cash In Summary
<?php if(empty($settlement_data)){?>
<span class="pull-right">
<a href="" class="" data-toggle="modal" data-target="#default2">Add Money</a>
</span>
<?php } ?>
</h4>
<div class="table-responsive custom_table_area">
<table class="table table-striped table-bordered daily_stl_table" id="cash_in_table">
<thead>
<tr>
<th style="min-width: 140px;">Notes</th>
<th>Qty</th>
<th style="min-width: 100px;">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>5c Coins</td>
<td><?=isset($cash_in_data['5c_coins_qty'])?$cash_in_data['5c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['5c_coins_amt'])?$cash_in_data['5c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>10c Coins</td>
<td><?=isset($cash_in_data['10c_coins_qty'])?$cash_in_data['10c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['10c_coins_amt'])?$cash_in_data['10c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>20c Coins</td>
<td><?=isset($cash_in_data['20c_coins_qty'])?$cash_in_data['20c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['20c_coins_amt'])?$cash_in_data['20c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>50c Coins</td>
<td><?=isset($cash_in_data['50c_coins_qty'])?$cash_in_data['50c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['50c_coins_amt'])?$cash_in_data['50c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>1$ Coins</td>
<td><?=isset($cash_in_data['1d_coins_qty'])?$cash_in_data['1d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['1d_coins_amt'])?$cash_in_data['1d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>2$ Coins</td>
<td><?=isset($cash_in_data['2d_coins_qty'])?$cash_in_data['2d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['2d_coins_amt'])?$cash_in_data['2d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>5$ Notes</td>
<td><?=isset($cash_in_data['5d_notes_qty'])?$cash_in_data['5d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['5d_notes_amt'])?$cash_in_data['5d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>10$ Notes</td>
<td><?=isset($cash_in_data['10d_notes_qty'])?$cash_in_data['10d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['10d_notes_amt'])?$cash_in_data['10d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>20$ Notes</td>
<td><?=isset($cash_in_data['20d_notes_qty'])?$cash_in_data['20d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['20d_notes_amt'])?$cash_in_data['20d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>50$ Notes</td>
<td><?=isset($cash_in_data['50d_notes_qty'])?$cash_in_data['50d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['50d_notes_amt'])?$cash_in_data['50d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>100$ Notes</td>
<td><?=isset($cash_in_data['100d_notes_qty'])?$cash_in_data['100d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in_data['100d_notes_amt'])?$cash_in_data['100d_notes_amt'] : ''?></td>
</tr>
<tr>
<td colspan="2" style="color: #0c6eea;font-weight: 500;">Total</td>
<td class="td_amount_right" style="color: #0c6eea;font-weight: 500;"><span class="currency_span">$ </span><?=isset($cash_in_data['total_amount'])?$cash_in_data['total_amount'] : ''?></td>
</tr>
<?php if(!empty($cash_in_details)){ ?>
<?php foreach($cash_in_details as $key => $cash_in) { ?>
<tr class="cash_in_tr_cls" data-toggle="collapse" data-target="#cash_in_sub_<?=$key?>" data-parent="#cash_in_table">
<td colspan="2"><?=$cash_in['transaction_desc']?>
<span style="width:auto;float:right;font-size: 12px;">
<i class="fa fa-plus" aria-hidden="true"></i>
</span>
</td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=$cash_in['total_amount']?></td>
</tr>
<tr id="cash_in_sub_<?=$key?>" class="collapse">
<td colspan="3" class="pad0LR">
<table class="table table-striped table-bordered daily_stl_table">
<thead>
<tr>
<th style="min-width: 140px;background:#1db5bd;">Notes</th>
<th style="background:#1db5bd;">Qty</th>
<th style="min-width: 100px;background:#1db5bd;">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>5c Coins</td>
<td><?=isset($cash_in['5c_coins_qty'])?$cash_in['5c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['5c_coins_amt'])?$cash_in['5c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>10c Coins</td>
<td><?=isset($cash_in['10c_coins_qty'])?$cash_in['10c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['10c_coins_amt'])?$cash_in['10c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>20c Coins</td>
<td><?=isset($cash_in['20c_coins_qty'])?$cash_in['20c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['20c_coins_amt'])?$cash_in['20c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>50c Coins</td>
<td><?=isset($cash_in['50c_coins_qty'])?$cash_in['50c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['50c_coins_amt'])?$cash_in['50c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>1$ Coins</td>
<td><?=isset($cash_in['1d_coins_qty'])?$cash_in['1d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['1d_coins_amt'])?$cash_in['1d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>2$ Coins</td>
<td><?=isset($cash_in['2d_coins_qty'])?$cash_in['2d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['2d_coins_amt'])?$cash_in['2d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>5$ Notes</td>
<td><?=isset($cash_in['5d_notes_qty'])?$cash_in['5d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['5d_notes_amt'])?$cash_in['5d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>10$ Notes</td>
<td><?=isset($cash_in['10d_notes_qty'])?$cash_in['10d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['10d_notes_amt'])?$cash_in['10d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>20$ Notes</td>
<td><?=isset($cash_in['20d_notes_qty'])?$cash_in['20d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['20d_notes_amt'])?$cash_in['20d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>50$ Notes</td>
<td><?=isset($cash_in['50d_notes_qty'])?$cash_in['50d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['50d_notes_amt'])?$cash_in['50d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>100$ Notes</td>
<td><?=isset($cash_in['100d_notes_qty'])?$cash_in['100d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_in['100d_notes_amt'])?$cash_in['100d_notes_amt'] : ''?></td>
</tr>
<tr>
<td colspan="2" style="color: #0c6eea;font-weight: 500;">Total</td>
<td class="td_amount_right" style="color: #0c6eea;font-weight: 500;"><span class="currency_span">$ </span><?=isset($cash_in['total_amount'])?$cash_in['total_amount'] : ''?></td>
</tr>
</tbody>
</table>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-6">
<div class="daily_stl_top_box">
<h4 class="cash_summary">Cash In Hand
<span class="pull-right">
<?php
$cash_in_total=isset($cash_in_data['total_amount'])?$cash_in_data['total_amount']:0;
$cash_out_total=isset($cash_out_data['total_amount'])?$cash_out_data['total_amount']:0;
$cash_in_hand = $cash_in_total - $cash_out_total;
?>
$<?=number_format($cash_in_hand,2)?>
</span>
</h4>
<h4 class="cash_summary">Cash Out Summary
<?php if(empty($settlement_data)){?>
<span class="pull-right">
<a href="" class="" data-toggle="modal" data-target="#cash_out_modal">Add Money</a>
</span>
<?php } ?>
</h4>
<div class="table-responsive custom_table_area">
<table class="table table-striped table-bordered daily_stl_table" id="cash_out_table">
<thead>
<tr>
<th style="min-width: 140px;">Notes</th>
<th>Qty</th>
<th style="min-width: 100px;">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>5c Coins</td>
<td><?=isset($cash_out_data['5c_coins_qty'])?$cash_out_data['5c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['5c_coins_amt'])?$cash_out_data['5c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>10c Coins</td>
<td><?=isset($cash_out_data['10c_coins_qty'])?$cash_out_data['10c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['10c_coins_amt'])?$cash_out_data['10c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>20c Coins</td>
<td><?=isset($cash_out_data['20c_coins_qty'])?$cash_out_data['20c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['20c_coins_amt'])?$cash_out_data['20c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>50c Coins</td>
<td><?=isset($cash_out_data['50c_coins_qty'])?$cash_out_data['50c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['50c_coins_amt'])?$cash_out_data['50c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>1$ Coins</td>
<td><?=isset($cash_out_data['1d_coins_qty'])?$cash_out_data['1d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['1d_coins_amt'])?$cash_out_data['1d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>2$ Coins</td>
<td><?=isset($cash_out_data['2d_coins_qty'])?$cash_out_data['2d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['2d_coins_amt'])?$cash_out_data['2d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>5$ Notes</td>
<td><?=isset($cash_out_data['5d_notes_qty'])?$cash_out_data['5d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['5d_notes_amt'])?$cash_out_data['5d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>10$ Notes</td>
<td><?=isset($cash_out_data['10d_notes_qty'])?$cash_out_data['10d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['10d_notes_amt'])?$cash_out_data['10d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>20$ Notes</td>
<td><?=isset($cash_out_data['20d_notes_qty'])?$cash_out_data['20d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['20d_notes_amt'])?$cash_out_data['20d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>50$ Notes</td>
<td><?=isset($cash_out_data['50d_notes_qty'])?$cash_out_data['50d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['50d_notes_amt'])?$cash_out_data['50d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>100$ Notes</td>
<td><?=isset($cash_out_data['100d_notes_qty'])?$cash_out_data['100d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out_data['100d_notes_amt'])?$cash_out_data['100d_notes_amt'] : ''?></td>
</tr>
<tr>
<td colspan="2" style="color: #0c6eea;font-weight: 500;">Total</td>
<td class="td_amount_right" style="color: #0c6eea;font-weight: 500;"><span class="currency_span">$ </span><?=isset($cash_out_data['total_amount'])?$cash_out_data['total_amount'] : ''?></td>
</tr>
<?php if(!empty($cash_out_details)){ ?>
<?php foreach($cash_out_details as $key=> $cash_out) { ?>
<tr class="cash_out_tr_cls" data-toggle="collapse" data-target="#cash_out_sub_<?=$key?>" data-parent="#cash_out_table">
<td colspan="2"><?=$cash_out['transaction_desc']?>
<span style="width:auto;float:right;font-size: 12px;">
<i class="fa fa-plus" aria-hidden="true"></i>
</span>
</td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=$cash_out['total_amount']?></td>
</tr>
<tr id="cash_out_sub_<?=$key?>" class="collapse">
<td colspan="3">
<table class="table table-striped table-bordered daily_stl_table">
<thead>
<tr>
<th style="min-width: 140px;background:#1db5bd;">Notes</th>
<th style="background:#1db5bd;">Qty</th>
<th style="min-width: 100px;background:#1db5bd;">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>5c Coins</td>
<td><?=isset($cash_out['5c_coins_qty'])?$cash_out['5c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['5c_coins_amt'])?$cash_out['5c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>10c Coins</td>
<td><?=isset($cash_out['10c_coins_qty'])?$cash_out['10c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['10c_coins_amt'])?$cash_out['10c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>20c Coins</td>
<td><?=isset($cash_out['20c_coins_qty'])?$cash_out['20c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['20c_coins_amt'])?$cash_out['20c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>50c Coins</td>
<td><?=isset($cash_out['50c_coins_qty'])?$cash_out['50c_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['50c_coins_amt'])?$cash_out['50c_coins_amt'] : ''?></td>
</tr>
<tr>
<td>1$ Coins</td>
<td><?=isset($cash_out['1d_coins_qty'])?$cash_out['1d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['1d_coins_amt'])?$cash_out['1d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>2$ Coins</td>
<td><?=isset($cash_out['2d_coins_qty'])?$cash_out['2d_coins_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['2d_coins_amt'])?$cash_out['2d_coins_amt'] : ''?></td>
</tr>
<tr>
<td>5$ Notes</td>
<td><?=isset($cash_out['5d_notes_qty'])?$cash_out['5d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['5d_notes_amt'])?$cash_out['5d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>10$ Notes</td>
<td><?=isset($cash_out['10d_notes_qty'])?$cash_out['10d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['10d_notes_amt'])?$cash_out['10d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>20$ Notes</td>
<td><?=isset($cash_out['20d_notes_qty'])?$cash_out['20d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['20d_notes_amt'])?$cash_out['20d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>50$ Notes</td>
<td><?=isset($cash_out['50d_notes_qty'])?$cash_out['50d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['50d_notes_amt'])?$cash_out['50d_notes_amt'] : ''?></td>
</tr>
<tr>
<td>100$ Notes</td>
<td><?=isset($cash_out['100d_notes_qty'])?$cash_out['100d_notes_qty'] : ''?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=isset($cash_out['100d_notes_amt'])?$cash_out['100d_notes_amt'] : ''?></td>
</tr>
<tr>
<td colspan="2" style="color: #0c6eea;font-weight: 500;">Total</td>
<td class="td_amount_right" style="color: #0c6eea;font-weight: 500;"><span class="currency_span">$ </span><?=isset($cash_out['total_amount'])?$cash_out['total_amount'] : ''?></td>
</tr>
</tbody>
</table>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-12">
<!--<h4 class="form-section">Docket Details:</h4>
<br>-->
<div class="table-responsive custom_table_area">
<table class="table table-striped table-bordered daily_stl_table" id="docket_table">
<thead>
<tr>
<th>Docket Summary</th>
<th>Amount</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if(!empty($docket_header)){
foreach($docket_header as $key => $header){ ?>
<tr class="docket_tr_cls" data-toggle="collapse" data-target="#docket_sub_<?=$key?>" data-parent="#docket_table">
<td><?=$header['docket_name']?><span class="plus_minus" style="width:auto;float:right;font-size: 12px;">
<i class="fa fa-plus" aria-hidden="true"></i>
</span></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=$header['total_amount']?></td>
<td class="text-center">
<span>
<label class="chk_custom_box">
<input type="checkbox" class="docket_checkbox" <?=(!empty($settlement_data))?'checked':''?>>
<span class="checkmark"></span>
</label>
</span>
</td>
</tr>
<tr id="docket_sub_<?=$key?>" class="collapse">
<td colspan="3">
<table class="table table-striped table-bordered daily_stl_table">
<thead>
<tr>
<th style="min-width: 140px;background:#1db5bd;">Driver</th>
<th style="min-width: 100px;background:#1db5bd;">Shift No</th>
<th style="background:#1db5bd;">Amount</th>
</tr>
</thead>
<tbody>
<?php if(!empty($docket_details)){
foreach($docket_details as $key => $details){
if($details['docket_id'] == $header['docket_id']){?>
<tr>
<td><?=$details['first_name'].'-'.$details['dc_no']?></td>
<td><?=$details['shift_no']?></td>
<td class="td_amount_right"><span class="currency_span">$ </span><?=$details['docket_settlement_amt']?></td>
</tr>
<?php } } } ?>
</tbody>
</table>
</td>
</tr>
<?php } }else { ?>
<tr>
<td colspan="3">No Data Available</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label>Remarks</label>
<div class="input-group">
<textarea class="form-control" id="remarks" name="remarks" placeholder="" row="4" col="80"><?=(!empty($settlement_data))?$settlement_data['remarks']:''?></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-actions" style="text-align:center;">
<?php if(empty($settlement_data)){?>
<button id="daily_settlement_submit_btn" type="button" class="btn btn-success">
<i class="fa fa-floppy-o" aria-hidden="true"></i> Close Settlement
</button>
<?php }else{ ?>
<button type="button" class="btn btn-success">
<i class="fa fa-floppy-o" aria-hidden="true"></i> Settlement Done Successfully
</button>
<?php } ?>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- // Basic form layout section end -->
</div>
</div>
</div>
<script>
var licence_exp_min_date = new Date();
licence_exp_min_date.setDate(licence_exp_min_date.getDate() + 1);
$(document).ready(function(){
$('#settlement_date').pickadate({
format: 'dd/mm/yyyy',
max: new Date(),
selectYears: true,
selectMonths: true,
disable: [1,7]
});
})
$("#settlement_date").change(function(){
if($(this).val()){
$("#date_wise_settlement").submit();
}
})
$(document).on('keyup','.calculate_amt',function(){
var qty = $(this).val();
var dollar_price = $(this).data('dollar_price');
var amount = parseFloat(Number(qty) * Number(dollar_price)).toFixed(2);
$(this).next('input[type=hidden]').val(amount);
$(this).parent().parent().children('.dollar_amount').html(amount);
calculate_total_amount();
})
function calculate_total_amount(){
var total_amount =0 * 1;
$('.dollar_amount').each(function(){
total_amount +=Number($(this).text());
})
$(".total_amount").text(parseFloat(total_amount).toFixed(2));
$("#total_amount").val(total_amount);
$("#total_amount_out").val(total_amount);
}
$(document).on("submit","#add_money_form",function(e){
e.preventDefault();
if($("#total_amount").val() < 1){
$.alert({
type: 'red',
title: 'Alert!',
content: 'Minimum 1$ required',
});
}
else if(($("#customer_id").val()) ==''){
$.alert({
type: 'red',
title: 'Alert!',
content: 'Please select customer',
});
}
else{
var senddata =$(this).serializeArray()
$.ajax({
url: "<?=base_url('admin/dailysettlement/add_money')?>",
type: "POST",
data: senddata,
dataType: "json",
encode: true,
async: false
})
.done(function(data) {
if (data.status) {
$.alert({
type: 'green',
title: 'Money Added',
content: data.msg,
});
setTimeout(function(){ location.reload() }, 2000);
} else {
$.alert({
type: 'red',
title: 'Alert!',
content: data.msg,
});
}
})
.fail(function(result) {
$.alert({
type: 'red',
title: 'Alert!',
content: 'Oops!Something went wrong...',
});
})
}
})
$(document).on("submit","#add_cash_out_money_form",function(e){
e.preventDefault();
if($("#total_amount_out").val() < 1){
$.alert({
type: 'red',
title: 'Alert!',
content: 'Minimum 1$ required',
});
}
else if(($("#customer_id_out").val()) ==''){
$.alert({
type: 'red',
title: 'Alert!',
content: 'Please select customer',
});
}
else{
var senddata =$(this).serializeArray()
$.ajax({
url: "<?=base_url('admin/dailysettlement/add_money_cash_out')?>",
type: "POST",
data: senddata,
dataType: "json",
encode: true,
async: false
})
.done(function(data) {
if (data.status) {
$.alert({
type: 'green',
title: 'Cash Out Added',
content: data.msg,
});
setTimeout(function(){ location.reload() }, 2000);
} else {
$.alert({
type: 'red',
title: 'Alert!',
content: data.msg,
});
}
})
.fail(function(result) {
$.alert({
type: 'red',
title: 'Alert!',
content: 'Oops!Something went wrong...',
});
})
}
})
$(document).on("click","#daily_settlement_submit_btn",function(e){
$("#settlement_date_hid").val($("#settlement_date").val());
var checked = true;
$('.docket_checkbox').each(function () {
if ($(this).is(':checked')) {
checked=true;
}
else{checked = false;}
});
if(checked && $("#settlement_date").val()){
$("#daily_settlement_submit").submit();
} else {
$.alert({type: 'red',title: 'Alert!',content: 'Please fill all the checkboxes & settlement date'});
}
})
$(document).on('click','.cash_in_tr_cls,.cash_out_tr_cls',function(){
if($(this).hasClass('collapsed')){
$(this).find('td:first-child span').html('<i class="fa fa-plus" aria-hidden="true"></i>');
}
else{
$(this).find('td:first-child span').html('<i class="fa fa-minus" aria-hidden="true"></i>');
}
})
$(document).on('click','.docket_tr_cls:not(:input[type=checkbox])',function(){
if($(this).hasClass('collapsed')){
$(this).find('td:last-child .plus_minus').html('<i class="fa fa-plus" aria-hidden="true"></i>');
}
else{
$(this).find('td:last-child .plus_minus').html('<i class="fa fa-minus" aria-hidden="true"></i>');
}
})
</script>