test action
[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
12   <p>
13    <table border="0">
14     <tr>
15      <th align="right">[% LxERP.t8('Status') %]</th>
16      <td>[% L.checkbox_tag("active", checked => config.active, label => LxERP.t8('Active')) %]</td>
17     </tr>
18
19     <tr>
20      <td>&nbsp;</td>
21      <td>
22       [% L.checkbox_tag('terminated', label => LxERP.t8('terminated'), checked => config.terminated) %]
23      </td>
24     </tr>
25
26     <tr>
27      <th align="right" valign="top">[%- LxERP.t8('Billing Periodicity') %]</th>
28      <td valign="top">
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) %]
30      </td>
31     </tr>
32
33     <tr>
34      <th align="right" valign="top">[%- LxERP.t8('Order value periodicity') %]</th>
35      <td valign="top">
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) %]
40      </td>
41     </tr>
42
43     <tr>
44      <th align="right">[%- LxERP.t8('Start date') %]</th>
45      <td valign="top">
46       [% L.date_tag("start_date_as_date", config.start_date_as_date) %]
47      </td>
48     </tr>
49
50     <tr>
51      <th align="right">[%- LxERP.t8('End date') %]<sup>(1)</sup></th>
52      <td valign="top">
53       [% L.date_tag("end_date_as_date", config.end_date_as_date) %]
54      </td>
55     </tr>
56
57     <tr>
58      <th align="right">[%- LxERP.t8('Create first invoice on') %]<sup>(2)</sup></th>
59      <td valign="top">
60       [% L.date_tag("first_billing_date_as_date", config.first_billing_date_as_date) %]
61      </td>
62     </tr>
63
64     <tr>
65      <th align="right">[% LxERP.t8('Extend automatically by n months') %]</th>
66      <td valign="top">
67       [% L.input_tag("extend_automatically_by", config.extend_automatically_by, size => 10) %]
68      </td>
69     </tr>
70
71     <tr>
72      <th align="right">[%- LxERP.t8('Record in') %]</th>
73      <td valign="top">
74       [% L.select_tag("ar_chart_id", AR, title_key => 'description', default => config.ar_chart_id, style=style) %]
75      </td>
76     </tr>
77
78     <tr>
79      <th align="right">[%- LxERP.t8('direct debit') %]</th>
80      <td valign="top">[% L.checkbox_tag("direct_debit", checked=config.direct_debit) %]</td>
81     </tr>
82
83     <tr class="rule-before">
84      <th align="right">[%- LxERP.t8('Print automatically') %]</th>
85      <td valign="top">
86       [% L.checkbox_tag("print", onclick => "toggle_printer_id_ctrl()", checked => config.print) %]
87      </td>
88     </tr>
89
90     <tr>
91      <th align="right">[%- LxERP.t8('Printer') %]</th>
92      <td valign="top">
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) %]
94      </td>
95     </tr>
96
97     <tr>
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>
100     </tr>
101
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>
105     </tr>
106     <tr>
107      <th align="right">[%- LxERP.t8("Email of the invoice recipient") %]</th>
108      <td>[% email_recipient_invoice_address %]</td>
109     </tr>
110     <tr>
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>
113     </tr>
114
115     <tr>
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>
118     </tr>
119
120     <tr>
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>
123     </tr>
124
125     <tr>
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>
128     </tr>
129
130     <tr>
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>
133     </tr>
134    </table>
135   </p>
136
137   <hr>
138
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>
143
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')) %]
147
148   [%- ELSE -%]
149     [% L.hidden_tag('action', 'save_periodic_invoices_config') %]
150
151     <p>
152      [% L.submit_tag('', LxERP.t8('Assign')) %]
153      [% L.submit_tag('', LxERP.t8('Cancel'), onclick => "self.close(); return false;") %]
154     </p>
155   [%- END -%]
156  </form>
157
158  <script type="text/javascript">
159   <!--
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);
164     }
165
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);
173     }
174     -->
175  </script>