Exemplo n.º 1
0
        public void SetValues(Expedient parent, InputInvoiceInfo factura, LineaFomento linea)
        {
            LineasFomento lista = GetListByFactura(factura, linea);

            if (lista.Count == 0)
            {
                linea.SetValues(factura);
            }
            else
            {
                decimal total_kilos = linea.Kilos;

                foreach (LineaFomento item in lista)
                {
                    total_kilos += item.Kilos;
                }

                linea.SetValues(factura, (linea.Kilos / total_kilos));

                foreach (LineaFomento item in lista)
                {
                    item.SetValues(factura, (item.Kilos / total_kilos));
                }
            }

            parent.UpdateTotalCostesCompensables();
        }
Exemplo n.º 2
0
        public static REAExpedients GetChildList(Expedient parent, bool childs)
        {
            CriteriaEx criteria = REAExpedient.GetCriteria(parent.SessionCode);

            criteria.Query  = REAExpedients.SELECT(parent);
            criteria.Childs = childs;

            REAExpedients list = DataPortal.Fetch <REAExpedients>(criteria);

            parent.UpdateTotalCostesCompensables();

            return(list);
        }
Exemplo n.º 3
0
        public static LineasFomento GetChildList(Expedient parent, bool childs)
        {
            CriteriaEx criteria = LineaFomento.GetCriteria(parent.SessionCode);

            criteria.Query  = LineasFomento.SELECT(parent);
            criteria.Childs = childs;

            LineasFomento list = DataPortal.Fetch <LineasFomento>(criteria);

            parent.UpdateTotalCostesCompensables();

            return(list);
        }
Exemplo n.º 4
0
        public void SetValues(Expedient parent, InputInvoiceInfo factura)
        {
            if (Items.Count != 1)
            {
                return;
            }

            LineaFomento item = Items[0];

            item.SetValues(factura);

            parent.UpdateTotalCostesCompensables();
        }