|
|
using BWP.B3ButcherManage.BO;
|
|
|
using BWP.B3Frameworks.BO.NamedValueTemplate;
|
|
|
using BWP.B3Sale.BO;
|
|
|
using BWP.B3Sale.Utils;
|
|
|
using BWP.Web.Pages.B3Sale.Reports;
|
|
|
using BWP.Web.Utils;
|
|
|
using Forks.EnterpriseServices.DataForm;
|
|
|
using Forks.EnterpriseServices.DomainObjects2;
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery;
|
|
|
using Forks.EnterpriseServices.SqlDoms;
|
|
|
using Forks.Utils;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Web.UI;
|
|
|
using System.Web.UI.HtmlControls;
|
|
|
using System.Web.UI.WebControls;
|
|
|
using TSingSoft.WebControls2;
|
|
|
using TSingSoft.WebControls2.DFGrids;
|
|
|
using TSingSoft.WebPluginFramework;
|
|
|
|
|
|
namespace BWP.Web.Pages.B3ButcherManageToSale.Reports.SaleOutStockAnalyse_
|
|
|
{
|
|
|
class SaleOutStockAnalyse : B3SaleDFGridReportPage
|
|
|
{
|
|
|
protected override string AccessRoleName
|
|
|
{
|
|
|
get { return "B3ButcherManageToSale.报表分析.销售备货分析"; }
|
|
|
}
|
|
|
|
|
|
protected override string Caption
|
|
|
{
|
|
|
get { return "销售备货分析"; }
|
|
|
}
|
|
|
|
|
|
protected override string QueryOptionsTabName
|
|
|
{
|
|
|
get { return string.Empty; }
|
|
|
}
|
|
|
|
|
|
readonly DFInfo mDFInfo = DFInfo.Get(typeof(SaleOutStore));
|
|
|
protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form)
|
|
|
{
|
|
|
base.InitForm(form);
|
|
|
mDFGrid.AllowRowGroup = true;
|
|
|
mDFGrid.AllowColGroup = true;
|
|
|
mDFGrid.AfterFillDetailRow += (htmlRow, dataRow) =>
|
|
|
{
|
|
|
var row = (DFDataRow)dataRow;
|
|
|
var diff = row["备货差异|数量"];
|
|
|
if (diff != null && Convert.ToDecimal(diff) <= 0)
|
|
|
{
|
|
|
foreach (HtmlTableCell c in htmlRow.Cells)
|
|
|
c.Style.Add("background-color", "lightgreen");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
var ava = row["可用|数量"];
|
|
|
if (ava != null && Convert.ToDecimal(diff ?? 0) == Convert.ToDecimal(ava))
|
|
|
{
|
|
|
var cIdx = onlyGoodsCheck.Checked ? 9 : 11;
|
|
|
htmlRow.Cells[cIdx].Style.Add("background-color", "lightgreen");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
};
|
|
|
}
|
|
|
|
|
|
protected override void InitQueryPanel(WebControls.QueryPanel queryPanel)
|
|
|
{
|
|
|
//base.InitQueryPanel(queryPanel);
|
|
|
queryPanel.ConditonPanel.EAdd(CreateDataRangePanel());
|
|
|
}
|
|
|
|
|
|
DFDropDownList billStateDp;
|
|
|
DFCheckBox onlyGoodsCheck;
|
|
|
HLayoutPanel CreateDataRangePanel()
|
|
|
{
|
|
|
var hPanel = new HLayoutPanel();
|
|
|
hPanel.Add(new LiteralControl("发货日期:"));
|
|
|
hPanel.Add(QueryCreator.DateRange(mDFInfo.Fields["LoadTime"], mQueryContainer, "MinLoadTime", "MaxLoadTime", DateTime.Today, DateTime.Today + new TimeSpan(23, 59, 29)));
|
|
|
hPanel.Add(new LiteralControl("送货线路:"));
|
|
|
hPanel.Add(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["DeliverGoodsLine_ID"], mQueryContainer, "DeliverGoodsLine_ID", B3SaleDataSources.送货线路));
|
|
|
|
|
|
hPanel.Add(new LiteralControl("存货:"));
|
|
|
hPanel.Add(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["AccountingUnit_ID"], mQueryContainer, "SaleGoods_ID", B3SaleDataSources.可销售存货));
|
|
|
|
|
|
hPanel.Add(new LiteralControl("单据状态:"));
|
|
|
billStateDp = hPanel.Add(new DFDropDownList() { Width = Unit.Pixel(80) });
|
|
|
billStateDp.Items.Add("");
|
|
|
billStateDp.Items.Add(new ListItem("未审核", "0"));
|
|
|
billStateDp.Items.Add(new ListItem("已审核", "20"));
|
|
|
billStateDp.SelectedIndex = 1;
|
|
|
|
|
|
onlyGoodsCheck = hPanel.Add(new DFCheckBox() { TextAlign = TextAlign.Left, Text = "按存货" });
|
|
|
onlyGoodsCheck.InputAttributes.Add("style", "width:15px;height:15px;");
|
|
|
return hPanel;
|
|
|
}
|
|
|
|
|
|
public override PagedDFDataTable GetPagedDFDataTable(QuerySettings settings)
|
|
|
{
|
|
|
var line = mQueryContainer.GetControl<DFChoiceBox>("DeliverGoodsLine_ID").GetValues().Select(x => long.Parse(x));
|
|
|
var goodsIds = mQueryContainer.GetControl<DFChoiceBox>("SaleGoods_ID").GetValues().Select(x => long.Parse(x));
|
|
|
var minDate = mQueryContainer.GetControl<DFDateInput>("MinLoadTime").Value;
|
|
|
var maxDate = mQueryContainer.GetControl<DFDateInput>("MaxLoadTime").Value;
|
|
|
|
|
|
var data = GetMainInfo(line, goodsIds, minDate, maxDate, billStateDp);
|
|
|
var products = GetInStoreNumber(goodsIds, minDate, maxDate);
|
|
|
foreach (var g in data.GroupBy(x => x.Goods_ID))
|
|
|
{
|
|
|
var first = products.FirstOrDefault(x => x.Goods_ID == g.Key);
|
|
|
if (first != null)
|
|
|
{
|
|
|
first.MainNumber = (first.MainNumber ?? 0) - g.Sum(x => (x.StockNumber ?? 0).Value);
|
|
|
first.SecondNumber = (first.SecondNumber ?? 0) - g.Sum(x => (x.StockSecondNumber ?? 0).Value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var list = new List<TempObj>();
|
|
|
if (onlyGoodsCheck.Checked)
|
|
|
{
|
|
|
foreach (var g in data.GroupBy(x => x.Goods_ID))
|
|
|
{
|
|
|
var first = g.First();
|
|
|
var entity = new TempObj();
|
|
|
entity.Goods_Name = first.Goods_Name;
|
|
|
entity.Unit = first.Unit;
|
|
|
entity.SecondUnit = first.SecondUnit;
|
|
|
entity.OrderMain = g.Sum(x => (x.OrderMain ?? 0).Value);
|
|
|
entity.OrderSecond = g.Sum(x => (x.OrderSecond ?? 0).Value);
|
|
|
entity.StockNumber = g.Sum(x => (x.StockNumber ?? 0).Value);
|
|
|
entity.StockSecondNumber = g.Sum(x => (x.StockSecondNumber ?? 0).Value);
|
|
|
list.Add(entity);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
list = data;
|
|
|
|
|
|
foreach (var item in list)
|
|
|
{
|
|
|
var first = products.FirstOrDefault(x => x.Goods_ID == item.Goods_ID);
|
|
|
if (first == null)
|
|
|
{
|
|
|
item.AvailableMain = 0;
|
|
|
item.AvailableSecond = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (item.StockDiffNumber > 0)
|
|
|
{
|
|
|
item.AvailableMain = Math.Min(item.StockDiffNumber.Value, (first.MainNumber ?? 0).Value);
|
|
|
|
|
|
first.MainNumber -= item.AvailableMain;
|
|
|
|
|
|
if (item.AvailableMain < 0)
|
|
|
item.AvailableMain = 0;
|
|
|
|
|
|
if (first.MainNumber < 0)
|
|
|
first.MainNumber = 0;
|
|
|
}
|
|
|
|
|
|
if (item.StockDiffSecondNumber > 0)
|
|
|
{
|
|
|
item.AvailableSecond = Math.Min(item.StockDiffSecondNumber.Value, (first.SecondNumber ?? 0).Value);
|
|
|
|
|
|
first.SecondNumber -= item.AvailableSecond;
|
|
|
|
|
|
if (item.AvailableSecond < 0)
|
|
|
item.AvailableSecond = 0;
|
|
|
|
|
|
if (first.SecondNumber < 0)
|
|
|
first.SecondNumber = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var table = new PagedDFDataTable(list.Count, new DFDataTable());
|
|
|
if (!onlyGoodsCheck.Checked)
|
|
|
{
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("顺序号", typeof(long?)));
|
|
|
ColumnNames.Add("顺序号");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("线路", typeof(string)));
|
|
|
ColumnNames.Add("线路");
|
|
|
}
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("存货", typeof(string)));
|
|
|
ColumnNames.Add("存货");
|
|
|
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("订货|数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("订货|数量");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("订货|单位", typeof(string)));
|
|
|
ColumnNames.Add("订货|单位");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("订货|辅数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("订货|辅数量");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("订货|辅单位", typeof(string)));
|
|
|
ColumnNames.Add("订货|辅单位");
|
|
|
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("已备|数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("已备|数量");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("已备|辅数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("已备|辅数量");
|
|
|
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("备货差异|数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("备货差异|数量");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("备货差异|辅数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("备货差异|辅数量");
|
|
|
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("可用|数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("可用|数量");
|
|
|
table.Data.Columns.Add(new DFCustomDataColumn("可用|辅数量", typeof(Money<decimal>?)));
|
|
|
ColumnNames.Add("可用|辅数量");
|
|
|
|
|
|
foreach (var item in list)
|
|
|
{
|
|
|
var row = table.Data.Rows.NewRow();
|
|
|
|
|
|
if (!onlyGoodsCheck.Checked)
|
|
|
{
|
|
|
row["顺序号"] = item.SequenceNumber;
|
|
|
row["线路"] = item.LineName;
|
|
|
}
|
|
|
row["存货"] = item.Goods_Name;
|
|
|
row["订货|数量"] = item.OrderMain;
|
|
|
row["订货|单位"] = item.Unit;
|
|
|
row["订货|辅数量"] = item.OrderSecond;
|
|
|
row["订货|辅单位"] = item.SecondUnit;
|
|
|
row["已备|数量"] = item.StockNumber;
|
|
|
row["已备|辅数量"] = item.StockSecondNumber;
|
|
|
row["备货差异|数量"] = item.StockDiffNumber;
|
|
|
row["备货差异|辅数量"] = item.StockDiffSecondNumber;
|
|
|
row["可用|数量"] = item.AvailableMain;
|
|
|
row["可用|辅数量"] = item.AvailableSecond;
|
|
|
}
|
|
|
SumColumnNames.Add("订货|数量");
|
|
|
table.Data.SumRow["订货|数量"] = list.Sum(x => (x.OrderMain ?? 0).Value);
|
|
|
table.Data.SumRow["订货|辅数量"] = list.Sum(x => (x.OrderSecond ?? 0).Value);
|
|
|
table.Data.SumRow["已备|数量"] = list.Sum(x => (x.StockNumber ?? 0).Value);
|
|
|
table.Data.SumRow["已备|辅数量"] = list.Sum(x => (x.StockSecondNumber ?? 0).Value);
|
|
|
table.Data.SumRow["备货差异|数量"] = list.Sum(x => x.StockDiffNumber.Value);
|
|
|
table.Data.SumRow["备货差异|辅数量"] = list.Sum(x => x.StockDiffSecondNumber.Value);
|
|
|
table.Data.SumRow["可用|数量"] = list.Sum(x => (x.AvailableMain ?? 0).Value);
|
|
|
table.Data.SumRow["可用|辅数量"] = list.Sum(x => (x.AvailableSecond ?? 0).Value);
|
|
|
|
|
|
return table;
|
|
|
}
|
|
|
|
|
|
IEnumerable<MinObj> GetInStoreNumber(IEnumerable<long> goodsIDs, DateTime? start, DateTime? end)
|
|
|
{
|
|
|
var main = new JoinAlias(typeof(ProductInStore));
|
|
|
var detail = new JoinAlias(typeof(ProductInStore_Detail));
|
|
|
var config = new JoinAlias(typeof(GoodsViewConfig));
|
|
|
var query = new DQueryDom(main);
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "ProductInStore_ID"));
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(config), DQCondition.EQ(detail, "Goods_ID", config, "Goods_ID"));
|
|
|
|
|
|
query.Columns.Add(DQSelectColumn.Field("Goods_ID", detail));
|
|
|
query.Columns.Add(DQSelectColumn.Sum(detail, "Number"));
|
|
|
query.Columns.Add(DQSelectColumn.Sum(detail, "SecondNumber"));
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field(detail, "Goods_ID"));
|
|
|
|
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.InEQ("BillState", 单据状态.已作废));
|
|
|
if (start.HasValue)
|
|
|
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("Date", start));
|
|
|
if (start.HasValue)
|
|
|
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("Date", end));
|
|
|
if (goodsIDs.Any())
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "Goods_ID"), goodsIDs.Select(x => DQExpression.Value(x)).ToArray()));
|
|
|
return query.EExecuteList<long, Money<decimal>?, Money<decimal>?>().Select(x => new MinObj { Goods_ID = x.Item1, MainNumber = x.Item2, SecondNumber = x.Item3 });
|
|
|
}
|
|
|
|
|
|
List<TempObj> GetMainInfo(IEnumerable<long> line, IEnumerable<long> goodsIDs, DateTime? minDate, DateTime? maxDate, DFDropDownList billStateDp)
|
|
|
{
|
|
|
var main = new JoinAlias("_m", typeof(SaleOutStore));
|
|
|
var detail = new JoinAlias("_d", typeof(SaleOutStore_Detail));
|
|
|
var config = new JoinAlias("_g1", typeof(GoodsViewConfig));
|
|
|
var customer = new JoinAlias("_c1", typeof(CustomerViewConfig));
|
|
|
var temp = new JoinAlias(typeof(StockUpClass));
|
|
|
var query = new DQueryDom(main);
|
|
|
StockUpClass.Register(query, line, goodsIDs, minDate, maxDate, billStateDp);
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID"));
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(config), DQCondition.EQ(config, "Goods_ID", detail, "SaleGoods_ID"));
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(customer), DQCondition.EQ(main, "Customer_ID", customer, "Customer_ID"));
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(temp), DQCondition.EQ(detail, "ID", temp, "DetailID"));
|
|
|
query.Columns.Add(DQSelectColumn.Field("SequenceNumber"));
|
|
|
query.Columns.Add(DQSelectColumn.Field("DeliverGoodsLine_Name"));
|
|
|
query.Columns.Add(DQSelectColumn.Field("SaleGoods_ID", detail));
|
|
|
query.Columns.Add(DQSelectColumn.Field("Goods_Name", detail));
|
|
|
query.Columns.Add(DQSelectColumn.Field("Unit", detail));
|
|
|
query.Columns.Add(DQSelectColumn.Field("Goods_SecondUnit", detail));
|
|
|
foreach (var c in query.Columns)
|
|
|
query.GroupBy.Expressions.Add(c.Expression);
|
|
|
|
|
|
query.Columns.Add(DQSelectColumn.Sum(detail, "UnitNum"));
|
|
|
query.Columns.Add(DQSelectColumn.Sum(detail, "SecondNumber"));
|
|
|
|
|
|
query.Columns.Add(DQSelectColumn.Sum(temp, "StockNumber"));
|
|
|
query.Columns.Add(DQSelectColumn.Sum(temp, "StockSecondNumber"));
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("SequenceNumber"));
|
|
|
|
|
|
if (minDate.HasValue)
|
|
|
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(main, "LoadTime", minDate.Value));
|
|
|
if (maxDate.HasValue)
|
|
|
query.Where.Conditions.Add(DQCondition.LessThanOrEqual(main, "LoadTime", maxDate.Value));
|
|
|
if (line.Any())
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(main, "DeliverGoodsLine_ID"), line.Select(x => DQExpression.Value(x)).ToArray()));
|
|
|
else
|
|
|
query.Where.Conditions.Add(DQCondition.IsNotNull(DQExpression.Field("DeliverGoodsLine_ID")));
|
|
|
if (goodsIDs.Any())
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "SaleGoods_ID"), goodsIDs.Select(x => DQExpression.Value(x)).ToArray()));
|
|
|
|
|
|
if (!string.IsNullOrEmpty(billStateDp.SelectedValue))
|
|
|
query.Where.Conditions.Add(DQCondition.EQ(main, "BillState", short.Parse(billStateDp.SelectedValue)));
|
|
|
else
|
|
|
query.Where.Conditions.Add(DQCondition.InEQ(main, "BillState", 单据状态.已作废));
|
|
|
|
|
|
var list = new List<TempObj>();
|
|
|
using (var session = Dmo.NewSession())
|
|
|
{
|
|
|
using (var reader = session.ExecuteReader(query))
|
|
|
{
|
|
|
while (reader.Read())
|
|
|
{
|
|
|
var entity = new TempObj();
|
|
|
entity.SequenceNumber = (long?)reader[0];
|
|
|
entity.LineName = (string)reader[1];
|
|
|
entity.Goods_ID = (long)reader[2];
|
|
|
entity.Goods_Name = (string)reader[3];
|
|
|
entity.Unit = (string)reader[4];
|
|
|
entity.SecondUnit = (string)reader[5];
|
|
|
|
|
|
entity.OrderMain = (Money<decimal>?)reader[6];
|
|
|
entity.OrderSecond = (Money<decimal>?)reader[7];
|
|
|
entity.StockNumber = (Money<decimal>?)reader[8];
|
|
|
entity.StockSecondNumber = (Money<decimal>?)reader[9];
|
|
|
|
|
|
list.Add(entity);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
class StockUpClass
|
|
|
{
|
|
|
public long DetailID { get; set; }
|
|
|
|
|
|
public Money<decimal>? StockSecondNumber { get; set; }
|
|
|
|
|
|
public Money<decimal>? StockNumber { get; set; }
|
|
|
|
|
|
public static void Register(DQueryDom root, IEnumerable<long> line, IEnumerable<long> goodsIDs, DateTime? minDate, DateTime? maxDate, DFDropDownList billStateDp)
|
|
|
{
|
|
|
var main = new JoinAlias("_tMain", typeof(SaleOutStore));
|
|
|
var detail = new JoinAlias("_tDetail", typeof(SaleOutStore_Detail));
|
|
|
var stockUp = new JoinAlias(typeof(StockUpDetail));
|
|
|
var query = new DQueryDom(stockUp);
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(detail, "ID", stockUp, "DetailID"));
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(main), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID"));
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID", detail));
|
|
|
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(stockUp, "SecondNumber")).ECastType<Money<decimal>?>(), "备货辅数量"));
|
|
|
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(stockUp, "UnitNumber")).ECastType<Money<decimal>?>(), "备货报价数量"));
|
|
|
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field(detail, "ID"));
|
|
|
if (minDate.HasValue)
|
|
|
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(main, "LoadTime", minDate.Value));
|
|
|
if (maxDate.HasValue)
|
|
|
query.Where.Conditions.Add(DQCondition.LessThanOrEqual(main, "LoadTime", maxDate.Value));
|
|
|
if (line.Any())
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(main, "DeliverGoodsLine_ID"), line.Select(x => DQExpression.Value(x)).ToArray()));
|
|
|
if (goodsIDs.Any())
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "SaleGoods_ID"), goodsIDs.Select(x => DQExpression.Value(x)).ToArray()));
|
|
|
|
|
|
if (!string.IsNullOrEmpty(billStateDp.SelectedValue))
|
|
|
query.Where.Conditions.Add(DQCondition.EQ(main, "BillState", short.Parse(billStateDp.SelectedValue)));
|
|
|
else
|
|
|
query.Where.Conditions.Add(DQCondition.InEQ(main, "BillState", 单据状态.已作废));
|
|
|
root.RegisterQueryTable(typeof(StockUpClass), new string[] { "DetailID", "StockSecondNumber", "StockNumber" }, query);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
class TempObj
|
|
|
{
|
|
|
public long? SequenceNumber { get; set; }
|
|
|
public string LineName { get; set; }
|
|
|
public long Goods_ID { get; set; }
|
|
|
public string Goods_Name { get; set; }
|
|
|
public string Unit { get; set; }
|
|
|
public string SecondUnit { get; set; }
|
|
|
public Money<decimal>? OrderMain { get; set; }
|
|
|
public Money<decimal>? OrderSecond { get; set; }
|
|
|
public Money<decimal>? StockNumber { get; set; }
|
|
|
public Money<decimal>? StockSecondNumber { get; set; }
|
|
|
public Money<decimal> StockDiffNumber { get { return (OrderMain ?? 0) - (StockNumber ?? 0); } }
|
|
|
public Money<decimal> StockDiffSecondNumber { get { return (OrderSecond ?? 0) - (StockSecondNumber ?? 0); } }
|
|
|
public Money<decimal>? AvailableMain { get; set; }
|
|
|
public Money<decimal>? AvailableSecond { get; set; }
|
|
|
}
|
|
|
|
|
|
class MinObj
|
|
|
{
|
|
|
public long Goods_ID { get; set; }
|
|
|
public Money<decimal>? MainNumber { get; set; }
|
|
|
public Money<decimal>? SecondNumber { get; set; }
|
|
|
}
|
|
|
}
|
|
|
}
|