Пример #1
0
 function formModificarSubfamilia($action, $mud, $muc, $dsto, $tipocosto)
 {
     $ot = getTemplate("ModificarSubFamilia");
     if (!$ot) {
         return false;
     }
     //$comboidiomas = genComboIdiomas($this->get("IdIdioma"));
     //$comboperfiles = genComboPerfiles($this->get("IdPerfil"));
     $xcheck = $mud != 'MUD' ? 'checked="checked"' : '';
     $xmutc = $mud != 'MUD' ? 'visible' : 'hidden';
     $xcp = $tipocosto == 'CP' ? 'selected' : '';
     $xuc = $tipocosto == 'UC' ? 'selected' : '';
     $xmud = $mud != 'MUD' ? CleanFloat($mud) : $this->get("MargenUtilidadVD");
     $xmuc = $muc != 'MUC' ? CleanFloat($muc) : $this->get("MargenUtilidadVC");
     $xdsto = $dsto != 'DSTO' ? CleanFloat($dsto) : $this->get("Descuento");
     $xlist = ListaProductosxSubFamilia($this->get("IdFamilia"), $this->get("IdSubFamilia"), $xmud, $xmuc, $xdsto, $tipocosto);
     $oFam = new familia();
     $oFam->Load($this->get("IdFamilia"));
     $NomFamilia = $oFam->get("Familia");
     $cambios = array("tTitulo" => _("Modificando ") . $NomFamilia . "/" . $this->get("SubFamilia"), "tSubFamilia" => _("Nombre"), "vSubFamilia" => $this->get("SubFamilia"), "vIdFamilia" => $this->get("IdFamilia"), "tMargenUtilidadVD" => _("Margen de Utilidad VP"), "vMargenUtilidadVD" => $xmud, "tMargenUtilidadVC" => _("Margen de Utilidad VC"), "vMargenUtilidadVC" => $xmuc, "tDescuento" => _("Descuento"), "vDescuento" => $xdsto, "vLista" => $xlist, "vIdBase" => $this->getId(), "vRecalcular" => $xcheck, "vCP" => $xcp, "vUC" => $xuc, "vMUTC" => $xmutc, "action" => $action, "HIDDENDATA" => Hidden("id", $this->getId()) . Hidden("IdFamilia", $this->get("IdFamilia")));
     return $ot->makear($cambios);
 }
Пример #2
0
function BorrarFamilia($id)
{
    $oFamilia = new familia();
    $id = CleanID($id);
    if ($oFamilia->Load($id)) {
        $nombre = $oFamilia->getNombre();
        echo gas("Aviso", _("Familia {$nombre} borrado"));
        $oFamilia->EliminarFamilia();
    } else {
        echo gas("Aviso", _("No se ha podido borrar la familia"));
    }
}