Added cost import via web
This commit is contained in:
@@ -22,6 +22,7 @@ class ImportCosts implements ShouldQueue
|
||||
|
||||
private const LOGKEY = 'JIC';
|
||||
private Cost $co;
|
||||
private Site $site;
|
||||
private string $file;
|
||||
protected Collection $columns;
|
||||
|
||||
@@ -33,7 +34,7 @@ class ImportCosts implements ShouldQueue
|
||||
public function __construct(Site $site,Supplier $so,Carbon $invoice_date,string $file)
|
||||
{
|
||||
$this->file = $file;
|
||||
Config::set('site',$site);
|
||||
$this->site = $site;
|
||||
|
||||
$this->co = Cost::where('site_id',$site->site_id)
|
||||
->where('supplier_id',$so->id)
|
||||
@@ -72,9 +73,10 @@ class ImportCosts implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Config::set('site',$this->site);
|
||||
$skip = 7; // @todo to be stored in supplier config
|
||||
|
||||
$file = fopen($this->file,'r');
|
||||
$file = fopen('storage/app/'.$this->file,'r');
|
||||
$haveHeader = FALSE;
|
||||
|
||||
$c = 0;
|
||||
|
Reference in New Issue
Block a user