description => 'p.',
qty => 'ioi.',
serialnumber => 'ioi.',
+ quotation => 'apoe.',
+ cv => 'cv.',
);
# if the join condition in these blocks are met, the column
my $bsooqr = any { $form->{$_} } @oe_flags;
my @bsooqr_tokens = ();
- push @select_tokens, @qsooqr_flags if $bsooqr;
+ push @select_tokens, @qsooqr_flags, 'quotation', 'cv' if $bsooqr;
push @select_tokens, @deliverydate_flags if $bsooqr && $form->{l_deliverydate};
push @select_tokens, $q_assembly_lastcost if ($form->{searchitems} eq 'assembly') && $form->{l_lastcost};
push @bsooqr_tokens, q|module = 'ir' AND NOT ioi.assemblyitem| if $form->{bought};
# set module stuff
if ($ref->{module} eq 'oe') {
- my $edit_oe_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{customer_id} ne '' ? 'sales_order' : 'purchase_order'), 'id=' . E($ref->{trans_id}), 'callback');
+ my $edit_oe_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');
$row->{ordnumber}{link} = $edit_oe_link;
$row->{quonumber}{link} = $edit_oe_link if (!$ref->{ordnumber});