@ -75,5 +75,17 @@ namespace BWP.B3ButcherManageToSale.TypeIOCs
query . Where . Conditions . Add ( DQCondition . And ( DQCondition . EQ ( "Stopped" , false ) , DQCondition . EQ ( "Domain_ID" , DomainContext . Current . ID ) ) ) ;
return query . EExecuteList < long , long , Money < decimal > > ( session ) ;
}
public Money < decimal > ? GetGoodsSaleOutStoreNumber ( IDmoContext context , long storeID , DateTime date , long goodsID )
{
var main = new JoinAlias ( "_main" , typeof ( SaleOutStore ) ) ;
var detail = new JoinAlias ( typeof ( SaleOutStore_Detail ) ) ;
var query = new DQueryDom ( main ) ;
query . From . AddJoin ( JoinType . Inner , new DQDmoSource ( detail ) , DQCondition . EQ ( main , "ID" , detail , "SaleOutStore_ID" ) ) ;
query . Columns . Add ( DQSelectColumn . Sum ( detail , "UnitNum" ) ) ;
query . Where . Conditions . Add ( DQCondition . And ( DQCondition . EQ ( DQExpression . Snippet ( "cast(_main.LoadTime as date)" ) , DQExpression . Value ( date ) ) , DQCondition . EQ ( "BillState" , 单 据 状 态 . 未 审 核 ) , DQCondition . IsNotNull ( DQExpression . Field ( detail , "UnitNum" ) ) ) ) ;
query . Where . Conditions . Add ( DQCondition . And ( DQCondition . EQ ( detail , "SaleGoods_ID" , goodsID ) , DQCondition . EQ ( "Store_ID" , storeID ) ) ) ;
return query . EExecuteScalar < Money < decimal > ? > ( context . Session ) ;
}
}
}