⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.142
Server IP:
217.76.53.76
Server:
Linux vmi1397931.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
test2.webi.com.ng
/
app
/
Models
/
View File Name :
Estimate.php
'dark', 'Open' => 'info', 'Sent' => 'success', 'Close' => 'danger', ]; public function taxes1() { return $this->hasOne('App\Models\TaxRate', 'id', 'tax1'); } public function taxes2() { return $this->hasOne('App\Models\TaxRate', 'id', 'tax2'); } public function units() { return $this->hasOne('App\Models\Item', 'id', 'unit'); } public function categories() { return $this->hasOne('App\Models\Item', 'id', 'category'); } public function clients() { return $this->hasOne('App\Models\User', 'id', 'client'); } public function clientDetail() { return $this->hasOne('App\Models\Client', 'user_id', 'client'); } public function items() { $t = $this->hasMany('App\Models\EstimateProduct', 'estimate', 'id'); return $t; } public function getSubTotal() { $subTotal = 0; foreach($this->items as $product) { $subTotal += ($product->price * $product->quantity); } return $subTotal; } public function getTotalTax() { $totalTax = 0; foreach($this->items as $product) { $taxes = Utility::totalTaxRate($product->tax); $totalTax += ($taxes / 100) * ($product->price * $product->quantity); } return $totalTax; } public function getTotalDiscount() { $totalDiscount = 0; foreach($this->items as $product) { $totalDiscount += $product->discount; } return $totalDiscount; } public function getTotal() { return ($this->getSubTotal() + $this->getTotalTax()) - $this->getTotalDiscount(); } public function getDue() { $due = 0; foreach($this->payments as $payment) { $due += $payment->amount; } return ($this->getTotal() - $due) - $this->invoiceTotalCreditNote(); } }