updated attributes

This commit is contained in:
olegphenomenon 2022-01-11 13:31:02 +02:00
parent 9bdca96f87
commit 9aba744494

View file

@ -22,18 +22,17 @@ module EisBilling
:created_at, :created_at,
:updated_at, :updated_at,
:e_invoice_sent_at, :e_invoice_sent_at,
:issue_date, :items_attributes])
:due_date])
parsed_data = JSON.parse(invoice) parsed_data = JSON.parse(invoice)
parsed_data["role"] = "registrar" parsed_data["role"] = "registrar"
parsed_data["invoice_number"] = "2232"
parsed_data["description"] = "some" if parsed_data["description"] == '' parsed_data["description"] = "some" if parsed_data["description"] == ''
parsed_data = replace_key(json_obj: parsed_data, old_key: "total", new_key: "transaction_amount") parsed_data = replace_key(json_obj: parsed_data, old_key: "total", new_key: "transaction_amount")
parsed_data = replace_key(json_obj: parsed_data, old_key: "reference_no", new_key: "reference_number") parsed_data = replace_key(json_obj: parsed_data, old_key: "reference_no", new_key: "reference_number")
p parsed_data invoice_items_json = @invoice.items.to_json(except: [:created_at, :updated_at])
parsed_data["items"] = JSON.parse(invoice_items_json)
parsed_data parsed_data
end end