container monthly report

This commit is contained in:
omair saleh
2021-10-01 18:18:40 +08:00
parent 1af45e5132
commit 8f381b42f3
2 changed files with 44 additions and 44 deletions
+43 -43
View File
@@ -172,49 +172,49 @@ class CompaniesTableSeeder extends Seeder
} }
if(true){ // if(true){
$companies = OldCompany::all(); // $companies = OldCompany::all();
//
foreach($companies as $company){ // foreach($companies as $company){
//
$marking = explode("CIEF/", $company->marking); // $marking = explode("CIEF/", $company->marking);
//
if(count($marking) < 2){ // if(count($marking) < 2){
continue; // continue;
} // }
//
$marking = str_replace(' ', '', str_replace('/', '', $marking[1])); // $marking = str_replace(' ', '', str_replace('/', '', $marking[1]));
//
//
/** @var Company $newCompany */ // /** @var Company $newCompany */
$newCompany = $this->createCompanyProcessor->execute($company->name, CompanyType::COMPANY_BUSINESS, ApprovalStatus::PENDING_SUBMISSION); // $newCompany = $this->createCompanyProcessor->execute($company->name, CompanyType::COMPANY_BUSINESS, ApprovalStatus::PENDING_SUBMISSION);
//
$this->updatesCompanyStatus->execute($newCompany, ApprovalStatus::APPROVED); // $this->updatesCompanyStatus->execute($newCompany, ApprovalStatus::APPROVED);
//
/** @var CompanyModule $companyModule */ // /** @var CompanyModule $companyModule */
$companyModule = $this->createCompanyModuleProcessor->execute($newCompany, BusinessType::IMPORTER); // $companyModule = $this->createCompanyModuleProcessor->execute($newCompany, BusinessType::IMPORTER);
//
$connectionObject = new CompanyConnectionObject($companyModule, 'CIEF', $marking); // $connectionObject = new CompanyConnectionObject($companyModule, 'CIEF', $marking);
//
$connection = $this->createsCompanyConnection->execute($connectionObject); // $connection = $this->createsCompanyConnection->execute($connectionObject);
$this->approvesCompanyConnection->execute($connection); // $this->approvesCompanyConnection->execute($connection);
//
$i = 0; // $i = 0;
foreach($company->addresses as $address){ // foreach($company->addresses as $address){
$this->createAddressFromOldAddressProcessor->execute($address, $companyModule); // $this->createAddressFromOldAddressProcessor->execute($address, $companyModule);
$contact = preg_replace("/[^0-9.]/", "", $address->contact); // $contact = preg_replace("/[^0-9.]/", "", $address->contact);
if($contact){ // if($contact){
$i++; // $i++;
if($i === 1) { // if($i === 1) {
$contactObject = new ContactObject('', $contact, $company->email, '',); // $contactObject = new ContactObject('', $contact, $company->email, '',);
$this->createContactProcessor->execute($contactObject, $newCompany); // $this->createContactProcessor->execute($contactObject, $newCompany);
} // }
} // }
//
//
} // }
} // }
} // }
} }
+1 -1
View File
@@ -143,7 +143,7 @@ Route::get('/report', function(){
$total += $cbm; $total += $cbm;
echo $container->reference.': '.$cbm.'<br><br><br>'; echo $container->reference.': '.$cbm.'<br><br>';
} }
echo '<br><br><br>total cbm: '. $total; echo '<br><br><br>total cbm: '. $total;