~openbig/bigconsulting/added_report_barcode_check

« back to all changes in this revision

Viewing changes to account_invoice_cash_discount/account_invoice_cash_discount.py

  • Committer: husen
  • Date: 2010-06-18 13:06:05 UTC
  • Revision ID: husen@husen-laptop-20100618130605-bsn2pzgabkatfo22
Fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
        else:
72
72
            date2 =  time.strftime('%Y-%m-%d')   
73
73
 
74
 
        if date1 > date2:
 
74
        if date1 >= date2:
75
75
            from_dt = time.mktime(time.strptime(date1,'%Y-%m-%d'))
76
76
            to_dt = time.mktime(time.strptime(date2,'%Y-%m-%d'))
77
77
            diff_day = (from_dt-to_dt)/(3600*24)
86
86
                    res = 0.0
87
87
                    dis = 0
88
88
                    for discount_line in payment_term_lines.cash_discount_ids:
89
 
                        if diff_day > dis and  diff_day <= discount_line.delay:
 
89
                        if diff_day >= dis and  diff_day <= discount_line.delay:
90
90
                            if resudial_amonut:
91
91
                                res = resudial_amonut * discount_line.discount
92
92
                            discount = res