4 [% SET style="width: 400px" %]
6 [%- IF !popup_dialog -%]
10 <form name="Form" action="oe.pl" method="post">
11 [%- IF popup_dialog -%]
12 [% L.button_tag(popup_js_assign_function, LxERP.t8('Assign')) %]
13 [% L.button_tag(popup_js_close_function, LxERP.t8('Cancel')) %]
16 [% L.hidden_tag('action', 'save_periodic_invoices_config') %]
19 [% L.submit_tag('', LxERP.t8('Assign')) %]
20 [% L.submit_tag('', LxERP.t8('Cancel'), onclick => "self.close(); return false;") %]
27 <th align="right">[% LxERP.t8('Status') %]</th>
28 <td>[% L.checkbox_tag("active", checked => config.active, label => LxERP.t8('Active')) %]</td>
34 [% L.checkbox_tag('terminated', label => LxERP.t8('terminated'), checked => config.terminated) %]
39 <th align="right" valign="top">[%- LxERP.t8('Billing Periodicity') %]</th>
41 [% L.select_tag("periodicity", [ [ "o", LxERP.t8("one time") ], [ "m", LxERP.t8("monthly") ], [ "q", LxERP.t8("every third month") ], [ "b", LxERP.t8("semiannually") ], [ "y", LxERP.t8("yearly") ] ], default=config.periodicity, style=style) %]
46 <th align="right" valign="top">[%- LxERP.t8('Order value periodicity') %]</th>
48 [% L.select_tag("order_value_periodicity",
49 [ [ "p", LxERP.t8("same as periodicity") ], [ "m", LxERP.t8("monthly") ], [ "q", LxERP.t8("every third month") ], [ "b", LxERP.t8("semiannually") ], [ "y", LxERP.t8("yearly") ],
50 [ "2", LxERP.t8("2 years") ], [ "3", LxERP.t8("3 years") ], [ "4", LxERP.t8("4 years") ], [ "5", LxERP.t8("5 years") ], ],
51 default=config.order_value_periodicity, style=style) %]
56 <th align="right">[%- LxERP.t8('Start date') %]</th>
58 [% L.date_tag("start_date_as_date", config.start_date_as_date) %]
63 <th align="right">[%- LxERP.t8('End date') %]<sup>(1)</sup></th>
65 [% L.date_tag("end_date_as_date", config.end_date_as_date) %]
70 <th align="right">[%- LxERP.t8('Create first invoice on') %]<sup>(2)</sup></th>
72 [% L.date_tag("first_billing_date_as_date", config.first_billing_date_as_date) %]
77 <th align="right">[% LxERP.t8('Extend automatically by n months') %]</th>
79 [% L.input_tag("extend_automatically_by", config.extend_automatically_by, size => 10) %]
84 <th align="right">[%- LxERP.t8('Record in') %]</th>
86 [% L.select_tag("ar_chart_id", AR, title_key => 'description', default => config.ar_chart_id, style=style) %]
91 <th align="right">[%- LxERP.t8('direct debit') %]</th>
92 <td valign="top">[% L.checkbox_tag("direct_debit", checked=config.direct_debit) %]</td>
95 <tr class="rule-before">
96 <th align="right">[%- LxERP.t8('Print automatically') %]</th>
98 [% L.checkbox_tag("print", onclick => "toggle_printer_id_ctrl()", checked => config.print) %]
103 <th align="right">[%- LxERP.t8('Printer') %]</th>
105 [% L.select_tag("printer_id", ALL_PRINTERS, title_key = 'printer_description', default = config.printer_id, disabled = !config.print, id = "pic_printer_id", style=style) %]
110 <th align="right">[%- LxERP.t8('Copies') %]</th>
111 <td valign="top">[% L.input_tag("copies", config.copies, size => 6, disabled => !config.print, id = "pic_copies") %]</td>
114 <tr class="rule-before">
115 <th align="right">[%- LxERP.t8("Send invoice via email") %]</th>
116 <td>[% L.checkbox_tag("send_email", onclick => "toggle_send_email_ctrl()", checked=config.send_email, disabled=postal_invoice) %]</td>
119 <th align="right">[%- LxERP.t8("Email of the invoice recipient") %]</th>
120 <td>[% email_recipient_invoice_address %]</td>
123 <th align="right">[%- LxERP.t8("Contact to send to") %]</th>
124 <td>[% L.select_tag("email_recipient_contact_id", ALL_CONTACTS, title_key="full_name_dep", value_key="cp_id", default=config.email_recipient_contact_id, with_empty=1, disabled=!config.send_email, style=style) %]</td>
128 <th align="right">[%- LxERP.t8("Other recipients") %]<sup>3</sup></th>
129 <td>[% L.input_tag("email_recipient_address", config.email_recipient_address, disabled=!config.send_email, style=style) %]</td>
133 <th align="right">[%- LxERP.t8("Sender") %]<sup>4</sup></th>
134 <td>[% L.input_tag("email_sender", config.email_sender, disabled=!config.send_email, style=style) %]</td>
138 <th align="right">[%- LxERP.t8("Subject") %]</th>
139 <td>[% L.input_tag("email_subject", config.email_subject, disabled=!config.send_email, style=style) %]</td>
143 <th align="right" valign="top">[%- LxERP.t8("Message") %]</th>
144 <td valign="top">[% L.textarea_tag("email_body", config.email_body, disabled=!config.send_email, rows=8, style=style, class="texteditor") %]</td>
151 <p>(1): [%- LxERP.t8('The end date is the last day for which invoices will possibly be created.') %]</p>
152 <p>(2): [% LxERP.t8("If missing then the start date will be used.") %]</p>
153 <p>(3): [% LxERP.t8("Multiple addresses can be entered separated by commas.") %]</p>
154 <p>(4): [% LxERP.t8("If left empty the default sender from the kivitendo configuration will be used (key 'email_from' in section 'periodic_invoices'; current value: #1).", HTML.escape(LXCONFIG.periodic_invoices.email_from)) %]</p>
157 <script type="text/javascript">
159 function toggle_printer_id_ctrl() {
160 var disabled = !$('#print').prop('checked');
161 $('#pic_printer_id').prop('disabled', disabled);
162 $('#pic_copies').prop('disabled', disabled);
165 function toggle_send_email_ctrl() {
166 var disabled = !$('#send_email').prop('checked');
167 $('#email_recipient_contact_id').prop('disabled', disabled);
168 $('#email_recipient_address').prop('disabled', disabled);
169 $('#email_sender').prop('disabled', disabled);
170 $('#email_subject').prop('disabled', disabled);
171 $('#email_body').data('ckeditorInstance').setReadOnly(disabled);