Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2bc58307

Von Kivitendo Admin vor fast 8 Jahren hinzugefügt

  • ID 2bc58307ac661b7235b32160ad7eb74cb8ea8980
  • Vorgänger 3705b374
  • Nachfolger 955f5491

SL::Dev::Record - params immer per assign_attributes übergeben

Ansonsten wurden bei leerem Hash die vorherigen Werte überschrieben.

Unterschiede anzeigen:

SL/Dev/Record.pm
44 44
    payment_id   => $params{payment_id}  // undef,
45 45
    gldate       => DateTime->today_local->to_kivitendo,
46 46
    invoiceitems => $invoiceitems,
47
    %params,
48 47
  );
48
  $invoice->assign_attributes(%params) if %params;
49 49

  
50 50
  $invoice->post;
51 51
  return $invoice;
......
73 73
    salesman_id  => $params{employee_id} // SL::DB::Manager::Employee->current->id,
74 74
    transdate    => $params{transdate}   // DateTime->today_local->to_kivitendo,
75 75
    orderitems   => $orderitems,
76
    %params
77 76
  );
77
  $delivery_order->assign_attributes(%params) if %params;
78 78
  $delivery_order->save;
79 79
  return $delivery_order;
80 80
}
......
100 100
    # salesman_id  => delete $params{employee_id} // SL::DB::Manager::Employee->current->id,
101 101
    transdate    => delete $params{transdate}   // DateTime->today_local->to_kivitendo,
102 102
    orderitems   => $orderitems,
103
    %params
104 103
  );
104
  $order->assign_attributes(%params) if %params;
105 105

  
106 106
  if ( $save ) {
107 107
    $order->calculate_prices_and_taxes;
......
130 130
    transdate    => delete $params{transdate}   // DateTime->today_local->to_kivitendo,
131 131
    'closed'     => undef,
132 132
    orderitems   => $orderitems,
133
    %params
134 133
  );
134
  $order->assign_attributes(%params) if %params;
135 135

  
136 136
  if ( $save ) {
137 137
    $order->calculate_prices_and_taxes; # not tested for purchase orders
......
192 192
    description => $part->description,
193 193
    unit        => $part->unit,
194 194
    qty         => $params{qty} || 5,
195
    %params,
196 195
  );
196
  $item->assign_attributes(%params) if %params;
197 197
  return $item;
198 198
}
199 199

  
......
220 220
    valid             => 1,
221 221
    project_status_id => SL::DB::Manager::ProjectStatus->find_by(name => "running")->id,
222 222
    project_type_id   => SL::DB::Manager::ProjectType->find_by(description => "Standard")->id,
223
    %params,
224 223
  )->save;
224
  $project->assign_attributes(%params) if %params;
225 225
  return $project;
226 226
}
227 227

  

Auch abrufbar als: Unified diff