Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fbebd06d

Von Jan Büren vor 4 Monaten hinzugefügt

  • ID fbebd06df00a31b8c8e0847a45b94b75245261ec
  • Vorgänger 0e71a0c8
  • Nachfolger 4cf2f2ab

DATEV: neue Routine, die prüft ob jede Buchung auch eine Dokument besitzt

Unterschiede anzeigen:

SL/DATEV.pm
1082 1082

  
1083 1083
  return 1;
1084 1084

  
1085
  # TODO maybe needed
1085
}
1086

  
1087
sub check_all_bookings_have_documents {
1088
  my ($self) = shift;
1089
  my %params = @_;
1090

  
1091
  die "Need from date" unless $params{from};
1092
  die "Need to date"   unless $params{to};
1093

  
1094
  $self->from($params{from});
1095
  $self->to($params{to});
1096

  
1097
  my $fromto = $self->fromto;
1086 1098
  # not all last month ar ap gl booking have an entry -> rent ?
1087
  my $query = <<"SQL";
1099
  my $query = qq|
1088 1100
  select distinct trans_id,object_id from acc_trans
1089 1101
  left join files on files.object_id=trans_id
1090
  where date_trunc('month', transdate) = date_trunc('month', current_date - interval '1 month')
1102
  where $fromto
1091 1103
  and object_id is null
1092
  LIMIT 1
1093
SQL
1104
  LIMIT 1|;
1105

  
1094 1106
  my ($booking_has_no_document)  = selectrow_query($::form, SL::DB->client->dbh, $query);
1095 1107
  return defined $booking_has_no_document ? 0 : 1;
1096 1108

  
1097 1109
}
1098 1110

  
1099 1111

  
1112

  
1100 1113
sub _u8 {
1101 1114
  my ($value) = @_;
1102 1115
  return encode('UTF-8', $value // '');
......
1322 1335
The error message gives a short hint with the value of the (at least)
1323 1336
two mismatching number length domains.
1324 1337

  
1338
=item check_document_export
1339

  
1340
Returns 1 if DMS feature is enabled and Backend is Filesystem
1341

  
1342
=item check_all_bookings_have_documents
1343

  
1344
Returns 1 if all transactions for this period have a document entry in files.
1345
Therefore all transactions may be exported (type is not checked and DATEV
1346
only accepts PDF).
1347

  
1348

  
1325 1349
=back
1326 1350

  
1327 1351
=head1 ATTRIBUTES

Auch abrufbar als: Unified diff