Revision 4776a4a2
Von Tamino Steinert vor 11 Monaten hinzugefügt
SL/DB/Helper/Record.pm | ||
---|---|---|
4 | 4 |
use warnings; |
5 | 5 |
use Carp; |
6 | 6 |
use Exporter qw(import); |
7 |
|
|
7 | 8 |
use SL::DB::Order::TypeData; |
8 | 9 |
use SL::DB::DeliveryOrder::TypeData; |
9 | 10 |
use SL::DB::Reclamation::TypeData; |
11 |
use SL::DB::Invoice::TypeData; |
|
12 |
use SL::DB::PurchaseInvoice::TypeData; |
|
10 | 13 |
|
11 | 14 |
my @export_subs = qw(get_object_name_from_type get_class_from_type); |
12 | 15 |
|
... | ... | |
14 | 17 |
our %EXPORT_TAGS = (subs => \@export_subs); |
15 | 18 |
|
16 | 19 |
my %type_to_object_name = (); |
17 |
$type_to_object_name{$_} = 'Order' for (@{(SL::DB::Order::TypeData::valid_types)}); |
|
18 |
$type_to_object_name{$_} = 'DeliveryOrder' for (@{(SL::DB::DeliveryOrder::TypeData::valid_types)}); |
|
19 |
$type_to_object_name{$_} = 'Reclamation' for (@{(SL::DB::Reclamation::TypeData::valid_types)}); |
|
20 |
# TODO: rewrite when invoice type data is available |
|
21 |
$type_to_object_name{invoice} = 'Invoice'; |
|
22 |
$type_to_object_name{invoice_for_advance_payment} = 'Invoice'; |
|
23 |
$type_to_object_name{final_invoice} = 'Invoice'; |
|
24 |
$type_to_object_name{credit_note} = 'Invoice'; |
|
25 |
$type_to_object_name{purchase_invoice} = 'PurchaseInvoice'; |
|
20 |
$type_to_object_name{$_} = 'Order' for (@{(SL::DB::Order::TypeData::valid_types)}); |
|
21 |
$type_to_object_name{$_} = 'DeliveryOrder' for (@{(SL::DB::DeliveryOrder::TypeData::valid_types)}); |
|
22 |
$type_to_object_name{$_} = 'Reclamation' for (@{(SL::DB::Reclamation::TypeData::valid_types)}); |
|
23 |
$type_to_object_name{$_} = 'Invoice' for (@{(SL::DB::Invoice::TypeData::valid_types)}); |
|
24 |
$type_to_object_name{$_} = 'PurchaseInvoice' for (@{(SL::DB::Invoice::TypeData::valid_types)}); |
|
26 | 25 |
|
27 | 26 |
sub get_object_name_from_type { |
28 | 27 |
my ($type) = @_; |
Auch abrufbar als: Unified diff
S:D:H:Record: TypeData von Invoice und PurchaseInvoice verwenden