Erfolgsrechnung
[kivitendo-erp.git] / templates / webpages / rp / report.html
index 158c0cc..1eb5e48 100644 (file)
@@ -9,7 +9,9 @@
   </tr>
   <tr>
     <th colspan=1>[% 'Year' | $T8 %]</th>
-    <td><input name=year size=11 title="[% 'YYYY' | $T8 %]" value="[% year %]"></td>
+    <td>
+      <input name=year size=11 title="[% 'YYYY' | $T8 %]" value="[% year %]" class="initial_focus" oninput='set_from_to(duetyp.value, this.value)'>
+    </td>
   </tr>
   <tr>
     <td align=right> <b>[% 'Yearly' | $T8 %]</b> </td>
     <th align=left colspan=3>[% 'Monthly' | $T8 %]</th>
   </tr>
   <tr>
-    <td align=right>&nbsp; <input name=duetyp class=radio type=radio value="13"></td>
-    <td><input name=duetyp class=radio type=radio value="A">&nbsp;1. [% 'Quarter' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="1" checked>&nbsp;[% 'January' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="5">&nbsp;[% 'May' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="9">&nbsp;[% 'September' | $T8 %]</td>
+    <td align=right>&nbsp;
+      <input name=duetyp class=radio type=radio value="13" onchange='set_from_to(this.value, year.value)'>
+    </td>
+    <td><input name=duetyp class=radio type=radio value="A" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;1. [% 'Quarter' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="1" checked onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'January' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="5" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'May' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="9" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'September' | $T8 %]
+    </td>
   </tr>
   <tr>
     <td align= right>&nbsp;</td>
-    <td><input name=duetyp class=radio type=radio value="B">&nbsp;2. [% 'Quarter' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="2">&nbsp;[% 'February' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="6">&nbsp;[% 'June' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="10">&nbsp;[% 'October' | $T8 %]</td>
+    <td><input name=duetyp class=radio type=radio value="B" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;2. [% 'Quarter' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="2" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'February' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="6" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'June' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="10" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'October' | $T8 %]
+    </td>
   </tr>
   <tr>
     <td> &nbsp;</td>
-    <td><input name=duetyp class=radio type=radio value="C">&nbsp;3. [% 'Quarter' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="3">&nbsp;[% 'March' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="7">&nbsp;[% 'July' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="11">&nbsp;[% 'November' | $T8 %]</td>
+    <td><input name=duetyp class=radio type=radio value="C" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;3. [% 'Quarter' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="3" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'March' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="7" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'July' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="11" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'November' | $T8 %]
+    </td>
   </tr>
   <tr>
     <td> &nbsp;</td>
-    <td><input name=duetyp class=radio type=radio value="D">&nbsp;4. [% 'Quarter' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="4">&nbsp;[% 'April' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="8">&nbsp;[% 'August' | $T8 %]</td>
-    <td><input name=duetyp class=radio type=radio value="12">&nbsp;[% 'December' | $T8 %]</td>
+    <td><input name=duetyp class=radio type=radio value="D" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;4. [% 'Quarter' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="4" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'April' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="8" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'August' | $T8 %]
+    </td>
+    <td><input name=duetyp class=radio type=radio value="12" onchange='set_from_to(this.value, year.value)'>
+      &nbsp;[% 'December' | $T8 %]
+    </td>
   </tr>
   <tr>
     <td colspan=5><hr size=3 noshade></td>
@@ -51,7 +87,7 @@
     <th align=left><input name=reporttype class=radio type=radio value="free">[% 'Free report period' | $T8 %]</th>
     <td align=left colspan=4>
       [% 'From' | $T8 %] [% L.date_tag('fromdate', fromdate) %]
-      [% 'Bis' | $T8 %] [% L.date_tag('todate') %]
+      [% 'Bis' | $T8 %] [% L.date_tag('todate', todate)  %]
     </td>
   </tr>
   <tr>
   <tr>
     <th align=left>[% 'Method' | $T8 %]</th>
     <td colspan=3>
-      [% L.radio_button_tag('method', value='accrual', checked=accrual, label=LxERP.t8('Accrual')) %]
-      [% L.radio_button_tag('method', value='cash', checked=cash, label=LxERP.t8('cash')) %]
+      [% L.radio_button_tag('method', value='accrual', checked=(INSTANCE_CONF.get_accounting_method=='accrual'), label=LxERP.t8('Accrual')) %]
+      [% L.radio_button_tag('method', value='cash', checked=(INSTANCE_CONF.get_accounting_method=='cash'), label=LxERP.t8('cash')) %]
     </td>
   </tr>
 [%- END %]
+[%- BLOCK customer %]
+  <tr>
+    <th align=right nowrap>[% 'Customer' | $T8 %]</th>
+    <td colspan=3>[% L.customer_vendor_picker('customer_id', '', type='customer') %]</td>
+  </tr>
+[%- END %]
 [%- BLOCK projectnumber %]
   <tr>
     <th align=right nowrap>[% 'Project' | $T8 %]</th>
 <table border="0">
 [%- IF selectdepartment %]
   <tr>
-    <th align=right nowrap>[% 'Department' | $T8 %]</th>
+    <th align="left" nowrap>[% 'Department' | $T8 %]</th>
     <td colspan=3><select name=department>[% selectdepartment %]</select></td>
   </tr>
 [%- END %]
 
 [%- IF is_projects %]
-  <tr>
-    <th align=right nowrap>[% 'Project' | $T8 %]</th>
-    <td colspan=5><input name=projectnumber size=25</td>
-  </tr>
+  [% INCLUDE projectnumber %]
   <input type=hidden name=nextsub value=generate_projects>
   <tr>
-    <th align=right>[% 'as at' | $T8 %]</th>
-    <td> [% L.date_tag('fromdate', fromdate) %]</td>
-    <th align=right nowrap>[% 'Compare to' | $T8 %]</th>
+    <th align=right>[% 'From' | $T8 %]</th>
+    <td> [% L.date_tag('fromdate', fromdate, class='initial_focus') %]</td>
+    <th align=right nowrap>[% 'Bis' | $T8 %]</th>
     <td>[% L.date_tag('todate') %]</td>
   </tr>
 </table>
   </tr>
 [%- END %]
 
+
 [%- IF is_bwa %]
 [%- PROCESS projectnumber %]
   <input type=hidden name=nextsub value=generate_bwa>
   </tr>
 [%- END %]
 
+
+[%- IF is_erfolgsrechnung %]
+  <input type=hidden name=nextsub value=generate_erfolgsrechnung>
+</table>
+<table>
+[%- PROCESS customized_report %]
+[%- END %]
+
+
 [%- IF is_balance_sheet %]
   <input type=hidden name=nextsub value=generate_balance_sheet>
   <tr>
     <th align=right>[% 'as at' | $T8 %]</th>
-    <td> [% L.date_tag('asofdate', asofdate) %]</td>
+    <td> [% L.date_tag('asofdate', asofdate, class="initial_focus") %]</td>
+    <td><input name=l_cb class=checkbox type=checkbox value=Y>&nbsp;[% 'CB Transactions' | $T8 %]</td>
+    <td><input name=l_ob class=checkbox type=checkbox value=Y>&nbsp;[% 'only OB Transactions' | $T8 %]</td>
+  </tr>
+  </tr>
     <th align=right nowrap>[% 'Compare to' | $T8 %]</th>
     <td>[% L.date_tag('compareasofdate', compareasofdate) %]</td>
+    <td><input name=l_cb_compared class=checkbox type=checkbox value=Y>&nbsp;[% 'CB Transactions' | $T8 %]</td>
+    <td><input name=l_ob_compared class=checkbox type=checkbox value=Y>&nbsp;[% 'only OB Transactions' | $T8 %]</td>
   </tr>
   <tr>
     <th align=right>[% 'Decimalplaces' | $T8 %]</th>
     <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;[% 'Subtotal' | $T8 %]
     <input name=l_accno class=checkbox type=checkbox value=Y>&nbsp;[% 'Account Number' | $T8 %]</td>
   </tr>
-  <tr>
-    <th></th>
-    <td><input name=l_cb class=checkbox type=checkbox value=Y>&nbsp;[% 'CB Transactions' | $T8 %]
-    <input name=l_ob class=checkbox type=checkbox value=Y>&nbsp;[% 'only OB Transactions' | $T8 %]</td>
-  </tr>
 [%- END %]
 
 [%- IF is_trial_balance %]
+[%- PROCESS customer %]
 [%- PROCESS projectnumber %]
   <input type=hidden name=nextsub value=generate_trial_balance>
 </table>
 
 [%- IF is_aging %]
   <tr>
-    <th align=right>[% label %]</th>
+    <th align=left>[% label %]</th>
     <td>[% vc %]</td>
   </tr>
+</table>
+<table border="0">
   <tr>
-    <td>[% 'Review of Aging list' | $T8 %]</td>
-    <td><select name="review_of_aging_list">
+    <td colspan=5><hr size=1 noshade></td>
+  </tr>
+  <tr>
+    <th align=left><input name=reporttype class=radio type=radio value="custom" checked><b>[% 'Reference day' | $T8 %]</b> ([% 'Due Date' | $T8 %][% ', if set' | $T8 %])</b>&nbsp; </th>
+     <td align="right" colspan="4">[% 'Review of Aging list' | $T8 %] <select name="review_of_aging_list">
         <option></option>
         <option>0-30</option>
         <option>30-60</option>
         <option>60-90</option>
         <option>90-120</option>
         <option>&gt; 120</option>
-        </select>
+        </select> [% 'for date' | $T8 %] [% L.date_tag('fordate', today) %]
     </td>
   </tr>
   <tr>
-    <td align=left colspan=4>
+    <td colspan=5><hr size=3 noshade></td>
+ </tr>
+ <tr>
+    <th align=left><input name=reporttype class=radio type=radio value="free"><b>[% 'Free report period' | $T8 %]</b> ([% 'Invoice Date' | $T8 %])&nbsp; </th>
+    <td align="right" colspan=4>
       [% 'From' | $T8 %] [% L.date_tag('fromdate', fromdate) %]
       [% 'Bis' | $T8 %] [% L.date_tag('todate') %]
     </td>
   </tr>
   <tr>
     <th align=right>[% 'Reference' | $T8 %]</th>
-    <td colspan=3><input name=reference></td>
+    <td colspan=3><input name=reference class="initial_focus"></td>
   </tr>
   <tr>
     <th align=right nowrap>[% 'Source' | $T8 %]</th>
     </td>
   </tr>
 [%- END %]
-
-[%- IF 0 # is_nontaxable %]
-  <input type=hidden name=nextsub value=generate_tax_report>
-
-  <input type=hidden name=db value=[% db %]>
-  <input type=hidden name=sort value=transdate>
-  <input type=hidden name=report value='[% report %]'>
-
-  <tr>
-    <th align=right>[% 'From' | $T8 %]</th>
-    <td>[% L.date_tag('fromdate', fromdate) %]</td>
-    <th align=right>[% 'Bis' | $T8 %]</th>
-    <td>[% L.date_tag('todate', todate) %]</td>
-  </tr>
-[%- PROCESS cash_or_accrual %]
-  <tr>
-    <th align=right>[% 'Include in Report' | $T8 %]</th>
-    <td colspan=3>
-      <table>
-        <tr>
-          <td><input name="l_id" class=checkbox type=checkbox value=Y></td>
-          <td>[% 'ID' | $T8 %]</td>
-          <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
-          <td>[% 'Invoice' | $T8 %]</td>
-          <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
-          <td>[% 'Date' | $T8 %]</td>
-        </tr>
-        <tr>
-          <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
-          <td>
-            [% LxERP.t8('Customer') IF db == 'ar' %]
-            [% LxERP.t8('Vendor')   IF db == 'ap' %]
-       </td>
-          <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td>
-          <td>[% 'Amount' | $T8 %]</td>
-          <td><input name="l_amount" class=checkbox type=checkbox value=Y></td>
-          <td>[% 'Total' | $T8 %]</td>
-        </tr>
-        <tr>
-          <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
-          <td>[% 'Subtotal' | $T8 %]</td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-[%- END %]
 </table>
 
 <hr size=3 noshade>
 
 </form>
 
+<script type="text/javascript">
+function format_date(yy, mm, dd) {
+  var format = "[% dateformat %]";
+  format = format.replace("yyyy", "yy");
+  format = format.replace("yy", yy);
+  format = format.replace("mm", mm);
+  format = format.replace("dd", dd);
+  return format;
+}
+function set_from_to(duetyp, year) {
+  switch(duetyp) {
+    case '1':
+      document.getElementById('fromdate').value=format_date(year, '01', '01');
+      document.getElementById('todate').value=format_date(year, '01', '31');
+    break;
+    case '2':
+      document.getElementById('fromdate').value=format_date(year, '02', '01');
+      if(year % 4) document.getElementById('todate').value=format_date(year, '02', '28');
+      else document.getElementById('todate').value=format_date(year, '2', '29');
+    break;
+    case '3':
+      document.getElementById('fromdate').value=format_date(year, '03', '01');
+      document.getElementById('todate').value=format_date(year, '03', '31');
+    break;
+    case '4':
+      document.getElementById('fromdate').value=format_date(year, '04', '01');
+      document.getElementById('todate').value=format_date(year, '04', '30');
+    break;
+    case '5':
+      document.getElementById('fromdate').value=format_date(year, '05', '01');
+      document.getElementById('todate').value=format_date(year, '05', '31');
+    break;
+    case '6':
+      document.getElementById('fromdate').value=format_date(year, '06', '01');
+      document.getElementById('todate').value=format_date(year, '06', '30');
+    break;
+    case '7':
+      document.getElementById('fromdate').value=format_date(year, '07', '01');
+      document.getElementById('todate').value=format_date(year, '07', '31');
+    break;
+    case '8':
+      document.getElementById('fromdate').value=format_date(year, '08', '01');
+      document.getElementById('todate').value=format_date(year, '08', '31');
+    break;
+    case '9':
+      document.getElementById('fromdate').value=format_date(year, '09', '01');
+      document.getElementById('todate').value=format_date(year, '09', '30');
+    break;
+    case '10':
+      document.getElementById('fromdate').value=format_date(year, '10', '01');
+      document.getElementById('todate').value=format_date(year, '10', '31');
+    break;
+    case '11':
+      document.getElementById('fromdate').value=format_date(year, '11', '01');
+      document.getElementById('todate').value=format_date(year, '11', '30');
+    break;
+    case '12':
+      document.getElementById('fromdate').value=format_date(year, '12', '01');
+      document.getElementById('todate').value=format_date(year, '12', '31');
+    break;
+    case '13':
+      document.getElementById('fromdate').value=format_date(year, '01', '01');
+      document.getElementById('todate').value=format_date(year, '12', '31');
+    break;
+    case 'A':
+      document.getElementById('fromdate').value=format_date(year, '01', '01');
+      document.getElementById('todate').value=format_date(year, '03', '31');
+    break;
+    case 'B':
+      document.getElementById('fromdate').value=format_date(year, '04', '01');
+      document.getElementById('todate').value=format_date(year, '06', '30');
+    break;
+    case 'C':
+      document.getElementById('fromdate').value=format_date(year, '07', '01');
+      document.getElementById('todate').value=format_date(year, '09', '31');
+    break;
+    case 'D':
+      document.getElementById('fromdate').value=format_date(year, '10', '01');
+      document.getElementById('todate').value=format_date(year, '12', '31');
+    break;
+    default:
+      document.getElementById('fromdate').value=format_date(year, '01', '01');
+      document.getElementById('todate').value=format_date(year, '12', '31');
+  }
+  return true;
+}
+</script>
+