diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index 9c28bd2c..41316e59 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -1092,12 +1092,12 @@
- +
-
+
diff --git a/app/Views/driverAttendance.php b/app/Views/driverAttendance.php index 9a843fbd..25d9846d 100755 --- a/app/Views/driverAttendance.php +++ b/app/Views/driverAttendance.php @@ -377,7 +377,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); $("#attendanceModal").on("shown.bs.modal", function (e) { var id = $(e.relatedTarget).data('id'); - let fields = ['invoice_number', 'vehicle_number', 'load_type', 'salary_amount', 'food_amount','customer','quantity']; + let fields = ['invoice_number', 'vehicle_number', 'load_type', 'salary_amount', 'food_amount','customer','quantity','total_amount']; fields.forEach(function(field) { $("#" + field).val(""); @@ -398,10 +398,18 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); if(field == 'driver_id'){ $("#driver_id").val(arr && arr['driver_id']); } - if(field == 'salary_amount' || field == 'food_amount') { - var ttl = parseFloat(arr['salary_amount']) + (parseFloat(arr['food_amount'] || 0)); + var salary = arr['salary_amount'] ? parseFloat(arr['salary_amount']) : 0; + var food = arr['food_amount'] ? parseFloat(arr['food_amount']) : 0; + + if (isNaN(salary)) salary = 0; + if (isNaN(food)) food = 0; + + var ttl = salary + food; + $('#total_amount').val(ttl.toFixed(2)); + + var ttl = parseFloat(salary) + parseFloat(food) ; $('#total_amount').val(ttl.toFixed(2)); - } + }); $('#attendanceTitle').html("Edit Driver Trip"); } @@ -486,21 +494,9 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); buttons: [ 'excel', 'pdf' ], - pageLength: 10, - lengthMenu: [ - [10, 20, 30, 50, -1], - [10, 20, 30, 50, "All"] - ], responsive: false, order: false, - language: { - paginate: { - next: '', // Next button icon - previous: '' // Previous button icon - } - }, - - + paging: false, footerCallback: function (row, data, start, end, display) { var api = this.api(); var isTableEmpty = api.data().length === 0; diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php index 77861569..c4420bcf 100755 --- a/app/Views/editEmployeenew.php +++ b/app/Views/editEmployeenew.php @@ -1136,7 +1136,7 @@ if (!empty($EmpDetails)) {
- + @@ -1154,7 +1154,7 @@ if (!empty($EmpDetails)) {
-
+
@@ -1263,13 +1263,13 @@ if (!empty($EmpDetails)) {
- +
- +