Coder Social home page Coder Social logo

jsisie's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jsisie's Issues

Outdated Nuget package?

Hi @idstam ! Thanks for a nice library.
I downloaded jsisie package via NuGet Package Manager and the most recent version seems to be 2.2.0 there. However, I can see some differences between the version in Nuget and the version here on Github (e.g. method SieDocument.ReadDocument accepts only string as parameter, but in source code here I can see it can take also Stream (and I specifically need that:) )).
Is it possible that version on Nuget is not up-to-date?

Thanks!

Testfiles are missing

Hi,
I tried to run your unit tests but they fail because the download urls for the testfiles point to 404. Do you happen to have a saved copy of the files to add to the source files?

Allow unbalanced vouchers when reading documents

Great library and I've used it in many projects!

I'm having an issue where some SIE-files include unbalanced vouchers but I still want to be able to parse these.

I can fix it myself if that's OK. I would like to add a new flag, IgnoreUnbalancedVoucher, and check this flag in closeVoucher method.

Tip for encoding

https://www.nuget.org/packages/System.Text.Encoding.CodePages/

	public class EncodingHelper
	{
		private const int _default = 437;

		public static Encoding GetDefault()
		{
			//Dotnet core does not have codepage 437 that is the standard for SIE
			var encodings = Encoding.GetEncodings();
			if (encodings.All(e => e.CodePage != _default))
			{
				Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
			}

			return Encoding.GetEncoding(_default);
		}
	}

Async support

Hi,

Any plans to implement async version of ReadDocument?

Thanks!

A.68 Sum is not zero

Hello

I get an exception jsiSIE.SieVoucherMissmatchException 'A.68 Sum is not zero' when trying to get voucherRows using jsisie. Can you help me to understand what's the issue?

//Getting connector
            var sieConnector = fortnoxClient.Get<SIEConnector>();
            var data = sieConnector.Get(SIEType.Transactions, 6);

            //SIE from Fortnox is encoded in PC-8 (Code page 437) 
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            var sieDocument = new SieDocument();
            sieDocument.ReadDocument(new MemoryStream(data));

            foreach (var sieVoucher in sieDocument.VER)
            {
                var series = sieVoucher.Series;
                var date = sieVoucher.VoucherDate;
                //...//

                foreach (var sieVoucherRow in sieVoucher.Rows)
                {
                    var amount = sieVoucherRow.Amount;
                    var account = sieVoucherRow.Account.Number;
                    var text = sieVoucherRow.Text;
                    
                    // ... //
                }
            }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.