diff --git a/app/Http/Requests/Login/LoginRequest.php b/app/Http/Requests/Login/LoginRequest.php index f02169180c7d..102a3e676426 100644 --- a/app/Http/Requests/Login/LoginRequest.php +++ b/app/Http/Requests/Login/LoginRequest.php @@ -47,15 +47,4 @@ class LoginRequest extends Request ]; } - // public function prepareForValidation() - // { - // $input = $this->all(); - - // // if(base64_decode(base64_encode($input['password'])) === $input['password']) - // // $input['password'] = base64_decode($input['password']); - - // // nlog($input['password']); - - // $this->replace($input); - // } } diff --git a/app/Http/ValidationRules/Account/BlackListRule.php b/app/Http/ValidationRules/Account/BlackListRule.php index 51fab56af44a..0a2a681f0ff3 100644 --- a/app/Http/ValidationRules/Account/BlackListRule.php +++ b/app/Http/ValidationRules/Account/BlackListRule.php @@ -24,7 +24,8 @@ class BlackListRule implements Rule 'vusra.com', 'fourthgenet.com', 'arxxwalls.com', - 'superhostforumla.com' + 'superhostforumla.com', + 'wnpop.com', ]; /** diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index dec4e6518dbf..f627a0a0075d 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -394,7 +394,7 @@ class Design extends BaseDesign public function productTable(): array { $product_items = collect($this->entity->line_items)->filter(function ($item) { - return $item->type_id == 1 || $item->type_id == 6; + return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5; }); if (count($product_items) == 0) { diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 735d436c296b..9a4bd3b6c29f 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -282,9 +282,9 @@ trait MakesInvoiceValues } if ($table_type == '$task' && $item->type_id != 2) { - if ($item->type_id != 4 && $item->type_id != 5) { + // if ($item->type_id != 4 && $item->type_id != 5) { continue; - } + // } } $helpers = new Helpers(); diff --git a/tests/Unit/InvoiceTest.php b/tests/Unit/InvoiceTest.php index aff6437a5395..0ed0ebb67085 100644 --- a/tests/Unit/InvoiceTest.php +++ b/tests/Unit/InvoiceTest.php @@ -13,6 +13,7 @@ namespace Tests\Unit; use App\Factory\InvoiceItemFactory; use App\Helpers\Invoice\InvoiceSum; +use App\Helpers\Invoice\InvoiceSumInclusive; use App\Models\Invoice; use Illuminate\Foundation\Testing\DatabaseTransactions; use Tests\MockAccountData; @@ -41,11 +42,47 @@ class InvoiceTest extends TestCase $this->invoice->line_items = $this->buildLineItems(); - $this->invoice->usesinclusive_taxes = true; + $this->invoice->uses_inclusive_taxes = true; $this->invoice_calc = new InvoiceSum($this->invoice); } + public function testInclusiveRounding() + { + $this->invoice->line_items = []; + $this->invoice->discount = 0; + $this->invoice->uses_inclusive_taxes = true; + $this->invoice->save(); + + + $item = InvoiceItemFactory::create(); + $item->quantity = 1; + $item->cost = 50; + $item->tax_name1 = "taxy"; + $item->tax_rate1 = 19; + + $line_items[] = $item; + + $item = InvoiceItemFactory::create(); + $item->quantity = 1; + $item->cost = 50; + $item->tax_name1 = "taxy"; + $item->tax_rate1 = 19; + + $line_items[] = $item; + + $this->invoice->line_items = $line_items; + $this->invoice->save(); + + $invoice_calc = new InvoiceSumInclusive($this->invoice); + + $invoice_calc->build(); + // $this->invoice->save(); + + $this->assertEquals($invoice_calc->getTotalTaxes(), 15.96); + + } + private function buildLineItems() { $line_items = [];