mirror of
https://gitlab.com/flectra-community/l10n-switzerland-flectra.git
synced 2024-11-16 19:12:04 +00:00
message now define which provider the ebill is sent
invocloud xml get now bank clearing number
This commit is contained in:
parent
d76fc65c98
commit
7daf54fee2
@ -60,7 +60,7 @@
|
||||
<Acct-No>{{ bank.sanitized_acc_number }}</Acct-No>
|
||||
<Acct-Name>{{ bank.acc_holder_name or bank.partner_id.name }}</Acct-Name>
|
||||
{# Is this the default for e-banking customers ? -#}
|
||||
<BankId Type="BCNr-int" Country="CH">209</BankId>
|
||||
<BankId Type="BCNr-int" Country="CH">{{bank.bank_id.clearing}}</BankId>
|
||||
</BANK-INFO>
|
||||
</BILLER>
|
||||
<PAYER>
|
||||
|
@ -106,28 +106,26 @@ class AccountInvoice(models.Model):
|
||||
self.ensure_one()
|
||||
return []
|
||||
|
||||
def log_invoice_accepted_by_system(self):
|
||||
def log_invoice_accepted_by_system(self, provider = False):
|
||||
""" """
|
||||
self.activity_feedback(
|
||||
["ebill_paynet.mail_activity_dws_error"],
|
||||
feedback="It worked on a later try",
|
||||
)
|
||||
self.message_post(body=_("Invoice accepted by the Paynet system"))
|
||||
self.message_post(body=_("Invoice accepted by the %s system" % (provider)))
|
||||
self.invoice_export_confirmed = True
|
||||
|
||||
def log_invoice_refused_by_system(self):
|
||||
def log_invoice_refused_by_system(self, provider = False):
|
||||
""" """
|
||||
activity_type = "ebill_paynet.mail_activity_dws_error"
|
||||
activity = self.activity_reschedule(
|
||||
[activity_type], date_deadline=fields.Date.today()
|
||||
)
|
||||
values = {}
|
||||
|
||||
if not activity:
|
||||
message = self.env.ref("ebill_paynet.dws_reject_invoice")._render(
|
||||
values=values
|
||||
)
|
||||
message = _("The %s system rejected the eBill that was send." % (provider))
|
||||
activity = self.activity_schedule(
|
||||
activity_type, summary="Invoice rejected by Paynet", note=message
|
||||
activity_type, summary="Invoice rejected by %s" % (provider), note=message
|
||||
)
|
||||
# error_log = values.get("error_detail")
|
||||
# if not error_log:
|
||||
|
@ -183,8 +183,9 @@ class PaynetInvoiceMessage(models.Model):
|
||||
|
||||
def update_invoice_status(self):
|
||||
"""Update the export status in the chatter."""
|
||||
provider = self.service_id.service_provider if self.service_id.service_provider else 'No provider chosen'
|
||||
for message in self:
|
||||
if message.state == "done":
|
||||
message.invoice_id.log_invoice_accepted_by_system()
|
||||
message.invoice_id.log_invoice_accepted_by_system(provider)
|
||||
elif message.state in ["reject", "error"]:
|
||||
message.invoice_id.log_invoice_refused_by_system()
|
||||
message.invoice_id.log_invoice_refused_by_system(provider)
|
||||
|
@ -53,7 +53,7 @@ class PaynetService(models.Model):
|
||||
readonly=True,
|
||||
)
|
||||
active = fields.Boolean(default=True)
|
||||
|
||||
|
||||
#Adjustment to use InvoCloud
|
||||
service_provider = fields.Selection(
|
||||
selection=[("paynet", "Paynet"), ("invocloud", "InvoCloud")],
|
||||
@ -61,7 +61,7 @@ class PaynetService(models.Model):
|
||||
default="paynet",
|
||||
help="There are some specific diference between provider",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@api.depends("use_test_service")
|
||||
def _compute_url(self):
|
||||
|
Loading…
Reference in New Issue
Block a user