mrsool / zatca

An unofficial Ruby library for generating ZATCA e-invoices, QR Codes, and submitting e-invoices to ZATCA's servers.
MIT License
39 stars 16 forks source link

How to add new field in hash #12

Closed nexondevs closed 2 years ago

nexondevs commented 2 years ago

How to add new field in hash?

I have tried adding new fieds in tag schema by overriding the tag schema behavior by going in the lib folder and overriding the tag.rb file by freezing the added field but it gives Argument error undefined

My hash:

tags = ZATCA::Tags.new({
  seller_name: "Mrsool",
  vat_registration_number: "310228833400003",
  timestamp: "2021-10-20T19:29:32+03:00",
  vat_total: "15",
  invoice_total: "115",
  invoice_number: '212'
})

error: Image Pasted at 2021-11-19 12-12

Can you help me?

obahareth commented 2 years ago

Hey @ror-webExpert,

Can you explain a bit more on why you want to add invoice number to the QR Code? It's not part of the phase 1 or phase 1 implementations.

Anyways check the TagsSchema as well and override it if you need to do that but I don't recommend it as it might break, because you're adding a field ZATCA doesn't expect and isn't part of the specification.

nexondevs commented 2 years ago

Thanks for the reply Client had asked us to add invoice number as well in QR code.

On Thu, 9 Dec 2021, 1:46 pm Omar Bahareth, @.***> wrote:

Hey @ror-webExpert https://github.com/ror-webExpert,

Can you explain a bit more on why you want to add invoice number to the QR Code? It's not part of the phase 1 or phase 1 implementations.

Anyways check the TagsSchema as well and override it if you need to do that but I don't recommend it as it might break, because you're adding a field ZATCA doesn't expect and isn't part of the specification.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mrsool/zatca/issues/12#issuecomment-989635002, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQOOTYF3M4PGAMLLHJU4NXTUQBUF3ANCNFSM5ILOPGFA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.