mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for entity images
This commit is contained in:
parent
e17029223c
commit
e5997128d6
@ -63,11 +63,18 @@ class CreateAccount extends Command
|
||||
|
||||
private function createAccount()
|
||||
{
|
||||
$settings = CompanySettings::defaults();
|
||||
|
||||
$settings->name = "Untitled Company";
|
||||
$settings->currency_id = '1';
|
||||
$settings->language_id = '1';
|
||||
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'portal_domain' => config('ninja.app_url'),
|
||||
'portal_mode' => 'domain',
|
||||
'settings' => $settings,
|
||||
]);
|
||||
|
||||
$company->client_registration_fields = ClientRegistrationFields::generate();
|
||||
|
@ -841,6 +841,8 @@ class CompanySettings extends BaseSettings
|
||||
{
|
||||
$notification = new stdClass;
|
||||
$notification->email = [];
|
||||
$notification->email = ['invoice_sent_all'];
|
||||
|
||||
// $notification->email = ['all_notifications'];
|
||||
|
||||
return $notification;
|
||||
|
@ -1013,9 +1013,9 @@ html {
|
||||
*/
|
||||
protected function generateEntityImagesMarkup()
|
||||
{
|
||||
if ($this->client->getSetting('embed_documents') === false) {
|
||||
return '';
|
||||
}
|
||||
// if ($this->client->getSetting('embed_documents') === false) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
@ -1029,7 +1029,7 @@ html {
|
||||
|
||||
$image = $dom->createElement('img');
|
||||
|
||||
$image->setAttribute('src', $document->generateUrl());
|
||||
$image->setAttribute('src', "data:image/png;base64,".base64_encode($document->getFile()));
|
||||
$image->setAttribute('style', 'max-height: 100px; margin-top: 20px;');
|
||||
|
||||
$container->appendChild($image);
|
||||
@ -1040,6 +1040,8 @@ html {
|
||||
$html = $dom->saveHTML();
|
||||
|
||||
$dom = null;
|
||||
|
||||
nlog($html);
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
@ -89,10 +89,16 @@ class RandomDataSeeder extends Seeder
|
||||
Model::unguard();
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$settings= CompanySettings::defaults();
|
||||
|
||||
$settings->name = "Random Test Company";
|
||||
$settings->currency_id = '1';
|
||||
$settings->language_id = '1';
|
||||
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'settings' => $settings,
|
||||
]);
|
||||
|
||||
$account->default_company_id = $company->id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user