1 # -*- encoding: utf-8 -*-
2 ##############################################################################
4 # Author: Nicolas Bessi. Copyright Camptocamp SA
5 # Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
23 from osv import osv, fields
25 class account_dta(osv.osv):
26 """class that implements bank DTA File format,
27 used to transfert bulk batch payment instruction to a bank"""
29 _description = "DTA History"
32 'name': fields.binary('DTA file', readonly=True),
33 ### list of dta line linked to the dta order
34 'dta_line_ids': fields.one2many('account.dta.line','dta_id','DTA lines', readonly=True),
36 'note': fields.text('Creation log', readonly=True,
37 help="Displays the problem during dta generation"),
38 ### bank how will execute DTA order
39 'bank': fields.many2one('res.partner.bank','Bank', readonly=True,select=True,
40 help="Bank how will execute DTA order"),
41 ### date of DTA order generation
42 'date': fields.date('Creation Date', readonly=True,select=True,
43 help="Date of DTA order generation"),
44 ### user how generate the DTA order
45 'user_id': fields.many2one('res.users','User', readonly=True, select=True),
49 class account_dta_line(osv.osv):
50 """Class that represent a DTA order line,
51 each line corressponds to a payment instruction"""
52 _name = "account.dta.line"
53 _description = "DTA line"
56 'name' : fields.many2one('account.invoice','Invoice', required=True, size=256),
57 ### partner how will receive payments
58 'partner_id' : fields.many2one('res.partner','Partner',
59 help="Partenr to pay"),
60 ### due date of the payment
61 'due_date' : fields.date('Due date'),
62 ### date of the supplier invoice to pay
63 'invoice_date' : fields.date('Invoice date'),
64 ### cash discount date
65 'cashdisc_date' : fields.date('Cash Discount date'),
66 ### amount effectively paied on this line
67 'amount_to_pay' : fields.float('Amount to pay',
68 help="Amount effectively paid"),
69 ### amount that was on the supplier invoice
70 'amount_invoice': fields.float('Invoiced Amount',
71 help="Amount to pay base on the supplier invoice"),
72 ### Cash discount amount
73 'amount_cashdisc': fields.float('Cash Discount Amount'),
74 ### Linke to the main dta order
75 'dta_id': fields.many2one('account.dta','Associated DTA', required=True, ondelete='cascade'),
76 ### state of the invoice Drat, Cancel, Done
77 'state' : fields.selection([('draft','Draft'),('cancel','Error'),('done','Paid')],'State')
80 'state' : lambda *a :'draft',
85 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: