mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 12:44:35 -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()
|
private function createAccount()
|
||||||
{
|
{
|
||||||
|
$settings = CompanySettings::defaults();
|
||||||
|
|
||||||
|
$settings->name = "Untitled Company";
|
||||||
|
$settings->currency_id = '1';
|
||||||
|
$settings->language_id = '1';
|
||||||
|
|
||||||
$account = Account::factory()->create();
|
$account = Account::factory()->create();
|
||||||
$company = Company::factory()->create([
|
$company = Company::factory()->create([
|
||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
'portal_domain' => config('ninja.app_url'),
|
'portal_domain' => config('ninja.app_url'),
|
||||||
'portal_mode' => 'domain',
|
'portal_mode' => 'domain',
|
||||||
|
'settings' => $settings,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$company->client_registration_fields = ClientRegistrationFields::generate();
|
$company->client_registration_fields = ClientRegistrationFields::generate();
|
||||||
|
@ -841,6 +841,8 @@ class CompanySettings extends BaseSettings
|
|||||||
{
|
{
|
||||||
$notification = new stdClass;
|
$notification = new stdClass;
|
||||||
$notification->email = [];
|
$notification->email = [];
|
||||||
|
$notification->email = ['invoice_sent_all'];
|
||||||
|
|
||||||
// $notification->email = ['all_notifications'];
|
// $notification->email = ['all_notifications'];
|
||||||
|
|
||||||
return $notification;
|
return $notification;
|
||||||
|
@ -1013,9 +1013,9 @@ html {
|
|||||||
*/
|
*/
|
||||||
protected function generateEntityImagesMarkup()
|
protected function generateEntityImagesMarkup()
|
||||||
{
|
{
|
||||||
if ($this->client->getSetting('embed_documents') === false) {
|
// if ($this->client->getSetting('embed_documents') === false) {
|
||||||
return '';
|
// return '';
|
||||||
}
|
// }
|
||||||
|
|
||||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||||
|
|
||||||
@ -1029,7 +1029,7 @@ html {
|
|||||||
|
|
||||||
$image = $dom->createElement('img');
|
$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;');
|
$image->setAttribute('style', 'max-height: 100px; margin-top: 20px;');
|
||||||
|
|
||||||
$container->appendChild($image);
|
$container->appendChild($image);
|
||||||
@ -1040,6 +1040,8 @@ html {
|
|||||||
$html = $dom->saveHTML();
|
$html = $dom->saveHTML();
|
||||||
|
|
||||||
$dom = null;
|
$dom = null;
|
||||||
|
|
||||||
|
nlog($html);
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
@ -89,10 +89,16 @@ class RandomDataSeeder extends Seeder
|
|||||||
Model::unguard();
|
Model::unguard();
|
||||||
|
|
||||||
$faker = \Faker\Factory::create();
|
$faker = \Faker\Factory::create();
|
||||||
|
$settings= CompanySettings::defaults();
|
||||||
|
|
||||||
|
$settings->name = "Random Test Company";
|
||||||
|
$settings->currency_id = '1';
|
||||||
|
$settings->language_id = '1';
|
||||||
|
|
||||||
$account = Account::factory()->create();
|
$account = Account::factory()->create();
|
||||||
$company = Company::factory()->create([
|
$company = Company::factory()->create([
|
||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
|
'settings' => $settings,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$account->default_company_id = $company->id;
|
$account->default_company_id = $company->id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user