Update supplier/cost with components

This commit is contained in:
2024-08-24 17:37:55 +10:00
parent b877a2b673
commit 2627cea3b5
8 changed files with 89 additions and 146 deletions

View File

@@ -126,7 +126,7 @@ class ImportCosts implements ShouldQueue
$cost = ($x=$this->getColumnKey('PRICETOTAL')) ? str_replace([',','$'],'',$fields[$x]) : NULL;
$start_at = Carbon::createFromFormat('d M Y',$m[3]);
$stop_at = Carbon::createFromFormat('d M Y',$m[4]);
$so = Service::search($m[1])->active()->with(['type','product.type.supplied'])->single();
$so = Service::search($m[1])->ServiceActive()->with(['type','product.type.supplied'])->single();
if ($so) {
// r[1] = Monthly Charge or Extra Charge,r[2] = "On Plan", r[3] = Plan Info
@@ -197,7 +197,7 @@ class ImportCosts implements ShouldQueue
}
} else {
dump(['line'=>$line,'sql'=>Service::search($m[1])->active()->with(['type','product.type.supplied'])->toSql()]);
dump(['line'=>$line,'sql'=>Service::search($m[1])->ServiceActive()->with(['type','product.type.supplied'])->toSql()]);
$to = Cost\Generic::where('site_id',$this->co->site_id)
->where('cost_id',$this->co->id)