Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 38666007

Von Jan Büren vor mehr als 9 Jahren hinzugefügt

  • ID 386660077eb786611dc1649d0e1617a29ffc4091
  • Vorgänger a2be45a1
  • Nachfolger b74a00e5

convert_to_invoice params an Invoice::new_from(%params)

DeliveryOrder.pm übergab etwaige Parameter beim Aufruf von new_from
an Invoice->post(%params). Das macht für den Anwendungsfall chart_id
in 42ea98b4 Sinn (Order.pm), allerdings benötigt die convert_to_invoice in
DeliveryOrder.pm die new_from(attributes => {'custom_attr' => value })
(s.a. 20118160).

Unterschiede anzeigen:

SL/DB/DeliveryOrder.pm
195 195
  my $invoice;
196 196
  if (!$self->db->with_transaction(sub {
197 197
    require SL::DB::Invoice;
198
    $invoice = SL::DB::Invoice->new_from($self)->post(%params) || die;
198
    $invoice = SL::DB::Invoice->new_from($self, %params)->post || die;
199 199
    $self->link_to_record($invoice);
200 200
    foreach my $item (@{ $invoice->items }) {
201 201
      foreach (qw(delivery_order_items)) {    # expand if needed (delivery_order_items)
......
328 328
linked to the new invoice via L<SL::DB::RecordLink>. C<$self>'s
329 329
C<closed> attribute is set to C<true>, and C<$self> is saved.
330 330

  
331
The arguments in C<%params> are passed to L<SL::DB::Invoice::post>.
331
The arguments in C<%params> are passed to L<SL::DB::Invoice::new_from>.
332 332

  
333 333
Returns the new invoice instance on success and C<undef> on
334 334
failure. The whole process is run inside a transaction. On failure

Auch abrufbar als: Unified diff