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

增值税电子普通发票识别没有项目名称,OFD调用接口不能识别。 #8

Open
344020353 opened this issue Dec 8, 2022 · 3 comments

Comments

@344020353
Copy link

image

@344020353
Copy link
Author

使用的是 大佬提供的在线接口测试哈
http://www.heycore.com/invoice.html,上传PDF没有识别项目名称,上传ofd
提示报错
image

@sanluan
Copy link
Owner

sanluan commented Dec 8, 2022

看了看错误日志是 里面一个文件不存在,ofd格式比较简单 当作zip打开后 有一些xml文件能直接拿到发票数据
你们这个地方的好像和一般的电子发票不太一样 你可以研究下 OfdInvoiceExtractor.extract方法 和 这个文件里面的xml

@82kg
Copy link

82kg commented Oct 9, 2023

           detail.setAmount(element.elementTextTrim("Amount").equals("") == true ? null:new BigDecimal(element.elementTextTrim("Amount")));
                detail.setTaxAmount(element.elementTextTrim("TaxAmount").equals("") == true ? null:new BigDecimal(element.elementTextTrim("TaxAmount")));
                detail.setCount(element.elementTextTrim("Quantity").equals("") == true ? null:new BigDecimal(element.elementTextTrim("Quantity")));
                detail.setPrice(element.elementTextTrim("Price").equals("") == true ? null:new BigDecimal(element.elementTextTrim("Price")));

判断下是不是为空就行了

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

No branches or pull requests

3 participants