Merge branch 'test' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / oe / edit_periodic_invoices_config.html
1 [% USE HTML %]
2 [% USE LxERP %]
3 [% USE L %]
4 [% SET style="width: 400px" %]
5
6 [%- IF !popup_dialog -%]
7 <h1>[% title %]</h1>
8 [%- END -%]
9
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')) %]
14
15   [%- ELSE -%]
16     [% L.hidden_tag('action', 'save_periodic_invoices_config') %]
17
18     <p>
19      [% L.submit_tag('', LxERP.t8('Assign')) %]
20      [% L.submit_tag('', LxERP.t8('Cancel'), onclick => "self.close(); return false;") %]
21     </p>
22   [%- END -%]
23
24   <p>
25    <table border="0">
26     <tr>
27      <th align="right">[% LxERP.t8('Status') %]</th>
28      <td>[% L.checkbox_tag("active", checked => config.active, label => LxERP.t8('Active')) %]</td>
29     </tr>
30
31     <tr>
32      <td>&nbsp;</td>
33      <td>
34       [% L.checkbox_tag('terminated', label => LxERP.t8('terminated'), checked => config.terminated) %]
35      </td>
36     </tr>
37
38     <tr>
39      <th align="right" valign="top">[%- LxERP.t8('Billing Periodicity') %]</th>
40      <td valign="top">
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) %]
42      </td>
43     </tr>
44
45     <tr>
46      <th align="right" valign="top">[%- LxERP.t8('Order value periodicity') %]</th>
47      <td valign="top">
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) %]
52      </td>
53     </tr>
54
55     <tr>
56      <th align="right">[%- LxERP.t8('Start date') %]</th>
57      <td valign="top">
58       [% L.date_tag("start_date_as_date", config.start_date_as_date) %]
59      </td>
60     </tr>
61
62     <tr>
63      <th align="right">[%- LxERP.t8('End date') %]<sup>(1)</sup></th>
64      <td valign="top">
65       [% L.date_tag("end_date_as_date", config.end_date_as_date) %]
66      </td>
67     </tr>
68
69     <tr>
70      <th align="right">[%- LxERP.t8('Create first invoice on') %]<sup>(2)</sup></th>
71      <td valign="top">
72       [% L.date_tag("first_billing_date_as_date", config.first_billing_date_as_date) %]
73      </td>
74     </tr>
75
76     <tr>
77      <th align="right">[% LxERP.t8('Extend automatically by n months') %]</th>
78      <td valign="top">
79       [% L.input_tag("extend_automatically_by", config.extend_automatically_by, size => 10) %]
80      </td>
81     </tr>
82
83     <tr>
84      <th align="right">[%- LxERP.t8('Record in') %]</th>
85      <td valign="top">
86       [% L.select_tag("ar_chart_id", AR, title_key => 'description', default => config.ar_chart_id, style=style) %]
87      </td>
88     </tr>
89
90     <tr>
91      <th align="right">[%- LxERP.t8('direct debit') %]</th>
92      <td valign="top">[% L.checkbox_tag("direct_debit", checked=config.direct_debit) %]</td>
93     </tr>
94
95     <tr class="rule-before">
96      <th align="right">[%- LxERP.t8('Print automatically') %]</th>
97      <td valign="top">
98       [% L.checkbox_tag("print", onclick => "toggle_printer_id_ctrl()", checked => config.print) %]
99      </td>
100     </tr>
101
102     <tr>
103      <th align="right">[%- LxERP.t8('Printer') %]</th>
104      <td valign="top">
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) %]
106      </td>
107     </tr>
108
109     <tr>
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>
112     </tr>
113
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>
117     </tr>
118     <tr>
119      <th align="right">[%- LxERP.t8("Email of the invoice recipient") %]</th>
120      <td>[% email_recipient_invoice_address %]</td>
121     </tr>
122     <tr>
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>
125     </tr>
126
127     <tr>
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>
130     </tr>
131
132     <tr>
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>
135     </tr>
136
137     <tr>
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>
140     </tr>
141
142     <tr>
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 texteditor-space-for-toolbar") %]</td>
145     </tr>
146    </table>
147   </p>
148
149   <hr>
150
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>
155  </form>
156
157  <script type="text/javascript">
158   <!--
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);
163     }
164
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);
172     }
173     -->
174  </script>