Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions codbex-payments/codbex-payments.edm

Large diffs are not rendered by default.

2,197 changes: 1,620 additions & 577 deletions codbex-payments/codbex-payments.gen

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions codbex-payments/codbex-payments.model
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@
"generateReport": "false",
"icon": "/services/web/resources/unicons/file.svg",
"importsCode": "aW1wb3J0IHsgTnVtYmVyR2VuZXJhdG9yU2VydmljZSB9IGZyb20gIi9jb2RiZXgtbnVtYmVyLWdlbmVyYXRvci9zZXJ2aWNlL2dlbmVyYXRvciI7",
"layoutType": "MANAGE",
"layoutType": "MANAGE_MASTER",
"menuIndex": "100",
"menuKey": "supplierpayment",
"menuLabel": "SupplierPayment",
Expand Down Expand Up @@ -990,7 +990,7 @@
"description": "Manage entity PaymentRecord",
"generateReport": "true",
"icon": "/services/web/resources/unicons/file.svg",
"layoutType": "MANAGE",
"layoutType": "MANAGE_MASTER",
"menuIndex": "100",
"menuKey": "paymentrecord",
"menuLabel": "PaymentRecord",
Expand Down Expand Up @@ -1866,7 +1866,7 @@
"description": "Manage entity PaymentAdjustment",
"generateReport": "false",
"icon": "/services/web/resources/unicons/file.svg",
"layoutType": "MANAGE",
"layoutType": "MANAGE_MASTER",
"menuIndex": "100",
"menuKey": "paymentadjustment",
"menuLabel": "PaymentAdjustment",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module": "codbex-payments/gen/codbex-payments/ui/CustomerPayment/CustomerPayment/dialog-filter/view.js",
"extensionPoint": "codbex-payments-dialog-window",
"extensionPoint": "dialog-window",
"description": "codbex-payments - Application Dialog Window"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
angular.module('page', ["ideUI", "ideView", "entityApi"])
.config(["messageHubProvider", function (messageHubProvider) {
messageHubProvider.eventIdPrefix = 'codbex-payments.CustomerPayment.CustomerPayment';
}])
.config(["entityApiProvider", function (entityApiProvider) {
entityApiProvider.baseUrl = "/services/ts/codbex-payments/gen/codbex-payments/api/CustomerPayment/CustomerPaymentService.ts";
}])
.controller('PageController', ['$scope', '$http', 'messageHub', 'ViewParameters', 'entityApi', function ($scope, $http, messageHub, ViewParameters, entityApi) {

$scope.entity = {};
$scope.forms = {
details: {},
};
$scope.formHeaders = {
select: "CustomerPayment Details",
create: "Create CustomerPayment",
update: "Update CustomerPayment"
};
$scope.action = 'select';

let params = ViewParameters.get();
if (Object.keys(params).length) {
$scope.action = params.action;
if (params.entity.Date) {
params.entity.Date = new Date(params.entity.Date);
}
if (params.entity.Valor) {
params.entity.Valor = new Date(params.entity.Valor);
}
$scope.entity = params.entity;
$scope.selectedMainEntityKey = params.selectedMainEntityKey;
$scope.selectedMainEntityId = params.selectedMainEntityId;
$scope.optionsCustomer = params.optionsCustomer;
$scope.optionsCurrency = params.optionsCurrency;
$scope.optionsCompany = params.optionsCompany;
$scope.optionsPaymentMethod = params.optionsPaymentMethod;
}

$scope.create = function () {
let entity = $scope.entity;
entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId;
entityApi.create(entity).then(function (response) {
if (response.status != 201) {
$scope.errorMessage = `Unable to create CustomerPayment: '${response.message}'`;
return;
}
messageHub.postMessage("entityCreated", response.data);
$scope.cancel();
messageHub.showAlertSuccess("CustomerPayment", "CustomerPayment successfully created");
});
};

$scope.update = function () {
let id = $scope.entity.Id;
let entity = $scope.entity;
entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId;
entityApi.update(id, entity).then(function (response) {
if (response.status != 200) {
$scope.errorMessage = `Unable to update CustomerPayment: '${response.message}'`;
return;
}
messageHub.postMessage("entityUpdated", response.data);
$scope.cancel();
messageHub.showAlertSuccess("CustomerPayment", "CustomerPayment successfully updated");
});
};

$scope.serviceCustomer = "/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts";

$scope.optionsCustomer = [];

$http.get("/services/ts/codbex-partners/gen/codbex-partners/api/Customers/CustomerService.ts").then(function (response) {
$scope.optionsCustomer = response.data.map(e => {
return {
value: e.Id,
text: e.Name
}
});
});
$scope.serviceCurrency = "/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts";

$scope.optionsCurrency = [];

$http.get("/services/ts/codbex-currencies/gen/codbex-currencies/api/Currencies/CurrencyService.ts").then(function (response) {
$scope.optionsCurrency = response.data.map(e => {
return {
value: e.Id,
text: e.Code
}
});
});
$scope.serviceCompany = "/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts";

$scope.optionsCompany = [];

$http.get("/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyService.ts").then(function (response) {
$scope.optionsCompany = response.data.map(e => {
return {
value: e.Id,
text: e.Name
}
});
});
$scope.servicePaymentMethod = "/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts";

$scope.optionsPaymentMethod = [];

$http.get("/services/ts/codbex-methods/gen/codbex-methods/api/Methods/PaymentMethodService.ts").then(function (response) {
$scope.optionsPaymentMethod = response.data.map(e => {
return {
value: e.Id,
text: e.Name
}
});
});

$scope.cancel = function () {
$scope.entity = {};
$scope.action = 'select';
messageHub.closeDialogWindow("CustomerPayment-details");
};

$scope.clearErrorMessage = function () {
$scope.errorMessage = null;
};

}]);
Loading