-
Notifications
You must be signed in to change notification settings - Fork 792
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
[IP-717] Implements hotfix for item discount calculation #638
Conversation
@mjmunger Would you like to take a look into this? |
Happy to check it out a little later today. Finishing up unit tests for a package that works with InvoicePlane's database, so I have use cases ready to go. |
Took a quick look at it just now... do you mind if I clean this up? |
Sure, feel free to propose changes. It's a quick and dirty solution. |
I've refactored a bunch of things. I am not sure how you want to receive the changes. Obviously, I don't have push rights to your local fork (that would be most convenient). How do you want to do this? |
also, while refactoring, I discovered that your "mark tasks complete for this invoice" section appears to have never worked. line 465 sets |
You may send the patch file to mail@invoiceplane.com so I can apply the changes you made. |
Patch submitted. Updates are in the CHANGELOG.md, which I have added (not sure why it wasn't there before?) |
@mjmunger I implemented your new calculation approach for quotes. However, the |
I see the problem. Needs an update to the factory, and needs another decorator. Also, checking to see if base path is defined on those is an unneeded conditional because 1.) The .htaccess file rewrites all requests to the front controller doesn't allow access anyway, and 2.) Even if it did, that doesn't actually do anything except load the class without performing work. I'll fix it. |
I did not pull your current version to work with since I am already famliar with the changes needed, I just re-did it from my copy here. Sending you the patches now. |
@mjmunger Implemented your changes. Autoloading is handled by Composer, working perfectly well. Also moved the source files into the application directory to keep the current directory structure. |
Anything else that needs to be done? Or can we publish v1.5.10? |
If it's working correctly version 1.5.10 can be published. |
I'll pull and test. |
Doing a pull / test now. Will advise in 30 minutes. |
Revision 0a113a1 has the autoloader I put in pre-maturely removed. Composer does handle autloading for composer compliant packages, but these classes are not a composer compliant package, so Composer doesn't now about them. Moving Having fixed this in dev, the invoices are not calculating correctly again. :-( |
Classes are loaded correctly after running |
@mjmunger Are there any news on the testing? |
It's on my list, but I haven't been able to get to it. We do billing once / month, so it is about to get more important very soon. |
@miquel-cabanas Could you help me out here? Would just need a check of quotes / invoices to be working correctly. Would like to publish 1.5.10 in the next week(s). :) |
We've got it working internally, and it is a priority for us to push this out to you, but we have to get a few things handled on the business side first. Will try to do this in the next couple days.
Get Outlook for Android<https://aka.ms/ghei36>
On Sun, Sep 9, 2018 at 3:27 AM -0400, "Kovah" <notifications@github.com<mailto:notifications@github.com>> wrote:
@miquel-cabanas<https://github.com/miquel-cabanas> Could you help me out here? Would just need a check of quotes / invoices to be working correctly. Would like to publish 1.5.10 in the next week(s). :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#638 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGE1_mTrYVoOQdFosXu3hr4wASAB8k27ks5uZMMEgaJpZM4VxGSn>.
|
I am currently checking the language issue reported in IP-531. I think it is fixed, but when investigating it I have found another minor language problem. When I'm done with it I will have a look at this PR. |
@BoostIO funded this issue with $20. Visit this issue on Issuehunt |
Funding will be split 75:25 for development and testing. |
I would like to publish 1.5.10 with this fix on the upcoming sunday (2018-10-07). |
There is a minor issue in the function
public function get_item_discount_total()
{
$quantity = (int)round($this->item_quantity * 100, 2);
$discount = (int)round($this->item_discount_amount * 100, 2);
$tax_total = $quantity * $discount / 100 / 100;
return $tax_total;
} I will keep reviewing the code and will comment anything I found, although, from what I have read so far, I suspect they will be just minor issues like this one. |
Sorry to be picky 🙏 but the names of files, classes and variables do not seem to abide to CI conventions: For instance, the file On the other side, variable names seems to be fine There's no need to change them to test the code since CI does not seem to be enforcing its standards as of now, but the names should be changed before accepting the pull request just in case a future version of CI becomes more strict. |
Good news! I am picky again 🙏 which means I'm finding nothing really serious to comment 😉 Some functions in Other than this, I think the changes in this file are ok. |
Pull Request Checklist
Issue Type (Please check one or more)
Quotes / invoices created after the update to 1.5.10 will get a modifier that enables the new discount/tax calculation. This way old invoices are not recalculated but new ones will use the correct calculation method. Credits go to @mjmunger.