diff --git a/lib/Owlcode/Tech/Facturer.pm b/lib/Owlcode/Tech/Facturer.pm index 1b27fad..9243f94 100644 --- a/lib/Owlcode/Tech/Facturer.pm +++ b/lib/Owlcode/Tech/Facturer.pm @@ -33,6 +33,9 @@ sub postal_code ($self) { } sub image ($self) { + if (!defined $self->config->{img}) { + return + } return $ROOT_PATH->child($self->config->{img}); } diff --git a/lib/Owlcode/Tech/Facturer/MainCommand.pm b/lib/Owlcode/Tech/Facturer/MainCommand.pm index 0b62183..a1337a2 100644 --- a/lib/Owlcode/Tech/Facturer/MainCommand.pm +++ b/lib/Owlcode/Tech/Facturer/MainCommand.pm @@ -81,7 +81,12 @@ sub run ($self) { COMPLETA => $COMPLETA, concepts => $concepts, final_data => $final_data, - logo => MIME::Base64::encode_base64($logo->slurp_raw), + ( + ( defined $logo ) + ? ( logo => MIME::Base64::encode_base64( $logo->slurp_raw ), + ) + : ( logo => undef ) + ), } ) ); @@ -94,7 +99,9 @@ sub template_bill ($self) {
+% if (defined $logo) { +% }

Factura <%=$kind_of_bill eq $SIMPLIFICADA ? 'Simplificada' : 'Completa'%>

Datos de factura