add laporan pengeluaran, add pengeluaran
parent
fc9557d37f
commit
28ed616aa1
|
@ -90,3 +90,7 @@ function RemoveSpecialCharPlus($str)
|
|||
// Returning the result
|
||||
return $res;
|
||||
}
|
||||
|
||||
function toDmy($date){
|
||||
return date("d-m-Y", strtotime($date));
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admins\Pengeluaran;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\BukuBesar;
|
||||
use App\Models\Pengeluaran;
|
||||
use App\Models\RekeningCoa;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PengeluaranController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(){
|
||||
$coaBiaya = RekeningCoa::where('kode_coa', 5)->get();
|
||||
$rekeningCoaTf = RekeningCoa::where('kode_coa', 1)->where('sub_kode_coa', 200)->get();
|
||||
|
||||
return view('pages.admin.pengeluaran.index', compact('coaBiaya', 'rekeningCoaTf'));
|
||||
}
|
||||
|
||||
public function simpan(Request $request){
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
$user = request()->user();
|
||||
|
||||
Pengeluaran::create([
|
||||
'faktur' => "PG-".date('YmdHis'),
|
||||
'tanggal' => $request->tanggal,
|
||||
'jenis_transaksi' => $request->jenis_transaksi,
|
||||
'nominal' => $request->nominal,
|
||||
'keterangan' => $request->keterangan,
|
||||
'user_id' => $user->id
|
||||
]);
|
||||
if ($request->jenis_transaksi == "1") {
|
||||
BukuBesar::create([
|
||||
'faktur' => "PG-".date('YmdHis'),
|
||||
'tanggal' => $request->tanggal,
|
||||
'rekening_coa_id' => "2",
|
||||
'kode_rekening_coa' => "1.100.01",
|
||||
'keterangan_coa' => "Kas Kasir",
|
||||
'keterangan' => $request->keterangan,
|
||||
'debet' => 0,
|
||||
'kredit' => $request->nominal
|
||||
]);
|
||||
BukuBesar::create([
|
||||
'faktur' => "PG-".date('YmdHis'),
|
||||
'tanggal' => $request->tanggal,
|
||||
'rekening_coa_id' => $request->id_rekening_coa,
|
||||
'kode_rekening_coa' => $request->kode_coa,
|
||||
'keterangan_coa' => $request->keterangan_coa,
|
||||
'keterangan' => $request->keterangan,
|
||||
'debet' => $request->nominal,
|
||||
'kredit' => 0,
|
||||
]);
|
||||
}else{
|
||||
BukuBesar::create([
|
||||
'faktur' => "PG-".date('YmdHis'),
|
||||
'tanggal' => $request->tanggal,
|
||||
'rekening_coa_id' => $request->id_rekening_coa_transfer,
|
||||
'kode_rekening_coa' => $request->kode_coa_transfer,
|
||||
'keterangan_coa' => $request->keterangan_coa_transfer,
|
||||
'keterangan' => $request->keterangan,
|
||||
'debet' => 0,
|
||||
'kredit' => $request->nominal
|
||||
]);
|
||||
BukuBesar::create([
|
||||
'faktur' => "PG-".date('YmdHis'),
|
||||
'tanggal' => $request->tanggal,
|
||||
'rekening_coa_id' => $request->id_rekening_coa,
|
||||
'kode_rekening_coa' => $request->kode_coa,
|
||||
'keterangan_coa' => $request->keterangan_coa,
|
||||
'keterangan' => $request->keterangan,
|
||||
'debet' => $request->nominal,
|
||||
'kredit' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json(['status' => true, 'message' => 'Data berhasil tersimpan']);
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
|
||||
dd($th->getMessage());
|
||||
return response()->json(['status' => false, 'message' => 'Kesalahan menyimpan data']);
|
||||
}
|
||||
}
|
||||
|
||||
public function laporan(Request $request){
|
||||
$mpdf = new \Mpdf\Mpdf([
|
||||
'mode' => 'utf-8',
|
||||
'format' => 'A4',
|
||||
'orientation' => 'portrait',
|
||||
'margin_left' => 15,
|
||||
'margin_right' => 15,
|
||||
'margin_top' => 10,
|
||||
'margin_bottom' => 10,
|
||||
'default_font_size' => 9,
|
||||
'default_font' => 'arial',
|
||||
]);
|
||||
$mpdf->AddPage();
|
||||
$mpdf->setFooter('{PAGENO}');
|
||||
|
||||
$data = Pengeluaran::with('user')->whereDate('tanggal', '>=', $request->filter_tanggal_1)
|
||||
->whereDate('tanggal', '<=', $request->filter_tanggal_2)
|
||||
->get();
|
||||
$html = view('pages.admin.pengeluaran.laporan', [
|
||||
'data' => $data,
|
||||
'filter_tanggal_1' => $request->filter_tanggal_1,
|
||||
'filter_tanggal_2' => $request->filter_tanggal_2,
|
||||
]);
|
||||
$mpdf->writeHTML($html);
|
||||
$mpdf->Output('Laporan_Pengeluaran.pdf', 'I');
|
||||
return response()->header('Content-Type', 'application/pdf');
|
||||
}
|
||||
}
|
|
@ -102,6 +102,9 @@ class AuthController extends Controller
|
|||
|
||||
try {
|
||||
if (Auth::attempt($validator->validated(), $request->has('remember_me') ? true : false)) {
|
||||
$user = auth()->user();
|
||||
session()->put('id', $user->id);
|
||||
session()->put('name', $user->name);
|
||||
Session::flash('login-message', [
|
||||
'type' => 'success',
|
||||
'msg' => 'Anda berhasil melakukan Login!'
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Pengeluaran extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'pengeluaran';
|
||||
protected $guarded = [];
|
||||
|
||||
public function user(){
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@
|
|||
"laravel/framework": "^10.10",
|
||||
"laravel/sanctum": "^3.3",
|
||||
"laravel/tinker": "^2.8",
|
||||
"mpdf/mpdf": "^8.2",
|
||||
"realrashid/sweet-alert": "^6.0",
|
||||
"spatie/laravel-permission": "^6.3",
|
||||
"yajra/laravel-datatables": "^10.1"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c2a087156cf7cdb5fbd03918562d593c",
|
||||
"content-hash": "622a1b44adad65bf17c6308f5e4f8fe0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
|
@ -2387,6 +2387,238 @@
|
|||
],
|
||||
"time": "2023-10-27T15:32:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/mpdf",
|
||||
"version": "v8.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mpdf/mpdf.git",
|
||||
"reference": "596a87b876d7793be7be060a8ac13424de120dd5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mpdf/mpdf/zipball/596a87b876d7793be7be060a8ac13424de120dd5",
|
||||
"reference": "596a87b876d7793be7be060a8ac13424de120dd5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-gd": "*",
|
||||
"ext-mbstring": "*",
|
||||
"mpdf/psr-http-message-shim": "^1.0 || ^2.0",
|
||||
"mpdf/psr-log-aware-trait": "^2.0 || ^3.0",
|
||||
"myclabs/deep-copy": "^1.7",
|
||||
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
|
||||
"php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
|
||||
"psr/http-message": "^1.0 || ^2.0",
|
||||
"psr/log": "^1.0 || ^2.0 || ^3.0",
|
||||
"setasign/fpdi": "^2.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.3.0",
|
||||
"mpdf/qrcode": "^1.1.0",
|
||||
"squizlabs/php_codesniffer": "^3.5.0",
|
||||
"tracy/tracy": "~2.5",
|
||||
"yoast/phpunit-polyfills": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "Needed for generation of some types of barcodes",
|
||||
"ext-xml": "Needed mainly for SVG manipulation",
|
||||
"ext-zlib": "Needed for compression of embedded resources, such as fonts"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Mpdf\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-2.0-only"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matěj Humpál",
|
||||
"role": "Developer, maintainer"
|
||||
},
|
||||
{
|
||||
"name": "Ian Back",
|
||||
"role": "Developer (retired)"
|
||||
}
|
||||
],
|
||||
"description": "PHP library generating PDF files from UTF-8 encoded HTML",
|
||||
"homepage": "https://mpdf.github.io",
|
||||
"keywords": [
|
||||
"pdf",
|
||||
"php",
|
||||
"utf-8"
|
||||
],
|
||||
"support": {
|
||||
"docs": "http://mpdf.github.io",
|
||||
"issues": "https://github.com/mpdf/mpdf/issues",
|
||||
"source": "https://github.com/mpdf/mpdf"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.paypal.me/mpdf",
|
||||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-07T13:52:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/psr-http-message-shim",
|
||||
"version": "v2.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mpdf/psr-http-message-shim.git",
|
||||
"reference": "f25a0153d645e234f9db42e5433b16d9b113920f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/f25a0153d645e234f9db42e5433b16d9b113920f",
|
||||
"reference": "f25a0153d645e234f9db42e5433b16d9b113920f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"psr/http-message": "^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Mpdf\\PsrHttpMessageShim\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Dorison",
|
||||
"email": "mark@chromatichq.com"
|
||||
},
|
||||
{
|
||||
"name": "Kristofer Widholm",
|
||||
"email": "kristofer@chromatichq.com"
|
||||
},
|
||||
{
|
||||
"name": "Nigel Cunningham",
|
||||
"email": "nigel.cunningham@technocrat.com.au"
|
||||
}
|
||||
],
|
||||
"description": "Shim to allow support of different psr/message versions.",
|
||||
"support": {
|
||||
"issues": "https://github.com/mpdf/psr-http-message-shim/issues",
|
||||
"source": "https://github.com/mpdf/psr-http-message-shim/tree/v2.0.1"
|
||||
},
|
||||
"time": "2023-10-02T14:34:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/psr-log-aware-trait",
|
||||
"version": "v3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mpdf/psr-log-aware-trait.git",
|
||||
"reference": "a633da6065e946cc491e1c962850344bb0bf3e78"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/a633da6065e946cc491e1c962850344bb0bf3e78",
|
||||
"reference": "a633da6065e946cc491e1c962850344bb0bf3e78",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"psr/log": "^3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Mpdf\\PsrLogAwareTrait\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Dorison",
|
||||
"email": "mark@chromatichq.com"
|
||||
},
|
||||
{
|
||||
"name": "Kristofer Widholm",
|
||||
"email": "kristofer@chromatichq.com"
|
||||
}
|
||||
],
|
||||
"description": "Trait to allow support of different psr/log versions.",
|
||||
"support": {
|
||||
"issues": "https://github.com/mpdf/psr-log-aware-trait/issues",
|
||||
"source": "https://github.com/mpdf/psr-log-aware-trait/tree/v3.0.0"
|
||||
},
|
||||
"time": "2023-05-03T06:19:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.11.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
|
||||
"reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/collections": "<1.6.8",
|
||||
"doctrine/common": "<2.13.3 || >=3,<3.2.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "^1.6.8",
|
||||
"doctrine/common": "^2.13.3 || ^3.2.2",
|
||||
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/DeepCopy/deep_copy.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"DeepCopy\\": "src/DeepCopy/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Create deep copies (clones) of your objects",
|
||||
"keywords": [
|
||||
"clone",
|
||||
"copy",
|
||||
"duplicate",
|
||||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/myclabs/DeepCopy/issues",
|
||||
"source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-08T13:26:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "2.72.1",
|
||||
|
@ -2879,6 +3111,56 @@
|
|||
],
|
||||
"time": "2024-01-09T09:30:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v9.99.100",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">= 7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*|5.*",
|
||||
"vimeo/psalm": "^1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
||||
},
|
||||
"type": "library",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Paragon Initiative Enterprises",
|
||||
"email": "security@paragonie.com",
|
||||
"homepage": "https://paragonie.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
||||
"keywords": [
|
||||
"csprng",
|
||||
"polyfill",
|
||||
"pseudorandom",
|
||||
"random"
|
||||
],
|
||||
"support": {
|
||||
"email": "info@paragonie.com",
|
||||
"issues": "https://github.com/paragonie/random_compat/issues",
|
||||
"source": "https://github.com/paragonie/random_compat"
|
||||
},
|
||||
"time": "2020-10-15T08:29:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpspreadsheet",
|
||||
"version": "1.29.0",
|
||||
|
@ -3865,6 +4147,78 @@
|
|||
],
|
||||
"time": "2023-02-15T07:13:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "setasign/fpdi",
|
||||
"version": "v2.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Setasign/FPDI.git",
|
||||
"reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6db878129ec6c7e141316ee71872923e7f1b7ad",
|
||||
"reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-zlib": "*",
|
||||
"php": "^5.6 || ^7.0 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"setasign/tfpdf": "<1.31"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~5.7",
|
||||
"setasign/fpdf": "~1.8.6",
|
||||
"setasign/tfpdf": "~1.33",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"tecnickcom/tcpdf": "~6.2"
|
||||
},
|
||||
"suggest": {
|
||||
"setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"setasign\\Fpdi\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jan Slabon",
|
||||
"email": "jan.slabon@setasign.com",
|
||||
"homepage": "https://www.setasign.com"
|
||||
},
|
||||
{
|
||||
"name": "Maximilian Kresse",
|
||||
"email": "maximilian.kresse@setasign.com",
|
||||
"homepage": "https://www.setasign.com"
|
||||
}
|
||||
],
|
||||
"description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.",
|
||||
"homepage": "https://www.setasign.com/fpdi",
|
||||
"keywords": [
|
||||
"fpdf",
|
||||
"fpdi",
|
||||
"pdf"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Setasign/FPDI/issues",
|
||||
"source": "https://github.com/Setasign/FPDI/tree/v2.6.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/setasign/fpdi",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-12-11T16:03:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-permission",
|
||||
"version": "6.3.0",
|
||||
|
@ -7388,65 +7742,6 @@
|
|||
},
|
||||
"time": "2023-12-10T02:24:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.11.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
|
||||
"reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/collections": "<1.6.8",
|
||||
"doctrine/common": "<2.13.3 || >=3,<3.2.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "^1.6.8",
|
||||
"doctrine/common": "^2.13.3 || ^3.2.2",
|
||||
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/DeepCopy/deep_copy.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"DeepCopy\\": "src/DeepCopy/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Create deep copies (clones) of your objects",
|
||||
"keywords": [
|
||||
"clone",
|
||||
"copy",
|
||||
"duplicate",
|
||||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/myclabs/DeepCopy/issues",
|
||||
"source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-08T13:26:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/collision",
|
||||
"version": "v7.10.0",
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('pengeluaran', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('faktur')->nullable();
|
||||
$table->date('tanggal')->nullable();
|
||||
$table->integer('jenis_transaksi')->nullable()->comment('1 = Tunai, 2 = Transfer');
|
||||
$table->integer('nominal')->nullable();
|
||||
$table->string('keterangan')->nullable();
|
||||
$table->foreignId('user_id')->nullable()->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('pengeluaran');
|
||||
}
|
||||
};
|
|
@ -15,11 +15,11 @@
|
|||
</li>
|
||||
@endcan
|
||||
<li class="nav-item dropdown">
|
||||
<a id="dropdownSubMenu1" href="#" data-toggle="dropdown" aria-haspopup="true"
|
||||
<a id="dropdownSubMenu1" href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false" class="nav-link dropdown-toggle">Transaksi</a>
|
||||
<ul aria-labelledby="dropdownSubMenu1" class="dropdown-menu border-0 shadow">
|
||||
<li><a href="#" class="dropdown-item">Order </a></li>
|
||||
<li><a href="#" class="dropdown-item">Pengeluaran</a></li>
|
||||
<li><a href="{{ route('pengeluaran.index') }}" class="dropdown-item">Pengeluaran</a></li>
|
||||
<li class="dropdown-divider"></li>
|
||||
<li><a href="#" class="dropdown-item">Laporan</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
@extends('layouts.base')
|
||||
|
||||
@section('content-header')
|
||||
<div class="col-12">
|
||||
<div class="container" style="display: contents">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0"> Pengeluaran</h1>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item">Home</li>
|
||||
<li class="breadcrumb-item">Transaksi</li>
|
||||
<li class="breadcrumb-item active">Pengeluaran</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="content__boxed">
|
||||
<div class="content__wrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mt-2">
|
||||
<div class="card">
|
||||
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
||||
<div class="card-body">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Form Input Data</h5>
|
||||
</div>
|
||||
<div class="col-md-6 mt-3">
|
||||
<label>Tanggal</label>
|
||||
<input type="date" class="form-control" id="tanggal" value="{{ date('Y-m-d') }}">
|
||||
</div>
|
||||
<div class="col-md-6 mt-3">
|
||||
<label>Jenis Transaksi</label>
|
||||
<select class="form-control" id="jenis_transaksi">
|
||||
<option value="" selected>--Pilih Jenis Transkasi--</option>
|
||||
<option value="1">Tunai</option>
|
||||
<option value="2">Transfer</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mt-3">
|
||||
<label>Rekening Coa Kebutuhan</label>
|
||||
<select class="form-control" id="rekening_coa_kebutuhan">
|
||||
<option value="" selected>--Pilih Rekening Coa--</option>
|
||||
@foreach ($coaBiaya as $biaya)
|
||||
@if ($biaya->status == 0)
|
||||
<optgroup label="{{ $biaya->coa }} | {{ $biaya->keterangan_coa }}">
|
||||
@else
|
||||
<option
|
||||
value="{{ $biaya->id }}|{{ $biaya->coa }}|{{ $biaya->keterangan_coa }}">
|
||||
{{ $biaya->coa }} | {{ $biaya->keterangan_coa }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mt-3">
|
||||
<label>Nominal</label>
|
||||
<input type="number" min="0" class="form-control" id="nominal" placeholder="Nominal Pengeluaran">
|
||||
</div>
|
||||
<div class="col-md-6 mt-3">
|
||||
<label>Keterangan</label>
|
||||
<textarea class="form-control" id="keterangan" placeholder="Keterangan"></textarea>
|
||||
</div>
|
||||
<div hidden class="transfer col-6 mt-3">
|
||||
<label class="form-label">Rekening Coa Jenis Transaksi</label>
|
||||
<select class="form-control" id="rekening_coa_transfer">
|
||||
<option selected disabled>--Pilih Rekening Coa--</option>
|
||||
@foreach ($rekeningCoaTf as $coaTf)
|
||||
@if ($coaTf->status == 0)
|
||||
<optgroup label="{{ $coaTf->coa }} | {{ $coaTf->keterangan_coa }}">
|
||||
@else
|
||||
<option value="{{ $biaya->id }}|{{ $coaTf->coa }}|{{ $coaTf->keterangan_coa }}">
|
||||
{{ $coaTf->coa }} | {{ $coaTf->keterangan_coa }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<a href="javascript:void(0)" class="btn btn-warning" id="simpan_pengeluaran">Simpan Data</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mt-2">
|
||||
<div class="card">
|
||||
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
||||
<div class="card-body">
|
||||
<div class="col-md-12">
|
||||
<form action="{{ route('pengeluaran.laporan') }}" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Form Laporan</h5>
|
||||
</div>
|
||||
<div class="col-md-4 mt-3">
|
||||
<label>Dari Tanggal</label>
|
||||
<input type="date" class="form-control" name="filter_tanggal_1" value="{{ date('Y-m-d') }}">
|
||||
</div>
|
||||
<div class="col-md-4 mt-3">
|
||||
<label>Sampai Tanggal</label>
|
||||
<input type="date" class="form-control" name="filter_tanggal_2" value="{{ date('Y-m-d') }}">
|
||||
</div>
|
||||
<div class="col-md-4 mt-5">
|
||||
<button type="submit" class="btn btn-warning" id="filter_laporan">Preview</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('pages.admin.pengeluaran.js')
|
|
@ -0,0 +1,92 @@
|
|||
@push('scripts')
|
||||
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#jenis_transaksi').on('change', function(){
|
||||
if ($("#jenis_transaksi").val() == "1") {
|
||||
$(".transfer").prop('hidden', true)
|
||||
}else if($("#jenis_transaksi").val() == "2"){
|
||||
$(".transfer").prop('hidden', false)
|
||||
}else{
|
||||
$(".transfer").prop('hidden', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#simpan_pengeluaran').on('click', function() {
|
||||
// Jika jenis transaksi tunai
|
||||
if($("#jenis_transaksi").val() == "1"){
|
||||
let rekening_coa_kebutuhan = $("#rekening_coa_kebutuhan").val()
|
||||
let split_rekening_coa_kebutuhan = rekening_coa_kebutuhan.split("|")
|
||||
let id_rekening_coa = split_rekening_coa_kebutuhan[0]
|
||||
let kode_coa = split_rekening_coa_kebutuhan[1]
|
||||
let keterangan_coa = split_rekening_coa_kebutuhan[2]
|
||||
let dataTunai = {
|
||||
tanggal : $("#tanggal").val(),
|
||||
jenis_transaksi : $("#jenis_transaksi").val(),
|
||||
nominal : $("#nominal").val(),
|
||||
keterangan : $("#keterangan").val(),
|
||||
id_rekening_coa : id_rekening_coa,
|
||||
kode_coa : kode_coa,
|
||||
keterangan_coa : keterangan_coa,
|
||||
}
|
||||
// return console.log(dataTunai);
|
||||
$.ajax({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
type: "POST",
|
||||
url: "{{ route('pengeluaran.simpan') }}",
|
||||
data: dataTunai,
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
alert(result.message)
|
||||
location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
let rekening_coa_kebutuhan = $("#rekening_coa_kebutuhan").val()
|
||||
let split_rekening_coa_kebutuhan = rekening_coa_kebutuhan.split("|")
|
||||
let id_rekening_coa = split_rekening_coa_kebutuhan[0]
|
||||
let kode_coa = split_rekening_coa_kebutuhan[1]
|
||||
let keterangan_coa = split_rekening_coa_kebutuhan[2]
|
||||
let rekening_coa_transfer = $("#rekening_coa_transfer").val()
|
||||
let split_rekening_coa_transfer = rekening_coa_transfer.split("|")
|
||||
let id_rekening_coa_transfer = split_rekening_coa_transfer[0]
|
||||
let kode_coa_transfer = split_rekening_coa_transfer[1]
|
||||
let keterangan_coa_transfer = split_rekening_coa_transfer[2]
|
||||
let dataTranfer = {
|
||||
tanggal : $("#tanggal").val(),
|
||||
jenis_transaksi : $("#jenis_transaksi").val(),
|
||||
nominal : $("#nominal").val(),
|
||||
keterangan : $("#keterangan").val(),
|
||||
id_rekening_coa : id_rekening_coa,
|
||||
kode_coa : kode_coa,
|
||||
keterangan_coa : keterangan_coa,
|
||||
id_rekening_coa_transfer : id_rekening_coa_transfer,
|
||||
kode_coa_transfer : kode_coa_transfer,
|
||||
keterangan_coa_transfer : keterangan_coa_transfer,
|
||||
}
|
||||
// return console.log(dataTranfer);
|
||||
$.ajax({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
type: "POST",
|
||||
url: "{{ route('pengeluaran.simpan') }}",
|
||||
data: dataTranfer,
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
alert(result.message)
|
||||
location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Laporan Pengeluaran</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td>Tanggal Unduh: {{ date('d-m-Y H:i:s') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dicetak Oleh: {{ Session::get('name') }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="text-align: center; font-size: 20px; font-weight: bold;">Laporan Pengeluaran</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">Pencarian: {{ 'Antara Tanggal '.toDmy($filter_tanggal_1).' s/d Tanggal '.toDmy($filter_tanggal_2).'' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table style="width: 100%; border-collapse:collapse; border:1px solid black;">
|
||||
<thead style="border-collapse:collapse; border:1px solid black;">
|
||||
<tr style="border-collapse:collapse; border:1px solid black;">
|
||||
<th style="border-collapse:collapse; border:1px solid black;">No</th>
|
||||
<th style="border-collapse:collapse; border:1px solid black;">Faktur</th>
|
||||
<th style="border-collapse:collapse; border:1px solid black;">Tanggal</th>
|
||||
<th style="border-collapse:collapse; border:1px solid black;">Jenis Transaksi</th>
|
||||
<th style="border-collapse:collapse; border:1px solid black;">Nominal</th>
|
||||
<th style="border-collapse:collapse; border:1px solid black;">Keterangan</th>
|
||||
<th style="border-collapse:collapse; border:1px solid black;">User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="border-collapse:collapse; border:1px solid black;">
|
||||
@foreach ($data as $key => $val)
|
||||
<tr>
|
||||
<td style="text-align: center; border-collapse:collapse; border:1px solid black;">{{ $key+1 }}</td>
|
||||
<td style="border-collapse:collapse; border:1px solid black;">{{ $val->faktur }}</td>
|
||||
<td style="text-align:center; border-collapse:collapse; border:1px solid black;">{{ toDmy($val->tanggal) }}</td>
|
||||
<td style="text-align:center; border-collapse:collapse; border:1px solid black;">{{ $val->jenis_transaksi == "1" ? "Tunai" : "Transfer" }}</td>
|
||||
<td style="text-align: left; border-collapse:collapse; border:1px solid black;">Rp {{ format_uang($val->nominal) }}</td>
|
||||
<td style="border-collapse:collapse; border:1px solid black;">{{ $val->keterangan }}</td>
|
||||
<td style="text-align:center; border-collapse:collapse; border:1px solid black;">{{ $val->user->name }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\Admins\DashboardController;
|
||||
use App\Http\Controllers\Admins\Pengeluaran\PengeluaranController;
|
||||
use App\Http\Controllers\Admins\Users\RoleController;
|
||||
use App\Http\Controllers\Admins\Users\UserController;
|
||||
use App\Http\Controllers\Auths\AuthController;
|
||||
|
@ -83,4 +84,11 @@ Route::group(['middleware' => ['auth', 'permission']], function () {
|
|||
Route::delete('/delete/{id}', [RoleController::class, 'destroy'])->name('roles.delete')->comment('Menghapus Roles');
|
||||
Route::get('/refresh-routes', [RoleController::class, 'refreshRoutes'])->name('roles.refresh-routes')->comment('Refresh Permission Routes');
|
||||
});
|
||||
|
||||
// Pengeluaran
|
||||
Route::group(['prefix' => 'pengeluaran'], function () {
|
||||
Route::get('/', [PengeluaranController::class, 'index'])->name('pengeluaran.index')->comment('Halaman Pengeluaran');
|
||||
Route::post('/simpan', [PengeluaranController::class, 'simpan'])->name('pengeluaran.simpan')->comment('Halaman Simpan Pengeluaran');
|
||||
Route::post('/laporan', [PengeluaranController::class, 'laporan'])->name('pengeluaran.laporan')->comment('Halaman Laporan');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue