frappe / books

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

🐛 [Bug] - Purchase Payment Bug on Both Party #860

Open smalldale opened 4 months ago

smalldale commented 4 months ago

Expected Behavior

Purchase Payment From Account should use the same From Account from single role party. image image

Current Behavior

By default, it uses Piutang Dagang Dalam Negeri, with the options Piutang Lain-lain and Piutang Dagang. Same if choose Transfer as Payment Method. image image

Steps to Reproduce

  1. Create New Company. Add 2 Suppliers, and an Item. I create a company like the screenshot below. image Create 2 party, one with only supplier role and other with both roles. For Item is Pencil like the screenshot below. image
  2. Create a new purchase invoice for both role like this, submit it, then create new payment. image

As comparison, create a new purchase invoice for single role (supplier), submit it, then create new payment.

FrappeBooks Version

from 0.20.0 to 0.21.2

Path or Feature name

Purchase Invoice

Country

ID

Language

EN

OS

Windows 10

Additional OS Info

No response

Sutiksh27 commented 4 months ago

Hello, I am trying to solve this bug, just wanted to make sure, the From account that we can see in the payment section side should be similar to the account we have chosen while creating the single role party or both role party, right?

Abhi135721 commented 4 months ago

Hi, I am trying to resolve this bug as well. I think that is the requirement @Sutiksh27.

I found out that when a party is created with both role and when we try to add payment, the payment type is marked as Receive even if it is a Purchase invoice. Is it expected behavior or do we need to change the payment type based on whether it is a Purchase/Sales invoice?

Sutiksh27 commented 4 months ago

Hi, I am trying to resolve this bug as well. I think that is the requirement @Sutiksh27.

I found out that when a party is created with both role and when we try to add payment, the payment type is marked as Receive even if it is a Purchase invoice. Is it expected behavior or do we need to change the payment type based on whether it is a Purchase/Sales invoice?

In this particular issue, we only need to change the account that we can view in the payment section dropdown to the one assigned to the single role party/both parties. I can't see the payment type as Receive for both parties, can you share how did you arrive to that scenario?

Abhi135721 commented 4 months ago
  1. I created a Purchase invoice with Supplier set as Party with both role: image

  2. Then, I tried to add payment and I can see the payment type as Receive here: image

  3. I think, when the payment type is set to receive, accounts also change from when the payment type was set to pay. I might be wrong here. Just trying to understand if this is the expected behavior.

Sutiksh27 commented 4 months ago

I think it should be pay, When I tried to save a payment, it says the amount was paid from the "from account" to the "account" which you can see on the invoice side. That's what I was asking previously, because it is confusing based on the output that I am receiving.

Abhi135721 commented 4 months ago

Yeah, I think it should be pay too. If it is pay, then I guess the issue will be solved because the accounts change. But I am not sure if it was expected behavior or changing it to pay effects some other flow. So, wanted to confirm here.