Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Modules/Core/Support/NumberFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function formatTrimmed(float $number, int $decimalPlaces = 4): str
{
$formatted = number_format($number, $decimalPlaces, '.', '');

return mb_rtrim(mb_rtrim($formatted, '0'), '.');
return rtrim(rtrim($formatted, '0'), '.');
}

public static function unformat($number, $currency = null): float | string
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Tests/AbstractAdminPanelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class AbstractAdminPanelTestCase extends BaseTestCase
{
use RefreshDatabase;

protected $superAdmin;
protected ?User $superAdmin;

protected function setUp(): void
{
Expand Down
2 changes: 2 additions & 0 deletions Modules/Core/Tests/Feature/UsersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function it_lists_users(): void
# endregion

# region crud
#[Test]
#[Group('crud')]
public function it_deletes_a_user(): void
{
/* arrange */
Expand Down
16 changes: 12 additions & 4 deletions Modules/Expenses/Database/Factories/ExpenseItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function definition(): array
->first();

if ( ! $item) {
dd('die early');
$item = Product::factory()
->state(['company_id' => $company->id])
->create();
}

// Get a unit that belongs to this company
Expand All @@ -53,7 +55,9 @@ public function definition(): array
->first();

if ( ! $unit) {
dd('die early');
$unit = ProductUnit::factory()
->state(['company_id' => $company->id])
->create();
}

// Get a tax rate that belongs to this company
Expand All @@ -63,7 +67,9 @@ public function definition(): array
->first();

if ( ! $taxRate) {
dd('die early');
$taxRate = TaxRate::factory()
->state(['company_id' => $company->id])
->create();
}

// Get a second tax rate 75% of the time that belongs to this company
Expand All @@ -76,7 +82,9 @@ public function definition(): array
->first();

if ( ! $taxRate2) {
dd('die early');
$taxRate2 = TaxRate::factory()
->state(['company_id' => $company->id])
->create();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/Invoices/Database/Factories/InvoiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function configure(): static
->first();

if ( ! $taxRate) {
$taxRate = Product::factory()
$taxRate = TaxRate::factory()
->state(['company_id' => $invoice->company_id])
->create();
}
Expand Down