Revision 27e3ec0d
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/Reclamation.pm | ||
---|---|---|
},
|
||
id => t8('ID'),
|
||
record_number => t8('Reclamation Number'),
|
||
employee_id => t8('Employee'),
|
||
salesman_id => t8('Salesman'),
|
||
customer_id => t8('Customer'),
|
||
vendor_id => t8('Vendor'),
|
||
contact_id => t8('Contact'),
|
||
language_id => t8('Language'),
|
||
department_id => t8('Department'),
|
||
globalproject_id => t8('Project Number'),
|
||
employee => t8('Employee'),
|
||
salesman => t8('Salesman'),
|
||
customer => t8('Customer'),
|
||
vendor => t8('Vendor'),
|
||
contact => t8('Contact'),
|
||
language => t8('Language'),
|
||
department => t8('Department'),
|
||
globalproject => t8('Project Number'),
|
||
cv_record_number => ($self->type eq 'sales_reclamation' ? t8('Customer Record Number') : t8('Vendor Record Number')),
|
||
transaction_description => t8('Description'),
|
||
notes => t8('Notes'),
|
||
... | ... | |
shipto_id => t8('Shipping Address'),
|
||
amount => t8('Total'),
|
||
netamount => t8('Subtotal'),
|
||
delivery_term_id => t8('Delivery Terms'),
|
||
payment_id => t8('Payment Terms'),
|
||
currency_id => t8('Currency'),
|
||
delivery_term => t8('Delivery Terms'),
|
||
payment => t8('Payment Terms'),
|
||
currency => t8('Currency'),
|
||
exchangerate => t8('Exchangerate'),
|
||
taxincluded => t8('Tax Included'),
|
||
taxzone_id => t8('Tax zone'),
|
||
taxzone => t8('Tax zone'),
|
||
tax_point => t8('Tax point'),
|
||
reqdate => t8('Deadline'),
|
||
transdate => t8('Booking Date'),
|
||
... | ... | |
(employee_id => SL::DB::Manager::Employee->current->id) x ($self->reclamation->is_sales && !$::auth->assert('sales_all_edit', 1)),
|
||
(employee_id => SL::DB::Manager::Employee->current->id) x (!$self->reclamation->is_sales && !$::auth->assert('purchase_all_edit', 1)),
|
||
],
|
||
);
|
||
|
||
with_objects => [
|
||
'customer', 'vendor', 'employee', 'salesman',
|
||
'contact', 'language', 'department', 'globalproject',
|
||
'delivery_term', 'payment', 'currency', 'taxzone',
|
||
],
|
||
);
|
||
}
|
||
|
||
sub init_p {
|
||
... | ... | |
my @columns_order = qw(
|
||
id
|
||
record_number
|
||
employee_id
|
||
salesman_id
|
||
customer_id
|
||
vendor_id
|
||
contact_id
|
||
language_id
|
||
department_id
|
||
globalproject_id
|
||
employee
|
||
salesman
|
||
customer
|
||
vendor
|
||
contact
|
||
language
|
||
department
|
||
globalproject
|
||
cv_record_number
|
||
transaction_description
|
||
notes
|
||
... | ... | |
shipvia
|
||
amount
|
||
netamount
|
||
delivery_term_id
|
||
payment_id
|
||
currency_id
|
||
delivery_term
|
||
payment
|
||
currency
|
||
exchangerate
|
||
taxincluded
|
||
taxzone_id
|
||
taxzone
|
||
tax_point
|
||
reqdate
|
||
transdate
|
||
... | ... | |
|
||
my @default_columns = qw(
|
||
record_number
|
||
employee_id
|
||
department_id
|
||
globalproject_id
|
||
employee
|
||
department
|
||
globalproject
|
||
cv_record_number
|
||
transaction_description
|
||
amount
|
||
... | ... | |
obj_link => sub {$self->url_for(action => 'edit', id => $_[0]->id, type => $self->type, callback => $callback)},
|
||
sub => sub { $_[0]->record_number },
|
||
},
|
||
employee_id => {
|
||
employee => {
|
||
sub => sub { $_[0]->employee ? $_[0]->employee->name : '' },
|
||
},
|
||
salesman_id => {
|
||
salesman => {
|
||
sub => sub { $_[0]->salesman ? $_[0]->salesman->name : '' },
|
||
},
|
||
language_id => {
|
||
language => {
|
||
sub => sub { $_[0]->language ? $_[0]->language->article_code : '' },
|
||
},
|
||
department_id => {
|
||
department => {
|
||
sub => sub { $_[0]->department ? $_[0]->department->description : '' },
|
||
},
|
||
globalproject_id => {
|
||
globalproject => {
|
||
obj_link => sub { $_[0]->globalproject_id ?
|
||
$self->url_for(
|
||
controller => "controller.pl",
|
||
... | ... | |
netamount => {
|
||
sub => sub { $_[0]->netamount_as_number },
|
||
},
|
||
delivery_term_id => {
|
||
delivery_term => {
|
||
obj_link => sub { $_[0]->delivery_term_id ?
|
||
$self->url_for(
|
||
controller => "controller.pl",
|
||
... | ... | |
) : '' },
|
||
sub => sub { $_[0]->delivery_term ? $_[0]->delivery_term->description : '' },
|
||
},
|
||
payment_id => {
|
||
payment => {
|
||
obj_link => sub { $_[0]->payment_id ?
|
||
$self->url_for(
|
||
controller => "controller.pl",
|
||
... | ... | |
) : '' },
|
||
sub => sub { $_[0]->payment ? $_[0]->payment->description : '' },
|
||
},
|
||
currency_id => {
|
||
currency => {
|
||
sub => sub { $_[0]->currency ? $_[0]->currency->name : '' },
|
||
},
|
||
exchangerate => {
|
||
... | ... | |
taxincluded => {
|
||
sub => sub { $_[0]->taxincluded ? t8('Yes') : t8('No') },
|
||
},
|
||
taxzone_id => {
|
||
taxzone => {
|
||
obj_link => sub { $_[0]->taxzone_id ?
|
||
$self->url_for(
|
||
controller => "controller.pl",
|
||
... | ... | |
},
|
||
);
|
||
if ($self->type eq sales_reclamation_type()) {
|
||
$column_defs{customer_id} = ({
|
||
$column_defs{customer} = ({
|
||
raw_data => sub { $_[0]->customervendor->presenter->customer(display => 'table-cell', callback => $callback) },
|
||
sub => sub { $_[0]->customervendor->name },
|
||
});
|
||
$column_defs{contact_id} = ({
|
||
$column_defs{contact} = ({
|
||
obj_link => sub { $self->url_for(
|
||
controller => "controller.pl",
|
||
action => 'CustomerVendor/edit',
|
||
... | ... | |
sub => sub { $_[0]->contact ? $_[0]->contact->cp_name : '' },
|
||
});
|
||
} elsif ($self->type eq purchase_reclamation_type()) {
|
||
$column_defs{vendor_id} = ({
|
||
$column_defs{vendor} = ({
|
||
raw_data => sub { $_[0]->customervendor->presenter->vendor(display => 'table-cell', callback => $callback) },
|
||
sub => sub { $_[0]->customervendor->name },
|
||
});
|
||
$column_defs{contact_id} = ({
|
||
$column_defs{contact} = ({
|
||
obj_link => sub { $self->url_for(
|
||
controller => "controller.pl",
|
||
action => 'CustomerVendor/edit',
|
SL/DB/Manager/Reclamation.pm | ||
---|---|---|
customer => 'lower(customer.name)',
|
||
vendor => 'lower(vendor.name)',
|
||
employee => 'lower(employee.name)',
|
||
salesman => 'lower(salesman.name)',
|
||
contact => 'lower(contact.cp_name)',
|
||
language => 'lower(language.article_code)',
|
||
department => 'lower(department.description)',
|
||
globalprojectnumber => 'lower(globalproject.projectnumber)',
|
||
delivery_term => 'lower(delivery_term.description)',
|
||
payment => 'lower(payment.description)',
|
||
currency => 'lower(currency.name)',
|
||
taxzone => 'lower(taxzone.description)',
|
||
|
||
# Bug in Rose::DB::Object: the next should be
|
||
# "globalproject.project_type.description". This workaround will
|
SL/Presenter/ReclamationFilter.pm | ||
---|---|---|
'input_name' => 'filter.id:number',
|
||
'input_default' =>$filter->{'id:number'},
|
||
'report_id' => 'id',
|
||
'active' => 1,
|
||
'active' => 0,
|
||
},
|
||
'record_number' => {
|
||
'position' => 3,
|
||
... | ... | |
'report_id' => 'record_number',
|
||
'active' => 1,
|
||
},
|
||
'employee_name' => {
|
||
'employee' => {
|
||
'position' => 4,
|
||
'text' => t8("Employee Name"),
|
||
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.employee.name:substr::ilike',
|
||
'input_default' =>$filter->{employee}->{'name:substr::ilike'},
|
||
'report_id' => 'employee_id',
|
||
'report_id' => 'employee',
|
||
'active' => 1,
|
||
},
|
||
'salesman_name' => {
|
||
'salesman' => {
|
||
'position' => 5,
|
||
'text' => t8("Salesman Name"),
|
||
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.salesman.name:substr::ilike',
|
||
'input_default' =>$filter->{salesman}->{'name:substr::ilike'},
|
||
'report_id' => 'salesman_id',
|
||
'report_id' => 'salesman',
|
||
'active' => 1,
|
||
},
|
||
# 6,7 for Customer/Vendor
|
||
'customer_name' => {
|
||
'customer' => {
|
||
'position' => 6,
|
||
'text' => t8("Customer Name"),
|
||
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.customer.name:substr::ilike',
|
||
'input_default' => $filter->{customer}->{'name:substr::ilike'},
|
||
'report_id' => 'customer_id',
|
||
'report_id' => 'customer',
|
||
'active' => ($reclamation_type eq 'sales_reclamation' ? 1 : 0),
|
||
},
|
||
'vendor_name' => {
|
||
'vendor' => {
|
||
'position' => 6,
|
||
'text' => t8("Vendor"),
|
||
'text' => t8("Vendor Name"),
|
||
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.vendor.name:substr::ilike',
|
||
'input_default' => $filter->{vendor}->{'name:substr::ilike'},
|
||
'report_id' => 'vendor_id',
|
||
'report_id' => 'vendor',
|
||
'active' => ($reclamation_type eq 'purchase_reclamation' ? 1 : 0),
|
||
},
|
||
'customer_number' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.contact.cp_name:substr::ilike',
|
||
'input_default' =>$filter->{contact}->{'cp_name:substr::ilike'},
|
||
'report_id' => 'contact_id',
|
||
'report_id' => 'contact',
|
||
'active' => 1,
|
||
},
|
||
'language_code' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.language.article_code:substr::ilike',
|
||
'input_default' =>$filter->{language}->{'article_code:substr::ilike'},
|
||
'report_id' => 'language_id',
|
||
'report_id' => 'language',
|
||
'active' => 1,
|
||
},
|
||
'department_description' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.department.description:substr::ilike',
|
||
'input_default' =>$filter->{department}->{'description:substr::ilike'},
|
||
'report_id' => 'department_id',
|
||
'report_id' => 'department',
|
||
'active' => 1,
|
||
},
|
||
'globalproject_projectnumber' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.globalproject.projectnumber:substr::ilike',
|
||
'input_default' =>$filter->{globalproject}->{'projectnumber:substr::ilike'},
|
||
'report_id' => 'globalproject_id',
|
||
'report_id' => 'globalproject',
|
||
'active' => 1,
|
||
},
|
||
'globalproject_description' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.delivery_term.description:substr::ilike',
|
||
'input_default' =>$filter->{delivery_term}->{'description:substr::ilike'},
|
||
'report_id' => 'delivery_term_id',
|
||
'report_id' => 'delivery_term',
|
||
'active' => 1,
|
||
},
|
||
'payment_description' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.payment.description:substr::ilike',
|
||
'input_default' =>$filter->{payment}->{'description:substr::ilike'},
|
||
'report_id' => 'payment_id',
|
||
'report_id' => 'payment',
|
||
'active' => 1,
|
||
},
|
||
'currency_name' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.currency.name:substr::ilike',
|
||
'input_default' =>$filter->{currency}->{'name:substr::ilike'},
|
||
'report_id' => 'currency_id',
|
||
'report_id' => 'currency',
|
||
'active' => 1,
|
||
},
|
||
'exchangerate' => {
|
||
... | ... | |
'input_type' => 'input_tag',
|
||
'input_name' => 'filter.taxzone.description:substr::ilike',
|
||
'input_default' =>$filter->{taxzone}->{'description:substr::ilike'},
|
||
'report_id' => 'taxzone_id',
|
||
'report_id' => 'taxzone',
|
||
'active' => 1,
|
||
},
|
||
'tax_point' => {
|
Auch abrufbar als: Unified diff
FIX: Reklamationsbericht: Sortierung nach angezeigten Werten