Add config advance payment
This commit is contained in:
parent
a712e52d2c
commit
06c03d9d85
|
@ -496,6 +496,7 @@ class Booking(Workflow, ModelSQL, ModelView):
|
||||||
def add_payment(cls, args):
|
def add_payment(cls, args):
|
||||||
pool = Pool()
|
pool = Pool()
|
||||||
StatementLine = pool.get('account.statement.line')
|
StatementLine = pool.get('account.statement.line')
|
||||||
|
Config = pool.get('hotel.configuration')
|
||||||
Folio = pool.get('hotel.folio')
|
Folio = pool.get('hotel.folio')
|
||||||
Booking = pool.get('hotel.booking')
|
Booking = pool.get('hotel.booking')
|
||||||
Party = pool.get('party.party')
|
Party = pool.get('party.party')
|
||||||
|
@ -513,8 +514,12 @@ class Booking(Workflow, ModelSQL, ModelView):
|
||||||
party_id = args['party']
|
party_id = args['party']
|
||||||
party = Party(party_id)
|
party = Party(party_id)
|
||||||
|
|
||||||
|
config = Config.get_configuration()
|
||||||
try:
|
try:
|
||||||
account = party.account_receivable.id
|
if config.advance_account:
|
||||||
|
account = config.advance_account.id
|
||||||
|
else:
|
||||||
|
account = party.account_receivable.id
|
||||||
except:
|
except:
|
||||||
raise UserError(gettext('hotel.party_without_account_receivable'))
|
raise UserError(gettext('hotel.party_without_account_receivable'))
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,11 @@ class Configuration(ModelSQL, ModelView):
|
||||||
('type', '!=', None),
|
('type', '!=', None),
|
||||||
], depends=['company'])
|
], depends=['company'])
|
||||||
space_booking = fields.Many2One('analytic_account.space', 'Default Space')
|
space_booking = fields.Many2One('analytic_account.space', 'Default Space')
|
||||||
|
advance_account = fields.Many2One('account.account', 'Advance Account',
|
||||||
|
domain=[
|
||||||
|
('company', '=', Eval('company')),
|
||||||
|
('type', '!=', None),
|
||||||
|
], depends=['company'])
|
||||||
token_siat = fields.Char('Token Siat')
|
token_siat = fields.Char('Token Siat')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
10
invoice.py
10
invoice.py
|
@ -100,14 +100,22 @@ class Invoice(metaclass=PoolMeta):
|
||||||
if invoice.amount_to_pay == 0 and to_reconcile:
|
if invoice.amount_to_pay == 0 and to_reconcile:
|
||||||
MoveLine.reconcile(to_reconcile)
|
MoveLine.reconcile(to_reconcile)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def do_move_writeoff_advance(cls, invoices):
|
||||||
|
# Asiento de cancelacion de los anticipos en la reserva
|
||||||
|
# Para abono de pago en factura
|
||||||
|
Config = Pool().get('hotel.configuration')
|
||||||
|
config = Config.get_configuration()
|
||||||
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _post(cls, invoices):
|
def _post(cls, invoices):
|
||||||
for invoice in invoices:
|
for invoice in invoices:
|
||||||
lines_ids = None
|
|
||||||
if invoice.type == 'in':
|
if invoice.type == 'in':
|
||||||
super()._post([invoice])
|
super()._post([invoice])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
lines_ids = None
|
||||||
if invoice.type == 'out' and invoice.agent:
|
if invoice.type == 'out' and invoice.agent:
|
||||||
lines_ids = cls.process_offset_move(invoice)
|
lines_ids = cls.process_offset_move(invoice)
|
||||||
|
|
||||||
|
|
2
sale.py
2
sale.py
|
@ -54,7 +54,7 @@ class Sale(metaclass=PoolMeta):
|
||||||
'kind': 'product',
|
'kind': 'product',
|
||||||
'order': number,
|
'order': number,
|
||||||
'status': 'pending',
|
'status': 'pending',
|
||||||
'origin': f'sale.sale,{sale_id}',
|
'origin': f'sale.line,{line.id}',
|
||||||
})
|
})
|
||||||
charges_ids = Charge.create(to_create)
|
charges_ids = Charge.create(to_create)
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="accounting_revenue"/>
|
<field name="accounting_revenue"/>
|
||||||
<label name="recognise_account"/>
|
<label name="recognise_account"/>
|
||||||
<field name="recognise_account"/>
|
<field name="recognise_account"/>
|
||||||
|
<label name="advance_account"/>
|
||||||
|
<field name="advance_account"/>
|
||||||
<label name="space_booking"/>
|
<label name="space_booking"/>
|
||||||
<field name="space_booking"/>
|
<field name="space_booking"/>
|
||||||
<label name="charge_sequence"/>
|
<label name="charge_sequence"/>
|
||||||
|
|
Loading…
Reference in New Issue