~openerp-commiter/openobject-addons/extra-6.0

« back to all changes in this revision

Viewing changes to nan_account_payment_term_extension/test/account_payment_term.yml

  • Committer: Albert Cervera i Areny
  • Date: 2011-03-27 23:58:08 UTC
  • Revision ID: albert@nan-tic.com-20110327235808-z41s8yqnjrwjyin1
[IMP] nan_account_payment_term_extension:
- Use 4 digits for Value Amount field for higher precision in percentages.
- Add new 'Division' type of calculation to ensure the last line will differ only in one cent.
- Add new 'Months' field to allow setting the number of months (apart from days) to calculate due date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-
 
2
  In order to test payment term extension I create a payment terms and check dates.
 
3
-
 
4
  In order to test the new months field I create a payment terms and check result.
 
5
-
 
6
  !record {model: account.payment.term, id: account_payment_term_0}:
 
7
    name: 3 months
 
8
    line_ids:
 
9
      - name: 3 months
 
10
        sequence: 1
 
11
        value: balance
 
12
        value_amount: 1
 
13
        days: 0
 
14
        months: 3 
 
15
        days2: 0
 
16
-
 
17
  I check that due date for 2011-01-31 is 2011-04-30
 
18
-
 
19
  !assert {model: account.payment.term, id: account_payment_term_0}:
 
20
    - compute(3000.0, '2011-01-31') == [('2011-04-30', 3000.0)]
 
21
-
 
22
  In order to test the new division value I create a payment term and check result.
 
23
-
 
24
  !record {model: account.payment.term, id: account_payment_term_1}:
 
25
    name: 1, 2 and 3 months
 
26
    line_ids:
 
27
      - name: 1 month
 
28
        sequence: 1
 
29
        value: division
 
30
        value_amount: 3
 
31
        days: 0
 
32
        months: 1 
 
33
        days2: 0
 
34
      - name: 2 month
 
35
        sequence: 2
 
36
        value: division
 
37
        value_amount: 3
 
38
        days: 0
 
39
        months: 2 
 
40
        days2: 0
 
41
      - name: 3 month
 
42
        sequence: 3
 
43
        value: balance
 
44
        value_amount: 0
 
45
        days: 0
 
46
        months: 3 
 
47
        days2: 0
 
48
-
 
49
  I check that due date for 2011-01-31 is 2011-04-30
 
50
-
 
51
  !assert {model: account.payment.term, id: account_payment_term_1}:
 
52
    - compute(200.0, '2011-01-31') == [('2011-02-28', 66.67),('2011-03-31',66.67),('2011-04-30',66.66)]