Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / requirement_spec / _show_time_and_cost_estimate.html
1 [%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE P -%]
2 [%- DEFAULT id_prefix = 'time_and_cost_estimate_form' %]
3 [%- SET total_cost = 0 %]
4
5 <div id="time_cost_estimate"[% IF initially_hidden %] style="display: none;"[% END %]>
6  [%- IF !SELF.requirement_spec.sections.size %]
7   <p>[%- LxERP.t8("Neither sections nor function blocks have been created yet.") %]</p>
8
9  [%- ELSE %]
10
11   [%- SET at_least_one_function_block = 0 %]
12
13   <table class="time-cost-estimate time-cost-estimate-context-menu">
14    <tbody>
15     [%- FOREACH section = SELF.requirement_spec.sections_sorted %]
16      <tr class="listheading">
17       <th>[%- LxERP.t8("Function block") %]</th>
18       <th>[%- LxERP.t8("Complexity") %]</th>
19       <th>[%- LxERP.t8("Risk") %]</th>
20       <th align="right">[%- LxERP.t8("Time estimate") %]</th>
21       [%- UNLESS SELF.requirement_spec.is_template %]
22        <th align="right">[%- LxERP.t8("Price") %]</th>
23       [%- END %]
24      </tr>
25
26      <tr class="listrow section">
27       <td colspan="5">[%- HTML.escape(section.fb_number) %]: [%- HTML.escape(section.title) %]</td>
28      </tr>
29
30      [%- IF section.children.size %]
31       [%- SET at_least_one_function_block = 1 %]
32       [%- FOREACH child = section.children_sorted %]
33        [%- INCLUDE 'requirement_spec/_show_time_and_cost_estimate_item.html'
34                    section = section
35                    item    = child
36                    level   = 1 %]
37       [%- END %]
38
39       <tr class="listrow subtotal">
40        <td style="padding-left: 50px" colspan="3" class="sum">[%- LxERP.t8("Sum for section") -%]:</td>
41        <td align="right" nowrap>[%- P.format_man_days(section.time_estimation, 'skip_zero'=1) -%]</td>
42        [%- UNLESS SELF.requirement_spec.is_template %]
43         [%- SET section_cost = section.time_estimation * SELF.requirement_spec.hourly_rate * section.sellprice_factor;
44                 total_cost   = total_cost + section_cost %]
45         <td align="right" nowrap>[%- LxERP.format_amount(section_cost, 2) -%] EUR</td>
46        [%- END %]
47       </tr>
48      [%- END -%]
49     [%- END -%]
50    </tbody>
51
52    <tfoot>
53     <tr>
54      <td colspan="3">[%- LxERP.t8("Sum for #1", SELF.requirement_spec.type.description) -%]:</td>
55      <td align="right" nowrap>[%- P.format_man_days(SELF.requirement_spec.time_estimation) -%]</td>
56      [%- UNLESS SELF.requirement_spec.is_template %]
57       <td align="right" nowrap>[%- LxERP.format_amount(total_cost, 2) -%] EUR</td>
58      [%- END %]
59     </tr>
60    </tfoot>
61   </table>
62  [%- END %]
63 </div>