private void CopyFactura()
        {
            Factura = InputInvoice.New(_entity).GetInfo(true);

            List <InputInvoiceLineInfo> conceptosOut = new List <InputInvoiceLineInfo>();

            foreach (InputInvoiceLineInfo item in Factura.Conceptos)
            {
                bool isIn = false;

                foreach (InputInvoiceLineInfo cp in _conceptos_selected)
                {
                    if (cp.Oid == item.Oid)
                    {
                        isIn = true;
                        continue;
                    }
                }

                if (!isIn)
                {
                    conceptosOut.Add(item);
                }
            }

            foreach (InputInvoiceLineInfo item in conceptosOut)
            {
                Factura.Conceptos.RemoveItem(item.Oid);
            }

            Factura.CalculateTotal();
        }
Example #2
0
        public static InputInvoiceLineList GetByFacturaList(long oid_factura, bool childs)
        {
            InputInvoiceLineList list;

            QueryConditions conditions = new QueryConditions
            {
                FacturaRecibida = InputInvoice.New().GetInfo(false)
            };

            conditions.FacturaRecibida.Oid = oid_factura;

            list = GetList(InputInvoiceLine.SELECT(conditions, false), childs);

            return(list);
        }
Example #3
0
        protected override void GetFormSourceData(object[] parameters)
        {
            _entity = InputInvoice.New();
            _entity.BeginEdit();

            try
            {
                //NO SE PUEDE HACER AQUI LO QUE SE HACE EN EL CONSTRUCTOR PORQUE LOS CONTROLES NO ESTAN INICIALIZADOS
                if (parameters[0] != null)
                {
                    _entity.Fecha = ((InputDeliveryInfo)parameters[0]).Fecha;
                }
            }
            catch { }
        }
Example #4
0
        public static TransactionPaymentList GetListByFactura(long oid_factura)
        {
            CriteriaEx criteria = TransactionPayment.GetCriteria(TransactionPayment.OpenSession());

            criteria.Childs = false;

            Library.Store.QueryConditions conditions = new Library.Store.QueryConditions {
                FacturaRecibida = InputInvoice.New().GetInfo()
            };
            conditions.FacturaRecibida.Oid = oid_factura;
            criteria.Query = TransactionPaymentList.SELECT(conditions);

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

            CloseSession(criteria.SessionCode);
            return(list);
        }