Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0a64ac3d

Von Kivitendo Admin vor etwa 7 Jahren hinzugefügt

  • ID 0a64ac3db8c430756ab6260399816714e44ec16d
  • Vorgänger 8b8570b3
  • Nachfolger b90426d3

DATEV-Checks beim Buchen nutzen nun generate_datev_data

Unterschiede anzeigen:

SL/AP.pm
368 368

  
369 369
  # safety check datev export
370 370
  if ($::instance_conf->get_datev_check_on_ap_transaction) {
371
    my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
372
    $transdate  ||= DateTime->today;
373

  
374 371
    my $datev = SL::DATEV->new(
375
      exporttype => DATEV_ET_BUCHUNGEN,
376
      format     => DATEV_FORMAT_KNE,
377 372
      dbh        => $dbh,
378 373
      trans_id   => $form->{id},
379 374
    );
380

  
381
    $datev->export;
375
    $datev->generate_datev_data;
382 376

  
383 377
    if ($datev->errors) {
384 378
      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
SL/AR.pm
312 312

  
313 313
  # safety check datev export
314 314
  if ($::instance_conf->get_datev_check_on_ar_transaction) {
315
    my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
316
    $transdate  ||= DateTime->today;
317

  
318 315
    my $datev = SL::DATEV->new(
319
      exporttype => DATEV_ET_BUCHUNGEN,
320
      format     => DATEV_FORMAT_KNE,
321 316
      dbh        => $dbh,
322 317
      trans_id   => $form->{id},
323 318
    );
324 319

  
325
    $datev->export;
320
    $datev->generate_datev_data;
326 321

  
327 322
    if ($datev->errors) {
328 323
      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
SL/DB/Helper/Payment.pm
294 294
    if ( $datev_check ) {
295 295

  
296 296
      my $datev = SL::DATEV->new(
297
        exporttype => DATEV_ET_BUCHUNGEN,
298
        format     => DATEV_FORMAT_KNE,
299 297
        dbh        => $db->dbh,
300 298
        trans_id   => $self->{id},
301 299
      );
302 300

  
303
      $datev->clean_temporary_directories;
304
      $datev->export;
301
      $datev->generate_datev_data;
305 302

  
306 303
      if ($datev->errors) {
307 304
        # this exception should be caught by with_transaction, which handles the rollback
SL/GL.pm
197 197

  
198 198
  # safety check datev export
199 199
  if ($::instance_conf->get_datev_check_on_gl_transaction) {
200
    my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
201
    $transdate  ||= DateTime->today;
202 200

  
201
    # create datev object
203 202
    my $datev = SL::DATEV->new(
204
      exporttype => DATEV_ET_BUCHUNGEN,
205
      format     => DATEV_FORMAT_KNE,
206 203
      dbh        => $dbh,
207 204
      trans_id   => $form->{id},
208 205
    );
209 206

  
210
    $datev->export;
207
    $datev->generate_datev_data;
211 208

  
212 209
    if ($datev->errors) {
213 210
      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
SL/IR.pm
817 817

  
818 818
  # safety check datev export
819 819
  if ($::instance_conf->get_datev_check_on_purchase_invoice) {
820
    # if we need department for kostenstelle in DATEV check
821
    $form->{department} = SL::DB::Manager::Department->find_by(id => $form->{department_id})->description if $form->{department_id};
822
    my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
823
    $transdate  ||= DateTime->today;
824 820

  
825 821
    my $datev = SL::DATEV->new(
826
      exporttype => DATEV_ET_BUCHUNGEN,
827
      format     => DATEV_FORMAT_KNE,
828 822
      dbh        => $dbh,
829 823
      trans_id   => $form->{id},
830 824
    );
831 825

  
832
    $datev->export;
826
    $datev->generate_datev_data;
833 827

  
834 828
    if ($datev->errors) {
835 829
      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
SL/IS.pm
1409 1409

  
1410 1410
  # safety check datev export
1411 1411
  if ($::instance_conf->get_datev_check_on_sales_invoice) {
1412
    my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
1413
    $transdate  ||= DateTime->today;
1414 1412

  
1415 1413
    my $datev = SL::DATEV->new(
1416
      exporttype => DATEV_ET_BUCHUNGEN,
1417
      format     => DATEV_FORMAT_KNE,
1418 1414
      dbh        => $dbh,
1419 1415
      trans_id   => $form->{id},
1420 1416
    );
1421 1417

  
1422
    $datev->export;
1418
    $datev->generate_datev_data;
1423 1419

  
1424 1420
    if ($datev->errors) {
1425 1421
      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
t/ar/ar.t
195 195

  
196 196
  if ($datev_check) {
197 197
    my $datev = SL::DATEV->new(
198
      exporttype => DATEV_ET_BUCHUNGEN,
199
      format     => DATEV_FORMAT_KNE,
200 198
      dbh        => $invoice->db->dbh,
201 199
      trans_id   => $invoice->id,
202 200
    );
203 201

  
204
    $datev->export;
202
    $datev->generate_datev_data;
203

  
205 204
    if ($datev->errors) {
206 205
      $invoice->db->dbh->rollback;
207 206
      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;

Auch abrufbar als: Unified diff