mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: filtered payments folios by state
This commit is contained in:
@@ -194,7 +194,9 @@ class PmsFolioService(Component):
|
||||
# pass
|
||||
# else:
|
||||
if folio.payment_ids:
|
||||
for payment in folio.payment_ids:
|
||||
for payment in folio.payment_ids.filtered(
|
||||
lambda p: p.state == "posted"
|
||||
):
|
||||
payment._compute_pms_api_transaction_type()
|
||||
transactions.append(
|
||||
PmsTransactiontInfo(
|
||||
|
||||
@@ -77,10 +77,6 @@ class PmsInvoiceService(Component):
|
||||
move_reversal.reverse_moves()
|
||||
reverse_invoice = move_reversal.new_move_ids
|
||||
invoice = reverse_invoice
|
||||
invoice.journal_id = invoice.pms_property_id._get_folio_default_journal(
|
||||
partner_invoice_id=new_vals.get("partner_id", invoice.partner_id.id)
|
||||
)
|
||||
invoice.sudo().action_post()
|
||||
# If change invoice by reversal, and new_vals has invoice_line_ids
|
||||
# we need to mapp the new invoice lines with the new invoice
|
||||
reverse_lines = []
|
||||
|
||||
@@ -309,10 +309,7 @@ class PmsTransactionService(Component):
|
||||
vals = {}
|
||||
transacion_type = pms_transaction_info.transactionType
|
||||
counterpart_transaction = False
|
||||
# 1- calculo los valores genericos que se cambiaran (amount, partner_id, ref, date)
|
||||
# 3- si es una transferencia interna hay que modificar el pago de contrapartida
|
||||
# 2- si se cambia el journal_id habrá que cancelar y crear un nuevo pago
|
||||
|
||||
# TODO: Downpayment invoiced (search invoice, reverse it and create a new one)
|
||||
# Get generic update vals
|
||||
if pms_transaction_info.amount and round(
|
||||
pms_transaction_info.amount, 2
|
||||
|
||||
Reference in New Issue
Block a user