Revision bbdb5edd
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
755 | 755 |
} |
756 | 756 |
|
757 | 757 |
1; |
758 |
__END__ |
|
759 |
|
|
760 |
=pod |
|
761 |
|
|
762 |
=encoding utf8 |
|
763 |
|
|
764 |
=head1 NAME |
|
765 |
|
|
766 |
SL::Controller::BankTransaction - Posting payments to invoices from |
|
767 |
bank transactions imported earlier |
|
768 |
|
|
769 |
=head1 FUNCTIONS |
|
770 |
|
|
771 |
=over 4 |
|
772 |
|
|
773 |
=item C<save_single_bank_transaction %params> |
|
774 |
|
|
775 |
Takes a bank transaction ID (as parameter C<bank_transaction_id> and |
|
776 |
tries to post its amount to a certain number of invoices (parameter |
|
777 |
C<invoice_ids>, an array ref of database IDs to purchase or sales |
|
778 |
invoice objects). |
|
779 |
|
|
780 |
The whole function is wrapped in a database transaction. If an |
|
781 |
exception occurs the bank transaction is not posted at all. The same |
|
782 |
is true if the code detects an error during the execution, e.g. a bank |
|
783 |
transaction that's already been posted earlier. In both cases the |
|
784 |
database transaction will be rolled back. |
|
785 |
|
|
786 |
If warnings but not errors occur the database transaction is still |
|
787 |
committed. |
|
788 |
|
|
789 |
The return value is an error object or C<undef> if the function |
|
790 |
succeeded. The calling function will collect all warnings and errors |
|
791 |
and display them in a nicely formatted table if any occurred. |
|
792 |
|
|
793 |
An error object is a hash reference containing the following members: |
|
794 |
|
|
795 |
=over 2 |
|
796 |
|
|
797 |
=item * C<result> — can be either C<warning> or C<error>. Warnings are |
|
798 |
displayed slightly different than errors. |
|
799 |
|
|
800 |
=item * C<message> — a human-readable message included in the list of |
|
801 |
errors meant as the description of why the problem happened |
|
802 |
|
|
803 |
=item * C<bank_transaction_id>, C<invoice_ids> — the same parameters |
|
804 |
that the function was called with |
|
805 |
|
|
806 |
=item * C<bank_transaction> — the database object |
|
807 |
(C<SL::DB::BankTransaction>) corresponding to C<bank_transaction_id> |
|
808 |
|
|
809 |
=item * C<invoices> — an array ref of the database objects (either |
|
810 |
C<SL::DB::Invoice> or C<SL::DB::PurchaseInvoice>) corresponding to |
|
811 |
C<invoice_ids> |
|
812 |
|
|
813 |
=back |
|
814 |
|
|
815 |
=back |
|
816 |
|
|
817 |
=head1 AUTHOR |
|
818 |
|
|
819 |
Niclas Zimmermann E<lt>niclas@kivitendo-premium.deE<gt>, |
|
820 |
Geoffrey Richardson E<lt>information@richardson-bueren.deE<gt> |
|
821 |
|
|
822 |
=cut |
Auch abrufbar als: Unified diff
Bankauszug verbuchen: etwas Dokumentation ergänzen