Skip to content

Commit

Permalink
Merge pull request #684 from OpenOlitor/dev/OO#163_new_columns_invoic…
Browse files Browse the repository at this point in the history
…e_items

Dev/oo#163 new columns invoice items
  • Loading branch information
mcmpp authored Jul 16, 2024
2 parents 0b8cbd2 + a7a5559 commit 9908f12
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ angular.module('openolitor-admin')
'DataUtil', 'EnumUtil',
'OverviewCheckboxUtil', 'appConfig', 'FilterQueryUtil', 'RECHNUNGSPOSITIONSSTATUS',
'msgBus', 'lodash', 'ReportvorlagenService', 'localeSensitiveComparator', 'gettextCatalog',
'gettext','ProjektService',
'gettext','ProjektService','KundenOverviewModel', 'AbosOverviewModel', 'ZusatzabosOverviewModel',
function($q, $scope, $rootScope, $filter, $location, RechnungsPositionenModel,
NgTableParams, $http, FileUtil, DataUtil, EnumUtil,
OverviewCheckboxUtil, appConfig,
FilterQueryUtil, RECHNUNGSPOSITIONSSTATUS, msgBus, lodash, ReportvorlagenService,
localeSensitiveComparator, gettextCatalog, gettext, ProjektService) {
localeSensitiveComparator, gettextCatalog, gettext, ProjektService, KundenOverviewModel, AbosOverviewModel,ZusatzabosOverviewModel) {
$rootScope.viewId = 'L-Repo';

$scope.entries = [];
Expand Down Expand Up @@ -179,12 +179,33 @@ angular.module('openolitor-admin')
$scope.tableParams.reload();

$scope.loading = true;
$scope.entries = RechnungsPositionenModel.query({
f: $scope.search.filterQuery,
q: $scope.search.queryQuery
}, function() {
$scope.tableParams.reload();
$scope.loading = false;

KundenOverviewModel.query({}, function(allKunden) {
AbosOverviewModel.query({}, function(abos) {
ZusatzabosOverviewModel.query({}, function(zusatzabos) {
$scope.entries = RechnungsPositionenModel.query({
f: $scope.search.filterQuery,
q: $scope.search.queryQuery
}, function(rechnungsPosition) {
angular.forEach(rechnungsPosition, function(rp){
var kunde = lodash.find(allKunden, {'id' : rp.kundeId});
var abo = lodash.find(abos, {'id' : rp.aboId});
var zusatzabo = lodash.find(zusatzabos, {'id' : rp.aboId});
if (kunde !== undefined){
rp.kundeBezeichnung = kunde.bezeichnung;
}
if (abo !== undefined){
rp.abotypBezeichnung = abo.abotypName;
} else if (zusatzabo !== undefined){
rp.abotypBezeichnung = zusatzabo.abotypName;
}
$scope.entries.push(rp);
});
$scope.tableParams.reload();
$scope.loading = false;
});
});
});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ <h3 class="panel-title"><span class="navbar-brand" translate>Rechnungspositionen
<a ng-show="rechnungsPosition.typ === 'Abo'" target="_blank" rel="noopener noreferrer" ng-href="#/abos?q=id%3D{{rechnungsPosition.aboId}}"><i class="glyphicon small glyphicon-new-window"></i></a>
<a ng-show="rechnungsPosition.typ === 'ZusatzAbo'" target="_blank" rel="noopener noreferrer" ng-href="#/zusatzabos?q=id%3D{{rechnungsPosition.aboId}}"><i class="glyphicon small glyphicon-new-window"></i></a>
</td>
<td data-title="'Abotyp'|translate" sortable="'abotypBezeichnung'">
{{rechnungsPosition.abotypBezeichnung}}
</td>
<td data-title="'Kunde'|translate" sortable="'kundeId'">
{{rechnungsPosition.kundeId}} &nbsp;
<a target="_blank" rel="noopener noreferrer" ng-href="#/kunden/{{rechnungsPosition.kundeId}}"><i class="glyphicon small glyphicon-new-window"></i></a>
</td>
<td data-title="'Kunde Bezeichnung'|translate" sortable="'kundeBezeichnung'">
{{rechnungsPosition.kundeBezeichnung}}
</td>
<td data-title="'Beschrieb'|translate" sortable="'titel'">
{{rechnungsPosition.beschrieb}}
</td>
Expand Down

0 comments on commit 9908f12

Please sign in to comment.