Skip to content

Commit

Permalink
OO#162_adding_customer_designation_to_invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmpp committed Jul 8, 2024
1 parent b29cb7f commit 56275cb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
27 changes: 18 additions & 9 deletions app/scripts/rechnungen/overview/rechnungenoverview.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,10 @@ angular.module('openolitor-admin')
listKundeIds.push($scope.checkboxes.data[id].kundeId);
});

var allEntries = KundenOverviewModel.query({
f: $scope.search.filterQuery
}, function() {
angular.forEach(listKundeIds, function(kundeId){
$scope.filteredEntries.push($filter('filter')(allEntries,{id:kundeId},true)[0]);
});
DetailNavigationService.detailFromOverview(currentKundeId.kundeId, $scope, 'kunden', $location.url());
angular.forEach(listKundeIds, function(kundeId){
$scope.filteredEntries.push($filter('filter')($scope.allKunden, {id:kundeId},true)[0]);
});
DetailNavigationService.detailFromOverview(currentKundeId.kundeId, $scope, 'kunden', $location.url());
};


Expand Down Expand Up @@ -390,11 +386,24 @@ angular.module('openolitor-admin')
}

$scope.loading = true;
$scope.entries = RechnungenOverviewModel.query({

$scope.allKunden = KundenOverviewModel.query({
f: $scope.search.filterQuery
}, function() {
$scope.tableParams.reload();
$scope.loading = false;
});

RechnungenOverviewModel.query({
f: $scope.search.filterQuery,
g: /^\d+$/.test($scope.geschaeftsjahr)?$scope.geschaeftsjahr:'',
q: $scope.search.queryQuery
}, function() {
}, function(rechnungen) {
angular.forEach(rechnungen, function(rechnung){
var kunde = lodash.find($scope.allKunden, {'id' : rechnung.kundeId});
rechnung.kundeBezeichnung = kunde.bezeichnung;
$scope.entries.push(rechnung);
});
$scope.tableParams.reload();
$scope.loading = false;
});
Expand Down
3 changes: 3 additions & 0 deletions app/scripts/rechnungen/overview/rechnungenoverview.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ <h3 class="panel-title"><span class="navbar-brand" translate>Rechnungen</span>
{{rechnung.kundeId}} &nbsp;
<a target="_blank" rel="noopener noreferrer" ng-click="navigateToKunde(rechnung.id)" ng-href="#/kunden/{{rechnung.kundeId}}"><i class="glyphicon small glyphicon-new-window"></i></a>
</td>
<td data-title="'Bezeichnung'|translate" sortable="'bezeichnung'">
{{rechnung.kundeBezeichnung}} &nbsp;
</td>
<td data-title="'Titel'|translate" sortable="'titel'">
{{rechnung.titel}}
</td>
Expand Down

0 comments on commit 56275cb

Please sign in to comment.