[%- USE LxERP -%][%- USE L -%][%- USE HTML -%] [% SET data = job.data_as_hash %]

[% LxERP.t8("Watch status") %]

[% L.hidden_tag('', job.id, id="mdo_job_id") %]

[% LxERP.t8("This status output will be refreshed every five seconds.") %]

[% IF data.status < 2 %] [% L.link("login.pl?action=company_logo", LxERP.t8("Open new tab"), target="_blank") %] [% ELSE %] [% IF data.pdf_file_name %] [% L.link(SELF.url_for(action="mass_mdo_download", job_id=job.id), LxERP.t8("Download PDF")) %] [% END %] [% L.link("#", LxERP.t8("Close window"), onclick="kivi.MassDeliveryOrderPrint.massConversionFinishProcess();") %] [% END %]

[% LxERP.t8("Current status:") %] [% IF !data.status %] [% LxERP.t8("waiting for job to be started") %] [% ELSIF data.status == 1 %] [% LxERP.t8("Creating Documents") %] [% ELSIF data.status == 2 %] [% LxERP.t8("Printing Documents") %] [% ELSE %] [% LxERP.t8("Done.") %] [% IF data.pdf_file_name %] [% LxERP.t8("The file is available for download.") %] [% ELSIF data.printer_id %] [% LxERP.t8("The file has been sent to the printer.") %] [% END %] [% END %]
[% LxERP.t8("Number of delivery orders created:") %] [% IF data.status > 0 %][% HTML.escape(data.num_created) %] / [% HTML.escape(data.record_ids.size) %][% ELSE %]–[% END %]
[% LxERP.t8("Number of delivery orders printed:") %] [% IF data.status > 1 %][% HTML.escape(data.num_printed) %] / [% HTML.escape(data.record_ids.size) %][% ELSE %]–[% END %]
[% LxERP.t8("Errors during conversion:") %] [% IF !data.status %] – [% ELSIF !data.conversion_errors.size %] [% LxERP.t8("No errors have occurred.") %] [% ELSE %] [% FOREACH error = data.conversion_errors %] [% END %]
[% LxERP.t8("Delivery Order") %] [% LxERP.t8("Error") %]
[% IF error.id %][% L.link(SELF.url_for(controller='do.pl', action='edit', type='sales_delivery_order', id=error.id), HTML.escape(error.number), target="_blank") %][% ELSE %]–[% END %] [% HTML.escape(error.message) %]
[% END %]
[% LxERP.t8("Errors during printing:") %] [% IF data.status < 2 %] – [% ELSIF !data.print_errors.size %] [% LxERP.t8("No errors have occurred.") %] [% ELSE %] [% FOREACH error = data.print_errors %] [% END %]
[% LxERP.t8("Invoice") %] [% LxERP.t8("Error") %]
[% IF error.id %][% L.link(SELF.url_for(controller='is.pl', action='edit', type='sales_invoice',id=error.id), HTML.escape(error.number), target="_blank") %][% ELSE %]–[% END %] [% HTML.escape(error.message) %]
[% END %]