New report
This commit is contained in:
parent
8739fd264e
commit
93915736cf
|
@ -81,6 +81,7 @@ def register():
|
|||
folio.OpenMigrationStart,
|
||||
folio.UpdateOccupancyStart,
|
||||
folio.HotelFolioChargeTax,
|
||||
folio.FolioAuditStart,
|
||||
guest.Tag,
|
||||
guest.TagGuest,
|
||||
stock.Move,
|
||||
|
@ -128,6 +129,7 @@ def register():
|
|||
folio.GuestsListReport,
|
||||
folio.RegistrationCardReport,
|
||||
folio.StatisticsByMonthReport,
|
||||
folio.FolioAuditReport,
|
||||
sale.InvoiceIncomeDailyReport,
|
||||
sale.InvoiceSimplifiedReport,
|
||||
service.ServiceReport,
|
||||
|
@ -150,6 +152,7 @@ def register():
|
|||
folio.StatisticsByMonth,
|
||||
folio.ReverseCheckout,
|
||||
folio.UpdateOccupancy,
|
||||
folio.FolioAudit,
|
||||
service.CreateDailyServices,
|
||||
room.Housekeeping,
|
||||
housekeeping.HousekeepingSchedule,
|
||||
|
|
|
@ -1714,11 +1714,6 @@ class BookingStatusStart(ModelView):
|
|||
('', ''),
|
||||
], 'State')
|
||||
|
||||
@staticmethod
|
||||
def default_date():
|
||||
Date_ = Pool().get('ir.date')
|
||||
return Date_.today()
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
return Transaction().context.get('company')
|
||||
|
|
80
folio.py
80
folio.py
|
@ -240,18 +240,6 @@ class Folio(ModelSQL, ModelView):
|
|||
def do_payment(cls, records):
|
||||
pass
|
||||
|
||||
# @classmethod
|
||||
# def _get_origin(cls):
|
||||
# 'Return list of Model names for origin Reference'
|
||||
# return []
|
||||
|
||||
# @classmethod
|
||||
# def get_origin(cls):
|
||||
# Model = Pool().get('ir.model')
|
||||
# get_name = Model.get_name
|
||||
# models = cls._get_origin()
|
||||
# return [(None, '')] + [(m, get_name(m)) for m in models]
|
||||
|
||||
def get_group(self, name=None):
|
||||
if self.booking:
|
||||
return self.booking.group
|
||||
|
@ -1623,7 +1611,8 @@ class FolioCharge(Workflow, ModelSQL, ModelView):
|
|||
status = fields.Selection([
|
||||
('paid', 'Paid'),
|
||||
('pending', 'Pending'),
|
||||
], 'Status', help="Status of payment")
|
||||
], 'Status', help="Status of Payment")
|
||||
status_string = status.translated('status')
|
||||
line_move = fields.Many2One('account.move.line', 'Line Acc. Move')
|
||||
analytic_account = fields.Many2One('analytic_account.account',
|
||||
'Analytic Account', domain=[
|
||||
|
@ -2560,3 +2549,68 @@ class HotelFolioChargeTax(ModelSQL):
|
|||
ondelete='CASCADE', required=True)
|
||||
tax = fields.Many2One('account.tax', 'Tax', ondelete='RESTRICT',
|
||||
required=True)
|
||||
|
||||
|
||||
class FolioAuditStart(ModelView):
|
||||
'Folio Audit Start'
|
||||
__name__ = 'hotel.folio_audit.start'
|
||||
start_date = fields.Date('Start Date', required=True)
|
||||
end_date = fields.Date('End Date', required=True)
|
||||
company = fields.Many2One('company.company', 'Company', required=True)
|
||||
registration_state = fields.Selection([
|
||||
('check_in', 'Check In'),
|
||||
('check_out', 'Check Out'),
|
||||
('', ''),
|
||||
], 'Reg. State')
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
return Transaction().context.get('company')
|
||||
|
||||
|
||||
class FolioAudit(Wizard):
|
||||
'Folio Audit'
|
||||
__name__ = 'hotel.folio_audit'
|
||||
start = StateView(
|
||||
'hotel.folio_audit.start',
|
||||
'hotel.print_folio_audit_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Open', 'print_', 'tryton-print', default=True),
|
||||
])
|
||||
print_ = StateReport('hotel.folio_audit.report')
|
||||
|
||||
def do_print_(self, action):
|
||||
company = self.start.company
|
||||
data = {
|
||||
'start_date': self.start.start_date,
|
||||
'end_date': self.start.end_date,
|
||||
'company': company.id,
|
||||
'state': self.start.registration_state,
|
||||
}
|
||||
return action, data
|
||||
|
||||
def transition_print_(self):
|
||||
return 'end'
|
||||
|
||||
|
||||
class FolioAuditReport(Report):
|
||||
__name__ = 'hotel.folio_audit.report'
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, header, data):
|
||||
report_context = super().get_context(records, header, data)
|
||||
pool = Pool()
|
||||
Company = pool.get('company.company')
|
||||
Folio = pool.get('hotel.folio')
|
||||
dom = [
|
||||
('arrival_date', '>=', data['start_date']),
|
||||
('arrival_date', '<=', data['end_date']),
|
||||
]
|
||||
if data['state']:
|
||||
dom.append(
|
||||
('state', '=', data['state'])
|
||||
)
|
||||
_records = Folio.search(dom, order=[('arrival_date', 'ASC')])
|
||||
report_context['records'] = _records
|
||||
report_context['company'] = Company(data['company'])
|
||||
return report_context
|
||||
|
|
19
folio.xml
19
folio.xml
|
@ -199,5 +199,24 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="action" ref="act_folio_update_occupancy"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.report" id="report_folio_audit">
|
||||
<field name="name">Folio Audit Report</field>
|
||||
<field name="model"></field>
|
||||
<field name="report_name">hotel.folio_audit.report</field>
|
||||
<field name="report">hotel/folio_audit.fods</field>
|
||||
<field name="template_extension">ods</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="print_folio_audit_start_view_form">
|
||||
<field name="model">hotel.folio_audit.start</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">folio_audit_start_form</field>
|
||||
</record>
|
||||
<record model="ir.action.wizard" id="wizard_folio_audit">
|
||||
<field name="name">Folio Audit Report</field>
|
||||
<field name="wiz_name">hotel.folio_audit</field>
|
||||
</record>
|
||||
<menuitem parent="hotel.menu_reporting" id="menu_folio_audit"
|
||||
action="wizard_folio_audit"/>
|
||||
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
Binary file not shown.
BIN
statement.fodt
BIN
statement.fodt
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=6.0.114
|
||||
version=6.0.115
|
||||
depends:
|
||||
party
|
||||
company
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<form>
|
||||
<label name="start_date"/>
|
||||
<field name="start_date"/>
|
||||
<label name="end_date"/>
|
||||
<field name="end_date"/>
|
||||
<label name="registration_state"/>
|
||||
<field name="registration_state"/>
|
||||
<label name="company"/>
|
||||
<field name="company" widget="selection"/>
|
||||
</form>
|
Loading…
Reference in New Issue