示例#1
0
                public void AgregarCampo(string label, Lui.Forms.EditableControl control)
                {
                        Lui.Forms.Label Lbl = new Lui.Forms.Label();
                        Lbl.AutoSize = false;
                        Lbl.Text = label;
                        Lbl.Tag = control;
                        Lbl.UseMnemonic = false;
                        Lbl.Height = control.Height;
                        Lbl.TextAlign = ContentAlignment.TopLeft;
                        Lbl.AutoEllipsis = true;
                        
                        this.FieldContainer.Controls.Add(Lbl);
                        this.FieldContainer.Controls.Add(control);

                        Lbl.Anchor = AnchorStyles.Left | AnchorStyles.Top;
                        control.Anchor = AnchorStyles.Left | AnchorStyles.Top;

                        this.Campos.Add(new Campo(control, Lbl));

                        this.ReLayout();
                }
        internal static int checkDelegate(IntPtr l,int p,out Lui.LScrollView.LDataSourceAdapter<Lui.LTableViewCell,System.Int32> ua)
        {
            int op = extractFunction(l,p);
            if(LuaDLL.lua_isnil(l,p)) {
                ua=null;
                return op;
            }
            else if (LuaDLL.lua_isuserdata(l, p)==1)
            {
                ua = (Lui.LScrollView.LDataSourceAdapter<Lui.LTableViewCell,System.Int32>)checkObj(l, p);
                return op;
            }
            LuaDelegate ld;
            checkType(l, -1, out ld);
            if(ld.d!=null)
            {
                ua = (Lui.LScrollView.LDataSourceAdapter<Lui.LTableViewCell,System.Int32>)ld.d;
                return op;
            }
            LuaDLL.lua_pop(l,1);

            l = LuaState.get(l).L;
            ua = (Lui.LTableViewCell a1,int a2) =>
            {
                int error = pushTry(l);

                pushValue(l,a1);
                pushValue(l,a2);
                ld.pcall(2, error);
                Lui.LTableViewCell ret;
                checkType(l,error+1,out ret);
                LuaDLL.lua_settop(l, error-1);
                return ret;
            };
            ld.d=ua;
            return op;
        }
示例#3
0
                public void RentabilidadAnual(int anio, Lui.Forms.Chart Chrt)
                {
                        if (Chrt.Series == null)
                                Chrt.Series = new System.Collections.Generic.List<Lbl.Charts.Serie>();

                        Lbl.Charts.Element[] ElFacturacion = new Lbl.Charts.Element[12];
                        Lbl.Charts.Element[] ElCosto = new Lbl.Charts.Element[12];
                        Lbl.Charts.Element[] ElGastos = new Lbl.Charts.Element[12];
                        Lbl.Charts.Element[] ElRentabilidad = new Lbl.Charts.Element[12];

                        for (int mes = 1; mes <= 12; mes++) {

                                if (anio > DateTime.Now.Year || (anio == DateTime.Now.Year && mes > DateTime.Now.Month)) {
                                        //Nada ?
                                } else {
                                        ElFacturacion[mes - 1] = new Lbl.Charts.Element();
                                        ElCosto[mes - 1] = new Lbl.Charts.Element();
                                        ElGastos[mes - 1] = new Lbl.Charts.Element();
                                        ElRentabilidad[mes - 1] = new Lbl.Charts.Element();

                                        string Fecha1Sql = anio.ToString("0000") + "-" + mes.ToString("00") + "-01";
                                        string Fecha2Sql = anio.ToString("0000") + "-" + mes.ToString("00") + "-31";

                                        decimal Facturas = this.Connection.FieldDecimal("SELECT SUM(total) FROM comprob WHERE tipo_fac IN ('FA', 'FB', 'FC', 'FE', 'FM', 'NDA', 'NDB', 'NDC', 'NDE', 'NDM') AND impresa>0 AND compra=0 AND anulada=0 AND fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        decimal NotasCredito = this.Connection.FieldDecimal("SELECT SUM(total) FROM comprob WHERE tipo_fac IN ('NCA', 'NCB', 'NCC', 'NCE', 'NCM') AND impresa>0 AND compra=0 AND anulada=0 AND fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        decimal Costo = this.Connection.FieldDecimal("SELECT SUM(costo*cantidad) FROM comprob, comprob_detalle WHERE comprob.id_comprob=comprob_detalle.id_comprob AND comprob.tipo_fac IN ('FA', 'FB', 'FC', 'FE', 'FM', 'NDA', 'NDB', 'NDC', 'NDE', 'NDM') AND comprob.compra=0 AND comprob.numero>0 AND comprob.anulada=0 AND comprob_detalle.precio>0 AND comprob.fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        decimal CostoNotasCredito = this.Connection.FieldDecimal("SELECT SUM(costo*cantidad) FROM comprob, comprob_detalle WHERE comprob.id_comprob=comprob_detalle.id_comprob AND comprob.tipo_fac IN ('NCA', 'NCB', 'NCC', 'NCE', 'NCM') AND comprob.impresa>0 AND comprob.compra=0 AND comprob.anulada=0 AND comprob.fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        //decimal CostoCapital = this.Connection.FieldDecimal("SELECT SUM(importe) FROM cajas_movim WHERE id_concepto IN (SELECT id_concepto FROM conceptos WHERE grupo=220) AND fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        decimal GastosFijos = this.Connection.FieldDecimal("SELECT SUM(importe) FROM cajas_movim WHERE id_concepto IN (SELECT id_concepto FROM conceptos WHERE grupo=230) AND fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        decimal GastosVariables = this.Connection.FieldDecimal("SELECT SUM(importe) FROM cajas_movim WHERE id_concepto IN (SELECT id_concepto FROM conceptos WHERE grupo=240) AND fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");
                                        decimal OtrosEgresos = this.Connection.FieldDecimal("SELECT SUM(importe) FROM cajas_movim WHERE importe<0 AND id_concepto IN (SELECT id_concepto FROM conceptos WHERE grupo NOT IN (110, 210, 220, 230, 240, 300)) AND id_concepto<>26030 AND fecha BETWEEN '" + Fecha1Sql + "' AND '" + Fecha2Sql + "'");

                                        ElFacturacion[mes - 1].Value = Facturas - NotasCredito;
                                        ElCosto[mes - 1].Value = Costo - CostoNotasCredito;
                                        ElGastos[mes - 1].Value = Math.Abs(GastosFijos + GastosVariables + OtrosEgresos);
                                        ElRentabilidad[mes - 1].Value = ElFacturacion[mes - 1].Value - ElCosto[mes - 1].Value - ElGastos[mes - 1].Value;
                                }

                        }
                        Lbl.Charts.Serie Serie1 = new Lbl.Charts.Serie("Facturación");
                        Lbl.Charts.Serie Serie2 = new Lbl.Charts.Serie("Gastos");
                        Lbl.Charts.Serie Serie3 = new Lbl.Charts.Serie("Rentabilidad");

                        Serie1.Elements = ElFacturacion;
                        Serie2.Elements = ElGastos;
                        Serie3.Elements = ElRentabilidad;

                        if (anio == DateTime.Now.Year) {
                                Serie1.Color = System.Drawing.Color.Goldenrod;
                                Serie2.Color = System.Drawing.Color.Red;
                                Serie3.Color = System.Drawing.Color.Green;
                        } else {
                                Serie1.Color = System.Drawing.Color.LightGoldenrodYellow;
                                Serie2.Color = System.Drawing.Color.Pink;
                                Serie3.Color = System.Drawing.Color.LightGreen;
                        }

                        Chrt.Series.Add(Serie1);
                        Chrt.Series.Add(Serie2);
                        Chrt.Series.Add(Serie3);
                }
示例#4
0
 public void Mostrar(Lui.Forms.ComboBox parentControl)
 {
         this.ControlDestino = parentControl;
         this.Size = new Size(parentControl.Width, IdealHeight);
         this.Mostrar();
 }
示例#5
0
 public Contador(string etiqueta, Lui.Forms.DataTypes dataType, string prefijo, string sufijo)
         : this(etiqueta, dataType)
 {
         this.Prefijo = prefijo;
         this.Sufijo = sufijo;
 }
示例#6
0
 public Contador(string etiqueta, Lui.Forms.DataTypes dataType)
 {
         this.Etiqueta = etiqueta;
         this.DataType = dataType;
 }
示例#7
0
 public Campo(Lui.Forms.EditableControl control, Lui.Forms.Label etiqueta)
 {
         this.ControlEntrada = control;
         this.Etiqueta = etiqueta;
 }