public virtual ItemOrdenProduccion AddItem() { ItemOrdenProduccion Item = new ItemOrdenProduccion(); Items.Add(Item); return(Item); }
public FrmCalculoMetros(ItemOrdenProduccionServicio item, ItemOrdenProduccion itemOrdenProduccion) { InitializeComponent(); m_item = item; m_itemOrdenProduccion = itemOrdenProduccion; Mostrar(); ShowDialog(); }
public ItemOrdenProduccionServicio ObtenerServicio(OrdenProduccion m_OrdenProduccion, ItemOrdenProduccion m_ItemElemento) { ordenProduccion = m_OrdenProduccion; lcm = ordenProduccion.ListaCostosMaquina; lpe = ordenProduccion.ListaPreciosExistencia; lpt = ordenProduccion.ListaPreciosTransporte; ItemElemento = m_ItemElemento; ShowDialog(); if (SWAcept) { return Item; } return null; }
//public FrmCotizaciondeServicio(ItemCotizacionServicio m_Item) //{ // InitializeComponent(); // Item = m_Item; // Mostrar(); //} public FrmOrdenProducciondeServicio(OrdenProduccion m_OrdenProduccion, ItemOrdenProduccionServicio m_Item, ItemOrdenProduccion m_ItemElemento) { InitializeComponent(); ordenProduccion = m_OrdenProduccion; lcm = ordenProduccion.ListaCostosMaquina; lpe = ordenProduccion.ListaPreciosExistencia; lpt = ordenProduccion.ListaPreciosTransporte; ItemElemento = m_ItemElemento; Item = m_Item; Mostrar(); }
private void CalcularProduccionItem(ItemOrdenProduccion itemcosteado) { try { if (itemcosteado == null) { return; } if (itemcosteado.Operacion.Codigo.Equals("IMPRVINIL") || itemcosteado.Operacion.Nombre.Equals("IMPRESION BANNER")) { Decimal largo = itemcosteado.MedidaAbiertaLargo; Decimal alto = itemcosteado.MedidaAbiertaAlto; if (itemcosteado.UnidadMedidaAbierta.Equals("CM.")) { largo = largo / 100; alto = alto / 100; } itemcosteado.CantidadMaterial = Math.Round((itemcosteado.CantidadElemento * (largo * alto)), 0); itemcosteado.CantidadDemasiaMaterial = itemcosteado.CantidadDemasia; itemcosteado.CantidadProduccion = itemcosteado.CantidadMaterial + itemcosteado.CantidadDemasiaMaterial; //itemcosteado.CantidadMaterial += itemcosteado.CantidadDemasia; } else { Decimal mat = (itemcosteado.CantidadElemento / (itemcosteado.NroPiezasPrecorte * itemcosteado.NroPiezasImpresion)); Int32 mate = Convert.ToInt32(mat); if ((mat - mate) > 0) { itemcosteado.CantidadMaterial = mate + 1; } else { itemcosteado.CantidadMaterial = mate; } //itemcosteado.CantidadMaterial += itemcosteado.CantidadDemasia; try { itemcosteado.CantidadDemasiaMaterial = itemcosteado.CantidadDemasia / itemcosteado.NroPiezasPrecorte; } catch (Exception) { } Int32 pases = 1; if (itemcosteado.MetodoImpresion.Equals("TIRA Y RETIRA")) { pases = 2; } else if (itemcosteado.MetodoImpresion.Equals("CONTRAPINZA")) { pases = 2; } if (itemcosteado.CantidadUnidad == 0) { itemcosteado.NumeroPliegos = 1; } else { Decimal pliegos = itemcosteado.CantidadUnidad / (itemcosteado.NroPiezasImpresion * 2); Decimal entero = Math.Truncate(pliegos); Decimal paginasresiduo = entero - pliegos; itemcosteado.NumeroPliegos = Convert.ToInt32(entero); if (itemcosteado.NumeroPliegos == 0) { itemcosteado.NumeroPliegos = 1; } } itemcosteado.CantidadProduccion = (itemcosteado.CantidadMaterial + itemcosteado.CantidadDemasiaMaterial) * itemcosteado.NumerodePases * itemcosteado.NroPiezasPrecorte * pases; } } catch (Exception) { //SoftException.ShowException(ex); } }
public void MostrarServicios(ItemOrdenProduccion item) { base.ClearAllRows(ref ugServicios); foreach (ItemOrdenProduccionServicio Item in item.Servicios) { UltraGridRow Row = ugServicios.DisplayLayout.Bands[0].AddNew(); Row.Tag = Item; MostrarServicio(Row); } //MostrarTotalServicio(item); }
public void MostrarItem(ItemOrdenProduccion ItemPROD) { ActualizandoIU = true; ItemOrdenProduccion Item = ItemPROD; ItemOrdenProduccion = Item; GrupoMedidaAbierta.Visible = Item.TieneMedidaAbierta; GrupoMedidaCerrada.Visible = Item.TieneMedidaCerrada; GruposTiras.Visible = Item.TieneTiraRetira; ssMaquina.Text = (Item.Maquina != null) ? Item.Maquina.Nombre : ""; ssMaterial.Text = (Item.Material != null) ? Item.Material.Descripcion : ""; lblTipoUnidad.Text = Item.TipoUnidad; txtObservacionItem.Text = Item.Observacion; txtCantidadItem.Value = Item.CantidadUnidad; txtCantidadProduccion.Value = Item.CantidadElemento; txtMedidaAbiertoLargo.Value = Item.MedidaAbiertaLargo; txtMedidaAbiertoAlto.Value = Item.MedidaAbiertaAlto; txtMedidaCerradaLargo.Value = Item.MedidaCerradaLargo; txtMedidaCerradaAlto.Value = Item.MedidaCerradaAlto; txtImpresoTiraColor.Value = Item.ImpresoTiraColor; txtImpresoRetiraColor.Value = Item.ImpresoRetiraColor; //uneCostoMaquina.Value = Item.CostoMaquina; //uneCostoMaterial.Value = Item.CostoMaterial; //uneCosto.Value = Item.Costo; uneSeparacionX.Value = Item.SeparacionX; uneSeparacionY.Value = Item.SeparacionY; txtFormatoImpresionAlto.Value = Item.FormatoImpresionAlto; txtFormatoImpresionLargo.Value = Item.FormatoImpresionLargo; txtNroPiezasPrecorte.Value = Item.NroPiezasPrecorte; txtNroPiezasImpresion.Value = Item.NroPiezasImpresion; txtImpresionAlto.Value = Item.MedidaAbiertaAlto; txtImpresionLargo.Value = Item.MedidaAbiertaLargo; ssMaquina.Visible = Item.TieneMaquina; lblMaquina.Visible = Item.TieneMaquina; ssMaterial.Visible = Item.TieneMaterial; lblMaterial.Visible = Item.TieneMaterial; //txtCostoServicio.Value = Item.CostoServicio; //lblCostoMaquina.Visible = Item.TieneMaquina; //uneCostoMaquina.Visible = Item.TieneMaquina; //lblCostoMaterial.Visible = Item.TieneMaterial; //uneCostoMaterial.Visible = Item.TieneMaterial; comboMedida.Text = Item.UnidadMedidaAbierta; lblTipoUnidad.Visible = Item.TieneTipoUnidad; txtCantidadItem.Visible = Item.TieneTipoUnidad; if (Item.TieneTipoUnidad == false) { txtCantidadItem.Value = 0; } txtDemasia.Value = Item.CantidadDemasia; txtPases.Value = Item.NumerodePases; txtHojasMaquina.Value = (Item.CantidadMaterial) * Item.NroPiezasPrecorte; txtTiraje.Value = Item.CantidadProduccion; LabelMateriaPrima.Text = ""; if (Item.NumeroPliegos > 0) { LabelMateriaPrima.Text = Item.NumeroPliegos + " pliegos de : "; } LabelMateriaPrima.Text += Math.Round(Item.CantidadMaterial, 0).ToString() + " + " + Math.Round(Item.CantidadDemasiaMaterial, 0).ToString() + " = " + Math.Round((Item.CantidadMaterial + Item.CantidadDemasiaMaterial), 0).ToString() + " Hjs/Resma"; LabelProduccion.Text = ""; if (Item.NumeroPliegos > 0) { LabelProduccion.Text = Item.NumeroPliegos + " pliegos de : "; } LabelProduccion.Text += Math.Round(((Item.CantidadMaterial + Item.CantidadDemasiaMaterial) * Item.NroPiezasPrecorte), 0).ToString() + " Hjs/Maquina"; txtPliegos.Value = Item.NumeroPliegos; // if (Item.MetodoImpresion != null) { ubeMetodo.Text = Item.MetodoImpresion; //} checkGraficoImpresionManual.Checked = Item.GraficoImpresionManual; utcItemCotizacion.Tabs["Graficos"].Visible = Item.TieneGraficos; txtDemasia.Value = Item.CantidadDemasia; if (Item.TieneGraficos) { try { upbImpresion.Visible = true; txtNroPiezasImpresion.ReadOnly = true; if (Item.GraficoImpresionManual) { upbImpresion.Visible = false; txtNroPiezasImpresion.ReadOnly = false; } else if (Item.GraficoImpresionGirado) { GenerarGraficoImpresionRotado(); } else { GenerarGraficoImpresionNormal(); } if (Item.GraficoPrecorteGirado) { GenerarGraficoPrecorteRotado(); } else { GenerarGraficoPrecorteNormal(); } } catch (Exception) { } } MostrarServicios(Item); ActualizandoIU = false; }
private Decimal obtenerItemListaCostosMaterial(ItemOrdenProduccion itemOP) { Decimal resultado = 0; try { if (itemOP.NumeroPliegos == 0) { itemOP.NumeroPliegos = 1; } resultado = itemOP.Material.CostoUltimaCompra * (itemOP.CantidadMaterial + itemOP.CantidadDemasiaMaterial) * itemOP.NumeroPliegos; } catch (Exception) { } return resultado; }
private EscalaListaCostosMaquina obtenerEscalaLCM(UnidadListaCostosMaquina Uilcm, ItemOrdenProduccion itemOP) { EscalaListaCostosMaquina eUilcm = null; if (Uilcm == null) { return eUilcm; } CalcularProduccionItem(itemOP); Decimal cantidadProduccion = 0; if (Uilcm.Unidad.Nombre.Equals("MILLAR")) { cantidadProduccion = itemOP.CantidadProduccion / 1000; Decimal entero = Convert.ToInt32(cantidadProduccion); Decimal dif = (cantidadProduccion - entero) * 100; if (dif < 20) { cantidadProduccion = entero; } } else { cantidadProduccion = itemOP.CantidadProduccion; } foreach (EscalaListaCostosMaquina escala in Uilcm.Escalas) { if ((escala.Desde == 0) && (escala.Hasta == 0)) { eUilcm = escala; break; } else if ((escala.Desde <= cantidadProduccion) && (escala.Hasta >= cantidadProduccion)) { eUilcm = escala; break; } else if ((escala.Hasta == 0)) { eUilcm = escala; break; } } return eUilcm; }
private Decimal obtenerItemListaCostosMaquina(ItemOrdenProduccion itemOP) { Decimal resultado = 0; try { ItemListaCostosMaquina ilcm = obtenerItemListaCostosMaquina(itemOP.Maquina); UnidadListaCostosMaquina Uilcm = obtenerUnidadLCM(ilcm); EscalaListaCostosMaquina Elcm = obtenerEscalaLCM(Uilcm, itemOP); Int32 multiplicador = 1; if (Uilcm.Unidad.Nombre.Equals("MILLAR")) { multiplicador = 1000; resultado = (itemOP.CantidadProduccion / itemOP.NumerodePases) / multiplicador; Int32 entero = Convert.ToInt32(resultado); Decimal residuo = (resultado - entero) * 100; if (residuo >= 20 && residuo <= 100) { resultado = (entero + 1) * Elcm.Costo * itemOP.NumerodePases * itemOP.NumeroPliegos; } else if (entero == 0 && residuo > 0) { resultado = (1) * Elcm.Costo * itemOP.NumerodePases * itemOP.NumeroPliegos; } else { resultado = (entero) * Elcm.Costo * itemOP.NumerodePases * itemOP.NumeroPliegos; } } else { multiplicador = 1; resultado = itemOP.CantidadProduccion / multiplicador; Int32 entero = Convert.ToInt32(resultado); Decimal residuo = resultado - entero; if (residuo > 0 && residuo <= 1) { resultado = (entero + 1) * Elcm.Costo; } else { resultado = (entero) * Elcm.Costo; } } } catch (Exception) { } return resultado; }
private void CosteoElemento(ItemOrdenProduccion item) { if (item.Maquina != null) { item.CostoMaquina = obtenerItemListaCostosMaquina(item); } else { item.CostoMaquina = 0; } if (item.Material != null) { item.CostoMaterial = obtenerItemListaCostosMaterial(item); } else { item.CostoMaterial = 0; } Decimal totalservicio = 0; foreach (ItemOrdenProduccionServicio itemServicio in item.Servicios) { totalservicio += itemServicio.CostoTotalServicio; } item.CostoServicio = totalservicio; item.Cantidad = 1; item.Costo = item.CostoMaquina + item.CostoMaterial + item.CostoServicio; item.Precio = item.Costo; }
private void GenerarImagenImpresion(ItemOrdenProduccion itemGrafico) { try { if (itemGrafico == null) { return; } if (ActualizandoIU) { return; } Bitmap b = new Bitmap((Image)upbImpresion.Image); String RutaGrafico = String.Format("{0}Grafico_Impresion_{1}.png", FrmMain.ObtenerValorKey("CarpetaOrdenesProduccion"), itemGrafico.ID); b.Save(RutaGrafico); } catch (Exception ex) { SoftException.Control(ex); } }
private void utCotizacion_AfterSelect(object sender, SelectEventArgs e) { try { UltraTreeNode Node = utOrdenProduccion.ActiveNode; if (Node != null) { ItemOrdenProduccion = (ItemOrdenProduccion)Node.Tag; utcItemCotizacion.Tabs[0].Text = Node.Text; MostrarItem(Node); } } catch (Exception ex) { SoftException.ShowException(ex); } }
public virtual ItemOrdenProduccion AddItem() { ItemOrdenProduccion Item = new ItemOrdenProduccion(); Items.Add(Item); return Item; }
private void MostrarTotalServicio(ItemOrdenProduccion itemSe) { Decimal total = 0; foreach (ItemOrdenProduccionServicio itemServicio in itemSe.Servicios) { total += itemServicio.CostoTotalServicio; } itemSe.CostoServicio = total; }
private void utCotizacion_AfterSelect(object sender, Infragistics.Win.UltraWinTree.SelectEventArgs e) { UltraTreeNode Node = utOrdenProduccion.ActiveNode; if (Node != null) { ItemOrdenProduccion = (ItemOrdenProduccion)Node.Tag; utcItemOrdenProduccion.Tabs[0].Text = Node.Text; MostrarItem(Node); } }