use SL::DB::Invoice;
use SL::DB::InvoiceItem;
+use SL::DB::DeliveryOrder::TypeData qw(:types);
use SL::DB::Employee;
use SL::Dev::Part qw(new_part);
use SL::Dev::CustomerVendor qw(new_vendor new_customer);
die "illegal customer" unless ref($customer) eq 'SL::DB::Customer';
my $delivery_order = SL::DB::DeliveryOrder->new(
- 'is_sales' => 'true',
+ order_type => SALES_DELIVERY_ORDER_TYPE,
'closed' => undef,
customer_id => $customer->id,
taxzone_id => $customer->taxzone_id,
die "illegal customer" unless ref($vendor) eq 'SL::DB::Vendor';
my $delivery_order = SL::DB::DeliveryOrder->new(
- 'is_sales' => 'false',
+ order_type => PURCHASE_DELIVERY_ORDER_TYPE,
'closed' => undef,
vendor_id => $vendor->id,
taxzone_id => $vendor->taxzone_id,
type => undef, # isn't set for ap
employee_id => SL::DB::Manager::Employee->current->id,
);
- # $ap_transaction->assign_attributes(%params) if %params;
+ # assign any parameters that weren't explicitly handled above, e.g. itime
+ $ap_transaction->assign_attributes(%params) if %params;
foreach my $booking ( @{$bookings} ) {
my $chart = delete $booking->{chart};
type => undef, # isn't set for ar
employee_id => SL::DB::Manager::Employee->current->id,
);
- # $ar_transaction->assign_attributes(%params) if %params;
+ # assign any parameters that weren't explicitly handled above, e.g. itime
+ $ar_transaction->assign_attributes(%params) if %params;
foreach my $booking ( @{$bookings} ) {
my $chart = delete $booking->{chart};
storno_id => undef,
transactions => [],
);
+ # assign any parameters that weren't explicitly handled above, e.g. itime
+ $gl_transaction->assign_attributes(%params) if %params;
my @acc_trans;
if ( scalar @{$bookings} ) {