1
###############################################################################
3
# OERPScenario, OpenERP Functional Tests
4
# Copyright 2009 Camptocamp SA
6
##############################################################################
7
##############################################################################
8
# Branch # Module # Processes # System
9
@addons @account_voucher @1 @102
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 customer 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 102
17
Given I need a "account.invoice" with oid: scen.voucher_inv_102
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: Debtors |
26
| journal_id | by name: Sales |
27
| currency_id | by name: USD |
28
| type | out_invoice |
31
Given I need a "account.invoice.line" with oid: scen.voucher_inv102_line102
34
| name | invoice line 102 |
37
| account_id | by name: Sales |
38
| invoice_id | by oid:scen.voucher_inv_102 |
39
Given I find a "account.invoice" with oid: scen.voucher_inv_102
40
And I open the credit invoice
43
Scenario: Create Statement 102
44
Given I need a "account.bank.statement" with oid: scen.voucher_statement_102
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_102
57
And I import invoice "SI_102" 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_102
62
And I set bank statement end-balance
63
When I confirm bank statement
65
@account_voucher_run @account_voucher_valid_102
66
Scenario: validate voucher
67
Given I find a "account.bank.statement" with oid: scen.voucher_statement_102
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 | Debtors | 111.11 | | | USD | yes | |
72
| %Y-03-15 | 03/%Y | Debtors | | 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_102
77
Scenario: validate voucher
78
Given My invoice "SI_102" is in state "paid" reconciled with a residual amount of "0.0"