1 [% USE HTML %][% USE L %][% USE LxERP %]
3 <form method="post" action="controller.pl">
4 <div class="listtop">[% FORM.title %]</div>
6 [%- INCLUDE 'common/flash.html' %]
8 <table class="rs_input_field">
10 <td>[% LxERP.t8("Title") %]</td>
11 <td>[% L.input_tag("requirement_spec.title", SELF.requirement_spec.description) %]</td>
15 <td>[% LxERP.t8("Requirement Spec Type") %]</td>
16 <td>[% L.select_tag("requirement_spec.type_id", SELF.types, default=SELF.requirement_spec.type_id, title_key="description") %]</td>
20 <td>[% LxERP.t8("Requirement Spec Status") %]</td>
21 <td>[% L.select_tag("requirement_spec.status_id", SELF.statuses, default=SELF.requirement_spec.status_id, title_key="description") %]</td>
25 <td>[% LxERP.t8("Customer") %]</td>
26 <td>[% L.select_tag("requirement_spec.customer_id", SELF.customers, default=SELF.requirement_spec.customer_id, title_key="name", id="customer_id") %]</td>
30 <td>[% LxERP.t8("Hourly Rate") %]</td>
31 <td>[% L.input_tag("requirement_spec.hourly_rate_as_number", SELF.requirement_spec.hourly_rate_as_number, id="hourly_rate") %]</td>
37 [% L.hidden_tag("id", SELF.requirement_spec.id) %]
38 [% L.hidden_tag("action", "RequirementSpec/dispatch") %]
39 [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save')) %]
40 [%- IF SELF.requirement_spec.id %]
41 [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) %]
43 <a href="[% SELF.url_for(action="list") %]">[% LxERP.t8('Abort') %]</a>
47 <script type="text/javascript">
49 function on_customer_changed() {
51 url: 'controller.pl?action=Customer/get_hourly_rate',
53 data: { id: $("#customer_id").attr('value') },
54 success: function(data) { if (data["hourly_rate"] > 0) $("#hourly_rate").attr("value", data["hourly_rate_formatted"]); }
58 $(document).ready(function() {
59 $("#customer_id").change(on_customer_changed);