1
###############################################################################
3
# OERPScenario, OpenERP Functional Tests
4
# Copyright 2009 Camptocamp SA
6
##############################################################################
7
##############################################################################
8
# Branch # Module # Processes # System
9
@addons @account_voucher @1 @104
11
Feature: In order to validate multicurrency account_voucher behaviour as an admin user I do a reconciliation run.
12
I want to create a supplier invoice for 1000 USD (rate : 1.8) and pay it in full in USD (rate : 1.5)
13
with account_voucher. The Journal entries must calculate the correct currency gain/loss.
16
Scenario: Create invoice 104
17
Given I need a "account.invoice" with oid: scen.voucher_inv_104
21
| date_invoice | %Y-02-01 |
22
| date_due | %Y-03-15 |
23
| address_invoice_id | by oid: scen.partner_1_add |
24
| partner_id | by oid: scen.partner_1 |
25
| account_id | by name: Creditors |
26
| journal_id | by name: Purchases |
27
| currency_id | by name: USD |
31
Given I need a "account.invoice.line" with oid: scen.voucher_inv104_line104
34
| name | invoice line 104 |
37
| account_id | by name: Sales |
38
| invoice_id | by oid:scen.voucher_inv_104 |
39
Given I find a "account.invoice" with oid: scen.voucher_inv_104
40
And I open the credit invoice
43
Scenario: Create Statement 104
44
Given I need a "account.bank.statement" with oid: scen.voucher_statement_104
49
| currency_id | by name: USD |
50
| journal_id | by oid: scen.voucher_usd_journal |
51
And the bank statement is linked to period "03/%Y"
54
@account_voucher_run @account_voucher_import_invoice
55
Scenario: Import invoice into statement
56
Given I find a "account.bank.statement" with oid: scen.voucher_statement_104
57
And I import invoice "SI_104" using import invoice button
59
@account_voucher_run @account_voucher_confirm
60
Scenario: confirm bank statement (/!\ Voucher payment options must be 'reconcile payment balance' by default )
61
Given I find a "account.bank.statement" with oid: scen.voucher_statement_104
62
And I set bank statement end-balance
63
When I confirm bank statement
65
@account_voucher_run @account_voucher_valid_104
66
Scenario: validate voucher
67
Given I find a "account.bank.statement" with oid: scen.voucher_statement_104
68
Then I should have following journal entries in voucher:
69
| date | period | account | debit | credit | curr.amt | curr. | reconcile | partial |
70
| %Y-03-15 | 03/%Y | Currency fx | 111.11 | | | USD | | |
71
| %Y-03-15 | 03/%Y | Creditors | | 111.11 | | USD | yes | |
72
| %Y-03-15 | 03/%Y | Creditors | 666.67 | | 1000 | USD | yes | |
73
| %Y-03-15 | 03/%Y | USD bank account | | 666.67| -1000 | USD | | |
76
@account_voucher_run @account_voucher_valid_invoice_104
77
Scenario: validate voucher
78
Given My invoice "SI_104" is in state "paid" reconciled with a residual amount of "0.0"