Giter VIP home page Giter VIP logo

ws-client-dotnet's Issues

ws-client-dotnet/izibiz.Application/izibiz.COMMON/UBLCreate/BaseInvoiceUBL.cs clasında hata

Merhaba,
BaseInvoiceUBL.cs clasında invoiceTaxTotal fonksiyonu KDV oranlarına göre gruplama işlevini gerçekleştirmiyor. Her defasında ilk KDV satırını almaktadır.
Aşağıdaki fonksiyonu kullanabilirsiniz.

public virtual TaxTotalType[] invoiceTaxTotal()
{
List taxTotalList = new List();
List taxSubTotalList = new List();

        TaxTotalType taxTotal = new TaxTotalType { TaxAmount = new TaxAmountType { Value = 0 } };

        foreach (var line in baseInvoiceUBL.InvoiceLine)
        {
            taxTotal.TaxAmount.Value += line.TaxTotal.TaxAmount.Value;
            taxTotal.TaxAmount.currencyID = line.TaxTotal.TaxAmount.currencyID;

            foreach (var tax in line.TaxTotal.TaxSubtotal)
            {
                var taxSubTotal = taxSubTotalList.Where(x=>x.Percent.Value == tax.Percent.Value).FirstOrDefault();

                if (taxSubTotal != null)
                {
                    taxSubTotal.TaxableAmount.Value += tax.TaxableAmount.Value;
                    taxSubTotal.TaxAmount.Value += line.TaxTotal.TaxAmount.Value;
                }
                else //yoksa ekle
                {
                    TaxSubtotalType taxSubtotalNew = new TaxSubtotalType();
                    taxSubtotalNew.TaxableAmount = new TaxableAmountType { Value = tax.TaxableAmount.Value, currencyID = tax.TaxableAmount.currencyID };

                    taxSubtotalNew.TaxAmount = new TaxAmountType { Value = line.TaxTotal.TaxAmount.Value, currencyID = tax.TaxAmount.currencyID };
                    taxSubtotalNew.Percent = new PercentType1 { Value = tax.Percent.Value };
                    taxSubtotalNew.TaxCategory = new TaxCategoryType();
                    if (tax.Percent.Value == 0)
                    {
                        taxSubtotalNew.TaxCategory.TaxExemptionReasonCode = new TaxExemptionReasonCodeType { Value = "351" };
                        taxSubtotalNew.TaxCategory.TaxExemptionReason = new TaxExemptionReasonType { Value = "ReasonTaxExemtion" };//Reson Value hard code basıldı
                                                                                                                                   //istenırse formdan da alınabılır
                    }

                    taxSubtotalNew.TaxCategory.TaxScheme = new TaxSchemeType();
                    taxSubtotalNew.TaxCategory.TaxScheme.Name = new NameType1 { Value = nameof(EI.TaxType.KDV) };
                    taxSubtotalNew.TaxCategory.TaxScheme.TaxTypeCode = new TaxTypeCodeType { Value = "0015" };

                    taxSubTotalList.Add(taxSubtotalNew);
                }
            }
        }

        taxTotal.TaxSubtotal = taxSubTotalList.ToArray();
        taxTotalList.Add(taxTotal);
        return taxTotalList.ToArray();
    }

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.