Revision 93ae5d0f
Von Tamino Steinert vor 9 Monaten hinzugefügt
SL/BackgroundJob/CreatePeriodicInvoices.pm | ||
---|---|---|
|
||
$invoice->post(ar_id => $config->ar_chart_id) || die;
|
||
|
||
foreach my $item (grep { ($_->recurring_billing_mode eq 'once') && !$_->recurring_billing_invoice_id } @{ $order->orderitems }) {
|
||
$item->update_attributes(recurring_billing_invoice_id => $invoice->id);
|
||
foreach my $item (
|
||
grep { $_->periodic_invoice_items_config
|
||
&& ($_->periodic_invoice_items_config->periodicity eq 'o')
|
||
&& !$_->periodic_invoice_items_config->once_invoice_id }
|
||
@{ $order->orderitems }
|
||
) {
|
||
$item->periodic_invoice_items_config->update_attributes(once_invoice_id => $invoice->id);
|
||
}
|
||
|
||
SL::DB::PeriodicInvoice->new(config_id => $config->id,
|
SL/DB/Order.pm | ||
---|---|---|
marge_percent marge_price_factor marge_total
|
||
ordnumber parts_id price_factor price_factor_id pricegroup_id
|
||
project_id qty reqdate sellprice serialnumber ship subtotal transdate unit
|
||
optional recurring_billing_mode position
|
||
optional position
|
||
)),
|
||
custom_variables => \@custom_variables,
|
||
);
|
||
if ( $is_abbr_any->(qw(soso)) && $source_item->periodic_invoice_items_config ) {
|
||
$current_oe_item->periodic_invoice_items_config(
|
||
$source_item->periodic_invoice_items_config->clone_and_reset
|
||
);
|
||
}
|
||
} elsif (ref($source) eq 'SL::DB::Reclamation') {
|
||
$current_oe_item = SL::DB::OrderItem->new(
|
||
map({ ( $_ => $source_item->$_ ) } qw(
|
SL/DB/OrderItem.pm | ||
---|---|---|
use SL::Helper::ShippedQty;
|
||
use Rose::DB::Object::Helpers qw(as_tree strip);
|
||
|
||
__PACKAGE__->meta->add_relationship(
|
||
periodic_invoice_items_config => {
|
||
type => 'one to one',
|
||
class => 'SL::DB::PeriodicInvoiceItemsConfig',
|
||
column_map => { id => 'order_item_id' },
|
||
},
|
||
);
|
||
|
||
__PACKAGE__->meta->initialize;
|
||
|
||
__PACKAGE__->configure_acts_as_list(group_by => [qw(trans_id)]);
|
SL/DB/PeriodicInvoicesConfig.pm | ||
---|---|---|
);
|
||
my @items;
|
||
for my $item ($orig_order->items) {
|
||
next if $item->recurring_billing_mode eq 'never';
|
||
next if $item->recurring_billing_mode eq 'once' && (
|
||
$item->recurring_billing_invoice_id
|
||
if ($item->periodic_invoice_items_config) {
|
||
next if $item->periodic_invoice_items_config->periodicity eq 'n';
|
||
next if $item->periodic_invoice_items_config->periodicity eq 'o' && (
|
||
$item->periodic_invoice_items_config->once_invoice_id
|
||
|| $period_start_date != $next_period_start_date
|
||
);
|
||
}
|
||
|
||
my $new_item = clone($item);
|
||
|
t/workflow/order_reclamation.t | ||
---|---|---|
id trans_id reclamation_id itime mtime
|
||
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate orderer_id
|
||
reason_description_ext reason_description_int reason_id
|
||
recurring_billing_mode recurring_billing_invoice_id
|
||
);
|
||
# sales
|
||
pairwise {
|
Auch abrufbar als: Unified diff
S:D:PeriodicInvoiceItemsConfig: Bisherige Verwendung umstellen