|
|
@ -76,7 +76,16 @@ class PaymentTransaction(models.Model): |
|
|
|
def _compute_reference_prefix(self, values): |
|
|
|
if values and values.get('invoice_ids'): |
|
|
|
invoices = self.new({'invoice_ids': values['invoice_ids']}).invoice_ids |
|
|
|
return ','.join(invoices.mapped('name')) |
|
|
|
|
|
|
|
if len(invoices)==1: |
|
|
|
invoice=self.env['account.move'].sudo().search([('name','=',invoices.name)]) |
|
|
|
reg=self.env['event.registration'].sudo().search(['|','|',('invoice_id','=',invoice.id),('balance_invoice_id','=',invoice.id),('down_payment_invoice_id','=',invoice.id)]) |
|
|
|
if reg: |
|
|
|
return 'txR-'+invoice.name |
|
|
|
else: |
|
|
|
return 'txP-'+invoice.name |
|
|
|
else: |
|
|
|
return ','.join(invoices.mapped('name')) |
|
|
|
|
|
|
|
if values and values.get('donation_ids'): |
|
|
|
|
|
|
@ -101,7 +110,7 @@ class AcquirerSystempay(models.Model): |
|
|
|
delta=str(delta) |
|
|
|
delta=delta[:-1] |
|
|
|
prefix=values['reference'][2:3] |
|
|
|
if prefix not in ('D','A'): prefix='P' |
|
|
|
if prefix not in ('D','A','P','R'): prefix='' |
|
|
|
|
|
|
|
trans_id = prefix+delta.rjust(5) |
|
|
|
|
|
|
|