Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directo: Reference BL from gem #1547

Merged
merged 15 commits into from
Mar 25, 2020
Merged

Directo: Reference BL from gem #1547

merged 15 commits into from
Mar 25, 2020

Conversation

karlerikounapuu
Copy link
Member

@karlerikounapuu karlerikounapuu commented Feb 27, 2020

Closes #509

Sending monthly registrar purchase summary:
DirectoInvoiceForwardJob.run(monthly: true)

Sending (daily / whenever) registrar prepayment invoices:
DirectoInvoiceForwardJob.run

Appending dry: true to run arguments composes invoice list, but doesn't deliver invoices to API.

Ready for testing, but please do not merge yet as it references development branch of Directo gem.

@karlerikounapuu karlerikounapuu force-pushed the 509-directo-to-gem branch 10 times, most recently from 1a5700a to 3aef0a3 Compare March 2, 2020 08:37
@karlerikounapuu karlerikounapuu force-pushed the 509-directo-to-gem branch 2 times, most recently from 0694b89 to 242f29d Compare March 2, 2020 12:05
@karlerikounapuu karlerikounapuu marked this pull request as ready for review March 2, 2020 12:09
@karlerikounapuu karlerikounapuu force-pushed the 509-directo-to-gem branch 2 times, most recently from 3469b51 to 07642a4 Compare March 2, 2020 14:46
@karlerikounapuu karlerikounapuu requested a review from yulgolem March 3, 2020 08:32
@vohmar
Copy link
Contributor

vohmar commented Mar 3, 2020

there is no feedback in stdout

both jobs fail. sample error from logs:

Mar  3 15:23:38 staging st-adm.infra.tld.ee[23283]: [Directo] - attempting to send following XML:#012 <?xml version="1.0" encoding="UTF-8"?><invoices>  <invoice Number="309910" InvoiceDate="2020-02-29" PaymentTerm="R" CustomerCode="EEDIRECT" CustomerName="" Language="ENG" Currency="EUR" SalesAgent="JAANA" TotalVAT="" TotalWoVAT="">    <line RN="1" RR="1" ProductName="Domain registrations - February 2020"/>    <line RN="2" RR="2" ProductID="01EE" Quantity="7" Unit="pc" ProductName=".ee registration: 1 year(s)" UnitPriceWoVAT="6.0"/>    <line RN="3" RR="3" ProductID="ETTEM06" Quantity="1" Unit="pc" ProductName="Domains prepayment" UnitPriceWoVAT="42.0"/>  </invoice>  <invoice Number="309911" InvoiceDate="2020-02-29" PaymentTerm="R" CustomerCode="RIKS" CustomerName="" Language="" Currency="EUR" SalesAgent="JAANA" TotalVAT="" TotalWoVAT="">    <line RN="1" RR="1" ProductName="Domeenide registreerimine - Veebruar 2020"/>    <line RN="2" RR="2" ProductID="01EE" Quantity="5" Unit="tk" ProductName=".ee registreerimine: 1 aasta(t)" UnitPriceWoVAT="6.0"/>    <line RN="3" RR="3" ProductID="01EE" Quantity="2" Unit="tk" ProductName=".ee registreerimine: 3 kuu(d)" UnitPriceWoVAT="1.6"/>    <line RN="4" RR="4" ProductID="ETTEM06" Quantity="1" Unit="tk" ProductName="Domeenide ettemaks" UnitPriceWoVAT="33.2"/>  </invoice></invoices>
Mar  3 15:23:38 staging st-adm.infra.tld.ee[23283]: [Directo] - Responded with body: <?xml version="1.0" encoding="utf-8"?><error code="20" desc="invalid xml given" err_reason="Invalid character value for cast specification." />

@vohmar
Copy link
Contributor

vohmar commented Mar 10, 2020

still no feedback in stdout

sending monthly inv succeeded
sending regular invoices failed with no error:

Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: [DIRECTO] Trying to send 2 prepayment invoices
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: Invoice Load (1.2ms)  SELECT "invoices".* FROM "invoices" WHERE "inv
oices"."in_directo" = $1 AND "invoices"."cancelled_at" IS NULL  [["in_directo", "f"]]
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: AccountActivity Load (0.8ms)  SELECT  "account_activities".* FROM "a
ccount_activities" WHERE "account_activities"."invoice_id" = $1 LIMIT $2  [["invoice_id", 94], ["LIMIT", 1]]
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: [DIRECTO] Invoice 3131076 has been skipped
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: AccountActivity Load (0.4ms)  SELECT  "account_activities".* FROM "a
ccount_activities" WHERE "account_activities"."invoice_id" = $1 LIMIT $2  [["invoice_id", 105], ["LIMIT", 1]]
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: [DIRECTO] Invoice 3131087 has been skipped
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: [Directo] - attempting to send following XML:#012 <?xml version="1.0
" encoding="UTF-8"?><invoices/>
Mar 10 15:17:02 staging st-adm.infra.tld.ee[26381]: [Directo] - Responded with body:

for some reason sending the first invoice was skipped. Second one is not paid so this is expected. First one has record in account_activities table and looks ok - what could be the reason here?

@vohmar vohmar assigned karlerikounapuu and unassigned vohmar Mar 10, 2020
@vohmar
Copy link
Contributor

vohmar commented Mar 19, 2020

testing done, did not find any issues ready to merge

@vohmar vohmar merged commit 8451aa7 into master Mar 25, 2020
@vohmar vohmar deleted the 509-directo-to-gem branch March 26, 2020 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor models/directo.rb
3 participants