]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Dev/Payment.pm
BankTransaction: Überarbeitung von "Kontoauszug verbuchen" , SEPA-Export wieder integ...
[mfinanz.git] / SL / Dev / Payment.pm
index c8943ec81ff478e31b2b61d7603accdd966f538c..2d1846e3f4e02da11c8e34365ca509e3cc6bb5d9 100644 (file)
@@ -39,6 +39,30 @@ sub create_bank_account {
   $bank_account->save;
 }
 
+sub create_sepa_export {
+  my (%params) = @_;
+  my $sepa_export = SL::DB::SepaExport->new(
+    closed      => 0,
+    employee_id  => $params{employee_id} // SL::DB::Manager::Employee->current->id,
+    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',
+  );
+  $sepa_exportitem->assign_attributes(%params) if %params;
+  $sepa_exportitem->save;
+}
+
 sub create_bank_transaction {
  my (%params) = @_;
 
@@ -88,14 +112,14 @@ SL::Dev::Payment - create objects for payment-related testing, with minimal defa
 Create payment terms.
 
 Minimal example with default values (30days, 5% skonto within 5 days):
-  my $payment_terms = SL::Dev::Record::create_payment_terms;
+  my $payment_terms = SL::Dev::Payment::create_payment_terms;
 
 =head2 C<create_bank_account %PARAMS>
 
 Required params: chart_id
 
 Example:
-  my $bank_account = SL::Dev::Record::create_bank_account(chart_id => SL::DB::Manager::Chart->find_by(description => 'Bank')->id);
+  my $bank_account = SL::Dev::Payment::create_bank_account(chart_id => SL::DB::Manager::Chart->find_by(description => 'Bank')->id);
 
 =head2 C<create_bank_transaction %PARAMS>
 
@@ -115,9 +139,9 @@ Param amount should always be relative to the absolute amount of the invoice, i.
 values for sales and purchases.
 
 Example:
-  my $payment_terms = SL::Dev::Record::create_payment_terms;
+  my $payment_terms = SL::Dev::Payment::create_payment_terms;
   my $bank_chart    = SL::DB::Manager::Chart->find_by(description => 'Bank');
-  my $bank_account  = SL::Dev::Record::create_bank_account(chart_id => $bank_chart->id);
+  my $bank_account  = SL::Dev::Payment::create_bank_account(chart_id => $bank_chart->id);
   my $customer      = SL::Dev::CustomerVendor::create_customer(iban           => 'DE12500105170648489890',
                                                                bank_code      => 'abc',
                                                                account_number => '44444',