Exemplo n.º 1
0
        public UnitCostDto(UnitPaymentOrderDetail detail, List <UnitPaymentOrderItem> spbItems, List <UnitReceiptNoteItem> unitReceiptNoteItems, List <UnitReceiptNote> unitReceiptNotes)
        {
            var unitReceiptNoteItem = unitReceiptNoteItems.FirstOrDefault(item => item.Id == detail.URNItemId);
            var unitReceiptNote     = unitReceiptNotes.FirstOrDefault(item => item.Id == unitReceiptNoteItem.URNId);

            Unit   = new UnitDto(unitReceiptNote.UnitId, unitReceiptNote.UnitCode, unitReceiptNote.UnitName, unitReceiptNote.DivisionCode, unitReceiptNote.DivisionId, unitReceiptNote.DivisionName);
            Amount = detail.PriceTotal;
        }
 public POExternalItemDto(GarmentExternalPurchaseOrderItem element, GarmentExternalPurchaseOrder entity, GarmentInternalPurchaseOrder purchaseOrder)
 {
     Product         = new ProductDto(element.ProductCode, element.ProductId, element.ProductName, element.DefaultUomId, element.DefaultUomUnit);
     DefaultQuantity = element.DefaultQuantity;
     DealQuantity    = element.DealQuantity;
     DealUOM         = new UOMDto(element.DealUomId, element.DealUomUnit);
     Conversion      = element.Conversion;
     Price           = element.PricePerDealUnit;
     UseVat          = entity.IsUseVat;
     Unit            = new UnitDto(purchaseOrder.UnitId, purchaseOrder.UnitCode, purchaseOrder.UnitName, purchaseOrder.DivisionCode, purchaseOrder.DivisionId, purchaseOrder.DivisionName);
     IncomeTax       = new IncomeTaxDto(entity.IncomeTaxId, entity.IncomeTaxName, entity.IncomeTaxRate);
     UseIncomeTax    = entity.IsIncomeTax;
     EPOId           = (int)entity.Id;
 }
 public POExternalItemDto(ExternalPurchaseOrderDetail element, ExternalPurchaseOrder entity)
 {
     Product         = new ProductDto(element.ProductCode, element.ProductId, element.ProductName, element.DefaultUomId, element.DefaultUomUnit);
     DefaultQuantity = element.DefaultQuantity;
     DealQuantity    = element.DealQuantity;
     DealUOM         = new UOMDto(element.DealUomId, element.DealUomUnit);
     Conversion      = element.Conversion;
     Price           = element.PricePerDealUnit;
     UseVat          = entity.UseVat;
     VatTax          = new VatTaxDto(entity.VatId, entity.VatRate);
     Unit            = new UnitDto(entity.UnitId, entity.UnitCode, entity.UnitName, entity.DivisionCode, entity.DivisionId, entity.DivisionName);
     IncomeTax       = new IncomeTaxDto(entity.IncomeTaxId, entity.IncomeTaxName, entity.IncomeTaxRate);
     IncomeTaxBy     = entity.IncomeTaxBy;
     UseIncomeTax    = entity.UseIncomeTax;
     EPOId           = (int)entity.Id;
 }
Exemplo n.º 4
0
        public UnitCostDto(UnitPaymentOrderDetail detail, List <UnitPaymentOrderItem> spbItems, List <UnitReceiptNoteItem> unitReceiptNoteItems, List <UnitReceiptNote> unitReceiptNotes, UnitPaymentOrder element)
        {
            var unitReceiptNoteItem = unitReceiptNoteItems.FirstOrDefault(item => item.Id == detail.URNItemId);
            var unitReceiptNote     = unitReceiptNotes.FirstOrDefault(item => item.Id == unitReceiptNoteItem.URNId);

            Unit = new UnitDto(unitReceiptNote.UnitId, unitReceiptNote.UnitCode, unitReceiptNote.UnitName, unitReceiptNote.DivisionCode, unitReceiptNote.DivisionId, unitReceiptNote.DivisionName);

            var quantity = detail.ReceiptQuantity;

            if (detail.QuantityCorrection > 0)
            {
                quantity = detail.QuantityCorrection;
            }

            var price = detail.PricePerDealUnit;

            if (detail.PricePerDealUnitCorrection > 0)
            {
                price = detail.PricePerDealUnitCorrection;
            }

            var result = quantity * price;

            if (detail.PriceTotalCorrection > 0)
            {
                result = detail.PriceTotalCorrection;
            }

            var total = result;

            if (element != null)
            {
                if (element.UseVat)
                {
                    result += total * (element.VatRate / 100);

                    //result += total * 0.1;
                }

                if (element.UseIncomeTax && (element.IncomeTaxBy == "Supplier" || element.IncomeTaxBy == "SUPPLIER"))
                {
                    result -= total * (element.IncomeTaxRate / 100);
                }
            }

            Amount = result;
        }
Exemplo n.º 5
0
        public UnitCostDto(GarmentInternNoteDetail detail, List <GarmentInternNoteItem> internNoteItems, GarmentInternNote element, GarmentInvoice elementInvoice)
        {
            Unit = new UnitDto(detail.UnitId, detail.UnitCode, detail.UnitName, "", "0", "");

            var total = detail.PriceTotal;

            if (elementInvoice != null)
            {
                if (elementInvoice.UseVat)
                {
                    total += detail.PriceTotal * 0.1;
                }

                if (elementInvoice.UseIncomeTax && !elementInvoice.IsPayTax)
                {
                    total -= detail.PriceTotal * (elementInvoice.IncomeTaxRate / 100);
                }
            }

            PriceTotal = detail.PriceTotal;
            Amount     = total;
        }
Exemplo n.º 6
0
        public UnitCostDto(UnitPaymentOrderDetail detail, List <UnitPaymentOrderItem> spbItems, List <UnitReceiptNoteItem> unitReceiptNoteItems, List <UnitReceiptNote> unitReceiptNotes, UnitPaymentOrder element)
        {
            var unitReceiptNoteItem = unitReceiptNoteItems.FirstOrDefault(item => item.Id == detail.URNItemId);
            var unitReceiptNote     = unitReceiptNotes.FirstOrDefault(item => item.Id == unitReceiptNoteItem.URNId);

            Unit = new UnitDto(unitReceiptNote.UnitId, unitReceiptNote.UnitCode, unitReceiptNote.UnitName, unitReceiptNote.DivisionCode, unitReceiptNote.DivisionId, unitReceiptNote.DivisionName);

            var total = detail.PriceTotal;

            if (element != null)
            {
                if (element.UseVat)
                {
                    total += detail.PriceTotal * 0.1;
                }

                if (element.UseIncomeTax && (element.IncomeTaxBy == "Supplier" || element.IncomeTaxBy == "SUPPLIER"))
                {
                    total -= detail.PriceTotal * (element.IncomeTaxRate / 100);
                }
            }

            Amount = total;
        }