Ejemplo n.º 1
0
    public static StructItems TaxCal(StructItems item)
    {
        decimal MaxAmt = item.ItemTaxable;

        int ValidCG   = (item.ItemCGSTRate > 0 ? 1 : 0);
        int ValidSG   = (item.ItemSGSTRate > 0 ? 1 : 0);
        int ValidIG   = (item.ItemIGSTRate > 0 ? 1 : 0);
        int ValidCess = (item.ItemCESSRate > 0 ? 1 : 0);

        int devidedBy = ValidCG + ValidSG + ValidIG + ValidCess;

        if (ValidCG == 1)
        {
            item.ItemCGSTRate = item.ItemRate / devidedBy;
            item.ItemCGSTAmt  = Math.Round(((MaxAmt * item.ItemCGSTRate) / 100), 2);
        }
        if (ValidIG == 1)
        {
            item.ItemIGSTRate = item.ItemRate / devidedBy;
            item.ItemIGSTAmt  = Math.Round(((MaxAmt * item.ItemIGSTRate) / 100), 2);
        }
        if (ValidSG == 1)
        {
            item.ItemSGSTRate = item.ItemRate / devidedBy;
            item.ItemSGSTAmt  = Math.Round(((MaxAmt * item.ItemSGSTRate) / 100), 2);
        }
        if (ValidCess == 1)
        {
            item.ItemCESSRate = item.ItemRate / devidedBy;
            item.ItemCESSAmt  = Math.Round(((MaxAmt * item.ItemCESSRate) / 100), 2);
        }
        return(item);
    }
Ejemplo n.º 2
0
 public static StructItems CalculateRate(StructItems item)
 {
     item.DiscountValue = item.ItemDiscount;
     if (item.DiscountInPerc)
     {
         item.DiscountValue = (((item.ItemQty + item.ItemFree) * item.ItemRate) * item.ItemDiscount) / 100;
     }
     item.ItemTaxable   = Math.Round((((item.ItemQty + item.ItemFree) * item.ItemRate) - item.DiscountValue), 2);
     item.ItemAmount    = Math.Round((item.ItemQty * item.ItemRate), 2);
     item.DiscountValue = Math.Round(item.DiscountValue, 2);
     return(item);
 }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        void Item001()
        {
            //Bonguri Blanco
            StructItems I001 = new StructItems();

            I001.ItemId      = 0;
            I001.ItemName    = "Bonguri Blanco";
            I001.ItemCatId   = 0;
            I001.ItemCatName = "Bonguri";
            I001.ItemCom     = -1;
            I001.ItemVen     = -1;
            //I001.ItemImg =
            I001.ItemDescrip = "Se utiliza para fabricar una Rapid Ball";
        }
    }