Ejemplo n.º 1
0
        public virtual void UpdateGastosPartidas()
        {
            InputDeliveryLineList conceptos = InputDeliveryLineList.GetByExpedienteStockList(Oid, false, true);

            if (Ayuda)
            {
                if (_expedientes_rea == null)
                {
                    LoadChilds(typeof(REAExpedient), true, false);
                }
            }

            KilosTotal = 0;

            foreach (BatchInfo item in Partidas)
            {
                if (item.OidExpediente != Oid)
                {
                    continue;
                }
                KilosTotal += item.KilosIniciales;
            }

            decimal ayudas     = 0;
            decimal kilos      = 0;
            decimal ayuda_kilo = 0;

            foreach (BatchInfo item in Partidas)
            {
                if (item.OidExpediente != Oid)
                {
                    continue;
                }

                if (Ayuda)
                {
                    ayudas     = ExpedientesREA.GetTotalAyudas(item.CodigoAduanero);
                    kilos      = Partidas.GetTotalKilos(item.CodigoAduanero);
                    ayuda_kilo = ayudas / kilos;
                }
                else
                {
                    ayuda_kilo = 0;
                }

                item.CalculaCostes(GastoPorKilo, ayuda_kilo);
            }
        }