-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
412 changed files
with
36,585 additions
and
35,610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,5 @@ yarn-error.log | |
/public/assets/js | ||
/public/assets/css | ||
/public/assets/vendor | ||
.env | ||
.env | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteRule ^(.*)$ public/$1 [L] | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Illuminate\Contracts\View; | ||
|
||
use Illuminate\Contracts\Support\Renderable; | ||
|
||
interface View extends Renderable | ||
{ | ||
/** @return static */ | ||
public function extends(string $layout); | ||
public function layoutData(); | ||
public function layout(string $layout); | ||
//any other method that throws false error here :) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,69 @@ | ||
- Venda NET | ||
# ISP Management System - VENDA NET | ||
|
||
ISP Management System ini dikembangkan untuk VENDA NET, sebuah penyedia layanan internet RT/RW yang memiliki fitur-fitur utama sebagai berikut: | ||
|
||
## Features | ||
|
||
1. **Manajemen Pelanggan**: | ||
|
||
- Tambah, edit, dan hapus data pelanggan. | ||
- **Integrasi dengan Mikrotik**: Setiap kali data pelanggan ditambahkan, sistem secara otomatis menambahkan `PPPoE Secret` ke Mikrotik. | ||
|
||
2. **Manajemen Paket Data**: | ||
|
||
- Tambah, edit, dan hapus data paket internet. | ||
- **Integrasi dengan Mikrotik**: Setiap kali data paket ditambahkan, sistem secara otomatis menambahkan `PPPoE Profile` ke Mikrotik. | ||
|
||
3. **Pembayaran**: | ||
|
||
- **Integrasi dengan Midtrans**: Pembayaran tagihan internet dilakukan melalui payment gateway Midtrans, memastikan proses pembayaran yang aman dan mudah bagi pelanggan. | ||
|
||
4. **Notifikasi Billing**: | ||
- **Integrasi dengan WABLAS**: Sistem mengirimkan notifikasi tagihan kepada pelanggan melalui WhatsApp menggunakan layanan WABLAS, memastikan pelanggan mendapatkan informasi tagihan tepat waktu. | ||
|
||
## Instalation | ||
|
||
1. **Clone Repository**: | ||
```bash | ||
git clone https://github.com/bangyadiii/venda-net | ||
cd venda-net | ||
``` | ||
2. **Install Depedencies**: | ||
```bash | ||
composer install | ||
npm install | ||
``` | ||
3. **Konfigurasi Environment**: | ||
Salin file .env.example menjadi .env dan sesuaikan konfigurasi database, Mikrotik, Midtrans, dan WABLAS sesuai kebutuhan Anda. | ||
```bash | ||
cp .env.example.env | ||
``` | ||
4. **Migrasi dan Seed Database**: | ||
```bash | ||
php artisan migrate --seed | ||
``` | ||
5. **Generate App Key**: | ||
```bash | ||
php artisan key:generate | ||
``` | ||
6. Run the app: | ||
```bash | ||
php artisan serve | ||
``` | ||
|
||
## Usage | ||
|
||
Setelah aplikasi berjalan, Anda dapat mengakses antarmuka melalui http://localhost:8000. Masuk dengan kredensial admin yang telah diatur selama proses seeding. | ||
|
||
## Mikrotik Integration | ||
|
||
- Tambahkan pelanggan baru melalui menu Manajemen Pelanggan dan `PPPoE Secret` akan otomatis ditambahkan ke Mikrotik. | ||
- Tambahkan paket data baru melalui menu Manajemen Paket Data dan `PPPoE Profile` akan otomatis ditambahkan ke Mikrotik. | ||
|
||
## Midtrans Payment Integration | ||
|
||
- Pembayaran dilakukan melalui gateway Midtrans. Pastikan Anda telah mengonfigurasi `MIDTRANS_SERVER_KEY` dan `MIDTRANS_CLIENT_KEY` di file `.env.` | ||
|
||
## WABLAS Notification Integration | ||
|
||
- Sistem akan mengirimkan notifikasi tagihan secara otomatis melalui WhatsApp menggunakan layanan WABLAS. Pastikan Anda telah mengonfigurasi `WABLAS_API_KEY` di file `.env`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Classes; | ||
|
||
use Carbon\CarbonInterface; | ||
use LaravelDaily\Invoices\Invoice as LaravelDailyInvoice; | ||
|
||
class Invoice extends LaravelDailyInvoice | ||
{ | ||
/** | ||
* @var CarbonInterface | ||
*/ | ||
public $dueDate; | ||
|
||
/** | ||
* @var CarbonInterface | ||
*/ | ||
public $paidDate; | ||
|
||
/** | ||
* @var CarbonInterface | ||
*/ | ||
public $periode; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->dueDate = $this->date; | ||
} | ||
|
||
public function dueDate(CarbonInterface $dueDate) | ||
{ | ||
$this->dueDate = $dueDate; | ||
return $this; | ||
} | ||
|
||
public function getDueDate() | ||
{ | ||
return $this->dueDate->format($this->date_format); | ||
} | ||
|
||
public function paidDate(CarbonInterface $paidDate) | ||
{ | ||
$this->paidDate = $paidDate; | ||
return $this; | ||
} | ||
|
||
public function getPaidDate() | ||
{ | ||
return $this->paidDate?->toDateTimeString() ?? null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Enums\BillStatus; | ||
use App\Enums\ServiceStatus; | ||
use Illuminate\Console\Command; | ||
use App\Models\Customer; | ||
use App\Jobs\IsolirCustomerJob; | ||
use Carbon\Carbon; | ||
|
||
class CheckLatePayments extends Command | ||
{ | ||
protected $signature = 'app:late-payments'; | ||
protected $description = 'Check for customers with late payments and suspend their service'; | ||
|
||
public function handle() | ||
{ | ||
/** @var \Illuminate\Database\Eloquent\Collection $customers */ | ||
$customers = Customer::query() | ||
->where('service_status', ServiceStatus::ACTIVE) | ||
->whereHas('bills', function ($query) { | ||
$query | ||
->where('status', BillStatus::UNPAID) | ||
->where('due_date', '<', Carbon::now()); | ||
})->get(); | ||
if ($customers->isEmpty()) { | ||
$this->info('No customers with late payments found'); | ||
return Command::SUCCESS; | ||
} | ||
|
||
foreach ($customers as $customer) { | ||
\dispatch(new IsolirCustomerJob($customer)); | ||
} | ||
|
||
return Command::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Models\User; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Hash; | ||
|
||
class CreateAdmin extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'app:create-admin {--default}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Creating an admin user.'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
if ($this->option('default')) { | ||
User::updateOrCreate([ | ||
'username' => 'admin', | ||
], [ | ||
'name' => 'Admin', | ||
'password' => Hash::make('password'), | ||
]); | ||
$this->info('Default admin user created successfully!'); | ||
return Command::SUCCESS; | ||
} | ||
|
||
$pwd = $this->secret('To create an admin user, you need to enter the password. Enter the password to continue.'); | ||
if ($pwd !== 'PASSWORD###') { | ||
$this->error('Invalid password!'); | ||
return Command::FAILURE; | ||
} | ||
|
||
$name = $this->ask('Enter your name', 'Admin'); | ||
$username = $this->ask('Enter your username', 'admin'); | ||
$password = $this->secret('Enter your password', 'password'); | ||
|
||
if (User::where('username', $username)->exists()) { | ||
$this->error('User already exists!'); | ||
return Command::FAILURE; | ||
} | ||
|
||
$admin = new User(); | ||
$admin->name = $name; | ||
$admin->username = $username; | ||
$admin->password = Hash::make($password); | ||
$admin->save(); | ||
|
||
$this->info('Admin user created successfully!'); | ||
return Command::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Enums\ServiceStatus; | ||
use App\Jobs\GenerateMonthlyBills; | ||
use App\Models\Customer; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class GenerateMonthlyBill extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'app:generate-monthly-bill'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Command description'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
$customers = Customer::with('plan') | ||
->where('service_status', ServiceStatus::ACTIVE) | ||
->whereDoesntHave('bills', function ($query) { | ||
$query->where(DB::raw('MONTH(due_date)'), now()->month); | ||
}) | ||
->get(); | ||
/** | ||
* @var Customer $customer | ||
*/ | ||
foreach ($customers as $customer) { | ||
dispatch(new GenerateMonthlyBills($customer)); | ||
} | ||
} | ||
} |
Oops, something went wrong.