4 [% SET style="width: 400px" %]
6 [%- IF !popup_dialog -%]
10 <form name="Form" action="oe.pl" method="post">
15 <th align="right">[% LxERP.t8('Status') %]</th>
16 <td>[% L.checkbox_tag("active", checked => config.active, label => LxERP.t8('Active')) %]</td>
22 [% L.checkbox_tag('terminated', label => LxERP.t8('terminated'), checked => config.terminated) %]
27 <th align="right" valign="top">[%- LxERP.t8('Billing Periodicity') %]</th>
29 [% 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) %]
34 <th align="right" valign="top">[%- LxERP.t8('Order value periodicity') %]</th>
36 [% L.select_tag("order_value_periodicity",
37 [ [ "p", LxERP.t8("same as periodicity") ], [ "m", LxERP.t8("monthly") ], [ "q", LxERP.t8("every third month") ], [ "b", LxERP.t8("semiannually") ], [ "y", LxERP.t8("yearly") ],
38 [ "2", LxERP.t8("2 years") ], [ "3", LxERP.t8("3 years") ], [ "4", LxERP.t8("4 years") ], [ "5", LxERP.t8("5 years") ], ],
39 default=config.order_value_periodicity, style=style) %]
44 <th align="right">[%- LxERP.t8('Start date') %]</th>
46 [% L.date_tag("start_date_as_date", config.start_date_as_date) %]
51 <th align="right">[%- LxERP.t8('End date') %]<sup>(1)</sup></th>
53 [% L.date_tag("end_date_as_date", config.end_date_as_date) %]
58 <th align="right">[%- LxERP.t8('Create first invoice on') %]<sup>(2)</sup></th>
60 [% L.date_tag("first_billing_date_as_date", config.first_billing_date_as_date) %]
65 <th align="right">[% LxERP.t8('Extend automatically by n months') %]</th>
67 [% L.input_tag("extend_automatically_by", config.extend_automatically_by, size => 10) %]
72 <th align="right">[%- LxERP.t8('Record in') %]</th>
74 [% L.select_tag("ar_chart_id", AR, title_key => 'description', default => config.ar_chart_id, style=style) %]
79 <th align="right">[%- LxERP.t8('direct debit') %]</th>
80 <td valign="top">[% L.checkbox_tag("direct_debit", checked=config.direct_debit) %]</td>
83 <tr class="rule-before">
84 <th align="right">[%- LxERP.t8('Print automatically') %]</th>
86 [% L.checkbox_tag("print", onclick => "toggle_printer_id_ctrl()", checked => config.print) %]
91 <th align="right">[%- LxERP.t8('Printer') %]</th>
93 [% L.select_tag("printer_id", ALL_PRINTERS, title_key = 'printer_description', default = config.printer_id, disabled = !config.print, id = "pic_printer_id", style=style) %]
98 <th align="right">[%- LxERP.t8('Copies') %]</th>
99 <td valign="top">[% L.input_tag("copies", config.copies, size => 6, disabled => !config.print, id = "pic_copies") %]</td>
102 <tr class="rule-before">
103 <th align="right">[%- LxERP.t8("Send invoice via email") %]</th>
104 <td>[% L.checkbox_tag("send_email", onclick => "toggle_send_email_ctrl()", checked=config.send_email, disabled=postal_invoice) %]</td>
107 <th align="right">[%- LxERP.t8("Email of the invoice recipient") %]</th>
108 <td>[% email_recipient_invoice_address %]</td>
111 <th align="right">[%- LxERP.t8("Contact to send to") %]</th>
112 <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>
116 <th align="right">[%- LxERP.t8("Other recipients") %]<sup>3</sup></th>
117 <td>[% L.input_tag("email_recipient_address", config.email_recipient_address, disabled=!config.send_email, style=style) %]</td>
121 <th align="right">[%- LxERP.t8("Sender") %]<sup>4</sup></th>
122 <td>[% L.input_tag("email_sender", config.email_sender, disabled=!config.send_email, style=style) %]</td>
126 <th align="right">[%- LxERP.t8("Subject") %]</th>
127 <td>[% L.input_tag("email_subject", config.email_subject, disabled=!config.send_email, style=style) %]</td>
131 <th align="right" valign="top">[%- LxERP.t8("Message") %]</th>
132 <td valign="top">[% L.textarea_tag("email_body", config.email_body, disabled=!config.send_email, rows=8, style=style) %]</td>
139 <p>(1): [%- LxERP.t8('The end date is the last day for which invoices will possibly be created.') %]</p>
140 <p>(2): [% LxERP.t8("If missing then the start date will be used.") %]</p>
141 <p>(3): [% LxERP.t8("Multiple addresses can be entered separated by commas.") %]</p>
142 <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>
144 [%- IF popup_dialog -%]
145 [% L.button_tag(popup_js_assign_function, LxERP.t8('Assign')) %]
146 [% L.button_tag(popup_js_close_function, LxERP.t8('Cancel')) %]
149 [% L.hidden_tag('action', 'save_periodic_invoices_config') %]
152 [% L.submit_tag('', LxERP.t8('Assign')) %]
153 [% L.submit_tag('', LxERP.t8('Cancel'), onclick => "self.close(); return false;") %]
158 <script type="text/javascript">
160 function toggle_printer_id_ctrl() {
161 var disabled = !$('#print').prop('checked');
162 $('#pic_printer_id').prop('disabled', disabled);
163 $('#pic_copies').prop('disabled', disabled);
166 function toggle_send_email_ctrl() {
167 var disabled = !$('#send_email').prop('checked');
168 $('#email_recipient_contact_id').prop('disabled', disabled);
169 $('#email_recipient_address').prop('disabled', disabled);
170 $('#email_sender').prop('disabled', disabled);
171 $('#email_subject').prop('disabled', disabled);
172 $('#email_body').prop('disabled', disabled);