mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Cash Daily Report Internal Transfers
This commit is contained in:
@@ -1,8 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<menuitem id="cash_daily_report_wizard" name="Cash Daily Report Wizard"
|
||||
parent="hotel.hotel_reports_menu"
|
||||
action="action_open_cash_daily_report_wizard" sequence="45" />
|
||||
</data>
|
||||
|
||||
<menuitem id="cash_daily_report_wizard" name="Cash Daily Report Wizard"
|
||||
parent="hotel.hotel_reports_menu"
|
||||
action="action_open_cash_daily_report_wizard"
|
||||
sequence="45" />
|
||||
|
||||
<menuitem id="hotel_payments_menu" name="Payments"
|
||||
sequence="80"
|
||||
parent="hotel.hotel_management_menu"
|
||||
groups="hotel.group_hotel_user"/>
|
||||
|
||||
<menuitem id="hotel_supplier_payment_menu" name="Supplier Payments"
|
||||
sequence="80"
|
||||
parent="hotel_payments_menu"
|
||||
groups="hotel.group_hotel_user"
|
||||
action="account.action_account_payments_payable"/>
|
||||
|
||||
<record id="action_account_payments_internal" model="ir.actions.act_window">
|
||||
<field name="name">Internal Transfers</field>
|
||||
<field name="res_model">account.payment</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,kanban,form,graph</field>
|
||||
<field name="context">{'default_payment_type': 'transfer', 'search_default_transfers_filter': 1}</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="view_id" ref="account.view_account_supplier_payment_tree"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to register a payment
|
||||
</p><p>
|
||||
Payments are used to register liquidity movements (send, collect or transfer money).
|
||||
You can then process those payments by your own means or by using installed facilities.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="hotel_transfer_menu" name="Internal Transfer"
|
||||
sequence="100"
|
||||
parent="hotel_payments_menu"
|
||||
groups="hotel.group_hotel_user"
|
||||
action="cash_daily_report.action_account_payments_internal"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 11.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-05-20 07:33+0000\n"
|
||||
"PO-Revision-Date: 2018-05-20 09:34+0200\n"
|
||||
"POT-Creation-Date: 2019-08-02 08:24+0000\n"
|
||||
"PO-Revision-Date: 2019-08-02 10:28+0200\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -36,11 +36,16 @@ msgstr "Informe de caja"
|
||||
msgid "Cash Daily Report Wizard"
|
||||
msgstr "Informe de caja diaria"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.actions.act_window,help:cash_daily_report.action_account_payments_internal
|
||||
msgid "Click to register a payment"
|
||||
msgstr "Pulse para registrar un pago"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:82
|
||||
#, python-format
|
||||
msgid "Client"
|
||||
msgstr "Cliente"
|
||||
msgid "Client/Supplier"
|
||||
msgstr "Client/Supplier"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.ui.view,arch_db:cash_daily_report.view_cash_daily_report_wizard
|
||||
@@ -66,12 +71,12 @@ msgstr "Fecha"
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Mostrar Nombre"
|
||||
msgstr "Nombre mostrado"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_date_end
|
||||
msgid "End Date"
|
||||
msgstr "Fecha finalización"
|
||||
msgstr "Fecha de finalización"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.ui.view,arch_db:cash_daily_report.view_cash_daily_report_wizard
|
||||
@@ -81,7 +86,17 @@ msgstr "Generar XLS"
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
msgstr "ID (identificación)"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.ui.menu,name:cash_daily_report.hotel_transfer_menu
|
||||
msgid "Internal Transfer"
|
||||
msgstr "Internal Transfer"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.actions.act_window,name:cash_daily_report.action_account_payments_internal
|
||||
msgid "Internal Transfers"
|
||||
msgstr "Internal Transfers"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:84
|
||||
@@ -97,7 +112,7 @@ msgstr "Última modificación en"
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Última actualización por"
|
||||
msgstr "Última actualización de"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_write_date
|
||||
@@ -111,11 +126,25 @@ msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:128
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:157
|
||||
#, python-format
|
||||
msgid "Not Any Payments"
|
||||
msgstr "No hay movimientos"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.ui.menu,name:cash_daily_report.hotel_payments_menu
|
||||
msgid "Payments"
|
||||
msgstr "Pagos"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.actions.act_window,help:cash_daily_report.action_account_payments_internal
|
||||
msgid ""
|
||||
"Payments are used to register liquidity movements (send, collect or transfer money).\n"
|
||||
" You can then process those payments by your own means or by using installed facilities."
|
||||
msgstr ""
|
||||
"Los pagos se utilizan para registrar movimientos de liquidez (enviar, recibir o transferir dinero).\n"
|
||||
"Puede procesar esos pagos por sus propios medios o utilizando los servicios instalados."
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:81
|
||||
#, python-format
|
||||
@@ -125,40 +154,46 @@ msgstr "Referencia"
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_date_start
|
||||
msgid "Start Date"
|
||||
msgstr "Fecha de inicio"
|
||||
msgstr "Fecha de Inicio"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:143
|
||||
#: model:ir.ui.menu,name:cash_daily_report.hotel_supplier_payment_menu
|
||||
msgid "Supplier Payments"
|
||||
msgstr "Supplier Payments"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:197
|
||||
#, python-format
|
||||
msgid "TOTAL"
|
||||
msgstr "TOTAL"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:139
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:188
|
||||
#, python-format
|
||||
msgid "TOTAL EXPENSES"
|
||||
msgstr "TOTAL EXPENSES"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:176
|
||||
#, python-format
|
||||
msgid "TOTAL PAYMENT RETURNS"
|
||||
msgstr "TOTAL DEVOLUCIONES"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:134
|
||||
#: code:addons/cash_daily_report/wizard/cash_daily_report.py:164
|
||||
#, python-format
|
||||
msgid "TOTAL PAYMENTS"
|
||||
msgstr "TOTAL PAGOS"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.ui.menu,name:cash_daily_report.menu_account_finance_xls_reports
|
||||
msgid "XLS Reports"
|
||||
msgstr "XLS Reports"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_xls_binary
|
||||
msgid "Xls binary"
|
||||
msgstr "Xls archivo"
|
||||
msgid "Xls Binary"
|
||||
msgstr "Xls Binary"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model.fields,field_description:cash_daily_report.field_cash_daily_report_wizard_xls_filename
|
||||
msgid "Xls filename"
|
||||
msgstr "Xls nombre de archivo"
|
||||
msgid "Xls Filename"
|
||||
msgstr "Xls Filename"
|
||||
|
||||
#. module: cash_daily_report
|
||||
#: model:ir.model,name:cash_daily_report.model_cash_daily_report_wizard
|
||||
|
||||
@@ -99,14 +99,22 @@ class CashDailyReportWizard(models.TransientModel):
|
||||
payment_journals = {}
|
||||
expense_journals = {}
|
||||
for k_payment, v_payment in enumerate(account_payments):
|
||||
amount = v_payment.amount if v_payment.payment_type == 'inbound' \
|
||||
where = v_payment.partner_id.name
|
||||
amount = v_payment.amount if v_payment.payment_type in ('inbound') \
|
||||
else -v_payment.amount
|
||||
if v_payment.payment_type == 'transfer':
|
||||
where = v_payment.destination_journal_id.name
|
||||
total_account_payment += -amount
|
||||
if v_payment.destination_journal_id.name not in payment_journals:
|
||||
payment_journals.update({v_payment.destination_journal_id.name: -amount})
|
||||
else:
|
||||
payment_journals[v_payment.destination_journal_id.name] += -amount
|
||||
if amount < 0:
|
||||
total_account_expenses += -amount
|
||||
if v_payment.journal_id.name not in expense_journals:
|
||||
expense_journals.update({v_payment.journal_id.name: -amount})
|
||||
expense_journals.update({v_payment.journal_id.name: amount})
|
||||
else:
|
||||
expense_journals[v_payment.journal_id.name] += -amount
|
||||
expense_journals[v_payment.journal_id.name] += amount
|
||||
else:
|
||||
total_account_payment += amount
|
||||
if v_payment.journal_id.name not in payment_journals:
|
||||
@@ -115,7 +123,7 @@ class CashDailyReportWizard(models.TransientModel):
|
||||
payment_journals[v_payment.journal_id.name] += amount
|
||||
worksheet.write(k_payment+offset, 0, v_payment.name)
|
||||
worksheet.write(k_payment+offset, 1, v_payment.communication)
|
||||
worksheet.write(k_payment+offset, 2, v_payment.partner_id.name)
|
||||
worksheet.write(k_payment+offset, 2, where)
|
||||
worksheet.write(k_payment+offset, 3, v_payment.payment_date,
|
||||
xls_cell_format_date)
|
||||
worksheet.write(k_payment+offset, 4, v_payment.journal_id.name)
|
||||
@@ -152,6 +160,9 @@ class CashDailyReportWizard(models.TransientModel):
|
||||
line = offset
|
||||
if k_line:
|
||||
line = k_line + offset
|
||||
|
||||
|
||||
result_journals = {}
|
||||
# NORMAL PAYMENTS
|
||||
if total_account_payment != 0:
|
||||
line += 1
|
||||
@@ -163,6 +174,10 @@ class CashDailyReportWizard(models.TransientModel):
|
||||
worksheet.write(line, 4, _(journal))
|
||||
worksheet.write(line, 5, payment_journals[journal],
|
||||
xls_cell_format_money)
|
||||
if journal not in result_journals:
|
||||
result_journals.update({journal: payment_journals[journal]})
|
||||
else:
|
||||
result_journals[journal] += payment_journals[journal]
|
||||
|
||||
# RETURNS
|
||||
if total_payment_returns_amount != 0:
|
||||
@@ -175,6 +190,10 @@ class CashDailyReportWizard(models.TransientModel):
|
||||
worksheet.write(line, 4, _(journal))
|
||||
worksheet.write(line, 5, return_journals[journal],
|
||||
xls_cell_format_money)
|
||||
if journal not in result_journals:
|
||||
result_journals.update({journal: return_journals[journal]})
|
||||
else:
|
||||
result_journals[journal] += return_journals[journal]
|
||||
|
||||
# EXPENSES
|
||||
if total_account_expenses != 0:
|
||||
@@ -187,13 +206,25 @@ class CashDailyReportWizard(models.TransientModel):
|
||||
worksheet.write(line, 4, _(journal))
|
||||
worksheet.write(line, 5, -expense_journals[journal],
|
||||
xls_cell_format_money)
|
||||
if journal not in result_journals:
|
||||
result_journals.update({journal: expense_journals[journal]})
|
||||
else:
|
||||
result_journals[journal] += expense_journals[journal]
|
||||
|
||||
#TOTALS
|
||||
line += 1
|
||||
worksheet.write(line, 4, _('TOTAL'), xls_cell_format_header)
|
||||
worksheet.write(
|
||||
line,
|
||||
5,
|
||||
total_account_payment_amount + total_payment_returns_amount,
|
||||
total_account_payment + total_payment_returns_amount - total_account_expenses,
|
||||
xls_cell_format_header)
|
||||
for journal in result_journals:
|
||||
line += 1
|
||||
worksheet.write(line, 4, _(journal))
|
||||
worksheet.write(line, 5, result_journals[journal],
|
||||
xls_cell_format_money)
|
||||
|
||||
workbook.close()
|
||||
file_data.seek(0)
|
||||
tnow = fields.Datetime.now().replace(' ', '_')
|
||||
|
||||
Reference in New Issue
Block a user