MT#5879 Default content on template creation and x- mimetype.

Store default template content on template creation.
Replace image/x-mimetype with image/mimetype to fix PDF generation.
gjungwirth/voicemail_number
Irina Peshinskaya 12 years ago
parent 9ca0ddc7bb
commit da71415239

@ -139,8 +139,9 @@ sub create :Chained('template_list') :PathPart('create') :Args() {
$form->params->{reseller_id} = $c->user->reseller_id;
}
delete $form->params->{reseller};
my $tmpl = $c->stash->{tmpl_rs}->create($form->params);
my $tmpl_params = $form->params;
$tmpl_params->{data} //= NGCP::Panel::Utils::InvoiceTemplate::svg_content($c, $tmpl_params->{data});
my $tmpl = $c->stash->{tmpl_rs}->create($tmpl_params);
# deactivate other templates if this one got active
if($tmpl->is_active) {
@ -385,6 +386,8 @@ sub embed_image :Chained('/') :PathPart('invoicetemplate/embedimage') :Args(0) {
$out->{image_content_base64} = encode_base64($out->{image_content}, '');
}
$c->log->debug('mime-type '.$out->{image_content_mimetype});
$out->{image_content_mimetype} =~s!image/x-([[:alnum:]]+)!image/$1!i;
$c->log->debug('mime-type for pdf generation:'.$out->{image_content_mimetype});
$c->stash(out => $out);
$c->stash(in => $in);
$c->stash(template => 'invoice/template_editor_aux_embedimage.tt');

@ -373,13 +373,14 @@ sub email{
$client_contact->{email} //= '';
$logger->debug("send email for: provider_contact_id=".$provider_contact->{id}.";client_contact_id=".$client_contact->{id}."; client_contact->email=".$client_contact->{email}."; invoice_ids=".join(",",@invoice_ids).";\n");
#one-by-one
$client_invoices = [$client_invoices->[0]];
@invoice_ids = map {$_->{id}} @$client_invoices;
if(@$client_invoices < 1 ){
return;
}
#one-by-one
$client_invoices = [$client_invoices->[0]];
@invoice_ids = map {$_->{id}} @$client_invoices;
$client_contact->{email} //= '';
if($client_contact->{email}){

Loading…
Cancel
Save