use strict;
use base qw(Exporter);
-our @EXPORT = qw(create_payment_terms create_bank_account create_bank_transaction);
+our @EXPORT_OK = qw(create_payment_terms create_bank_account create_bank_transaction create_sepa_export create_sepa_export_item);
+our %EXPORT_TAGS = (ALL => \@EXPORT_OK);
use SL::DB::PaymentTerm;
use SL::DB::BankAccount;
sub create_sepa_export {
my (%params) = @_;
my $sepa_export = SL::DB::SepaExport->new(
- closed => 0,
+ closed => 0,
employee_id => $params{employee_id} // SL::DB::Manager::Employee->current->id,
- executed => 0,
- vc => 'customer',
+ executed => 0,
+ vc => 'customer',
);
$sepa_export->assign_attributes(%params) if %params;
$sepa_export->save;
sub create_sepa_export_item {
my (%params) = @_;
my $sepa_exportitem = SL::DB::SepaExportItem->new(
- chart_id => delete $params{chart_id} // $::instance_conf->get_ar_paid_accno_id,
- payment_type => 'without_skonto',
- our_bic => 'BANK1234',
- our_iban => 'DE12500105170648489890',
+ chart_id => delete $params{chart_id} // $::instance_conf->get_ar_paid_accno_id,
+ payment_type => 'without_skonto',
+ our_bic => 'BANK1234',
+ our_iban => 'DE12500105170648489890',
);
$sepa_exportitem->assign_attributes(%params) if %params;
$sepa_exportitem->save;
$bank_chart = SL::DB::Manager::Chart->find_by(description => 'Bank') or die "Can't find bank chart";
}
my $bank_account = SL::DB::Manager::BankAccount->find_by( chart_id => $bank_chart->id );
+ die "bank account missing" unless $bank_account;
my $bt = SL::DB::BankTransaction->new(
local_bank_account_id => $bank_account->id,