+
+ # departments
+ if (@{ $form->{all_departments} }) {
+ $form->{selectdepartment} = "<option>\n";
+
+ map { $form->{selectdepartment} .= qq|<option value="$_->{description}--$_->{id}">$_->{description}\n| } (@{ $form->{all_departments} });
+ }
+
+ $department = qq|
+ <tr>
+ <th align=right nowrap>|.$locale->text('Department').qq|</th>
+ <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
+ </tr>
+| if $form->{selectdepartment};
+
+ $form->{title} = $locale->text('AP Transactions');
+
+ $invnumber = qq|
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td colspan=3><input name=invnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td colspan=3><input name=ordnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Notes').qq|</th>
+ <td colspan=3><input name=notes size=40></td>
+ </tr>
+|;
+
+ $openclosed = qq|
+ <tr>
+ <td align=right><input name=open class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Open').qq|</td>
+ <td align=right><input name=closed class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Closed').qq|</td>
+ </tr>
+|;
+
+ if ($form->{outstanding}) {
+ $form->{title} = $locale->text('AP Outstanding');
+ $invnumber = "";
+ $openclosed = "";
+ }
+
+ # accounting years
+ $form->{selectaccountingyear} = "<option>\n";
+ map { $form->{selectaccountingyear} .= qq|<option>$_\n| } @{ $form->{all_years} };
+ $form->{selectaccountingmonth} = "<option>\n";
+ map { $form->{selectaccountingmonth} .= qq|<option value=$_>|.$locale->text($form->{all_month}{$_}).qq|\n| } sort keys %{ $form->{all_month} };
+
+ $selectfrom = qq|
+ <tr>
+ <th align=right>|.$locale->text('Period').qq|</th>
+ <td colspan=3>
+ <select name=month>$form->{selectaccountingmonth}</select>
+ <select name=year>$form->{selectaccountingyear}</select>
+ <input name=interval class=radio type=radio value=0 checked>|.$locale->text('Current').qq|
+ <input name=interval class=radio type=radio value=1>|.$locale->text('Month').qq|
+ <input name=interval class=radio type=radio value=3>|.$locale->text('Quarter').qq|
+ <input name=interval class=radio type=radio value=12>|.$locale->text('Year').qq|
+ </td>
+ </tr>
+|;