use SL::Controller::CsvImport::Helper::Consistency;
use SL::DB::DeliveryOrder;
+use SL::DB::DeliveryOrder::TypeData qw(:types);
use SL::DB::DeliveryOrderItem;
use SL::DB::DeliveryOrderItemsStock;
use SL::DB::Part;
{ name => 'globalprojectnumber', description => $::locale->text('Document Project (number)') },
{ name => 'globalproject_id', description => $::locale->text('Document Project (database ID)') },
{ name => 'intnotes', description => $::locale->text('Internal Notes') },
- { name => 'is_sales', description => $::locale->text('Is sales') },
{ name => 'language', description => $::locale->text('Language (name)') },
{ name => 'language_id', description => $::locale->text('Language (database ID)') },
{ name => 'notes', description => $::locale->text('Notes') },
+ { name => 'order_type', description => $::locale->text('Delivery Order Type') },
{ name => 'ordnumber', description => $::locale->text('Order Number') },
{ name => 'payment', description => $::locale->text('Payment terms (name)') },
{ name => 'payment_id', description => $::locale->text('Payment terms (database ID)') },
push @{ $entry->{errors} }, $::locale->text('Error: Customer/vendor missing');
}
- $self->handle_is_sales($entry);
+ $self->handle_type($entry);
$self->check_contact($entry);
$self->check_language($entry);
$self->check_payment($entry);
}
}
-sub handle_is_sales {
+sub handle_type {
my ($self, $entry) = @_;
- if (!exists $entry->{raw_data}->{is_sales}) {
- $entry->{object}->is_sales(!!$entry->{object}->customer_id);
+ if (!exists $entry->{raw_data}->{order_type}) {
+ # if no type is present - set to sales delivery order or purchase delivery
+ # order depending on is_sales or customer/vendor
+
+ $entry->{object}->order_type(
+ $entry->{object}->customer_id ? SALES_DELIVERY_ORDER_TYPE :
+ $entry->{object}->vendor_id ? PURCHASE_DELIVERY_ORDER_TYPE :
+ $entry->{raw_data}->{is_sales} ? SALES_DELIVERY_ORDER_TYPE :
+ PURCHASE_DELIVERY_ORDER_TYPE
+ );
}
}
'Delivery Order Date' => 'Lieferscheindatum',
'Delivery Order Date missing!' => 'Lieferscheindatum fehlt!',
'Delivery Order Number' => 'Lieferscheinnummer',
+ 'Delivery Order Type' => 'Lieferschein Typ',
'Delivery Order created' => 'Lieferschein erstellt',
'Delivery Order deleted!' => 'Lieferschein gelöscht!',
'Delivery Order has been deleted' => 'Lieferschein wurde gelöscht',
'Invoices with payments cannot be canceled.' => 'Rechnungen mit Zahlungen können nicht storniert werden.',
'Invoices, Credit Notes & AR Transactions' => 'Rechnungen, Gutschriften & Debitorenbuchungen',
'Is Searchable' => 'Durchsuchbar',
- 'Is sales' => 'Verkauf',
'Is this a summary account to record' => 'Sammelkonto für',
'It can be changed later but must be unique within the installation.' => 'Er ist nachträglich änderbar, muss aber im System eindeutig sein.',
'It is not allowed that a summary account occurs in a drop-down menu!' => 'Ein Sammelkonto darf nicht in Aufklappmenüs aufgenommen werden!',