Esempio n. 1
0
    function dataedit()
    {
        $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
        $formato = $this->datasis->dameval('SELECT formato FROM cemp LIMIT 0,1');
        $qformato = '%';
        for ($i = 1; $i < substr_count($formato, '.') + 1; $i++) {
            $qformato .= '.%';
        }
        $this->qformato = $qformato;
        $modbusp = array('tabla' => 'scli', 'columnas' => array('cliente' => 'C&oacute;digo Cliente', 'nombre' => 'Nombre', 'dire11' => 'Direcci&oacute;n', 'rifci' => 'Rif/CI'), 'filtro' => array('cliente' => 'C&oacute;digo Cliente', 'nombre' => 'Nombre'), 'retornar' => array('cliente' => 'cod_cli'), 'titulo' => 'Buscar Cliente');
        $boton = $this->datasis->modbus($modbusp);
        //Script necesario para totalizar los detalles
        $modbus = array('tabla' => 'sinv', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'retornar' => array('codigo' => 'codigo<#i#>'), 'p_uri' => array(4 => '<#i#>'), 'titulo' => 'Buscar Articulo');
        $fdepar = new dropdownField("ccosto", "ccosto");
        $fdepar->options("SELECT depto,descrip FROM dpto WHERE tipo='G' ORDER BY descrip");
        $fdepar->status = 'create';
        $fdepar->build();
        $dpto = $fdepar->output;
        $dpto = trim($dpto);
        $dpto = preg_replace('/\\n/i', '', $dpto);
        $uri = site_url("/contabilidad/casi/dpto/");
        $script = '
 		function totalizar(){
 			monto=debe=haber=0;
 			amonto=$$(\'input[id^="monto"]\');
			for(var i=0; i<amonto.length; i++) {
    		valor=parseFloat(amonto[i].value);
    		if (isNaN(valor))
					valor=0.0;
				if (valor>0)
    			haber=haber+valor;
    		else{
    			valor=valor*(-1);
    			debe=debe+valor;
    		}
				$("haber").value=haber;
    		$("debe").value=debe;
				$("total").value=haber-debe;
			}
		}
		function departa(i){
			ccosto=$F(\'ccosto\'+i.toString())
			if (ccosto==\'S\'){
				//alert("come una matina");
				departamen=window.open("' . $uri . '/"+i.toString(),"buscardeparta","width=500,height=200,scrollbars=Yes,status=Yes,resizable=Yes,screenx=5,screeny=5,top="+ ((screen.height - 200) / 2) + ",left=" + ((screen.width - 500) / 2)); 
				departamen.focus();
				//new Insertion.Before(\'departa\'+i.toString(), \'' . $dpto . '\')
			}
		}
		';
        $edit = new DataEdit(" otrosingresos", "otin");
        $edit->post_process("insert", "_guarda_detalle");
        $edit->post_process("update", "_actualiza_detalle");
        $edit->post_process("delete", "_borra_detalle");
        $edit->pre_process('insert', '_pre_insert');
        $edit->back_url = "ventas/ otin";
        $edit->fecha = new DateonlyField("Fecha", "fecha", "d/m/Y");
        $edit->fecha->insertValue = date("Y-m-d");
        $edit->fecha->mode = "autohide";
        $edit->fecha->size = 10;
        $edit->vence = new DateonlyField("Vence", "vence", "d/m/Y");
        $edit->vence->insertValue = date("Y-m-d");
        $edit->vence->size = 10;
        $edit->numero = new inputField("N&uacute;mero", "numero");
        $edit->numero->size = 10;
        $edit->numero->rule = "required";
        $edit->numero->mode = "autohide";
        $edit->numero->maxlength = 8;
        $edit->nombre = new inputField("Nombre", "nombre");
        $edit->nombre->size = 55;
        $edit->nombre->maxlength = 40;
        $edit->iva = new inputField("IVA", "iva");
        $edit->iva->size = 20;
        $edit->iva->css_class = 'inputnum';
        $edit->subtotal = new inputField("Sub.Total", "totals");
        $edit->subtotal->size = 20;
        $edit->subtotal->css_class = 'inputnum';
        $edit->total = new inputField("Total", "totalg");
        $edit->total->size = 20;
        $edit->total->css_class = 'inputnum';
        $edit->cliente = new inputField("Cliente", "cod_cli");
        $edit->cliente->size = 10;
        $edit->cliente->maxlength = 5;
        $edit->cliente->append($boton);
        $edit->rifci = new inputField("RIF/CI", "rifci");
        $edit->rifci->size = 20;
        $edit->direc = new inputField("Direcci&oacute;n", "direc");
        $edit->direc->size = 55;
        $edit->dire1 = new inputField(" ", "dire1");
        $edit->dire1->size = 55;
        $edit->observaciones = new inputField("Observaciones", "observa1");
        $edit->observaciones->size = 40;
        $edit->observaciones1 = new inputField("Observaciones", "observa2");
        $edit->observaciones1->size = 40;
        $edit->orden = new inputField("Orden", "orden");
        $edit->orden->size = 20;
        $edit->tipo = new dropdownField("Tipo", "tipo_doc");
        $edit->tipo->option("FC", "FC");
        $edit->tipo->option("ND", "ND");
        $edit->tipo->option("OT", "OT");
        $edit->tipo->size = 20;
        $edit->tipo->style = 'width:70px;';
        $numero = $edit->_dataobject->get('numero');
        $tipo = $edit->_dataobject->get('tipo_doc');
        $detalle = new DataDetalle($edit->_status);
        //Campos para el detalle
        $detalle->db->select('codigo,descrip,precio,impuesto,importe');
        $detalle->db->from('itotin');
        $detalle->db->where("numero='{$numero}'");
        $detalle->db->where("tipo_doc='{$tipo}'");
        $detalle->codigo = new inputField("C&oacute;digo", "codigo<#i#>");
        $detalle->codigo->size = 18;
        $detalle->codigo->db_name = 'codigo';
        $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
        $detalle->codigo->readonly = TRUE;
        $detalle->descripcion = new inputField("Descripci&oacute;n", "descrip<#i#>");
        $detalle->descripcion->size = 30;
        $detalle->descripcion->db_name = 'descrip';
        $detalle->descripcion->maxlength = 12;
        $detalle->precio = new inputField("Precio", "precio<#i#>");
        $detalle->precio->css_class = 'inputnum';
        $detalle->precio->size = 20;
        $detalle->precio->db_name = 'precio';
        $detalle->impuesto = new inputField("Impuesto", "impuesto<#i#>");
        $detalle->impuesto->css_class = 'inputnum';
        $detalle->impuesto->size = 20;
        $detalle->impuesto->db_name = 'impuesto';
        $detalle->total = new inputField2("Total", "importe<#i#>");
        $detalle->total->db_name = 'importe';
        $detalle->total->size = 20;
        $detalle->total->css_class = 'inputnum';
        //fin de campos para detalle
        $detalle->onDelete('totalizar()');
        $detalle->onAdd('totalizar()');
        $detalle->script($script);
        $detalle->style = "width:110px";
        //Columnas del detalle
        $detalle->column("C&oacute;digo", "<#codigo#>");
        $detalle->column("Descripci&oacute;n", "<#descripcion#>");
        $detalle->column("Precio", "<#precio#>");
        $detalle->column("Impuesto", "<#impuesto#>");
        $detalle->column("Total", "<#total#>");
        $detalle->build();
        $conten["detalle"] = $detalle->output;
        $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
        $edit->buttons("save", "undo", "back");
        $edit->build();
        $smenu['link'] = barra_menu('122');
        $data['smenu'] = $this->load->view('view_sub_menu', $smenu, true);
        $conten["form"] =& $edit;
        $data['content'] = $this->load->view('view_otrosingresos', $conten, true);
        $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
        $data['title'] = '<h1>Otros Ingresos</h1>';
        $this->load->view('view_ventanas', $data);
    }
Esempio n. 2
0
    function dataedit()
    {
        $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
        $formato = $this->datasis->dameval('SELECT formato FROM cemp LIMIT 0,1');
        $qformato = '%';
        for ($i = 1; $i < substr_count($formato, '.') + 1; $i++) {
            $qformato .= '.%';
        }
        $this->qformato = $qformato;
        $modbus = array('tabla' => 'cpla', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'Descripci&oacute;n'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'Descripci&oacute;n'), 'retornar' => array('codigo' => 'cuenta<#i#>', 'descrip' => 'concepto<#i#>', 'departa' => 'ccosto<#i#>'), 'titulo' => 'Buscar Cuenta', 'p_uri' => array(4 => '<#i#>'), 'where' => "codigo LIKE \"{$qformato}\"", 'script' => array('departa(<#i#>)'));
        //Script necesario para totalizar los detalles
        $fdepar = new dropdownField("ccosto", "ccosto");
        $fdepar->options("SELECT depto,descrip FROM dpto WHERE tipo='G' ORDER BY descrip");
        $fdepar->status = 'create';
        $fdepar->build();
        $dpto = $fdepar->output;
        $dpto = trim($dpto);
        $dpto = preg_replace('/\\n/i', '', $dpto);
        $uri = site_url("/contabilidad/casi/dpto/");
        $script = '
 		function totalizar(){
 			monto=debe=haber=0;
 			amonto=$$(\'input[id^="monto"]\');
			for(var i=0; i<amonto.length; i++) {
    		valor=parseFloat(amonto[i].value);
    		if (isNaN(valor))
					valor=0.0;
				if (valor>0)
    			haber=haber+valor;
    		else{
    			valor=valor*(-1);
    			debe=debe+valor;
    		}
				$("haber").value=haber;
    		$("debe").value=debe;
				$("total").value=haber-debe;
			}
		}
		function departa(i){
			ccosto=$F(\'ccosto\'+i.toString())
			if (ccosto==\'S\'){
				//alert("come una matina");
				departamen=window.open("' . $uri . '/"+i.toString(),"buscardeparta","width=500,height=200,scrollbars=Yes,status=Yes,resizable=Yes,screenx=5,screeny=5,top="+ ((screen.height - 200) / 2) + ",left=" + ((screen.width - 500) / 2)); 
				departamen.focus();
				//new Insertion.Before(\'departa\'+i.toString(), \'' . $dpto . '\')
			}
		}
		';
        $edit = new DataEdit("Asientos", "casi");
        $edit->_dataobject->db->set('transac', 'MANUAL');
        $edit->_dataobject->db->set('origen', 'MANUAL');
        $edit->_dataobject->db->set('usuario', $this->session->userdata('usuario'));
        $edit->_dataobject->db->set('hora', 'CURRENT_TIME()', FALSE);
        $edit->_dataobject->db->set('estampa', 'NOW()', FALSE);
        $edit->post_process("insert", "_guarda_detalle");
        $edit->post_process("update", "_actualiza_detalle");
        $edit->post_process("delete", "_borra_detalle");
        $edit->pre_process('delete', '_pre_del');
        $edit->back_url = "contabilidad/casi";
        $edit->fecha = new DateonlyField("Fecha", "fecha", "d/m/Y");
        $edit->fecha->insertValue = date("Y-m-d");
        $edit->fecha->mode = "autohide";
        $edit->fecha->size = 10;
        $edit->numero = new inputField("N&uacute;mero", "comprob");
        $edit->numero->size = 10;
        $edit->numero->rule = "required";
        $edit->numero->mode = "autohide";
        $edit->numero->maxlength = 8;
        $edit->proveed = new inputField("C&oacute;digo", "proveed");
        $edit->proveed->size = 7;
        $edit->proveed->rule = "required";
        $edit->proveed->mode = "autohide";
        $edit->proveed->maxlength = 5;
        $edit->nombre = new inputField("Nombre", "nombre");
        $edit->nombre->size = 20;
        $edit->nombre->maxlength = 40;
        $edit->descrip = new inputField("Descripci&oacute;n", "descrip");
        $edit->descrip->maxlength = 60;
        $edit->debe = new inputField2("Debe", "debe");
        $edit->debe->size = 30;
        $edit->debe->css_class = 'inputnum';
        $edit->debe->readonly = TRUE;
        $edit->haber = new inputField2("Haber", "haber");
        $edit->haber->size = 30;
        $edit->haber->css_class = 'inputnum';
        $edit->haber->readonly = TRUE;
        $edit->total = new inputField("Saldo", "total");
        $edit->total->size = 25;
        $edit->total->css_class = 'inputnum';
        $edit->total->readonly = TRUE;
        $edit->status = new dropdownField("Status", "status");
        $edit->status->style = "width:110px";
        $edit->status->option("A", "Actualizado");
        $edit->status->option("D", "Diferido");
        $comprob = $edit->_dataobject->get('comprob');
        $detalle = new DataDetalle($edit->_status);
        //Campos para el detalle
        $detalle->db->select('cuenta,referen,concepto,ccosto, debe-haber AS monto');
        $detalle->db->from('itcasi');
        $detalle->db->where("comprob='{$comprob}'");
        $detalle->cuenta = new inputField2("Cuenta", "cuenta<#i#>");
        $detalle->cuenta->size = 11;
        $detalle->cuenta->db_name = 'cuenta';
        $detalle->cuenta->append($this->datasis->p_modbus($modbus, '<#i#>'));
        $detalle->cuenta->readonly = TRUE;
        $detalle->referencia = new inputField("Referencia", "referen<#i#>");
        $detalle->referencia->size = 15;
        $detalle->referencia->db_name = 'referen';
        $detalle->referencia->maxlength = 12;
        $detalle->concepto = new inputField("Concepto", "concepto<#i#>");
        $detalle->concepto->size = 30;
        $detalle->concepto->db_name = 'concepto';
        $detalle->concepto->maxlength = 60;
        $detalle->monto = new inputField("Monto", "monto<#i#>");
        $detalle->monto->css_class = 'inputnum';
        $detalle->monto->onchange = 'totalizar()';
        $detalle->monto->size = 20;
        $detalle->monto->db_name = 'monto';
        $detalle->departa = new inputField2("Centro Costo", "ccosto<#i#>");
        $detalle->departa->type = 'hidden';
        $detalle->departa->db_name = 'ccosto';
        $detalle->departa->onchange = 'departa(<#i#>)';
        //fin de campos para detalle
        $detalle->onDelete('totalizar()');
        $detalle->onAdd('totalizar()');
        $detalle->script($script);
        $detalle->style = "width:110px";
        //Columnas del detalle
        $detalle->column("Cuenta", "<#cuenta#>");
        $detalle->column("Referencia", "<#referencia#>");
        $detalle->column("Concepto", "<#concepto#>");
        $detalle->column("Monto", "<#monto#><#departa#>", 'align=right');
        $detalle->build();
        $conten["detalle"] = $detalle->output;
        $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
        $edit->buttons("modify", "save", "undo", "delete", "back");
        $edit->build();
        $conten["form"] =& $edit;
        $data['content'] = $this->load->view('view_gastos', $conten, true);
        $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
        $data['title'] = '<h1>Asientos Contables</h1>';
        $this->load->view('view_ventanas', $data);
    }
Esempio n. 3
0
 function dataedit()
 {
     $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
     $formato = $this->datasis->dameval('SELECT formato FROM cemp LIMIT 0,1');
     $qformato = '%';
     for ($i = 1; $i < substr_count($formato, '.') + 1; $i++) {
         $qformato .= '.%';
     }
     $this->qformato = $qformato;
     $modbus = array('tabla' => 'sinv', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'retornar' => array('codigo' => 'codigo<#i#>', 'descrip' => 'descrip<#i#>'), 'p_uri' => array(4 => '<#i#>'), 'titulo' => 'Buscar Articulo');
     $edit = new DataEdit("recetas", "rece");
     $edit->post_process("insert", "_guarda_detalle");
     $edit->post_process("update", "_actualiza_detalle");
     $edit->post_process("delete", "_borra_detalle");
     $edit->pre_process('insert', '_pre_insert');
     $edit->back_url = "hospitalidad/recetas";
     $edit->codigo = new inputField("C&oacute;digo", "codigo");
     $edit->codigo->size = 10;
     $edit->codigo->maxlength = 8;
     $edit->codigo->rule = "trim|required";
     $edit->codigo->mode = "autohide";
     $edit->descri1 = new inputField("Descripci&oacute;n", "descri1");
     $edit->descri1->size = 55;
     $edit->descri1->maxlength = 40;
     $edit->descri1->rule = "trim|required";
     $edit->precio = new inputField("Precio", "precio");
     $edit->precio->size = 20;
     $edit->precio->css_class = 'inputnum';
     $edit->precio->rule = 'trim';
     $edit->fecha = new DateonlyField("Fecha", "fecha", "d/m/Y");
     $edit->fecha->insertValue = date("Y-m-d");
     $edit->fecha->mode = "autohide";
     $edit->fecha->size = 10;
     $edit->fecha->maxlength = 10;
     $edit->fecha->rule = "required";
     $edit->total = new inputField("Total", "costo");
     $edit->total->size = 20;
     $edit->total->css_class = 'inputnum';
     $edit->total->rule = 'trim';
     $edit->rela = new inputField("Relacion Costo/Precio", "rela");
     $edit->rela->size = 20;
     $edit->rela->rule = "trim|required";
     $codigo = $edit->_dataobject->get('codigo');
     $detalle = new DataDetalle($edit->_status);
     //Campos para el detalle
     $detalle->db->select('codigo,descrip,cantidad,rendi,costo,monto');
     $detalle->db->from('itrece');
     $detalle->db->where("menu='{$codigo}'");
     $detalle->codigo = new inputField("C&oacute;digo", "codigo<#i#>");
     $detalle->codigo->size = 10;
     $detalle->codigo->maxlength = 15;
     $detalle->codigo->db_name = 'codigo';
     $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
     $detalle->codigo->readonly = TRUE;
     $detalle->codigo->rule = "trim";
     $detalle->descrip = new inputField("Descripci&oacute;n", "descrip<#i#>");
     $detalle->descrip->size = 30;
     $detalle->descrip->maxlength = 45;
     $detalle->descrip->db_name = 'descrip';
     $detalle->descrip->rule = 'trim';
     $detalle->cantidad = new inputField("Cantidad", "cantidad<#i#>");
     $detalle->cantidad->size = 10;
     $detalle->cantidad->maxlength = 13;
     $detalle->cantidad->db_name = 'cantidad';
     $detalle->cantidad->css_class = 'inputnum';
     $detalle->cantidad->rule = 'trim';
     $detalle->rendi = new inputField("Rendimiento", "rendi<#i#>");
     $detalle->rendi->size = 10;
     $detalle->rendi->maxlength = 11;
     $detalle->rendi->db_name = 'rendi';
     $detalle->rendi->css_class = 'inputnum';
     $detalle->rendi->rule = 'trim';
     $detalle->costo = new inputField("Costo", "costo<#i#>");
     $detalle->costo->css_class = 'inputnum';
     $detalle->costo->size = 10;
     $detalle->costo->db_name = 'costo';
     $detalle->costo->rule = 'trim';
     $detalle->monto = new inputField2("Total", "monto<#i#>");
     $detalle->monto->db_name = 'monto';
     $detalle->monto->size = 10;
     $detalle->monto->css_class = 'inputnum';
     $detalle->monto->rule = 'trim';
     //fin de campos para detalle
     $detalle->onDelete('totalizar()');
     $detalle->onAdd('totalizar()');
     //$detalle->script($script);
     $detalle->style = "width:110px";
     //Columnas del detalle
     $detalle->column("C&oacute;digo", "<#codigo#>");
     $detalle->column("Descripci&oacute;n", "<#descrip#>");
     $detalle->column("Ctd", "<#cantidad#>");
     $detalle->column("Rd%", "<#rendi#>");
     $detalle->column("Costo", "<#costo#>");
     $detalle->column("Total", "<#monto#>");
     $detalle->build();
     $conten["detalle"] = $detalle->output;
     $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
     $edit->buttons("save", "undo", "delete", "back", "modify");
     $edit->build();
     //$smenu['link']=barra_menu('103');
     //$data['smenu'] = $this->load->view('view_sub_menu', $smenu,true);
     $conten["form"] =& $edit;
     $data['content'] = $this->load->view('view_recetas', $conten, true);
     $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
     $data['title'] = '<h1>Recetas</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 4
0
 function dataedit()
 {
     $this->rapyd->load("dataedit", "datadetalle");
     $modbus = array('tabla' => 'sinv', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'retornar' => array('codigo' => 'codigo<#i#>', 'precio1' => 'precio1<#i#>', 'precio2' => 'precio2<#i#>', 'precio3' => 'precio3<#i#>', 'precio4' => 'precio4<#i#>', 'iva' => 'iva<#i#>', 'pond' => 'costo<#i#>'), 'p_uri' => array(4 => '<#i#>'), 'titulo' => 'Buscar Articulo');
     $edit = new DataEdit("Transferencia", "stra");
     $edit->_dataobject->db->set('usuario', $this->session->userdata('usuario'));
     $edit->_dataobject->db->set('hora', 'CURRENT_TIME()', FALSE);
     $edit->_dataobject->db->set('estampa', 'NOW()', FALSE);
     $edit->post_process("insert", "_guarda_detalle");
     $edit->post_process("update", "_actualiza_detalle");
     $edit->post_process("delete", "_borra_detalle");
     $edit->pre_process('delete', '_pre_del');
     $edit->pre_process('insert', '_pre_insert');
     $edit->back_url = "inventario/transferencia/";
     $edit->fecha = new DateonlyField("Fecha", "fecha", "d/m/Y");
     $edit->fecha->insertValue = date("Y-m-d");
     $edit->fecha->size = 10;
     $edit->numero = new inputField2("N&uacute;mero", "numero");
     $edit->numero->size = 10;
     $edit->numero->mode = "autohide";
     $edit->numero->maxlength = 8;
     $edit->numero->readonly = TRUE;
     $edit->observ1 = new inputField("Observaci&oacute;n", "observ1");
     $edit->observ1->maxlength = 30;
     $edit->observ1->size = 40;
     $edit->observ2 = new inputField("Observaci&oacute;n", "observ2");
     $edit->observ2->maxlength = 30;
     $edit->observ2->size = 40;
     $edit->envia = new inputField("Env&iacute;a", "envia");
     $edit->envia->append($this->datasis->p_modbus($this->modbus, 'envia'));
     $edit->envia->size = 7;
     $edit->envia->maxlength = 4;
     $edit->recibe = new inputField("Recibe", "recibe");
     $edit->recibe->append($this->datasis->p_modbus($this->modbus, 'recibe'));
     $edit->recibe->size = 7;
     $edit->recibe->maxlength = 4;
     $numero = $edit->_dataobject->get('numero');
     $detalle = new DataDetalle($edit->_status);
     //Campos para el detalle
     $detalle->db->select('codigo,descrip,cantidad, precio1,precio2,precio3,precio4,iva,costo');
     $detalle->db->from('itstra');
     $detalle->db->where("numero='{$numero}'");
     $detalle->codigo = new inputField2("Codigo", "codigo<#i#>");
     $detalle->codigo->size = 11;
     $detalle->codigo->db_name = 'codigo';
     $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
     $detalle->codigo->readonly = TRUE;
     $detalle->descrip = new inputField("Referencia", "descrip<#i#>");
     $detalle->descrip->size = 15;
     $detalle->descrip->db_name = 'descrip';
     $detalle->descrip->maxlength = 12;
     $detalle->cantidad = new inputField("Monto", "cantidad<#i#>");
     $detalle->cantidad->css_class = 'inputnum';
     $detalle->cantidad->size = 20;
     $detalle->cantidad->db_name = 'cantidad';
     for ($i = 1; $i <= 4; $i++) {
         $objeto = "precio{$i}";
         $detalle->{$objeto} = new inputField2("Precio", "{$objeto}<#i#>");
         $detalle->{$objeto}->type = 'hidden';
         $detalle->{$objeto}->db_name = $objeto;
     }
     $detalle->iva = new inputField2("IVA", "iva<#i#>");
     $detalle->iva->type = 'hidden';
     $detalle->iva->db_name = 'iva';
     $detalle->costo = new inputField2("Costo", "costo<#i#>");
     $detalle->costo->type = 'hidden';
     $detalle->costo->db_name = 'costo';
     //fin de campos para detalle
     //Columnas del detalle
     $detalle->column("C&oacute;digo", "<#codigo#><#precio1#><#precio2#><#precio3#><#precio4#><#iva#><#costo#>");
     $detalle->column("Descripci&oacute;n", "<#descrip#>");
     $detalle->column("Cantidad", "<#cantidad#>");
     $detalle->build();
     $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
     $edit->buttons("save", "undo", "delete", "back");
     $edit->build();
     $conten["form"] =& $edit;
     $data['content'] = $this->load->view('view_tranferencia', $conten, true);
     $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
     $data['title'] = '<h1>Transferencia de Inventario</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 5
0
    function dataedit()
    {
        $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
        $formato = $this->datasis->dameval('SELECT formato FROM cemp LIMIT 0,1');
        $qformato = '%';
        for ($i = 1; $i < substr_count($formato, '.') + 1; $i++) {
            $qformato .= '.%';
        }
        $this->qformato = $qformato;
        $modbus = array('tabla' => 'sinv', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'retornar' => array('codigo' => 'codigo<#i#>', 'precio1' => 'precio1<#i#>', 'precio2' => 'precio2<#i#>', 'precio3' => 'precio3<#i#>', 'precio4' => 'precio4<#i#>', 'iva' => 'iva<#i#>', 'pond' => 'costo<#i#>'), 'p_uri' => array(4 => '<#i#>'), 'titulo' => 'Buscar Articulo');
        //Script necesario para totalizar los detalles
        $fdepar = new dropdownField("ccosto", "ccosto");
        $fdepar->options("SELECT depto,descrip FROM dpto WHERE tipo='G' ORDER BY descrip");
        $fdepar->status = 'create';
        $fdepar->build();
        $dpto = $fdepar->output;
        $dpto = trim($dpto);
        $dpto = preg_replace('/\\n/i', '', $dpto);
        $uri = site_url("/contabilidad/casi/dpto/");
        $script = '
 		function totalizar(){
 			monto=debe=haber=0;
 			amonto=$$(\'input[id^="monto"]\');
			for(var i=0; i<amonto.length; i++) {
    		valor=parseFloat(amonto[i].value);
    		if (isNaN(valor))
					valor=0.0;
				if (valor>0)
    			haber=haber+valor;
    		else{
    			valor=valor*(-1);
    			debe=debe+valor;
    		}
				$("haber").value=haber;
    		$("debe").value=debe;
				$("total").value=haber-debe;
			}
		}
		function departa(i){
			ccosto=$F(\'ccosto\'+i.toString())
			if (ccosto==\'S\'){
				//alert("come una matina");
				departamen=window.open("' . $uri . '/"+i.toString(),"buscardeparta","width=500,height=200,scrollbars=Yes,status=Yes,resizable=Yes,screenx=5,screeny=5,top="+ ((screen.height - 200) / 2) + ",left=" + ((screen.width - 500) / 2)); 
				departamen.focus();
				//new Insertion.Before(\'departa\'+i.toString(), \'' . $dpto . '\')
			}
		}
		';
        $edit = new DataEdit("Compras", "scst");
        /*		
        		$edit->_dataobject->db->set('transac', 'MANUAL');
        		$edit->_dataobject->db->set('origen' , 'MANUAL');
        		$edit->_dataobject->db->set('usuario', $this->session->userdata('usuario'));
        		$edit->_dataobject->db->set('hora'   , 'CURRENT_TIME()', FALSE);
        		$edit->_dataobject->db->set('estampa', 'NOW()', FALSE);
        		
        		$edit->post_process("insert","_guarda_detalle");
        		$edit->post_process("update","_actualiza_detalle");
        		$edit->post_process("delete","_borra_detalle");
        		$edit->pre_process('delete','_pre_del');
        */
        $edit->back_url = "finanzas/compras";
        $edit->fecha = new DateonlyField("Fecha", "fecha", "d/m/Y");
        $edit->fecha->insertValue = date("Y-m-d");
        $edit->fecha->mode = "autohide";
        $edit->fecha->size = 10;
        $edit->vence = new DateonlyField("Vence", "vence", "d/m/Y");
        $edit->vence->insertValue = date("Y-m-d");
        $edit->vence->size = 10;
        $edit->numero = new inputField("N&uacute;mero", "numero");
        $edit->numero->size = 10;
        $edit->numero->rule = "required";
        $edit->numero->mode = "autohide";
        $edit->numero->maxlength = 8;
        $edit->proveedor = new inputField("Proveedor", "proveed");
        $edit->proveedor->size = 10;
        $edit->proveedor->maxlength = 5;
        $edit->nombre = new inputField("Nombre", "nombre");
        $edit->nombre->size = 50;
        $edit->nombre->maxlength = 40;
        $edit->cfis = new inputField("C.fis", "nfiscal");
        $edit->cfis->size = 15;
        $edit->cfis->maxlength = 8;
        $edit->almacen = new inputField("Almance", "depo");
        $edit->almacen->size = 15;
        $edit->almacen->maxlength = 8;
        $edit->tipo = new dropdownField("Tipo", "tipo_doc");
        $edit->tipo->option("FC", "Factura");
        $edit->tipo->option("NC", "Nota Credito");
        $edit->tipo->option("NE", "Nota de Entrega");
        $edit->tipo->rule = "required";
        $edit->tipo->size = 20;
        $edit->tipo->style = 'width:150px;';
        $edit->peso = new inputField2("Peso", "peso");
        $edit->peso->size = 20;
        $edit->peso->css_class = 'inputnum';
        $edit->orden = new inputField("Orden", "orden");
        $edit->orden->size = 15;
        $edit->credito = new inputField("Credito", "credito");
        $edit->credito->size = 20;
        $edit->credito->css_class = 'inputnum';
        $edit->subt = new inputField("Subt", "montotot");
        $edit->subt->size = 20;
        $edit->subt->css_class = 'inputnum';
        $edit->iva = new inputField("IVA", "montoiva");
        $edit->iva->size = 20;
        $edit->iva->css_class = 'inputnum';
        $edit->total = new inputField("Total", "montonet");
        $edit->total->size = 20;
        $edit->total->css_class = 'inputnum';
        $edit->anticipo = new inputField("Anticipo", "anticipo");
        $edit->anticipo->size = 20;
        $edit->anticipo->css_class = 'inputnum';
        $edit->contado = new inputField("Contado", "inicial");
        $edit->contado->size = 20;
        $edit->contado->css_class = 'inputnum';
        $edit->rislr = new inputField("R.ISLR", "flete");
        $edit->rislr->size = 20;
        $edit->rislr->css_class = 'inputnum';
        $edit->riva = new inputField("R.IVA", "reteiva");
        $edit->riva->size = 20;
        $edit->riva->css_class = 'inputnum';
        $edit->monto = new inputField("Monto\$", "mdolar");
        $edit->monto->size = 20;
        $edit->monto->css_class = 'inputnum';
        $numero = $edit->_dataobject->get('numero');
        $detalle = new DataDetalle($edit->_status);
        //Campos para el detalle
        $detalle->db->select('codigo,descrip,cantidad,costo,importe');
        $detalle->db->from('itscst');
        $detalle->db->where("numero='{$numero}'");
        $detalle->codigo = new inputField("Codigo", "codigo<#i#>");
        $detalle->codigo->size = 10;
        $detalle->codigo->db_name = 'codigo';
        $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
        $detalle->codigo->readonly = TRUE;
        $detalle->descripcion = new inputField("Descripci&oacute;n", "descrip<#i#>");
        $detalle->descripcion->size = 30;
        $detalle->descripcion->db_name = 'descrip';
        $detalle->descripcion->maxlength = 12;
        $detalle->cantidad = new inputField("Cantidad", "cantidad<#i#>");
        $detalle->cantidad->size = 10;
        $detalle->cantidad->db_name = 'cantidad';
        $detalle->cantidad->maxlength = 60;
        $detalle->cantidad->css_class = 'inputnum';
        $detalle->precio = new inputField("Precio", "costo<#i#>");
        $detalle->precio->css_class = 'inputnum';
        $detalle->precio->onchange = 'totalizar()';
        $detalle->precio->size = 20;
        $detalle->precio->db_name = 'costo';
        $detalle->importe = new inputField2("Importe", "importe<#i#>");
        $detalle->importe->db_name = 'importe';
        $detalle->importe->css_class = 'inputnum';
        $detalle->importe->size = 20;
        //fin de campos para detalle
        $detalle->onDelete('totalizar()');
        $detalle->onAdd('totalizar()');
        $detalle->script($script);
        $detalle->style = "width:110px";
        //Columnas del detalle
        $detalle->column("Codigo", "<#codigo#>");
        $detalle->column("Descripci&oacute;n", "<#descripcion#>");
        $detalle->column("Cantidad", "<#cantidad#>");
        $detalle->column("Precio", "<#precio#>");
        $detalle->column("Importe", "<#importe#>");
        $detalle->build();
        $conten["detalle"] = $detalle->output;
        $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
        $edit->buttons("modify", "save", "undo", "delete", "back");
        $edit->build();
        $conten["form"] =& $edit;
        $data['content'] = $this->load->view('view_compras', $conten, true);
        $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
        $data['title'] = '<h1>Compras</h1>';
        $this->load->view('view_ventanas', $data);
    }
Esempio n. 6
0
 function dataedit()
 {
     $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
     $modbus = array('tabla' => 'conc', 'columnas' => array('concepto' => 'Concepto', 'tipo' => 'tipo', 'descrip' => 'Descripci&oacute;n'), 'filtro' => array('descrip' => 'Descripci&oacute;n'), 'retornar' => array('concepto' => 'concepto<#i#>', 'descrip' => 'descrip<#i#>', 'tipo' => 'tipo<#i#>'), 'titulo' => 'Buscar Cconcepto', 'p_uri' => array(4 => '<#i#>'));
     $edit = new DataEdit("Contratos", "noco");
     /*
     $edit->_dataobject->db->set('transac', 'MANUAL');
     $edit->_dataobject->db->set('origen' , 'MANUAL');
     $edit->_dataobject->db->set('usuario', $this->session->userdata('usuario'));
     $edit->_dataobject->db->set('hora'   , 'CURRENT_TIME()', FALSE);
     $edit->_dataobject->db->set('estampa', 'NOW()', FALSE);
     */
     $edit->post_process("insert", "_guarda_detalle");
     $edit->post_process("update", "_actualiza_detalle");
     $edit->post_process("delete", "_borra_detalle");
     $edit->pre_process('delete', '_pre_del');
     $edit->back_url = "nomina/noco";
     $edit->codigo = new inputField("C&oacute;digo", "codigo");
     $edit->codigo->size = 10;
     $edit->codigo->rule = "required";
     $edit->codigo->mode = "autohide";
     $edit->codigo->maxlength = 8;
     $edit->nombre = new inputField("Nombre", "nombre");
     $edit->nombre->maxlength = 60;
     $edit->tipo = new dropdownField("Tipo", "tipo");
     $edit->tipo->style = "width:110px";
     $edit->tipo->option("S", "Semanal");
     $edit->tipo->option("Q", "Quincenal");
     $edit->tipo->option("M", "Mensual");
     $edit->tipo->option("O", "Otro");
     $edit->observa1 = new inputField("Observaciones", "observa1");
     $edit->observa1->maxlength = 60;
     $edit->observa2 = new inputField("Observaci&oacute;n", "observa2");
     $edit->observa2->maxlength = 60;
     $codigo = $edit->_dataobject->get('codigo');
     $detalle = new DataDetalle($edit->_status);
     //Campos para el detalle
     $detalle->db->select('concepto,descrip,tipo,grupo');
     $detalle->db->from('itnoco');
     $detalle->db->where("codigo='{$codigo}'");
     $detalle->codigo = new inputField2("C&oacute;digo", "concepto<#i#>");
     $detalle->codigo->size = 11;
     $detalle->codigo->db_name = 'concepto';
     $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
     $detalle->codigo->readonly = TRUE;
     $detalle->descrip = new inputField("Descripci&oacute;n", "descrip<#i#>");
     $detalle->descrip->size = 45;
     $detalle->descrip->db_name = 'descrip';
     $detalle->descrip->maxlength = 60;
     $detalle->tipo = new inputField("Tipo", "tipo<#i#>");
     $detalle->tipo->size = 2;
     $detalle->tipo->db_name = 'tipo';
     $detalle->grupo = new inputField2("Grupo", "grupo<#i#>");
     $detalle->grupo->size = 5;
     $detalle->grupo->db_name = 'grupo';
     //fin de campos para detalle
     /*		
     $detalle->onDelete('totalizar()');
     $detalle->onAdd('totalizar()');
     $detalle->script($script);
     */
     //$detalle->style="width:110px";
     //Columnas del detalle
     $detalle->column("C&oacute;digo", "<#codigo#>");
     $detalle->column("Descripci&oacute;n", "<#descrip#>");
     $detalle->column("Tipo", "<#tipo#>");
     $detalle->column("Grupo", "<#grupo#>");
     $detalle->build();
     $conten["detalle"] = $detalle->output;
     $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
     $edit->buttons("modify", "save", "undo", "delete", "back");
     $edit->build();
     $conten["form"] =& $edit;
     $data['content'] = $this->load->view('view_contratos', $conten, true);
     $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
     $data['title'] = '<h1>Contratos</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 7
0
 function dataedit()
 {
     $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
     $modbus = array('tabla' => 'sinv', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'retornar' => array('codigo' => 'codigo<#i#>', 'descrip' => 'descrip<#i#>'), 'p_uri' => array(4 => '<#i#>'), 'titulo' => 'Buscar Articulo');
     $edit = new DataEdit("Conversiones", "conv");
     $edit->back_url = "inventario/conversiones";
     $edit->post_process("insert", "_guarda_detalle");
     $edit->post_process("update", "_actualiza_detalle");
     $edit->post_process("delete", "_borra_detalle");
     $edit->pre_process('delete', '_pre_del');
     $edit->pre_process('insert', '_pre_insert');
     $edit->fecha = new DateonlyField("Fecha", "fecha", "d/m/Y");
     $edit->fecha->insertValue = date("Y-m-d");
     $edit->fecha->mode = "autohide";
     $edit->fecha->size = 10;
     $edit->numero = new inputField("N&uacute;mero", "numero");
     $edit->numero->size = 10;
     $edit->numero->rule = "required";
     $edit->numero->mode = "autohide";
     $edit->numero->maxlength = 8;
     $edit->observ1 = new inputField("Observaciones", "observ1");
     $edit->observ1->size = 38;
     $edit->observ1->maxlength = 35;
     $edit->observ2 = new inputField("Observaciones", "observ2");
     $edit->observ2->size = 38;
     $edit->observ2->maxlength = 35;
     $edit->almacen = new inputField("Almacen", "almacen");
     $edit->almacen->size = 6;
     $edit->almacen->maxlength = 4;
     $numero = $edit->_dataobject->get('numero');
     $detalle = new DataDetalle($edit->_status);
     //Campos para el detalle
     $detalle->db->select('numero,codigo,descrip,entrada,salida');
     $detalle->db->from('itconv');
     $detalle->db->where("numero='{$numero}'");
     $detalle->codigo = new inputField("C&oacute;digo", "codigo<#i#>");
     $detalle->codigo->size = 15;
     $detalle->codigo->db_name = 'codigo';
     $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
     $detalle->codigo->readonly = TRUE;
     $detalle->descripcion = new inputField("Descripci&oacute;n", "descrip<#i#>");
     $detalle->descripcion->size = 30;
     $detalle->descripcion->db_name = 'descrip';
     $detalle->descripcion->maxlength = 30;
     $detalle->entrada = new inputField("Cantidad", "entrada<#i#>");
     $detalle->entrada->size = 10;
     $detalle->entrada->db_name = 'entrada';
     $detalle->entrada->maxlength = 10;
     $detalle->entrada->css_class = 'inputnum';
     $detalle->salida = new inputField("Salida", "salida<#i#>");
     $detalle->salida->css_class = 'inputnum';
     $detalle->salida->size = 20;
     $detalle->salida->db_name = 'salida';
     //fin de campos para detalle
     $detalle->onDelete('totalizar()');
     $detalle->onAdd('totalizar()');
     //$detalle->script($script);
     $detalle->style = "width:110px";
     //Columnas del detalle
     $detalle->column("C&oacute;digo", "<#codigo#>");
     $detalle->column("Descripci&oacute;n", "<#descripcion#>");
     $detalle->column("Entrada", "<#entrada#>");
     $detalle->column("Salidad", "<#salida#>");
     $detalle->build();
     $conten["detalle"] = $detalle->output;
     $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
     $edit->buttons("save", "undo", "delete", "back");
     $edit->build();
     //$smenu['link']=barra_menu('201');
     ///$data['smenu'] = $this->load->view('view_sub_menu', $smenu,true);
     $conten["form"] =& $edit;
     $data['content'] = $this->load->view('view_conversiones', $conten, true);
     $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
     $data['title'] = '<h1>Conversiones</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 8
0
 function dataedit()
 {
     $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
     $edit = new DataEdit("Arqueo de Caja", "dine");
     $edit->back_url = site_url("ventas/dine/filteredgrid");
     $edit->post_process("delete", "_borra_detalle");
     $edit->post_process('delete', '_post_delete');
     $edit->fecha = new DateonlyField("Fecha", "fecha");
     $edit->fecha->size = 12;
     $edit->numero = new inputField("N&uacute;mero", "numero");
     $edit->numero->size = 15;
     $edit->caja = new inputField("Caja", "caja");
     $edit->caja->size = 10;
     $edit->cajero = new inputField("Cajero", "cajero");
     $edit->cajero->size = 10;
     $edit->monedas = new inputField("Monedas", "monedas");
     $edit->monedas->size = 20;
     $edit->recibido = new inputField("Recibido", "recibido");
     $edit->recibido->size = 20;
     $edit->computa = new inputField("Computador", "computa");
     $edit->computa->size = 20;
     $edit->diferen = new inputField("Diferencia", "diferen");
     $edit->diferen->size = 20;
     $numero = $edit->_dataobject->get('numero');
     $detalle = new DataDetalle($edit->_status);
     $detalle->db->select('numero,tipo,referen,cantidad,denomi,compuca,compumo,total');
     $detalle->db->from('itdine');
     $detalle->db->where("numero='{$numero}'");
     $detalle->tipo = new inputField("Tipo", "tipo<#i#>");
     $detalle->tipo->size = 7;
     $detalle->tipo->db_name = 'tipo';
     $detalle->tipo->readonly = TRUE;
     $detalle->referen = new inputField("Referencia", "referen<#i#>");
     $detalle->referen->size = 30;
     $detalle->referen->db_name = 'referen';
     $detalle->cantidad = new inputField("Cantidad", "cantidad<#i#>");
     $detalle->cantidad->size = 10;
     $detalle->cantidad->db_name = 'cantidad';
     $detalle->denomi = new inputField("Denominacion", "denomi<#i#>");
     $detalle->denomi->size = 20;
     $detalle->denomi->db_name = 'denomi';
     $detalle->compuca = new inputField("Cant. Computador", "compuca<#i#>");
     $detalle->compuca->size = 20;
     $detalle->compuca->db_name = 'compuca';
     $detalle->compumo = new inputField("Monto Computador", "compumo<#i#>");
     $detalle->compumo->size = 20;
     $detalle->compumo->db_name = 'compumo';
     $detalle->total = new inputField("Total", "total<#i#>");
     $detalle->total->size = 20;
     $detalle->total->db_name = 'total';
     //fin de campos para detalle
     $detalle->onDelete('totalizar()');
     $detalle->onAdd('totalizar()');
     $detalle->style = "width:110px";
     //Columnas del detalle
     $detalle->column("Tipo", "<#tipo#>");
     $detalle->column("Referencia", "<#referen#>");
     $detalle->column("Cantidad", "<#cantidad#>");
     $detalle->column("Denominacion", "<#denomi#>");
     $detalle->column("Cant. Computador", "<#compuca#>");
     $detalle->column("Monto Computador", "<#compumo#>");
     $detalle->column("Total", "<#total#>");
     $detalle->build();
     $conten["detalle"] = $detalle->output;
     $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
     $edit->buttons("delete", "back");
     $edit->build();
     $conten["form"] =& $edit;
     $data['content'] = $this->load->view('view_dine', $conten, true);
     $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
     $data['title'] = '<h1>Arqueo de Caja</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 9
0
 function dataedit()
 {
     $this->rapyd->load("dataedit", "datadetalle", "fields", "datagrid");
     $edit = new DataEdit("Recepci&oacute;n", "hres");
     $edit->back_url = "hospitalidad/recepcion";
     $formato = $this->datasis->dameval('SELECT formato FROM cemp LIMIT 0,1');
     $qformato = '%';
     for ($i = 1; $i < substr_count($formato, '.') + 1; $i++) {
         $qformato .= '.%';
     }
     $this->qformato = $qformato;
     $edit->post_process("insert", "_guarda_detalle");
     $edit->post_process("update", "_actualiza_detalle");
     $edit->post_process("delete", "_borra_detalle");
     $edit->pre_process('insert', '_pre_insert');
     $modbus = array('tabla' => 'hgas', 'columnas' => array('cod_gas' => 'C&oacute;digo', 'descrip' => 'Descripci&oacute;n'), 'filtro' => array('cod_gas' => 'C&oacute;digo', 'descrip' => 'Descripci&oacute;n'), 'retornar' => array('cod_gas' => 'codigoa<#i#>'), 'p_uri' => array(4 => '<#i#>'), 'titulo' => 'Buscar Cargo');
     $edit->huesped = new inputField("Huesped", "nombre");
     $edit->huesped->size = 50;
     $edit->huesped->rule = "trim|required";
     $edit->huesped->maxlength = 8;
     $edit->fecha_in = new DateonlyField("Ingreso", "fecha_in", "d/m/Y");
     $edit->fecha_in->insertValue = date("Y-m-d");
     $edit->fecha_in->size = 10;
     $edit->fecha_ou = new DateonlyField("Salidad", "fecha_ou", "d/m/Y");
     $edit->fecha_ou->insertValue = date("Y-m-d");
     $edit->fecha_ou->size = 10;
     $edit->cuenta = new inputField("Cuenta", "localiza");
     $edit->cuenta->size = 10;
     $edit->cuenta->rule = "trim|required";
     $edit->cuenta->maxlength = 20;
     $edit->habit = new inputField("Habitaci&oacute;n", "habit");
     $edit->habit->size = 5;
     $edit->habit->maxlength = 5;
     $edit->habit->rule = "trim";
     $edit->ocupantes = new inputField("Nombre", "nombre");
     $edit->ocupantes->size = 50;
     $edit->ocupantes->maxlength = 40;
     $edit->ocupantes->rule = "trim";
     $edit->folio = new inputField("Folio", "folio");
     $edit->folio->size = 20;
     $edit->folio->css_class = 'inputnum';
     $edit->folio->rule = 'trim';
     $edit->otro = new inputField("Otro", "otro");
     $edit->otro->size = 20;
     $edit->otro->css_class = 'inputnum';
     $edit->otro->rule = 'trim';
     $edit->total = new inputField("Total", "total");
     $edit->total->size = 20;
     $edit->total->css_class = 'inputnum';
     $edit->total->rule = 'trim';
     $edit->saldo = new inputField("Saldo", "saldo");
     $edit->saldo->size = 20;
     $edit->saldo->css_class = 'inputnum';
     $edit->saldo->rule = 'trim';
     $localiza = $edit->_dataobject->get('localiza');
     $detalle = new DataDetalle($edit->_status);
     //Campos para el detalle
     $detalle->db->select('codigoa,fecha,refe,desca,tota');
     $detalle->db->from('hcon');
     $detalle->db->where("numa='{$localiza}'");
     $detalle->codigo = new inputField("Codigo", "codigoa<#i#>");
     $detalle->codigo->size = 10;
     $detalle->codigo->db_name = 'codigoa';
     $detalle->codigo->append($this->datasis->p_modbus($modbus, '<#i#>'));
     $detalle->codigo->readonly = TRUE;
     $detalle->codigo->rule = "trim";
     $detalle->fecha = new inputField("Fecha", "fecha<#i#>");
     $detalle->fecha->insertValue = date("Y-m-d");
     $detalle->fecha->size = 10;
     $detalle->fecha->db_name = 'fecha';
     $detalle->codigo->rule = "trim";
     $detalle->referent = new inputField("Referent", "refe<#i#>");
     $detalle->referent->size = 10;
     $detalle->referent->db_name = 'refe';
     $detalle->referent->maxlength = 12;
     $detalle->referent->rule = "trim";
     $detalle->descrip = new inputField("Descripci&oacute;n", "desca<#i#>");
     $detalle->descrip->size = 30;
     $detalle->descrip->db_name = 'desca';
     $detalle->descrip->maxlength = 12;
     $detalle->descrip->rule = "trim";
     $detalle->monto = new inputField("Monto", "tota<#i#>");
     $detalle->monto->css_class = 'inputnum';
     $detalle->monto->size = 20;
     $detalle->monto->db_name = 'tota';
     $detalle->monto->rule = "trim";
     //fin de campos para detalle
     //$detalle->onDelete("totalizar('I');");
     //$detalle->onAdd('totalizar('I')');
     //$detalle->script($script);
     $detalle->style = "width:110px";
     //Columnas del detalle
     $detalle->column("Codigo", "<#codigo#>");
     $detalle->column("Fecha", "fecha");
     $detalle->column("Referent", "<#referent#>");
     $detalle->column("Descripci&oacute;n", "<#descrip#>");
     $detalle->column("Monto", "<number_format><#monto#>|2|,|.</number_format>", 'align=right');
     $detalle->build();
     $conten["detalle"] = $detalle->output;
     $edit->detalle = new freeField("detalle", 'detalle', $detalle->output);
     $edit->buttons("save", "undo", "delete", "back", "modify");
     $edit->build();
     $conten["form"] =& $edit;
     $data['content'] = $this->load->view('view_recepcion', $conten, true);
     $data["head"] = script("tabber.js") . script("prototype.js") . $this->rapyd->get_head() . script("scriptaculous.js") . script("effects.js");
     $data['title'] = '<h1>Recepci&oacute;n</h1>';
     $this->load->view('view_ventanas', $data);
 }