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

[IP-1] Working expense module for 1.5.12 #688

Open
wants to merge 11 commits into
base: do_NOT_USE_develop
Choose a base branch
from

Conversation

chrispytorius
Copy link

Sorry i messed up my first pull request, this one is has the correct files. Git is new to me :/

Pull Request Checklist

  • [x ] My code follows the code formatting guidelines.
  • [ x] I have an issue ID for this pull request.
  • [ x] I selected the corresponding branch.
  • [ x] I have rebased my changes on top of the corresponding branch.

Issue Type (Please check one or more)

  • Bugfix
  • Improvement of an existing Feature
  • [ x] New Feature

@pradeshc
Copy link

@chrispytorius Thank you,

Please check your files again. There are a few files that have recorded no change (perhaps end-of-line or end-of-file changes but are listed here as modified. Configure your git to ignore whitespace changes.

Also, it is not a good practice to change your master branch and push that to a derivative branch. Rather create a new branch that matches your task number and then make your changes against this. You can then submit a pull request to merge that branch to the target branch (in this case v1.5.10.1)

@chrispytorius chrispytorius changed the title [IP-1] Working expense module for 1.5/1.6 [IP-1] Working expense module for 1.5.10.1 Feb 20, 2019
@chrispytorius
Copy link
Author

@pradeshc

Thanks for the help, i have updated the pull request with the whitespace changes removed, and i have updated to the correct target branch. Hopefully this is now correct.

AndyX90 added a commit to AndyX90/InvoicePlane that referenced this pull request May 22, 2019
@Kovah Kovah changed the base branch from v1.5.10.1 to v1.5.11 January 22, 2020 19:05
@boban-dj
Copy link

Hi, I was wondering if we could make this expenses module work.
I see there are some issues from these commits, was it tested and working or a work in progress?

@the-hotmann the-hotmann changed the title [IP-1] Working expense module for 1.5.10.1 [IP-1] Working expense module for 1.5.11 Mar 31, 2020
@the-hotmann the-hotmann changed the base branch from v1.5.11 to 1.5.12 April 21, 2020 05:17
@rein-10
Copy link

rein-10 commented Apr 23, 2020

i cannot make this work i get this error:

Error Number: 1146

Table 'transene_invo873.ip_expense_custom' doesn't exist

SELECT * FROM ip_expense_custom WHERE expense_id IS NULL

Filename: core/MY_Model.php

Line Number: 157

Can someone guide me in the correct direction?

@boban-dj
Copy link

boban-dj commented Apr 23, 2020 via email

@the-hotmann the-hotmann changed the title [IP-1] Working expense module for 1.5.11 [IP-1] Working expense module for 1.5.12 Apr 24, 2020
@the-hotmann
Copy link
Member

the-hotmann commented Apr 24, 2020

If anything should be added/changed in the DB this also should be added to /application/modules/setup/sql/ in the related .sql file. In this example you should create 035_1.5.12.sql and add all the DB changes so they will be executed in the update process.

@rein-10
Copy link

rein-10 commented Apr 24, 2020

add those missing tabels to the db

On Thu, Apr 23, 2020, 20:29 rein-10 @.***> wrote: i cannot make this work i get this error: Error Number: 1146 Table 'transene_invo873.ip_expense_custom' doesn't exist SELECT * FROM ip_expense_custom WHERE expense_id IS NULL Filename: core/MY_Model.php Line Number: 157 Can someone guide me in the correct direction? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#688 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABI5UAV4NSQE4Z5FIBXEJJLROCCIBANCNFSM4GX3B6CA .

Thanks for the comment. Didnt really know how but finally figured it out. Is it possible to attach multiple files, instead of just one?

@boban-dj
Copy link

boban-dj commented May 4, 2020

from what I saw the file upload is just 1. but its not using existing fileupload from dropzone.js as in invoices and qoutes. also it stores file as blob in db.

@rein-10
Copy link

rein-10 commented May 8, 2020

The tax amount paid only works correctly for 10%? If you change the percentage it will show an incorrect calculation. You can fix it by changing the divisor but it would be a problem if you need to manage more than one tax rates. Am I right or is there something that i am missing?

@clockwiseq
Copy link
Contributor

I'm assuming this is a precision issue. Sounds like .1 is fine, but .09 is rounding or dropping the precision.

@rein-10
Copy link

rein-10 commented May 8, 2020

I'm assuming this is a precision issue. Sounds like .1 is fine, but .09 is rounding or dropping the precision.

Yes any other value instead of .1, will make the calculation imprecise.

@rein-10
Copy link

rein-10 commented May 8, 2020

Yes any other value instead of .1, will make the calculation imprecise. Made this correction and it will work with all the values that I tried, dont know really much of PHP but this work for me.

partial_expense_table.php
Line 31

<td><?php echo format_currency($expense->expense_amount / (($expense->tax_rate_percent + 100) / $expense->tax_rate_percent)); ?></td>

mdl_reports.php
Line 742

$this->db->select('ip_clients.client_name, SUM(ip_expenses.expense_amount) expense_total, SUM(ip_expenses.expense_amount / ((ip_tax_rates.tax_rate_percent + 100) / tax_rate_percent)) expense_tax_total, YEAR(ip_expenses.expense_date) year', FALSE);

Hope this helps!

@arturtle
Copy link

arturtle commented Jul 2, 2020

I keep on getting this error when trying to vie the index. I realize I need to add ip_expenses to my database, what I don't understand is what I should add to my columns. Can someone give me a hand?

Error Number: 1146

Table 'alsko_invo429.ip_expenses' doesn't exist

SELECT SQL_CALC_FOUND_ROWS ip_expense_custom., ip_payment_methods., ip_clients.client_name, ip_clients.client_id, ip_tax_rates.tax_rate_name, ip_tax_rates.tax_rate_percent, ip_expenses.* FROM ip_expenses LEFT JOIN ip_payment_methods ON ip_payment_methods.payment_method_id = ip_expenses.payment_method_id LEFT JOIN ip_expense_custom ON ip_expense_custom.expense_id = ip_expenses.expense_id LEFT JOIN ip_clients ON ip_clients.client_id = ip_expenses.client_id LEFT JOIN ip_tax_rates ON ip_tax_rates.tax_rate_id = ip_expenses.tax_rate_id ORDER BY ip_expenses.expense_date DESC LIMIT 15

Filename: core/MY_Model.php

Line Number: 220

Also, how do I get expenses

to show on my nav? And can I rename the dropdown options?
BD error
expense_1

@pradeshc
Copy link

pradeshc commented Jul 2, 2020

@arturtle , You will have to revisit your installation of the module.

The module needs the ip_expenses table to run, and from the error message it is clear that the table is not there.

I keep on getting this error when trying to vie the index. I realize I need to add ip_expenses to my database, what I don't understand is what I should add to my columns. Can someone give me a hand?

Error Number: 1146
Table 'alsko_invo429.ip_expenses' doesn't exist

@nielsdrost7 nielsdrost7 changed the base branch from 1.5.12 to develop July 10, 2022 15:48
@BastianBalthasarBux
Copy link

Is there any progress on this? Further plans?

@nielsdrost7
Copy link
Contributor

@BastianBalthasarBux the progress is, that this module is built in V2 of InvoicePlane.
The V1 part, the PR you're looking at right now hasn't had progress since July of 2020.

The V2 progress is coming along quite nicely.
It doesn't have expense_items, like quotes and invoices have, but for the rest: happy with the results in V2

@BastianBalthasarBux
Copy link

@nielsdrost7 this sounds really great!
[i do not need expense items, just "expense" would be great, so I could push the invoices i paid and have some sort of "poor mans" cash accounting ...]

@nielsdrost7
Copy link
Contributor

nielsdrost7 commented Oct 25, 2023

@BastianBalthasarBux understood. I'll add you to slack, we sometimes talk about V2 development there.

Here is the invite link for Slack:
https://join.slack.com/t/invoiceplane/shared_invite/zt-sjirc9h2-952baR9rn4r8LyzRK9MveA

@BastianBalthasarBux
Copy link

@nielsdrost7 i am already there since ... hmm, ages I think ... ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet