axenda / zatca Goto Github PK
View Code? Open in Web Editor NEWAn unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in Saudi Arabia.
License: MIT License
An unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in Saudi Arabia.
License: MIT License
Issue 1: Inconsistency in E-Invoicing Statistics
After successfully integrating and following the official documentation provided by ZATCA, I have encountered an inconsistency in the e-invoicing statistics displayed on the Fatoora portal's simulation section. Despite receiving a "status":"PASS", "reportingStatus": "REPORTED" for submitted simplified invoices via the API endpoint "https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/invoices/reporting/single" and despite receiving a "status": "PASS", "clearanceStatus": "CLEARED" for standard invoices via "https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/invoices/clearance/single", the total count of submitted documents does not reflect accurately on the portal. This issue persists even after multiple checks over several days. Also, if I submitted and got a successful response from the API as the document is accepted and while checking on the Fatoora statistics page sometimes it is counted in rejected documents. Why is this mismatch happening? If I received REPORTED, CLEARED status with no error or warning messages, can I confirm that my document is submitted and accepted by ZATCA successfully? Please clarify this.
Issue 2: Lack of Clarity on Tax Amount Calculation
Additionally, I seek clarification on the calculation of the total tax amount payable to ZATCA for the submitted and accepted invoice documents. As there is no provision to retrieve this information from the ZATCA side, could you please confirm whether we need to calculate this amount internally based on the submitted invoices? For instance, if five invoices are successfully submitted and accepted, how do we determine the total tax amount owed to ZATCA?
Could someone please clarify these doubts?
Hi, I was wondering, if this is compatible with ZATCA phase 1?
Is this the invoice data I need to save in a DB?
{
sellerName: 'Axenda',
vatRegistrationNumber: '1234567891',
invoiceTimestamp: '2021-12-04T00:00:00Z',
invoiceTotal: '100.00',
invoiceVatTotal: '15.00',
}
Or do I save the qrCode base64?
We want to integrate zatca 2nd phase QR. Can you help us?
Hi there,i am having an issue with my receipt printing code. My receipt is 12 pages and the qr code should repeat on each page as it is fixed on top of page.But it only renders once . Either first or last page. I cannot share the confidential document but i am attaching my code for fixed header which has the qr code in it.
.global-header{ position: fixed; width: 100%; bottom: 0; left: 0; padding: 1em }
<div className="global-header" style={{ display: "block", marginLeft: "auto", width: 180, height: 190 }} > <QRCode value={qrBarcodeInvoice} size={180} /> </div>
invoice.js:14
Uncaught (in promise) TypeError: tag_1.Tag is not a constructor
at new Invoice (invoice.js:14:13)
at _callee$ (App.jsx:32:25)
at tryCatch (regeneratorRuntime.js:86:17)
at Generator.eval [as _invoke] (regeneratorRuntime.js:66:24)
at Generator.eval [as next] (regeneratorRuntime.js:117:21)
Hi
When trying to use
const imageData = await invoice.render();
it's return Error: You need to specify a canvas element
After updating my existing project to react-scripts ^5.0.0 i have faced an error which is
Uncaught (in promise) ReferenceError: Buffer is not defined
this is because of Buffer is removed in react-scripts ^5.0.0
the issue is in functions named [toHex, toTlv] at the time of creating new object of Invoice
Testing environment:
When I increase the vatRegistrationNumber to 15 characters/numbers (which is the length of the vat registration number for my KSA company) the decoded string gets missed up.
const invoice = new Invoice({
sellerName: 'شركة تجريبية',
vatRegistrationNumber: '123456789135785',
invoiceTimestamp: '2021-02-21T11:20:27.983Z',
invoiceTotal: '2785.8',
invoiceVatTotal: '361.8',
})
invoice.toBase64()
a readable string similar to this
��شركة تجريبية�
123456789135785��2021-02-21T11:20:27.983Z��2785.8��361.8
Uncaught ReferenceError: Buffer is not defined
at toHex (to-hex.js:14:1)
at Tag.toTlv (tag.js:19:1)
at to-tlv.js:10:1
at Array.map ()
at toTlv (to-tlv.js:10:1)
at _c (ComponentToPrint.js:17:1)
at renderWithHooks (react-dom.development.js:16305:1)
at updateForwardRef (react-dom.development.js:19226:1)
at beginWork (react-dom.development.js:21636:1)
at beginWork$1 (react-dom.development.js:27426:1)
**It's work fine on codesandbox**
_but when it comes to npx create-react-app I get this message_
I downloaded Buffer as backage, but it didn't help
import { Invoice } from "@axenda/zatca";
function App() {
console.log(Invoice); --- ok
const invoice = new Invoice({
sellerName: "Axenda",
vatRegistrationNumber: "1234567891",
invoiceTimestamp: "2021-12-04T00:00:00Z",
invoiceTotal: "100.00",
invoiceVatTotal: "15.00",
});
console.log(invoice.toTlv()); --- throw error in console
.....
I am using this npm in angular getting issue buffer is not define in toHex(to-hex.js)
should I its support for angular or need to use any other framework could you please give me a solution
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.