Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(Setting) donor management module #4837

Closed

Conversation

jeremielodi
Copy link
Collaborator

@jeremielodi jeremielodi commented Aug 20, 2020

closes #4826

@jeremielodi
Copy link
Collaborator Author

jeremielodi commented Aug 20, 2020

There are still others step on which my working in order to totally fix #4826

@jmcameron
Copy link
Collaborator

I did a functional test with Bhima_test and found that the donor creation/editing works fine. Thanks. I have not scanned the code carefully.

I assume that future Pull Requests will deal with these issues:

  • Adding more details to the Donor (eg, address, Department, Company, contact info, etc).
  • Tying this into the Stock Entry module so that you can select an existing Donor or create a new one without leaving the Stock Entry form

@jeremielodi jeremielodi force-pushed the donator branch 5 times, most recently from 061e031 to 2f29aca Compare August 24, 2020 14:27
@jmcameron
Copy link
Collaborator

I did another functional test (I did not do a detailed code review). I was able to create, edit, and delete donors. I think that the additional donor contact details will be useful. It will be hard to tell what is really needed for details until we use this in the field with actual donors, etc.

However, I did find one problem: I was able to create a Donor, but when I went to Stock > Stock Entry, and selected "DONOR", I did not see my new donor in the list.

@jeremielodi
Copy link
Collaborator Author

The only thing that remains is to create a donation from find modal. I will work on that today and ask for a review just after

Copy link
Collaborator

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good job @jeremielodi most part of the work that you made work fine

I have just notice that :

  • We cannot get the donation receipt from the donation modal
  • There is not yet a donation module for creating donation
  • We cannot populate the grid with donation data in the stock entry module

/**
* Role Service
*
* A service wrapper for the /donors HTTP endpoint.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This service is for /donors or /donations ? If it is for /donations you could update this line

function DonorController($uibModal, Donor, Modal, Notify, uiGridConstants) {
const vm = this;

vm.createUpdateDonorModal = (selectedRole = {}) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this parameter is not related to role may be selectedDonor is a better name


Donor.read()
.then(roles => {
vm.gridOptions.data = roles;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

donors in place of roles will be better

@@ -0,0 +1,36 @@
angular.module('bhima.controllers')
.controller('DonorAddController', DonorAddController);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the controller is not only for creation of donors, so you could rename this controller to something like : DonorCreateAndUpdateController, DonorManagementController, etc.

TODO: add a donor management module
*/
movement.lots = Stock.processLotsFromStore(vm.stockForm.store.data, Uuid());
movement.lots = Stock.processLotsFromStore(vm.stockForm.store.data, vm.movement.entity.uuid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

<div class="row">
<div class="col-xs-12">
<div
id="PurchaseGrid"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grid is not for purchase I think, maybe DonationGrid will be better

field : 'reference',
displayName : 'TABLE.COLUMNS.REFERENCE',
headerCellFilter : 'translate',
cellTemplate : 'modules/stock/entry/modals/templates/purchase_reference.tmpl.html',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this template is used also with purchase, do you think we can rename it ?

vm.gridApi.core.notifyDataChange(uiGridConstants.dataChange.COLUMN);
}

/** get purchase document */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add comments about the use of Receipts.purchase here.

Also I cannot get the receipt of donation

app.get('/donations/:uuid', donation.detail);
app.put('/donations/:uuid', donation.update);
app.delete('/donations/:uuid', donation.remove);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

</div>

<div class="modal-body">
<div class="row">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this <div class="row"> it is not necessary

@jeremielodi jeremielodi force-pushed the donator branch 2 times, most recently from 01c9da8 to 11d5c8f Compare September 3, 2020 10:51
@jmcameron jmcameron self-requested a review September 3, 2020 17:54
Copy link
Collaborator

@jmcameron jmcameron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did another test and the donor add/edit/delete works fine.
However, using the Donors in the Stock Entry page is confusing to me.

  • When I added a new donor, and did Stock > Stock Entry, clicked on [Donor], the new Donor is not listed.
  • In the pop-up dialog that comes up to select a donor, if I click the check mark for the existing Donor and click on [Submit], I return to the Stock Entry page, but no Donor is indicated in the [Donor] button AND there is still a warning at the bottom "No source selected".
  • In the pop-up donor selection dialog, there is an [+] button on the top right to add a Donor (right?). However, I think there is a problem with the controls:
    image
    Notice that controls to add stock items appears. That should not be in this form. This form should just select the donor and return the the main Stock Entry page with the Donor inserted. If you click on the [Add] button, to add stock items (which you should not do in this form), you will see error messages on the underlying screen, not this dialog! So I think that the lower part (to add stock items) should be removed from this form.
  • Finally, is the pop-up Donor selection dialog the only place to associated a donation with a project?

What would make more sense to me (and probably be simpler for users), would be for

  • The Donor selection dialog allows you to pick the donor and return to the main Stock entry form.
  • The Donor would be selected and displayed in the [Donor] button.
  • Two new fields would appear in the Stock Entry form:
    • a task selection field (drop-down menu)
    • a donation description text field
  • No additional donation date field is needed (probably); I think that the date of the entry should be adequate. One could enter any other original donation dates, etc, in the Donation description field.

@jeremielodi
Copy link
Collaborator Author

jeremielodi commented Sep 3, 2020

The field date is enough for specifying the donation date, the stock_movement table has another column created_at that tell us the date the stock has been encoded

@jeremielodi
Copy link
Collaborator Author

jeremielodi commented Sep 3, 2020

The donor list shows up without error
donors

@jmcameron
Copy link
Collaborator

jmcameron commented Sep 3, 2020

The donor list shows up without error

Yes, I saw that. And it worked for me, but I thought the process was difficult. I outlined the way that seemed more user-friendly to me in my previous post.

@jeremielodi
Copy link
Collaborator Author

Even for purshase order if you create a supplier no source will be selected in the stock entry, @mbayopanda can tell us more about this

@mbayopanda
Copy link
Collaborator

Even for purshase order if you create a supplier no source will be selected in the stock entry, @mbayopanda can tell us more about this

I agree that we can simplify this feature by having just the donor (when we click on the donation button), we have already these pieces of information (date, description, and inventories) in the stock entry form, and I am not sure if we really need the project here.

@jeremielodi jeremielodi force-pushed the donator branch 3 times, most recently from 5137ff6 to 8eac0b7 Compare September 25, 2020 11:05
@jniles
Copy link
Collaborator

jniles commented Sep 28, 2020

@jeremielodi what is the status of this PR?

jniles added a commit to jniles/bhima that referenced this pull request Sep 30, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 to bring them into
master sooner.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Sep 30, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 to bring them into
master sooner.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Sep 30, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 to bring them into
master sooner.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Sep 30, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 to bring them into
master sooner.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Oct 1, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 and add the critical
await call to prevent test failures.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Oct 1, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 and add the critical
await call to prevent test failures.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Oct 1, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 and add the critical
await call to prevent test failures.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Oct 1, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 and add the critical
await call to prevent test failures.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Oct 1, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 and add the critical
await call to prevent test failures.

Closes Third-Culture-Software#4919.
jniles added a commit to jniles/bhima that referenced this pull request Oct 1, 2020
Cherry picked the bh-date-editor changes from Third-Culture-Software#4837 and add the critical
await call to prevent test failures.

Closes Third-Culture-Software#4919.
bors bot added a commit that referenced this pull request Oct 1, 2020
4970: fix(test): fix bh-date-editor tests r=lomamech a=jniles

Cherry picked the bh-date-editor changes from #4837 to bring them into `master` sooner.

Closes #4919.

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
@jeremielodi jeremielodi closed this Oct 1, 2021
@jeremielodi jeremielodi deleted the donator branch October 1, 2021 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify the donor on Stock entry from donation
5 participants