sub search {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
$form->{revers} = 0; # switch for backward sorting
$form->{lastsort} = ""; # memory for which table was sort at last time
sub generate_report {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
my ($revers, $lastsort, $description);
if ($ref->{module} eq 'oe') {
# für oe gibt es vier fälle, jeweils nach kunde oder lieferant unterschiedlich:
#
- # | ist bestellt | Vom Kunde bestellt | -> edit_oe_ord_link
- # | Anfrage | Angebot | -> edit_oe_quo_link
+ # | ist bestellt | Von Kunden bestellt | -> edit_oe_ord_link
+ # | Anfrage | Angebot | -> edit_oe_quo_link
my $edit_oe_ord_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{cv} eq 'vendor' ? 'purchase_order' : 'sales_order'), 'id=' . E($ref->{trans_id}), 'callback');
my $edit_oe_quo_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{cv} eq 'vendor' ? 'request_quotation' : 'sales_quotation'), 'id=' . E($ref->{trans_id}), 'callback');
sub edit {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
# show history button
$form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
sub link_part {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
IC->create_links("IC", \%myconfig, \%$form);
sub form_header {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
$form->{pg_keys} = sub { "$_[0]->{partsgroup}--$_[0]->{id}" };
$form->{description_area} = ($form->{rows} = $form->numtextrows($form->{description}, 40)) > 1;
if (my $max = scalar @{ $form->{WAREHOUSES} }) {
my ($default_warehouse_id, $default_bin_id);
if ($form->{action} eq 'add') { # default only for new entries
- $default_warehouse_id = $::instance_conf->get_default_warehouse_id;
- $default_bin_id = $::instance_conf->get_default_bin_id;
+ $default_warehouse_id = $::instance_conf->get_warehouse_id;
+ $default_bin_id = $::instance_conf->get_bin_id;
}
$form->{warehouse_id} ||= $default_warehouse_id || $form->{WAREHOUSES}->[$max -1]->{id};
$form->{bin_id} ||= $default_bin_id || $form->{WAREHOUSES}->[$max -1]->{BINS}->[0]->{id};
# BUCHUNGSGRUPPEN => $form->{BUCHUNGSGRUPPEN},
# payment_terms => $form->{payment_terms},
# all_partsgroup => $form->{all_partsgroup}});
+
+ $form->{show_edit_buttons} = $main::auth->check_right($form->{login}, 'part_service_assembly_edit');
+
print $form->parse_html_template('ic/form_header');
$lxdebug->leave_sub();
}
sub form_footer {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
print $form->parse_html_template('ic/form_footer');
sub update {
$lxdebug->enter_sub();
+ $auth->assert('part_service_assembly_edit');
+
# parse pricegroups. and no, don't rely on check_form for this...
map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows};
- $form->{sellprice} = $form->parse_amount(\%myconfig, $form->{sellprice});
+ $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) for qw(sellprice listprice ve gv);
+
+ if ($form->{item} eq 'part') {
+ $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) for qw(weight rop);
+ }
# same for makemodel lastcosts
# but parse_amount not necessary for assembly component lastcosts
unless ($form->{item} eq "assembly") {
map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"};
- };
- $form->{listprice} = $form->parse_amount(\%myconfig, $form->{listprice});
+ $form->{lastcost} = $form->parse_amount(\%myconfig, $form->{lastcost});
+ }
if ($form->{item} eq "assembly") {
my $i = $form->{assembly_rows};
sub price_row {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit');
+ $auth->assert('part_service_assembly_details');
my ($numrows) = @_;