$form->{description} =~ s/\"/"/g;
if (@{ $form->{TAXKEY} }) {
- foreach $item (@{ $form->{TAXKEY} }) {
+ foreach my $item (@{ $form->{TAXKEY} }) {
+
+ $item->{rate} = $item->{rate} * 100 . '%';
+
if ($item->{tax} == $form->{tax}) {
$form->{selecttaxkey} .=
- "<option value=$item->{tax} selected>$item->{taxdescription}\n";
+ "<option value=$item->{tax} selected>$item->{taxdescription} ($item->{rate})\n";
} else {
$form->{selecttaxkey} .=
- "<option value=$item->{tax}>$item->{taxdescription}\n";
+ "<option value=$item->{tax}>$item->{taxdescription} ($item->{rate})\n";
}
}
$discount =
$form->format_amount(\%myconfig, $ref->{discount} * 100);
$description =
- ($ref->{salesman})
- ? "<b>$ref->{description}</b>"
- : "$ref->{description}";
+ $ref->{description};
$column_data{description} =
qq|<td><a href=$form->{script}?action=edit_business&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$description</td>|;
$column_data{discount} = qq|<td align=right>$discount</td>|;
$lxdebug->enter_sub();
$form->{title} = $locale->text("$form->{title} Business");
- $form->{salesman} = "checked" if $form->{salesman};
# $locale->text('Add Business')
# $locale->text('Edit Business')
<th align=right>| . $locale->text('Customernumberinit') . qq|</th>
<td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
</tr>
- <tr>
- <td align=right>| . $locale->text('Salesman') . qq|</td>
- <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
- </tr>
<td colspan=2><hr size=3 noshade></td>
</tr>
</table>
$column_data{up} =
qq|<td align="center" valign="center" width="16">| .
qq|<a href="${swap_link}id1=$ref->{id}&id2=$pref->{id}">| .
- qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">| .
+ qq|<img border="0" src="image/up.png" alt="| . $locale->text("up") . qq|">| .
qq|</a></td>|;
} else {
$column_data{up} = qq|<td width="16"> </td>|;
$column_data{down} =
qq|<td align="center" valign="center" width="16">| .
qq|<a href="${swap_link}id1=$ref->{id}&id2=$nref->{id}">| .
- qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">| .
+ qq|<img border="0" src="image/down.png" alt="| . $locale->text("down") . qq|">| .
qq|</a></td>|;
}
$lxdebug->leave_sub();
}
-
sub add_payment {
$lxdebug->enter_sub();
$column_data{up} =
qq|<td align="center" valign="center" width="16">| .
qq|<a href="${swap_link}&id1=$ref->{id}&id2=$pref->{id}">| .
- qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">| .
+ qq|<img border="0" src="image/up.png" alt="| . $locale->text("up") . qq|">| .
qq|</a></td>|;
} else {
$column_data{up} = qq|<td width="16"> </td>|;
$column_data{down} =
qq|<td align="center" valign="center" width="16">| .
qq|<a href="${swap_link}&id1=$ref->{id}&id2=$nref->{id}">| .
- qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">| .
+ qq|<img border="0" src="image/down.png" alt="| . $locale->text("down") . qq|">| .
qq|</a></td>|;
}
}
}
- opendir CSS, "css/.";
- @all = grep /.*\.css$/, readdir CSS;
- closedir CSS;
+# opendir CSS, "css/.";
+# @all = grep /.*\.css$/, readdir CSS;
+# closedir CSS;
+
+# css dir has styles that are not intended as general layouts.
+# reverting to hardcoded list
+ @all = qw(lx-office-erp.css Win2000.css);
foreach $item (@all) {
if ($item eq $myconfig{stylesheet}) {
$lxdebug->leave_sub();
}
+sub show_history_search {
+ $lxdebug->enter_sub();
+
+ $form->{title} = $locale->text("History Search");
+ $form->header();
+
+ print $form->parse_html_template("/common/search_history");
+
+ $lxdebug->leave_sub();
+}
+
+sub show_am_history {
+ $lxdebug->enter_sub();
+ my %search = ( "Artikelnummer" => "parts",
+ "Kundennummer" => "customer",
+ "Lieferantennummer" => "vendor",
+ "Projektnummer" => "project",
+ "Buchungsnummer" => "oe",
+ "Eingangsrechnungnummer" => "ap",
+ "Ausgangsrechnungnummer" => "ar"
+ );
+ my %searchNo = ( "Artikelnummer" => "partnumber",
+ "Kundennummer" => "customernumber",
+ "Lieferantennummer" => "vendornumber",
+ "Projektnummer" => "projectnummer",
+ "Buchungsnummer" => "ordnumber",
+ "Eingangsrechnungnummer" => "invnumber",
+ "Ausgangsrechnungnummer" => "invnumber"
+ );
+
+ my $restriction;
+ my $tempNo = 0;
+ foreach(split(/\,/, $form->{einschraenkungen})) {
+ if($tempNo == 0) {
+ $restriction .= " AND addition = '" . $_ . "'";
+ $tempNo = 1;
+ }
+ else {
+ $restriction .= " OR addition = '" . $_ . "'";
+ }
+ }
+
+ $restriction .= (($form->{transdate} ne "" && $form->{reqdate} ne "")
+ ? qq| AND st.itime::date >= '| . $form->{transdate} . qq|' AND st.itime::date <= '| . $form->{reqdate} . qq|'|
+ : (($form->{transdate} ne "" && $form->{reqdate} eq "")
+ ? qq| AND st.itime::date >= '| . $form->{transdate} . qq|'|
+ : ($form->{transdate} eq "" && $form->{reqdate} ne "")
+ ? qq| AND st.itime::date <= '| . $form->{reqdate} . qq|'|
+ : ""
+ )
+ );
+
+ my $dbh = $form->dbconnect(\%myconfig);
+
+ $restriction .= ($form->{mitarbeiter} eq "" ? ""
+ : ($form->{mitarbeiter} =~ /^[0-9]*$/
+ ? " AND employee_id = " . $form->{mitarbeiter}
+ : " AND employee_id = " . &get_employee_id($form->{mitarbeiter}, $dbh)));
+
+ my $query = qq|SELECT id FROM $search{$form->{what2search}}
+ WHERE $searchNo{$form->{'what2search'}} ILIKE '$form->{"searchid"}'
+ |;
+
+ my $sth = $dbh->prepare($query);
+
+ $sth->execute() || $form->dberror($query);
+
+ $form->{title} = $locale->text("History Search");
+ $form->header();
+
+ while(my $hash_ref = $sth->fetchrow_hashref()){
+ print $form->parse_html_template("/common/show_history",
+ {"DATEN" => $form->get_history($dbh,$hash_ref->{id},$restriction),
+ "SUCCESS" => ($form->get_history($dbh,$hash_ref->{id},$restriction) != 0),
+ "NONEWWINDOW" => "1"
+ }
+ );
+ }
+ $dbh->disconnect();
+
+ $lxdebug->leave_sub();
+}
+
+sub get_employee_id {
+ $lxdebug->enter_sub();
+ my $query = qq|SELECT id FROM employee WHERE name = '| . $_[0] . qq|'|;
+ my $sth = $_[1]->prepare($query);
+ $sth->execute() || $form->dberror($query);
+ my $return = $sth->fetch();
+ $sth->finish();
+ return ${$return}[0];
+ $lxdebug->leave_sub();
+}
+
sub swap_units {
$lxdebug->enter_sub();