1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6
# nhomar.hernandez@netquatro.com
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
23
from osv import fields
24
from tools.translate import _
25
from tools import config
26
import decimal_precision as dp
28
class baremo_book(osv.osv):
32
'name':fields.char('Baremo', size=64, required=True, readonly=False),
33
'notes':fields.text('Notas', required=True, readonly=False),
34
'bar_ids':fields.one2many('baremo', 'bar_id', 'Dias de Emision', required=False),
37
'name': lambda *a: 'DEBE ESCRIBIR UNA NOTA REFERENTE A ESTE BAREMO PARA SER USADO EN EL REPORTE DE COMISIONES, COMO POR EJEMPLO, LOS DESCUENTOS NEGATIVOS REPRESENTAN LOS SOBRE PRECIOS REALIZADOS A LOS PRODUCTOS PARA COMPENSAR EN PAGO RETARDADO POR PARTE DEL CLIENTE',
41
class baremo(osv.osv):
43
OpenERP Model : baremo
50
'name':fields.char('Nombre', size=64, required=True, readonly=False, help="Nombre del termino de Vencimiento"),
51
'number': fields.integer('Dias', help="Dias desde emision de la factura", required=True),
52
'disc_ids':fields.one2many('baremo.discount', 'disc_id', 'Comision x Dscto.', required=False, help="Comision x Dscto x Dia"),
53
'bar_id':fields.many2one('baremo.book', 'Padre', required=False),
56
'name': lambda *a: None,
60
class baremo_discount(osv.osv):
62
OpenERP Model : baremo_discount
65
_name = 'baremo.discount'
66
_order = "porc_disc asc"
68
'name':fields.char('Nombre', size=64, required=False, readonly=False, help="No Usado"),
69
'porc_disc': fields.float('% Dcto', digits_compute=dp.get_precision('Commission'), help="% de Descuento por producto", required=True),
70
'porc_com': fields.float('% Com.', digits_compute=dp.get_precision('Commission'), help="% de Comision @ porcentaje Descuento", required=True),
71
'disc_id':fields.many2one('baremo', 'Baremo', required=False),
74
'name': lambda *a: None,