mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Fix CC issues
This commit is contained in:
parent
1f49a7411d
commit
53a45f60a4
1 changed files with 8 additions and 5 deletions
|
@ -32,14 +32,17 @@ class DirectoInvoiceForwardJob < Que::Job
|
||||||
next unless registrar.cash_account
|
next unless registrar.cash_account
|
||||||
|
|
||||||
@client = new_directo_client
|
@client = new_directo_client
|
||||||
summary = registrar.monthly_summary(month: @month)
|
send_invoice_for_registrar(registrar)
|
||||||
@client.invoices.add_with_schema(invoice: summary, schema: 'summary') unless summary.nil?
|
|
||||||
next unless @client.invoices.count.positive?
|
|
||||||
|
|
||||||
sync_with_directo
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_invoice_for_registrar(registrar)
|
||||||
|
summary = registrar.monthly_summary(month: @month)
|
||||||
|
@client.invoices.add_with_schema(invoice: summary, schema: 'summary') unless summary.nil?
|
||||||
|
|
||||||
|
sync_with_directo if @client.invoices.count.positive?
|
||||||
|
end
|
||||||
|
|
||||||
def assign_monthly_numbers
|
def assign_monthly_numbers
|
||||||
if directo_counter_exceedable?(@client.invoices.count)
|
if directo_counter_exceedable?(@client.invoices.count)
|
||||||
raise 'Directo Counter is going to be out of period!'
|
raise 'Directo Counter is going to be out of period!'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue