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){
$companies = OldCompany::all();
foreach($companies as $company){
$marking = explode("CIEF/", $company->marking);
if(count($marking) < 2){
continue;
}
$marking = str_replace(' ', '', str_replace('/', '', $marking[1]));
/** @var Company $newCompany */
$newCompany = $this->createCompanyProcessor->execute($company->name, CompanyType::COMPANY_BUSINESS, ApprovalStatus::PENDING_SUBMISSION);
$this->updatesCompanyStatus->execute($newCompany, ApprovalStatus::APPROVED);
/** @var CompanyModule $companyModule */
$companyModule = $this->createCompanyModuleProcessor->execute($newCompany, BusinessType::IMPORTER);
$connectionObject = new CompanyConnectionObject($companyModule, 'CIEF', $marking);
$connection = $this->createsCompanyConnection->execute($connectionObject);
$this->approvesCompanyConnection->execute($connection);
$i = 0;
foreach($company->addresses as $address){
$this->createAddressFromOldAddressProcessor->execute($address, $companyModule);
$contact = preg_replace("/[^0-9.]/", "", $address->contact);
if($contact){
$i++;
if($i === 1) {
$contactObject = new ContactObject('', $contact, $company->email, '',);
$this->createContactProcessor->execute($contactObject, $newCompany);
}
}
}
}
}
// if(true){
// $companies = OldCompany::all();
//
// foreach($companies as $company){
//
// $marking = explode("CIEF/", $company->marking);
//
// if(count($marking) < 2){
// continue;
// }
//
// $marking = str_replace(' ', '', str_replace('/', '', $marking[1]));
//
//
// /** @var Company $newCompany */
// $newCompany = $this->createCompanyProcessor->execute($company->name, CompanyType::COMPANY_BUSINESS, ApprovalStatus::PENDING_SUBMISSION);
//
// $this->updatesCompanyStatus->execute($newCompany, ApprovalStatus::APPROVED);
//
// /** @var CompanyModule $companyModule */
// $companyModule = $this->createCompanyModuleProcessor->execute($newCompany, BusinessType::IMPORTER);
//
// $connectionObject = new CompanyConnectionObject($companyModule, 'CIEF', $marking);
//
// $connection = $this->createsCompanyConnection->execute($connectionObject);
// $this->approvesCompanyConnection->execute($connection);
//
// $i = 0;
// foreach($company->addresses as $address){
// $this->createAddressFromOldAddressProcessor->execute($address, $companyModule);
// $contact = preg_replace("/[^0-9.]/", "", $address->contact);
// if($contact){
// $i++;
// if($i === 1) {
// $contactObject = new ContactObject('', $contact, $company->email, '',);
// $this->createContactProcessor->execute($contactObject, $newCompany);
// }
// }
//
//
// }
// }
// }
}
+1 -1
View File
@@ -143,7 +143,7 @@ Route::get('/report', function(){
$total += $cbm;
echo $container->reference.': '.$cbm.'<br><br><br>';
echo $container->reference.': '.$cbm.'<br><br>';
}
echo '<br><br><br>total cbm: '. $total;