示例#1
0
$entrada_lote->addField("id_lote", "Lote", "combobox");
//$entrada_lote->createComboBoxJoin("id_lote", "id_lote", LoteDAO::getAll(   ) );
$entrada_lote->createComboBoxJoinDistintName("id_lote", "id_lote", "folio", LoteDAO::getAll());
$entrada_lote->setHelp("id_lote", "Lote a donde se insertara este arrivo");
$entrada_lote->addField("cantidad", "Cantidad", "text");
$este_producto = ProductoDAO::GetByPK($_GET["pid"]);
$um = UnidadMedidaDAO::getByPK($este_producto->getIdUnidad());
if (!is_null($um)) {
    $entrada_lote->setHelp("cantidad", "Cantidad en " . $um->getDescripcion());
} else {
    $entrada_lote->setHelp("cantidad", "Error!");
}
$entrada_lote->addField("productos", "", "text", "\"   [ { \\\"id_producto\\\" : " . $_GET["pid"] . ", \\\"cantidad\\\"    : 0 } ]   \"");
$entrada_lote->sendHidden("productos");
$entrada_lote->makeObligatory(array("id_lote", "cantidad"));
$entrada_lote->beforeSend("beforeSendNuevaEntrada");
$entrada_lote->addApiCall("api/almacen/lote/entrada", "POST");
$page->addComponent("<script> function beforeSendNuevaEntrada(a){ \n\t\t\t\t\tconsole.log('beforeSend(' + a + ')');\n\t\t\t\t\tvar aPdec = Ext.JSON.decode(a.productos);\n\t\t\t\t\tconsole.log(aPdec);\n\t\t\t\t\taPdec[0].cantidad = a.cantidad;\n\t\t\t\t\ta.productos = Ext.JSON.encode(aPdec);\n\t\t\t\t\treturn a;\n\t\t\t\t}</script>");
$page->addComponent($entrada_lote);
$page->nextTab("Historial");
//mostrar entradas
$entradas = LoteEntradaProductoDAO::obtenerEntradaPorProducto($_GET["pid"]);
$salidas = LoteSalidaProductoDAO::obtenerSalidaPorProducto($_GET["pid"]);
$merged = array_merge($entradas, $salidas);
function cmpByFecha($a, $b)
{
    if ($a["fecha_registro"] == $b["fecha_registro"]) {
        return 0;
    }
    return $a["fecha_registro"] < $b["fecha_registro"] ? 1 : -1;
}
示例#2
0
$form->addApiCall("api/cliente/editar/", "POST");
$form->onApiCallSuccessRedirect("clientes.ver.php?cid=" . $_GET["cid"]);
$form->renameField(array("nombre" => "razon_social", "codigo_usuario" => "codigo_cliente", "correo_electronico" => "email", "id_categoria_contacto" => "clasificacion_cliente", "id_moneda" => "moneda_del_cliente", "pagina_web" => "sitio_web", "id_sucursal" => "sucursal"));
$page->addComponent($form);
$page->nextTab("Otros");
//buscar los parametros extra
$out = ExtraParamsValoresDAO::getVals("usuarios", $este_cliente->getIdUsuario());
$epform = new FormComponent();
$epform->setEditable(true);
foreach ($out as $ep) {
    $epform->addField($ep["campo"], $ep["caption"], $ep["tipo"], $ep["val"]);
    if (!is_null($ep["descripcion"])) {
        $epform->setHelp($ep["campo"], $ep["descripcion"]);
    }
}
$epform->beforeSend("editar_extra_p");
$page->addComponent('
			<script>
				var cliente = ' . $_GET["cid"] . ';
				function editar_extra_p(obj){
					return	{
						id_cliente		: cliente,
						extra_params	: Ext.JSON.encode(obj)
					}
				}
			</script>
		');
$epform->addApiCall("api/cliente/editar/", "POST");
$page->addComponent($epform);
$page->nextTab("Direccion");
if (is_null($este_cliente->getIdDireccion())) {
示例#3
0
$f->setEditable(false);
$f->setStyle("big");
$page->addComponent($f);
/** 
 *
 *
 **/
$page->nextTab("Editar");
$f = new FormComponent();
for ($i = 0; $i < sizeof($values); $i++) {
    $f->addField($values[$i]["campo"], $values[$i]["caption"], $values[$i]["tipo"], utf8_decode($values[$i]["val"]));
}
$f->setEditable(true);
$f->setStyle("big");
$f->addApiCall("api/documento/editar", "POST");
$f->beforeSend("attachExtraParams");
$html = " <script>\n\t\t\tfunction attachExtraParams( a ) {\n\t\t\t\ta.id_documento = " . $documento->getIdDocumento() . ";\n\t\t\t\ta.extra_params = Ext.JSON.encode({ ";
for ($i = 0; $i < sizeof($values); $i++) {
    $html .= $values[$i]["campo"] . " : Ext.get(\"" . $f->getGuiComponentId() . $values[$i]["campo"] . "\" ).getValue() , ";
}
$html .= "});\n\t\t\t\treturn a;\n\t\t\t}\n\t\t</script>";
$page->addComponent($html);
$page->addComponent($f);
/** 
 *
 *
 **/
$page->nextTab("Compartir");
/** 
 *
 *
示例#4
0
文件: c.php 项目: kailIII/pos-erp
$html .= "   });";
$html .= "</script>";
// Configuracion de productos en VC
$form = new FormComponent();
$form->addField('mostrar', 'Mostrar productos', 'bool', 'mostrar');
$campos = array_keys(get_class_vars('Producto'));
foreach ($campos as $key => $campo) {
    if ($campo == "visible_en_vc") {
        unset($campos[$key]);
    } else {
        $caption = ucwords(str_replace("_", " ", $campo));
        $campos[$key] = array("id" => $campo, "caption" => $caption);
    }
}
$form->addField('propiedades', 'Propiedades *', 'listbox', $campos, 'propiedades');
$form->beforeSend('attachPropiedades');
$form->addApiCall('api/pos/configuracion/vistas/clientes');
$html .= <<<EOD
    <script type='text/javascript' charset='utf-8'>
        function attachPropiedades(o) {
            o.propiedades = getParams();
            console.log(o.propiedades);
            return o;
        }

        function getParams() {
            var options = Ext.DomQuery.jsSelect('select[name=propiedades] > option');
            var params = new Array();
            for (var i = 0; i < options.length; i++) {
                if (options[i].selected) {
                    params.push(options[i].value);