Merged in pipi/main/stok-backdate (pull request #33)
merge stock audit backdate, add excel in stock audit backdate and ujrah and untung column added, also fix dashboard years
This commit is contained in:
@@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Http;
|
||||
use Carbon\Carbon;
|
||||
|
||||
use Barryvdh\DomPDF\Facade as PDF;
|
||||
use Maatwebsite\Excel\Excel;
|
||||
// use Maatwebsite\Excel\Excel;
|
||||
use DateTime;
|
||||
|
||||
use App\Models\Lejeram;
|
||||
@@ -17,6 +17,9 @@ use App\Models\Cawangan;
|
||||
use App\Services\ImbangdugaServices as ImbanganDuga;
|
||||
use App\Services\RingkasanHarianServices;
|
||||
|
||||
use App\Exports\Laporan\StokAuditBackdateExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class AkaunController extends Controller
|
||||
{
|
||||
public function viewlejeram(Request $request)
|
||||
@@ -892,7 +895,13 @@ class AkaunController extends Controller
|
||||
|
||||
$stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokaudit/backdate',['kodcaw' => $kodcaw,'tahun'=>$tahun,'bulan'=>$bulan])->json();
|
||||
|
||||
return view('akaun.laporan_stokauditbackdate', compact('stokaudit','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
$file_title = sprintf("Laporan-StokAuditBackdate %s (%s - %s).xlsx", $kodcaw, $bulan, $tahun);
|
||||
|
||||
if(isset($request->jenis))
|
||||
if($request->jenis == 'excel')
|
||||
return Excel::download(new StokAuditBackdateExport($stokaudit['rekod']), $file_title);
|
||||
else
|
||||
return view('akaun.laporan_stokauditbackdate', compact('stokaudit','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<span style="background-color: #F9FAFB" class="text-gray-600 border border-2 rounded-l px-4 py-2 whitespace-no-wrap">Mula</span>
|
||||
<!-- <input id="tarikhmula" name="datestokauditbackdate" class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2" type="date" /> -->
|
||||
<flat-pickr v-model="mula" :config="config" class="border border-2 rounded-r px-4 py-2 w-80r mr-2"></flat-pickr>
|
||||
<!-- <button @click.prevent="generatepdf" class=" mr-2 border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"><i class="fas fa-file-pdf mr-2"></i>PDF</button> -->
|
||||
<button @click.prevent="generateexcel" class=" mr-2 border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"><i class="fas fa-file-excel mr-2"></i>Excel</button>
|
||||
<button @click.prevent="generateview" class="border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"><i class="fas fa-eye mr-2"></i>View</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,21 +64,21 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// async generatepdf(){
|
||||
// await this.setJenis('pdf');
|
||||
async generateexcel(){
|
||||
await this.setJenis('excel');
|
||||
|
||||
|
||||
// Vue.swal({
|
||||
// title: 'Memuatkan...',
|
||||
// allowEscapeKey : false,
|
||||
// allowOutsideClick: false,
|
||||
// showCancelButton: false,
|
||||
// showConfirmButton: false,
|
||||
// timer: 8000,
|
||||
// });
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
// document.getElementById("formringkasanharian").submit();
|
||||
// },
|
||||
document.getElementById("formstokauditbackdate").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<div class="p-2.5 -mt-3 font-bold">TAHUN : </div>
|
||||
<select v-model="selected" class="w-1/12 bg-white mb-2 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
<option value="2022">2022</option>
|
||||
<option value="2023">2023</option>
|
||||
<option v-for="year in availableYears" :key="year" :value="year">{{ year }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="w-full grid grid-cols-1 xl:grid-cols-3 2xl:grid-cols-3 gap-4">
|
||||
@@ -49,7 +48,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selected: '2023',
|
||||
selected: new Date().getFullYear().toString(),
|
||||
}
|
||||
},
|
||||
created(){
|
||||
@@ -67,5 +66,17 @@ export default {
|
||||
this.$refs.tahunan.getDataKeuntungan();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
availableYears() {
|
||||
const currentYear = new Date().getFullYear();
|
||||
const years = [];
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
years.push(currentYear - i);
|
||||
}
|
||||
|
||||
return years;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>>
|
||||
</script>
|
||||
@@ -206,6 +206,8 @@
|
||||
<th>Kadar Upah</th>
|
||||
<th>Tempoh Belum Bayar</th>
|
||||
<th>Keuntungan Belum Bayar (RM)</th>
|
||||
<th>Utg 1%(RM) </th>
|
||||
<th>Ujrah(RM)</th>
|
||||
<th>Lanjutan</th>
|
||||
</thead>
|
||||
@php $counter = 1;$totalpinjaman = 0; @endphp
|
||||
@@ -222,6 +224,8 @@
|
||||
<td>{{ number_format($item['kadarupah'],2) }}</td>
|
||||
<td>{{ number_format($item['tempohblmbyar'],2) }}</td>
|
||||
<td>{{ number_format($item['upahblmbyar'],2) }}</td>
|
||||
<td>{{ number_format($item['utgonepercent'],2) }}</td>
|
||||
<td> {{ number_format($item['ujrah'],2) }} </td>
|
||||
<td>{{$item['lanjutan']}}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@@ -235,6 +239,8 @@
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>{{ number_format($stokaudit['totaltunggakan'],2) }}</th>
|
||||
<th>{{ (isset($stokaudit['totalonepercent'])) ? number_format($stokaudit['totalonepercent'],2) : 0 }}</th>
|
||||
<th>{{ (isset($stokaudit['totalujrah'])) ? number_format($stokaudit['totalujrah'],2) : 0 }}</th>
|
||||
<th></th>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user