-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(supplier): generate creditors from groups
This commit fixes a long-standing bug in the suppliers page. The suppliers previously used Creditors instead of Creditor Groups which have no way to be created independently of the supplier. The client page has been refactored to choose creditor groups from a dropdown and the server now generates a new creditor UUID when creating a supplier. Closes #754.
- Loading branch information
Showing
7 changed files
with
237 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,14 @@ | ||
angular.module('bhima.services') | ||
.service('CreditorGroupService', CreditorGroupService); | ||
.service('CreditorGroupService', CreditorGroupService); | ||
|
||
CreditorGroupService.$inject = ['$http', 'util']; | ||
CreditorGroupService.$inject = ['PrototypeApiService']; | ||
|
||
/** | ||
* Creditor Group Service | ||
* | ||
* This service implements CRUD operations for the /creditor_groups API endpoint | ||
*/ | ||
function CreditorGroupService($http, util) { | ||
var service = this; | ||
var baseUrl = '/creditor_groups/'; | ||
|
||
/** Exposed method read */ | ||
service.read = read; | ||
|
||
/** | ||
* @method read | ||
* @param {string} uuid The creditor group uuid | ||
* @param {object} parameters The query string object | ||
* @description This function is responsible for getting creditor groups | ||
*/ | ||
function read(uuid, parameters) { | ||
var url = baseUrl.concat(uuid || ''); | ||
return $http.get(url, { params : parameters }) | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
function CreditorGroupService(Api) { | ||
var service = Api('/creditor_groups/'); | ||
return service; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.