diff --git a/account_credit_control/scenarios/features/04_credit_control_run_feb.feature b/account_credit_control/scenarios/features/04_credit_control_run_feb.feature index b76198f3a..563c4e7b7 100644 --- a/account_credit_control/scenarios/features/04_credit_control_run_feb.feature +++ b/account_credit_control/scenarios/features/04_credit_control_run_feb.feature @@ -8,7 +8,7 @@ # Features Generic tags (none for all) ############################################################################## -@account_credit_control_run @account_credit_control_run_feb +@account_credit_control @account_credit_control_run @account_credit_control_run_feb Feature: Ensure that mail credit line generation first pass is correct @@ -23,11 +23,11 @@ Feature: Ensure that mail credit line generation first pass is correct Given I need a "credit.control.run" with oid: credit_control.run2 And having: | name | value | - | date | 2012-02-29 | + | date | %Y-02-28 | When I launch the credit run Then my credit run should be in state "done" And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 360 | 2012-02-15 | Debtors | 3 time policy | 2012-02-29 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 360 | USD | - | 1000 | 2012-02-17 | Debtors USD | 3 time policy | 2012-02-29 | customer_5_usd | email | 1 | SI_13 | 10 days net | draft | 1000 | USD | - | 300 | 2012-01-18 | Debtors | 3 time policy | 2012-02-29 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 300 | | + | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | + | 360 | %Y-02-15 | Debtors | 3 time policy | %Y-02-28 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 360 | USD | + | 1000 | %Y-02-17 | Debtors USD | 3 time policy | %Y-02-28 | customer_5_usd | email | 1 | SI_13 | 10 days net | draft | 1000 | USD | + | 300 | %Y-01-18 | Debtors | 3 time policy | %Y-02-28 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 300 | | diff --git a/account_credit_control/scenarios/features/05_credit_control_run_mar.feature b/account_credit_control/scenarios/features/05_credit_control_run_mar.feature index c43c7fcd5..4de33b86c 100644 --- a/account_credit_control/scenarios/features/05_credit_control_run_mar.feature +++ b/account_credit_control/scenarios/features/05_credit_control_run_mar.feature @@ -8,7 +8,7 @@ # Features Generic tags (none for all) ############################################################################## -@account_credit_control_run @account_credit_control_run_mar +@account_credit_control @account_credit_control_run @account_credit_control_run_mar Feature: Ensure that email credit line generation first pass is correct @@ -20,47 +20,43 @@ Feature: Ensure that email credit line generation first pass is correct @pay_invoice_si_19_part1 Scenario: I pay a part of the first part of the invoice SI 19, - Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_19 + Given I need a "account.bank.statement" with oid: scen.state_control_eur_1 And having: - | name | value | - | name | Bk.St.si_19_part1 | - | date | 2012-03-31 | - | currency_id | by name: EUR | - | journal_id | by oid: scen.voucher_eur_journal | - And the bank statement is linked to period "03/2012" + | name | value | + | name | Bk.St.si_19_part1 | + | date | %Y-03-31 | + | journal_id | by oid: scen.eur_journal | + And I import invoice "SI_19" using import invoice button - And I should have a "account.bank.statement.line" with name: SI_19 and amount: 450 - And the line amount should be 450 + And I should have a "account.bank.statement.line" with name: "SI_19" and amount: "450" And I set the voucher paid amount to "300" And I save the voucher - Then I modify the line amount to 300 - And I should have a "account.bank.statement.line" with name: SI_19 and amount: 1050 - And the line amount should be 1050 + And I should have a "account.bank.statement.line" with name: "SI_19" and amount: "1050" And I set the voucher paid amount to "0" And I save the voucher - Then I modify the line amount to 0 - And I should have a "account.bank.statement" with oid: scen.voucher_statement_si_19 + Then I modify the line amount to "0" + Given I need a "account.bank.statement" with oid: scen.state_control_eur_1 And I set bank statement end-balance When I confirm bank statement Then My invoice "SI_19" is in state "open" reconciled with a residual amount of "1200.0" - @account_credit_control_run_month + @account_credit_control_run_month_mar Scenario: Create run Given I need a "credit.control.run" with oid: credit_control.run3 And having: | name | value | - | date | 2012-03-31 | + | date | %Y-03-31 | When I launch the credit run Then my credit run should be in state "done" And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1000 | 2012-02-29 | Debtors | 2 time policy | 2012-03-31 | customer_2 | email | 1 | SI_4 | 30 days end of month | draft | 1000 | | - | 1000 | 2012-02-17 | Debtors | 2 time policy | 2012-03-31 | customer_3 | email | 1 | SI_7 | 30 days end of month | draft | 1000 | | - | 700 | 2012-02-29 | Debtors | 3 time policy | 2012-03-31 | customer_4 | email | 1 | SI_10 | 10 days net | draft | 700 | | - | 450 | 2012-03-15 | Debtors | 3 time policy | 2012-03-31 | customer_4 | email | 1 | SI_12 | 10 days net | draft | 450 | | - | 1200 | 2012-03-16 | Debtors USD | 3 time policy | 2012-03-31 | customer_5_usd | email | 1 | SI_14 | 10 days net | draft | 1200 | USD | - | 360 | 2012-02-15 | Debtors | 3 time policy | 2012-03-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 360 | USD | - | 1000 | 2012-02-17 | Debtors USD | 3 time policy | 2012-03-31 | customer_5_usd | email | 2 | SI_13 | 30 days end of month | draft | 1000 | USD | - | 300 | 2012-01-18 | Debtors | 3 time policy | 2012-03-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 300 | | - | 450 | 2012-03-15 | Debtors | 3 time policy | 2012-03-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 450 | | - | 150 | 2012-03-15 | Debtors | 3 time policy | 2012-03-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 450 | | + | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | + | 1000 | %Y-02-28 | Debtors | 2 time policy | %Y-03-31 | customer_2 | email | 1 | SI_4 | 30 days end of month | draft | 1000 | | + | 1000 | %Y-02-17 | Debtors | 2 time policy | %Y-03-31 | customer_3 | email | 1 | SI_7 | 30 days end of month | draft | 1000 | | + | 700 | %Y-02-28 | Debtors | 3 time policy | %Y-03-31 | customer_4 | email | 1 | SI_10 | 10 days net | draft | 700 | | + | 450 | %Y-03-15 | Debtors | 3 time policy | %Y-03-31 | customer_4 | email | 1 | SI_12 | 10 days net | draft | 450 | | + | 1200 | %Y-03-17 | Debtors USD | 3 time policy | %Y-03-31 | customer_5_usd | email | 1 | SI_14 | 10 days net | draft | 1200 | USD | + | 360 | %Y-02-15 | Debtors | 3 time policy | %Y-03-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 360 | USD | + | 1000 | %Y-02-17 | Debtors USD | 3 time policy | %Y-03-31 | customer_5_usd | email | 2 | SI_13 | 30 days end of month | draft | 1000 | USD | + | 300 | %Y-01-18 | Debtors | 3 time policy | %Y-03-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 300 | | + | 450 | %Y-03-15 | Debtors | 3 time policy | %Y-03-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 450 | | + | 150 | %Y-03-15 | Debtors | 3 time policy | %Y-03-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 450 | | diff --git a/account_credit_control/scenarios/features/06_credit_control_run_apr.feature b/account_credit_control/scenarios/features/06_credit_control_run_apr.feature index 76c8cec90..c7f6f1d69 100644 --- a/account_credit_control/scenarios/features/06_credit_control_run_apr.feature +++ b/account_credit_control/scenarios/features/06_credit_control_run_apr.feature @@ -8,7 +8,7 @@ # Features Generic tags (none for all) ############################################################################## -@account_credit_control_run @account_credit_control_run_apr +@account_credit_control @account_credit_control_run @account_credit_control_run_apr Feature: Ensure that email credit line generation first pass is correct @@ -22,22 +22,22 @@ Feature: Ensure that email credit line generation first pass is correct Scenario: Create run Given I need a "credit.control.run" with oid: credit_control.run4 And having: - | name | value | - | date | 2012-04-30 | + | name | value | + | date | %Y-04-30 | + When I launch the credit run Then my credit run should be in state "done" And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1200 | 2012-03-31 | Debtors | 2 time policy | 2012-04-30 | customer_2 | email | 1 | SI_5 | 30 days end of month | draft | 1200 | USD | - | 1200 | 2012-03-16 | Debtors | 2 time policy | 2012-04-30 | customer_3 | email | 1 | SI_8 | 30 days end of month | draft | 1200 | USD | - | 840 | 2012-03-31 | Debtors | 3 time policy | 2012-04-30 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 840 | USD | - | 1500 | 2012-04-14 | Debtors USD | 3 time policy | 2012-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD | - | 700 | 2012-02-29 | Debtors | 3 time policy | 2012-04-30 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 700 | | - | 450 | 2012-03-15 | Debtors | 3 time policy | 2012-04-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 450 | USD | - | 1200 | 2012-03-16 | Debtors USD | 3 time policy | 2012-04-30 | customer_5_usd | email | 2 | SI_14 | 30 days end of month | draft | 1200 | USD | - | 360 | 2012-02-15 | Debtors | 3 time policy | 2012-04-30 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 360 | USD | - | 1000 | 2012-02-17 | Debtors USD | 3 time policy | 2012-04-30 | customer_5_usd | letter | 3 | SI_14 | 10 days last reminder | draft | 1000 | USD | - | 1500 | 2012-04-14 | Debtors | 3 time policy | 2012-04-30 | customer_4 | email | 1 | SI_16 | 10 days net | draft | 1500 | | - | 1500 | 2012-04-14 | Debtors | 3 time policy | 2012-04-30 | customer_4 | email | 1 | SI_17 | 10 days net | draft | 1500 | | - | 450 | 2012-03-15 | Debtors | 3 time policy | 2012-04-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 450 | | - | 150 | 2012-03-15 | Debtors | 3 time policy | 2012-04-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 450 | | + | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | + | 1200 | %Y-03-31 | Debtors | 2 time policy | %Y-04-30 | customer_2 | email | 1 | SI_5 | 30 days end of month | draft | 1200 | USD | + | 1200 | %Y-03-17 | Debtors | 2 time policy | %Y-04-30 | customer_3 | email | 1 | SI_8 | 30 days end of month | draft | 1200 | USD | + | 700 | %Y-02-28 | Debtors | 3 time policy | %Y-04-30 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 700 | | + | 840 | %Y-03-31 | Debtors | 3 time policy | %Y-04-30 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 840 | USD | + | 450 | %Y-03-15 | Debtors | 3 time policy | %Y-04-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 450 | USD | + | 1500 | %Y-04-14 | Debtors USD | 3 time policy | %Y-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD | + | 1200 | %Y-03-17 | Debtors USD | 3 time policy | %Y-04-30 | customer_5_usd | email | 2 | SI_14 | 30 days end of month | draft | 1200 | USD | + | 1500 | %Y-04-14 | Debtors USD | 3 time policy | %Y-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD | + | 1500 | %Y-04-14 | Debtors | 3 time policy | %Y-04-30 | customer_4 | email | 1 | SI_16 | 10 days net | draft | 1500 | | + | 1500 | %Y-04-14 | Debtors | 3 time policy | %Y-04-30 | Scrooge McDuck | email | 1 | SI_17 | 10 days net | draft | 1500 | | + | 450 | %Y-03-15 | Debtors | 3 time policy | %Y-04-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 450 | | + | 150 | %Y-03-15 | Debtors | 3 time policy | %Y-04-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 450 | | diff --git a/account_credit_control/scenarios/features/07_credit_control_run_may.feature b/account_credit_control/scenarios/features/07_credit_control_run_may.feature index 77b02fac1..83f1e35b5 100644 --- a/account_credit_control/scenarios/features/07_credit_control_run_may.feature +++ b/account_credit_control/scenarios/features/07_credit_control_run_may.feature @@ -22,12 +22,10 @@ Feature: Ensure that email credit line generation first pass is correct Scenario: I pay entirely the invoice SI 16, so it should no longer appear in the credit control lines Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_16 And having: - | name | value | - | name | Bk.St.si_16 | - | date | 2012-05-30 | - | currency_id | by name: EUR | - | journal_id | by oid: scen.voucher_eur_journal | - And the bank statement is linked to period "05/2012" + | name | value | + | name | Bk.St.si_16 | + | date | %Y-05-30 | + | journal_id | by oid: scen.eur_journal | And I import invoice "SI_16" using import invoice button And I set bank statement end-balance When I confirm bank statement @@ -37,19 +35,16 @@ Feature: Ensure that email credit line generation first pass is correct Scenario: I pay entirely the invoice SI 17, so it should no longer appear in the credit control lines Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_17 And having: - | name | value | - | name | Bk.St.si_17 | - | date | 2012-05-30 | - | currency_id | by name: EUR | - | journal_id | by oid: scen.voucher_eur_journal | - And the bank statement is linked to period "05/2012" + | name | value | + | name | Bk.St.si_17 | + | date | %Y-05-30 | + | journal_id | by oid: scen.eur_journal | And I import invoice "SI_17" using import invoice button - And I need a "account.bank.statement.line" with name: SI_17 - And the line amount should be 1500 + And I should have a "account.bank.statement.line" with name: "SI_17" and amount: "1500" And I set the voucher paid amount to "1000" And I save the voucher - Then I modify the line amount to 1000 - And I should have a "account.bank.statement" with oid: scen.voucher_statement_si_17 + And I modify the line amount to "1000" + And I need a "account.bank.statement" with oid: scen.voucher_statement_si_17 And I set bank statement end-balance When I confirm bank statement Then My invoice "SI_17" is in state "open" reconciled with a residual amount of "500.0" @@ -58,24 +53,20 @@ Feature: Ensure that email credit line generation first pass is correct Scenario: I pay the first part of the invoice SI 18, so it should no longer appear in the credit control lines however, the second move lines should still appears Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_18 And having: - | name | value | - | name | Bk.St.si_18_part1 | - | date | 2012-05-30 | - | currency_id | by name: EUR | - | journal_id | by oid: scen.voucher_eur_journal | - And the bank statement is linked to period "05/2012" + | name | value | + | name | Bk.St.si_18_part1 | + | date | %Y-05-30 | + | journal_id | by oid: scen.eur_journal | And I import invoice "SI_18" using import invoice button - And I should have a "account.bank.statement.line" with name: SI_18 and amount: 450 - And the line amount should be 450 + And I should have a "account.bank.statement.line" with name: "SI_18" and amount: "450" And I set the voucher paid amount to "450" And I save the voucher - Then I modify the line amount to 450 - And I should have a "account.bank.statement.line" with name: SI_18 and amount: 1050 - And the line amount should be 1050 + And I modify the line amount to "450" + And I should have a "account.bank.statement.line" with name: "SI_18" and amount: "1050" And I set the voucher paid amount to "0" And I save the voucher - Then I modify the line amount to 0 - And I should have a "account.bank.statement" with oid: scen.voucher_statement_si_18 + Then I modify the line amount to "0" + And I need a "account.bank.statement" with oid: scen.voucher_statement_si_18 And I set bank statement end-balance When I confirm bank statement Then My invoice "SI_18" is in state "open" reconciled with a residual amount of "1050.0" @@ -85,22 +76,23 @@ Feature: Ensure that email credit line generation first pass is correct Given I need a "credit.control.run" with oid: credit_control.run5 And having: | name | value | - | date | 2012-05-31 | + | date | %Y-05-31 | When I launch the credit run Then my credit run should be in state "done" And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1500 | 2012-04-30 | Debtors | 2 time policy | 2012-05-31 | customer_2 | email | 1 | SI_6 | 30 days end of month | draft | 1500 | USD | - | 1500 | 2012-04-14 | Debtors | 2 time policy | 2012-05-31 | customer_3 | email | 1 | SI_8 | 30 days end of month | draft | 1500 | USD | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-05-31 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 1050 | USD | - | 1000 | 2012-02-29 | Debtors | 2 time policy | 2012-05-31 | customer_2 | letter | 2 | SI_4 | 60 days last reminder | draft | 1000 | | - | 1000 | 2012-02-17 | Debtors | 2 time policy | 2012-05-31 | customer_3 | letter | 2 | SI_7 | 60 days last reminder | draft | 1000 | | - | 840 | 2012-03-31 | Debtors | 3 time policy | 2012-05-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 840 | USD | - | 1500 | 2012-04-14 | Debtors USD | 3 time policy | 2012-05-31 | customer_5_usd | email | 2 | SI_15 | 30 days end of month | draft | 1500 | USD | - | 700 | 2012-02-29 | Debtors | 3 time policy | 2012-05-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 700 | | - | 450 | 2012-03-15 | Debtors | 3 time policy | 2012-05-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 450 | USD | - | 1200 | 2012-03-16 | Debtors USD | 3 time policy | 2012-05-31 | customer_5_usd | letter | 3 | SI_14 | 10 days last reminder | draft | 1200 | USD | - | 500 | 2012-04-14 | Debtors | 3 time policy | 2012-05-31 | Scrooge McDuck | email | 2 | SI_17 | 30 days end of month | draft | 1500 | | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-05-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 1050 | | - | 150 | 2012-03-15 | Debtors | 3 time policy | 2012-05-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 450 | | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-05-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 1050 | | + | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | + | 1500 | %Y-04-30 | Debtors | 2 time policy | %Y-05-31 | customer_2 | email | 1 | SI_6 | 30 days end of month | draft | 1500 | USD | + | 1500 | %Y-04-14 | Debtors | 2 time policy | %Y-05-31 | customer_3 | email | 1 | SI_8 | 30 days end of month | draft | 1500 | USD | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-05-31 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 1050 | USD | + | 1000 | %Y-02-29 | Debtors | 2 time policy | %Y-05-31 | customer_2 | letter | 2 | SI_4 | 60 days last reminder | draft | 1000 | | + | 1000 | %Y-02-17 | Debtors | 2 time policy | %Y-05-31 | customer_3 | letter | 2 | SI_7 | 60 days last reminder | draft | 1000 | | + | 840 | %Y-03-31 | Debtors | 3 time policy | %Y-05-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 840 | USD | + | 1500 | %Y-04-14 | Debtors USD | 3 time policy | %Y-05-31 | customer_5_usd | email | 2 | SI_15 | 30 days end of month | draft | 1500 | USD | + | 700 | %Y-02-29 | Debtors | 3 time policy | %Y-05-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 700 | | + | 450 | %Y-03-15 | Debtors | 3 time policy | %Y-05-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 450 | USD | + | 360 | %Y-04-30 | Debtors | 3 time policy | %Y-04-30 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 360 | USD | + | 1200 | %Y-03-16 | Debtors USD | 3 time policy | %Y-05-31 | customer_5_usd | letter | 3 | SI_14 | 10 days last reminder | draft | 1200 | USD | + | 500 | %Y-04-14 | Debtors | 3 time policy | %Y-05-31 | Scrooge McDuck | email | 2 | SI_17 | 30 days end of month | draft | 1500 | | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-05-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 1050 | | + | 150 | %Y-03-15 | Debtors | 3 time policy | %Y-05-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 450 | | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-05-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 1050 | | diff --git a/account_credit_control/scenarios/features/08_credit_control_run_jun.feature b/account_credit_control/scenarios/features/08_credit_control_run_jun.feature index fa02a20a5..25f04adce 100644 --- a/account_credit_control/scenarios/features/08_credit_control_run_jun.feature +++ b/account_credit_control/scenarios/features/08_credit_control_run_jun.feature @@ -23,16 +23,16 @@ Feature: Ensure that email credit line generation first pass is correct Given I need a "credit.control.run" with oid: credit_control.run6 And having: | name | value | - | date | 2012-06-30 | + | date | %Y-06-30 | When I launch the credit run Then my credit run should be in state "done" And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1200 | 2012-03-31 | Debtors | 2 time policy | 2012-06-30 | customer_2 | letter | 2 | SI_5 | 60 days last reminder | draft | 1200 | USD | - | 1200 | 2012-03-16 | Debtors | 2 time policy | 2012-06-30 | customer_3 | letter | 2 | SI_8 | 60 days last reminder | draft | 1200 | USD | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-06-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 1050 | USD | - | 840 | 2012-03-31 | Debtors | 3 time policy | 2012-06-30 | customer_4 | letter | 3 | SI_11 | 10 days last reminder | draft | 840 | USD | - | 1500 | 2012-04-14 | Debtors USD | 3 time policy | 2012-06-30 | customer_5_usd | letter | 3 | SI_15 | 10 days last reminder | draft | 1500 | USD | - | 500 | 2012-04-14 | Debtors | 3 time policy | 2012-06-30 | Scrooge McDuck | letter | 3 | SI_17 | 10 days last reminder | draft | 1500 | | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-06-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 1050 | | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-06-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 1050 | | + | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | + | 1200 | %Y-03-31 | Debtors | 2 time policy | %Y-06-30 | customer_2 | letter | 2 | SI_5 | 60 days last reminder | draft | 1200 | USD | + | 1200 | %Y-03-16 | Debtors | 2 time policy | %Y-06-30 | customer_3 | letter | 2 | SI_8 | 60 days last reminder | draft | 1200 | USD | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-06-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 1050 | USD | + | 840 | %Y-03-31 | Debtors | 3 time policy | %Y-06-30 | customer_4 | letter | 3 | SI_11 | 10 days last reminder | draft | 840 | USD | + | 1500 | %Y-04-14 | Debtors USD | 3 time policy | %Y-06-30 | customer_5_usd | letter | 3 | SI_15 | 10 days last reminder | draft | 1500 | USD | + | 500 | %Y-04-14 | Debtors | 3 time policy | %Y-06-30 | Scrooge McDuck | letter | 3 | SI_17 | 10 days last reminder | draft | 1500 | | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-06-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 1050 | | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-06-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 1050 | | diff --git a/account_credit_control/scenarios/features/09_credit_control_run_jul.feature b/account_credit_control/scenarios/features/09_credit_control_run_jul.feature index e20728554..5d89549e3 100644 --- a/account_credit_control/scenarios/features/09_credit_control_run_jul.feature +++ b/account_credit_control/scenarios/features/09_credit_control_run_jul.feature @@ -23,13 +23,13 @@ Feature: Ensure that email credit line generation first pass is correct Given I need a "credit.control.run" with oid: credit_control.run7 And having: | name | value | - | date | 2012-07-31 | + | date | %Y-07-31 | When I launch the credit run Then my credit run should be in state "done" And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1500 | 2012-04-30 | Debtors | 2 time policy | 2012-07-31 | customer_2 | letter | 2 | SI_6 | 60 days last reminder | draft | 1500 | USD | - | 1500 | 2012-04-14 | Debtors | 2 time policy | 2012-07-31 | customer_3 | letter | 2 | SI_9 | 60 days last reminder | draft | 1500 | USD | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-07-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 1050 | USD | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-07-31 | Donald Duck | letter | 3 | SI_18 | 10 days last reminder | draft | 1050 | | - | 1050 | 2012-04-30 | Debtors | 3 time policy | 2012-07-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 1050 | | + | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | + | 1500 | %Y-04-30 | Debtors | 2 time policy | %Y-07-31 | customer_2 | letter | 2 | SI_6 | 60 days last reminder | draft | 1500 | USD | + | 1500 | %Y-04-14 | Debtors | 2 time policy | %Y-07-31 | customer_3 | letter | 2 | SI_9 | 60 days last reminder | draft | 1500 | USD | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-07-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 1050 | USD | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-07-31 | Donald Duck | letter | 3 | SI_18 | 10 days last reminder | draft | 1050 | | + | 1050 | %Y-04-30 | Debtors | 3 time policy | %Y-07-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 1050 | | diff --git a/account_credit_control/scenarios/features/steps/account_credit_control.py b/account_credit_control/scenarios/features/steps/account_credit_control.py index 02cdeb694..dda9a07bd 100644 --- a/account_credit_control/scenarios/features/steps/account_credit_control.py +++ b/account_credit_control/scenarios/features/steps/account_credit_control.py @@ -11,8 +11,8 @@ def impl(ctx, policy_oid): for row in ctx.table: acc = acc_obj.get(['code = %s' % row['account code']]) assert acc, "Account with code %s not found" % row['account code'] - accounts.append(accounts) - policy.write({'account_ids': accounts}) + accounts.append(acc) + policy.write({'account_ids': [x.id for x in accounts]}) @when(u'I launch the credit run') @@ -44,16 +44,22 @@ def impl(ctx): for row in rows: account = model('account.account').get(['name = %s' % row['account']]) assert account, "no account named %s found" % row['account'] - import pdb; pdb.set_trace() policy = model('credit.control.policy').get(['name = %s' % row['policy']]) assert policy, "No policy %s found" % row['policy'] + partner = model('res.partner').get(['name = %s' % row['partner']]) assert partner, "No partner %s found" % row['partner'] - move_line = model('account.move.line').get(['name = %s' % row['move line']]) + + maturity_date = _parse_date(row['date due']) + move_line = model('account.move.line').get(['name = %s' % row['move line'], + 'date_maturity = %s' % maturity_date]) assert move_line, "No move line %s found" % row['move line'] - level = model('credit.control.policy.level').get(['name = %s' % row['policy level'], 'policy_id = %s' % policy.id]) + + level = model('credit.control.policy.level').get(['name = %s' % row['policy level'], + 'policy_id = %s' % policy.id]) assert level, "No level % found" % row['policy level'] + domain = [['account_id', '=', account.id], ['policy_id', '=', policy.id], ['partner_id', '=', partner.id], @@ -65,8 +71,9 @@ def impl(ctx): ['balance_due', '=', row.get('balance', 0.0)], ['date_due', '=', _parse_date(row['date due'])], ['date', '=', _parse_date(row['date'])], + ['move_line_id', '=', move_line.id], ] - if row.get('currrency'): + if row.get('currency'): curreny = model('res.currency').get(['name = %s' % row['currency']]) assert curreny, "No currency %s found" % row['currency'] domain.append(('currency_id', '=', curreny.id)) @@ -74,8 +81,9 @@ def impl(ctx): lines = model('credit.control.line').search(domain) assert lines, "no line found for %s" % repr(row) assert len(lines) == 1, "Too many lines found for %s" % repr(row) - date_lines = model('credit.control.lines').search([('date', '=', ctx.found_item.date)]) - assert len(date_lines) == len(ctx.table), "Too many lines generated" + date_lines = model('credit.control.line').search([('date', '=', ctx.found_item.date)]) + assert len(date_lines) == len(ctx.table.rows), "Too many lines generated" + def open_invoice(ctx): assert ctx.found_item @@ -90,3 +98,23 @@ def impl(ctx): @given(u'I open the credit invoice') def impl(ctx): open_invoice(ctx) + +@given(u'there is "{state}" credit lines') +def impl(ctx, state): + assert model('credit.control.line').search(['state = %s' % state]) + +@given(u'I mark all draft email to state "{state}"') +def impl(ctx, state): + wiz = model('credit.control.marker').create({'name': state}) + lines = model('credit.control.line').search([('state', '=', 'draft')]) + assert lines + ctx.lines = lines + wiz.write({'line_ids': lines}) + wiz.mark_lines() + +@then(u'the draft line should be in state "{state}"') +def impl(ctx, state): + assert ctx.lines + lines = model('credit.control.line').search([('state', '!=', state), + ('id', 'in', ctx.lines)]) + assert not lines