frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.86k stars 660 forks source link

feat: invoice return #743

Closed akshayitzme closed 10 months ago

akshayitzme commented 1 year ago

This PR adds the functionality for Sales and Purchase Return.

Invoice Return

Workflow
_follows ERPNext's workflow_ | # | Qty | SINV Outstanding | Return Inv Outstanding | Paid Amt (Pay) | Paid Amt (Receive) | |---|---|---|---|---|---| | **Scenario 1: (F Payment, F Return, F Payment)** | | | | | | | Invoice created | 2 | 20 | 0 | 0 | 0 | | Payment created | 2 | 0 | 0 | 0 | 20 | | Return issued (Full) | 2 | 0 | -20 | 0 | 0 | | Payment created against Return | 2 | 0 | 0 | 20 | 0 | | | | | | | | | **Scenario 2: (F Payment, P Return, P Payment)** | | | | | | | Invoice created | 2 | 20 | 0 | 0 | 0 | | Payment created | 2 | 0 | 0 | 0 | 20 | | Return Issued (Partial) | 1 | 0 | -10 | 0 | 0 | | Payment created against Return | 1 | 0 | 0 | 10 | 0 | | | | | | | | | **Scenario 3: (N Payment, F Return)** | | | | | | | Invoice created | 2 | 20 | 0 | 0 | 0 | | Return Issued (Full) | 2 | 20 | -20 | 0 | 0 | (_**F payment**: Full Payment, **P Payment**: Partial Payment, **N Payment**: No Payment_)
chaoxu commented 11 months ago

Is there a timeline on when this can be merged? This is an essential requirement that is holding me back from adopting frappe book.

akshayitzme commented 10 months ago

Did a self review, LGTM

mildred commented 10 months ago

@akshayitzme When using your code on an existing database, I get an error:

SqliteError alter table Payment add column referenceType text not null - Cannot add a NOT NULL column with default value ...

akshayitzme commented 10 months ago

@akshayitzme When using your code on an existing database, I get an error:

SqliteError alter table Payment add column referenceType text not null - Cannot add a NOT NULL column with default value ...

Hi, Thanks for pointing this out. I haven't tried reproducing it yet.. will do it in the coming days and push fixes if needed.

akshayitzme commented 10 months ago

@akshayitzme When using your code on an existing database, I get an error:

SqliteError alter table Payment add column referenceType text not null - Cannot add a NOT NULL column with default value ...

fixed in #782