Bug 32705

Summary: Display actual cost in foreign currency and currency from the invoice
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: Needs documenting --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: matt.blenkinsop, michaela.sieber
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
The original price of an order in a foreign currency and the currency will now display on the invoice summary page.
Version(s) released in:
23.05.00
Circulation function:
Bug Depends on: 25655    
Bug Blocks:    
Attachments: Bug 32705: Display invoice price
Bug 32705: Display invoice price
Bug 32705: Display invoice price
Bug 32705: Display invoice price
Bug 32705: Display invoice price
Bug 32705: Display the column if 1 order has an invoice price
Bug 32705: Display invoice price
Bug 32705: Display the column if 1 order has an invoice price

Description Jonathan Druart 2023-01-23 20:03:58 UTC
On bug 25655 we are going to store the cost and currency from the invoice. On this bug we will display them on the invoice summary.
Comment 1 Jonathan Druart 2023-01-31 20:26:12 UTC
Created attachment 145913 [details] [review]
Bug 32705: Display invoice price

On bug 25655 we are storing the unit price and currency used for
invoicing. Here we are displaying them on the invoice page.

Test plan:
Reuse the test plan from 25655 and go to the invoice page
Notice that a new 'Invoice price' column is displayed if at least one
order of the invoice had a price given in a foreign currency

We could discuss the display of the prices here, I've decided to format
them but they are not accurate to the currency. We cannot do better for
now as we are not storing the format along with the currency.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 2 Michaela Sieber 2023-02-03 12:40:47 UTC
(In reply to Jonathan Druart from comment #1)

> 
> We could discuss the display of the prices here, I've decided to format
> them but they are not accurate to the currency. We cannot do better for
> now as we are not storing the format along with the currency.
> 

We would prefer unitprice and currency code (not symbol)

[% order.invoice_unitprice | currency => order.invoice_currency %]

Exemplar:
52.33 EUR
876.42 USD
69.38 CAD
...
Comment 3 Jonathan Druart 2023-02-07 08:20:09 UTC
Created attachment 146307 [details] [review]
Bug 32705: Display invoice price

On bug 25655 we are storing the unit price and currency used for
invoicing. Here we are displaying them on the invoice page.

Test plan:
Reuse the test plan from 25655 and go to the invoice page
Notice that a new 'Invoice price' column is displayed if at least one
order of the invoice had a price given in a foreign currency

We could discuss the display of the prices here, we've decided to not
format them.
We cannot do better for now as we are not storing the format along with
the currency.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 4 PTFS Europe Sandboxes 2023-02-08 07:38:39 UTC
Created attachment 146382 [details] [review]
Bug 32705: Display invoice price

On bug 25655 we are storing the unit price and currency used for
invoicing. Here we are displaying them on the invoice page.

Test plan:
Reuse the test plan from 25655 and go to the invoice page
Notice that a new 'Invoice price' column is displayed if at least one
order of the invoice had a price given in a foreign currency

We could discuss the display of the prices here, we've decided to not
format them.
We cannot do better for now as we are not storing the format along with
the currency.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Comment 5 Jonathan Druart 2023-02-10 14:47:35 UTC
Created attachment 146477 [details] [review]
Bug 32705: Display invoice price

On bug 25655 we are storing the unit price and currency used for
invoicing. Here we are displaying them on the invoice page.

Test plan:
Reuse the test plan from 25655 and go to the invoice page
Notice that a new 'Invoice price' column is displayed if at least one
order of the invoice had a price given in a foreign currency

We could discuss the display of the prices here, we've decided to not
format them.
We cannot do better for now as we are not storing the format along with
the currency.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Comment 6 Katrin Fischer 2023-02-10 15:38:54 UTC
Created attachment 146486 [details] [review]
Bug 32705: Display invoice price

On bug 25655 we are storing the unit price and currency used for
invoicing. Here we are displaying them on the invoice page.

Test plan:
Reuse the test plan from 25655 and go to the invoice page
Notice that a new 'Invoice price' column is displayed if at least one
order of the invoice had a price given in a foreign currency

We could discuss the display of the prices here, we've decided to not
format them.
We cannot do better for now as we are not storing the format along with
the currency.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 7 Katrin Fischer 2023-02-10 15:39:43 UTC
I am happy with this one and ready to PQA, but moving to BLOCKED until we have resolved the question on the dependent bug 25655.
Comment 8 Jonathan Druart 2023-02-15 07:58:59 UTC
Created attachment 146659 [details] [review]
Bug 32705: Display the column if 1 order has an invoice price

On 25655 we added a new patch to store the invoice unitprice and
currency even if it's the active currency. Here we then want to display
the column if at least one order has an invoice price in a currency that
is not the active one.
Comment 9 Jonathan Druart 2023-02-15 08:07:21 UTC
The last patch needs a signoff.
Comment 10 Michaela Sieber 2023-02-16 17:53:25 UTC
I did some tests and everything was ok ! 

Sign-Off via sandbox was not possible, so I change the status to 'Signed Off' manually

This error message occured:
No local changes to save
git: 's' is not a git command. See 'git --help'.

The most similar commands are
	show
	sparse-checkout
	status
	switch
	am
	bz
	fsck
	gc
	mv
	push
	rm

No stash entries found.
Comment 11 Jonathan Druart 2023-02-17 10:25:08 UTC
(In reply to Michaela Sieber from comment #10)
> I did some tests and everything was ok ! 
> 
> Sign-Off via sandbox was not possible, so I change the status to 'Signed
> Off' manually
> 
> This error message occured:
> No local changes to save
> git: 's' is not a git command. See 'git --help'.

Reported on https://gitlab.com/koha-community/koha-sandboxes-docker/-/issues/85
Comment 12 Katrin Fischer 2023-02-17 10:35:01 UTC
Created attachment 146814 [details] [review]
Bug 32705: Display invoice price

On bug 25655 we are storing the unit price and currency used for
invoicing. Here we are displaying them on the invoice page.

Test plan:
Reuse the test plan from 25655 and go to the invoice page
Notice that a new 'Invoice price' column is displayed if at least one
order of the invoice had a price given in a foreign currency

We could discuss the display of the prices here, we've decided to not
format them.
We cannot do better for now as we are not storing the format along with
the currency.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 13 Katrin Fischer 2023-02-17 10:35:03 UTC
Created attachment 146815 [details] [review]
Bug 32705: Display the column if 1 order has an invoice price

On 25655 we added a new patch to store the invoice unitprice and
currency even if it's the active currency. Here we then want to display
the column if at least one order has an invoice price in a currency that
is not the active one.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 14 Katrin Fischer 2023-02-17 10:41:40 UTC
I have added the SO line for Michaela on the last patch in the QA step.
Comment 15 Tomás Cohen Arazi (tcohen) 2023-03-06 17:04:59 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 16 Matt Blenkinsop 2023-03-09 09:39:28 UTC
Enhancement - not backporting to 22.11.x. 
Setting to Needs documenting. 
Nice work everyone!