Skip to content

Commit

Permalink
Merge pull request #1664 from Blair2004/v4.8.x
Browse files Browse the repository at this point in the history
V4.8.x
  • Loading branch information
Blair2004 authored Nov 8, 2023
2 parents 28ffc09 + 4c04cb0 commit b35cba6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/Services/DemoCoreService.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Models\Procurement;
use App\Models\Product;
use App\Models\Provider;
use App\Models\Role;
use App\Models\Tax;
use App\Models\TaxGroup;
use App\Models\Unit;
Expand Down Expand Up @@ -62,7 +63,7 @@ public function prepareDefaultUnitSystem()
if ( ! $group instanceof UnitGroup ) {
$group = new UnitGroup;
$group->name = __( 'Countable' );
$group->author = Auth::id();
$group->author = Role::namespace( 'admin' )->users()->first()->id;
$group->save();
}

Expand All @@ -73,7 +74,7 @@ public function prepareDefaultUnitSystem()
$unit->name = __( 'Piece' );
$unit->identifier = 'piece';
$unit->description = '';
$unit->author = Auth::id();
$unit->author = Role::namespace( 'admin' )->users()->first()->id;
$unit->group_id = $group->id;
$unit->base_unit = true;
$unit->value = 1;
Expand All @@ -87,7 +88,7 @@ public function prepareDefaultUnitSystem()
$unit->name = __( 'Small Box' );
$unit->identifier = 'small-box';
$unit->description = '';
$unit->author = Auth::id();
$unit->author = Role::namespace( 'admin' )->users()->first()->id;
$unit->group_id = $group->id;
$unit->base_unit = true;
$unit->value = 6;
Expand All @@ -101,7 +102,7 @@ public function prepareDefaultUnitSystem()
$unit->name = __( 'Box' );
$unit->identifier = 'box';
$unit->description = '';
$unit->author = Auth::id();
$unit->author = Role::namespace( 'admin' )->users()->first()->id;
$unit->group_id = $group->id;
$unit->base_unit = true;
$unit->value = 12;
Expand Down Expand Up @@ -213,7 +214,7 @@ public function createTaxes()
if ( ! $taxGroup instanceof TaxGroup ) {
$taxGroup = new TaxGroup;
$taxGroup->name = __( 'GST' );
$taxGroup->author = Auth::id();
$taxGroup->author = Role::namespace( 'admin' )->users()->first()->id;
$taxGroup->save();
}

Expand All @@ -224,7 +225,7 @@ public function createTaxes()
$tax->name = __( 'SGST' );
$tax->rate = 8;
$tax->tax_group_id = $taxGroup->id;
$tax->author = Auth::id();
$tax->author = Role::namespace( 'admin' )->users()->first()->id;
$tax->save();
}

Expand All @@ -235,7 +236,7 @@ public function createTaxes()
$tax->name = __( 'CGST' );
$tax->rate = 8;
$tax->tax_group_id = $taxGroup->id;
$tax->author = Auth::id();
$tax->author = Role::namespace( 'admin' )->users()->first()->id;
$tax->save();
}
}
Expand Down

0 comments on commit b35cba6

Please sign in to comment.