/// <summary> /// Deprecated Method for adding a new object to the inventario_cafe_de_socio EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToinventario_cafe_de_socio(inventario_cafe_de_socio inventario_cafe_de_socio) { base.AddObject("inventario_cafe_de_socio", inventario_cafe_de_socio); }
/// <summary> /// Create a new inventario_cafe_de_socio object. /// </summary> /// <param name="tRANSACCION_NUMERO">Initial value of the TRANSACCION_NUMERO property.</param> /// <param name="sOCIOS_ID">Initial value of the SOCIOS_ID property.</param> /// <param name="cLASIFICACIONES_CAFE_ID">Initial value of the CLASIFICACIONES_CAFE_ID property.</param> /// <param name="dOCUMENTO_ID">Initial value of the DOCUMENTO_ID property.</param> /// <param name="dOCUMENTO_TIPO">Initial value of the DOCUMENTO_TIPO property.</param> /// <param name="iNVENTARIO_ENTRADAS_CANTIDAD">Initial value of the INVENTARIO_ENTRADAS_CANTIDAD property.</param> /// <param name="iNVENTARIO_SALIDAS_SALDO">Initial value of the INVENTARIO_SALIDAS_SALDO property.</param> /// <param name="cREADO_POR">Initial value of the CREADO_POR property.</param> /// <param name="fECHA_CREACION">Initial value of the FECHA_CREACION property.</param> public static inventario_cafe_de_socio Createinventario_cafe_de_socio(global::System.Int32 tRANSACCION_NUMERO, global::System.String sOCIOS_ID, global::System.Int32 cLASIFICACIONES_CAFE_ID, global::System.Int32 dOCUMENTO_ID, global::System.String dOCUMENTO_TIPO, global::System.Decimal iNVENTARIO_ENTRADAS_CANTIDAD, global::System.Decimal iNVENTARIO_SALIDAS_SALDO, global::System.String cREADO_POR, global::System.DateTime fECHA_CREACION) { inventario_cafe_de_socio inventario_cafe_de_socio = new inventario_cafe_de_socio(); inventario_cafe_de_socio.TRANSACCION_NUMERO = tRANSACCION_NUMERO; inventario_cafe_de_socio.SOCIOS_ID = sOCIOS_ID; inventario_cafe_de_socio.CLASIFICACIONES_CAFE_ID = cLASIFICACIONES_CAFE_ID; inventario_cafe_de_socio.DOCUMENTO_ID = dOCUMENTO_ID; inventario_cafe_de_socio.DOCUMENTO_TIPO = dOCUMENTO_TIPO; inventario_cafe_de_socio.INVENTARIO_ENTRADAS_CANTIDAD = iNVENTARIO_ENTRADAS_CANTIDAD; inventario_cafe_de_socio.INVENTARIO_SALIDAS_SALDO = iNVENTARIO_SALIDAS_SALDO; inventario_cafe_de_socio.CREADO_POR = cREADO_POR; inventario_cafe_de_socio.FECHA_CREACION = fECHA_CREACION; return inventario_cafe_de_socio; }
/// <summary> /// Insertar transacción de la hoja de liquidación en la tabla de inventario de café de socios como salida (Liquidación). /// </summary> /// <param name="HojaDeLiquidacion"></param> /// <param name="db"></param> public void InsertarTransaccionInventarioDeCafeDeSocio(liquidacion HojaDeLiquidacion, colinasEntities db) { try { reporte_total_inventario_de_cafe_por_socio asocInventory = this.GetReporteTotalInventarioDeCafeDeSocio(HojaDeLiquidacion.SOCIOS_ID, HojaDeLiquidacion.CLASIFICACIONES_CAFE_ID); decimal cantidad_en_inventario_socio = asocInventory == null ? 0 : asocInventory.INVENTARIO_ENTRADAS_CANTIDAD; decimal salidas_de_inventario_socio = asocInventory == null ? 0 : asocInventory.INVENTARIO_SALIDAS_SALDO; inventario_cafe_de_socio inventarioDeCafeDeSocio = new inventario_cafe_de_socio(); inventarioDeCafeDeSocio.SOCIOS_ID = HojaDeLiquidacion.SOCIOS_ID; inventarioDeCafeDeSocio.CLASIFICACIONES_CAFE_ID = HojaDeLiquidacion.CLASIFICACIONES_CAFE_ID; inventarioDeCafeDeSocio.DOCUMENTO_ID = HojaDeLiquidacion.LIQUIDACIONES_ID; inventarioDeCafeDeSocio.DOCUMENTO_TIPO = "SALIDA"; inventarioDeCafeDeSocio.INVENTARIO_ENTRADAS_CANTIDAD = cantidad_en_inventario_socio - HojaDeLiquidacion.LIQUIDACIONES_TOTAL_LIBRAS; inventarioDeCafeDeSocio.INVENTARIO_SALIDAS_SALDO = salidas_de_inventario_socio + HojaDeLiquidacion.LIQUIDACIONES_VALOR_TOTAL; inventarioDeCafeDeSocio.CREADO_POR = HojaDeLiquidacion.CREADO_POR; inventarioDeCafeDeSocio.FECHA_CREACION = HojaDeLiquidacion.FECHA_CREACION; db.inventario_cafe_de_socio.AddObject(inventarioDeCafeDeSocio); db.SaveChanges(); this.InsertarTransaccionInventarioDeCafe(HojaDeLiquidacion, db); } catch (Exception ex) { log.Fatal("Error fatal al insertar transaccion de inventario de cafe de socio. Hoja de Liquidacion.", ex); throw; } }
/// <summary> /// Insertar transacción de la nota de peso en la tabla de inventario de café de socios como ajuste (Ajuste de Inventario). /// </summary> /// <param name="AjusteDeInventarioDeCafe"></param> /// <param name="db"></param> public void InsertarTransaccionInventarioDeCafeDeSocio(ajuste_inventario_cafe_x_socio AjusteDeInventarioDeCafe, colinasEntities db) { try { reporte_total_inventario_de_cafe_por_socio asocInventory = this.GetReporteTotalInventarioDeCafeDeSocio(AjusteDeInventarioDeCafe.SOCIOS_ID, AjusteDeInventarioDeCafe.CLASIFICACIONES_CAFE_ID); decimal cantidad_en_inventario_socio = asocInventory == null ? 0 : asocInventory.INVENTARIO_ENTRADAS_CANTIDAD; decimal salidas_de_inventario_socio = asocInventory == null ? 0 : asocInventory.INVENTARIO_SALIDAS_SALDO; inventario_cafe_de_socio inventarioDeCafeDeSocio = new inventario_cafe_de_socio(); inventarioDeCafeDeSocio.SOCIOS_ID = AjusteDeInventarioDeCafe.SOCIOS_ID; inventarioDeCafeDeSocio.CLASIFICACIONES_CAFE_ID = AjusteDeInventarioDeCafe.CLASIFICACIONES_CAFE_ID; inventarioDeCafeDeSocio.DOCUMENTO_ID = AjusteDeInventarioDeCafe.AJUSTES_INV_CAFE_ID; inventarioDeCafeDeSocio.DOCUMENTO_TIPO = "AJUSTE"; inventarioDeCafeDeSocio.INVENTARIO_ENTRADAS_CANTIDAD = cantidad_en_inventario_socio - AjusteDeInventarioDeCafe.AJUSTES_INV_CAFE_CANTIDAD_LIBRAS; inventarioDeCafeDeSocio.INVENTARIO_SALIDAS_SALDO = salidas_de_inventario_socio + AjusteDeInventarioDeCafe.AJUSTES_INV_CAFE_SALDO_TOTAL; inventarioDeCafeDeSocio.CREADO_POR = AjusteDeInventarioDeCafe.CREADO_POR; inventarioDeCafeDeSocio.FECHA_CREACION = AjusteDeInventarioDeCafe.FECHA_CREACION; db.inventario_cafe_de_socio.AddObject(inventarioDeCafeDeSocio); db.SaveChanges(); } catch (Exception ex) { log.Fatal("Error fatal al insertar transaccion de inventario de cafe de socio. Ajuste de Inventario de Cafe.", ex); throw; } }
/* Inventario de Socios */ /// <summary> /// Insertar transacción de la nota de peso en la tabla de inventario de café de socios como entrada (Deposito). /// </summary> /// <param name="NotaDePeso"></param> /// <param name="db"></param> /// <returns>El numero de transacción asignado a la nota de peso registrada.</returns> public int InsertarTransaccionInventarioDeCafeDeSocio(nota_de_peso NotaDePeso, colinasEntities db) { try { reporte_total_inventario_de_cafe_por_socio asocInventory = this.GetReporteTotalInventarioDeCafeDeSocio(NotaDePeso.SOCIOS_ID, NotaDePeso.CLASIFICACIONES_CAFE_ID); decimal cantidad_en_inventario_socio = asocInventory == null ? 0 : asocInventory.INVENTARIO_ENTRADAS_CANTIDAD; decimal salidas_de_inventario_socio = asocInventory == null ? 0 : asocInventory.INVENTARIO_SALIDAS_SALDO; inventario_cafe_de_socio inventarioDeCafeDeSocio = new inventario_cafe_de_socio(); inventarioDeCafeDeSocio.SOCIOS_ID = NotaDePeso.SOCIOS_ID; inventarioDeCafeDeSocio.CLASIFICACIONES_CAFE_ID = NotaDePeso.CLASIFICACIONES_CAFE_ID; inventarioDeCafeDeSocio.DOCUMENTO_ID = NotaDePeso.NOTAS_ID; inventarioDeCafeDeSocio.DOCUMENTO_TIPO = "ENTRADA"; inventarioDeCafeDeSocio.INVENTARIO_ENTRADAS_CANTIDAD = cantidad_en_inventario_socio + NotaDePeso.NOTAS_PESO_TOTAL_RECIBIDO; inventarioDeCafeDeSocio.INVENTARIO_SALIDAS_SALDO = salidas_de_inventario_socio; inventarioDeCafeDeSocio.CREADO_POR = NotaDePeso.CREADO_POR; inventarioDeCafeDeSocio.FECHA_CREACION = Convert.ToDateTime(NotaDePeso.FECHA_MODIFICACION); db.inventario_cafe_de_socio.AddObject(inventarioDeCafeDeSocio); db.SaveChanges(); return inventarioDeCafeDeSocio.TRANSACCION_NUMERO; } catch (Exception ex) { log.Fatal("Error fatal al insertar transaccion de inventario de cafe de socio. Nota de Peso.", ex); throw; } }