agabor / szamlazz-hu-sdk Goto Github PK
View Code? Open in Web Editor NEWCreate invoices on Szamlazz.hu from .NET
Home Page: https://www.nuget.org/packages/szamlazz-hu-sdk/
License: MIT License
Create invoices on Szamlazz.hu from .NET
Home Page: https://www.nuget.org/packages/szamlazz-hu-sdk/
License: MIT License
Szia!
A vevő nevében levő speciális karatekere nekem elszáll az xml szerializás. Konkrétan a &-el van baja, így megy:
Replace("&", " & # 38;")
de ezek se mennek gondolom: https://docs.oracle.com/cd/A97335_02/apps.102/bc4j/developing_bc_projects/obcCustomXml.htm
Mondjuk a házszámban ilyen jel ritkán van de gondolom akkor már minden mezőben érdemes azt a konverziót megcsinálni.
Hacsak nem én szurtam el vmit...
Üdv,
A HttpUploadXmlFile hívásban nincs kezelve, ha az API válaszban ékezetes karakterek vannak pl hibaüzenet miatt, emiatt valahol az xml parse benyeli a hiba nagy részét és csak ennyi jön vissza:
"[ERR] Szá"
A választ dekódolva már jó lesz (string xml = System.Web.HttpUtility.HtmlDecode(reader.ReadToEnd()); a 102. sorban)
"[ERR] Számla mentés sikertelen.\nA számla kelte csak a mai nap lehet: 2023.08.23..\r\n.........
Van egy problémám, hogy az alábbi kódrészlettel állítom be a számla tételeit:
var request = new CreateInvoiceRequest();
request.AuthenticationData.ApiKey = "*****";
request.Header.IssueDate = DateTime.Now;
request.Header.CompletionDate = DateTime.Now;
request.Header.DueDate = DateTime.Now;
request.Header.PaymentType = "Készpénz";
request.Header.InvoiceNumberPrefix = "FRST1";
request.Seller.BankName = "Our Bank";
request.Seller.BankAccount = "11111111-22222222-33333333";
request.Customer.Name = "Good Friend Inc.";
request.Customer.CustomerAddress.PostalCode = "1132";
request.Customer.CustomerAddress.City = "Budapest";
request.Customer.CustomerAddress.StreetAddress = "Tárnoki út 23.";
request.Customer.TaxNumber = "12345678-1-42";
request.Settings.Electric = false;
request.Items = new List<InvoiceItem> {
new InvoiceItem
{
Name = "Citrom",
Quantity = 11046M,
UnitOfQuantity = "Dkg",
UnitPrice = 20.96505522M,
VatRate = "27",
NetPrice = 231580M,
VatAmount = 62526M,
GrossAmount = 294106M
}
};
var api = new SzamlazzHuApi();
var response = await api.CreateInvoice(request);
A számláz.hu -ról azzal a hibával jön vissza, hogy a nettó érték nem egyenlő a nettó egységár és a mennyiség szorzatával.
Van ötleted?
Köszi.
Zoli
Szia Gábor!
Nagyon köszönöm, hogy feltetted ezt a plugint. Sokat segített nekem. Egy nopCommerce webshopban használom.
Eddig kipróbáltam a számla létrehozásához használt interfészt.
Az alábbi sorban kapok egy exceptiont:
response = await api.CreateInvoice(request);
Az exception message az alábbi:
{"Could not find file 'createInvoiceRequest.sbn"}
A callstack:
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks)
at System.IO.File.InternalReadAllText(String path, Encoding encoding)
at System.IO.File.ReadAllText(String path)
at SzamlazzHu.XMLRenderer.RenderRequest(CreateInvoiceRequest request)
at SzamlazzHu.SzamlazzHuApi.d__0.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Nop.Plugin.Payments.SzamlazzHu.SzamlazzHuPaymentProcessor.d__11.MoveNext() in SzamlazzHuPaymentProcessor.cs:line 121
Üdv
Miki
Kicsit furcsa volt így hirtelen, hogy néhány property (pl. PaymentType, InvoiceType, stb.) sima stringként szerepel. Ebben tudnátok segíteni, hogy van-e esetleg valami indoka? Előre is köszi.
Apróság, de a minta hibás.
StreetAddress van már nem Address ahogy nézem.
Illetve nem pdf hanem InvoicePdf
Szia Gábor!
A levelezés alapján ez egy reminder, hogy ha időd engedi eu adószám hasznos lenne az sdk-ba.
A visual studio szerint 1.3.3 a legrégebbi nuget, de nuget.org-on van 1.3.3 is. Ez nem teljesen tiszta nekem h miért van, de mindegy is :)
Köszi
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.