|
|
@@ -6,6 +6,7 @@
|
|
|
use App\Models\Franchisee;
|
|
|
use App\Models\FranchiseeUnit;
|
|
|
use App\Models\Unit;
|
|
|
+use App\Models\UnitFinancial;
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
@@ -62,6 +63,14 @@ public function create(array $data): Unit
|
|
|
'unit_id' => $unit->id,
|
|
|
]);
|
|
|
|
|
|
+ // Dados financeiros da unidade já nascem com a cobrança de ROI/FNM ativa;
|
|
|
+ // para desativar, edita-se na tab Financeiro da unidade.
|
|
|
+ UnitFinancial::create([
|
|
|
+ 'unit_id' => $unit->id,
|
|
|
+ 'charge_roi' => true,
|
|
|
+ 'charge_fnm' => true,
|
|
|
+ ]);
|
|
|
+
|
|
|
$this->replicatePackagesToUnit($unit->id);
|
|
|
|
|
|
// Dispatch Asaas Subaccount creation asynchronously
|