Revision 20118160
Von Jan Büren vor mehr als 9 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
426 | 426 |
=item C<attributes> |
427 | 427 |
|
428 | 428 |
An optional hash reference. If it exists then it is passed to C<new> |
429 |
allowing the caller to set certain attributes for the new delivery |
|
430 |
order. |
|
429 |
allowing the caller to set certain attributes for the new invoice. |
|
430 |
For example to set a different transdate (default is the current date), |
|
431 |
call the method like this: |
|
432 |
|
|
433 |
my %params; |
|
434 |
$params{attributes}{transdate} = '28.08.2015'; |
|
435 |
$invoice = SL::DB::Invoice->new_from($self, %params)->post || die; |
|
431 | 436 |
|
432 | 437 |
=back |
433 | 438 |
|
... | ... | |
489 | 494 |
|
490 | 495 |
=back |
491 | 496 |
|
497 |
=head1 TODO |
|
498 |
As explained in the new_from example, it is possible to set transdate to a new value. |
|
499 |
From a user / programm point of view transdate is more than holy and there should be |
|
500 |
some validity checker available for controller code. At least the same logic like in |
|
501 |
Form.pm from ar.pl should be available: |
|
502 |
# see old stuff ar.pl post |
|
503 |
#$form->error($locale->text('Cannot post transaction above the maximum future booking date!')) |
|
504 |
# if ($form->date_max_future($transdate, \%myconfig)); |
|
505 |
#$form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig)); |
|
506 |
|
|
492 | 507 |
=head1 AUTHOR |
493 | 508 |
|
494 | 509 |
Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt> |
Auch abrufbar als: Unified diff
Doku: POD für Invoice.pm erweitert
- Invoice anstatt Delivery Order bei new_from
- Beispiel-Code für Benutzung von new_from mit parameter attributes
- TODO angelegt, Controller sollten einige Datenfelder mit Hilfe
von Backend-Funktionen prüfen können - in diesem Fall transdate