|
|
@@ -74,6 +74,7 @@ type
|
|
|
FAllProjectsTotalPriceSum: Double; // 缓存所有标段的总造价之和
|
|
|
FFirstProjectAreaNameFromProperty: string; // 缓存第一个标段的工程所在地(从项目属性获取。指标Indexs-IndexItem中会用到)
|
|
|
FOnOpenProject: TNotifyEvent;
|
|
|
+ FIsTender: Boolean; // 是否是调价。如浙江电子标,有个选项,决定是导出调价前的数据还是调价后的数据。
|
|
|
|
|
|
procedure AddRoot; virtual; // 兼容旧代码
|
|
|
procedure AddDetail; virtual; // 兼容旧代码
|
|
|
@@ -159,6 +160,7 @@ type
|
|
|
|
|
|
// 地区:不同地区在导出内容上有细微差别,用这个区分
|
|
|
property Area: TArea read FArea write FArea;
|
|
|
+ property IsTender: Boolean read FIsTender write FIsTender;
|
|
|
property OnOpenProject: TNotifyEvent read FOnOpenProject write SetOnOpenProject;
|
|
|
end;
|
|
|
|
|
|
@@ -4559,11 +4561,20 @@ end;
|
|
|
procedure TZTBXMLPort.AddBillMaterials(ABillItem: TScBillsItem; ABillMetNode: TXmlNode);
|
|
|
var billMetMX: TXmlNode;
|
|
|
i: Integer;
|
|
|
- sSQL: string;
|
|
|
+ sSQL, sField: string;
|
|
|
begin
|
|
|
+ if IsTender then
|
|
|
+ begin
|
|
|
+ sField := 'IIF(isnull(G.TenderPrice) or G.TenderPrice=0, 0, G.TenderPrice) as TP, IIF(isnull(G.TenderQuantity) or G.TenderQuantity=0, 0, G.TenderQuantity) as TQ ';
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ sField := 'IIF(isnull(G.BudgetPrice) or G.BudgetPrice=0, 0, G.BudgetPrice) as TP, IIF(isnull(G.Quantity) or G.Quantity=0, 0, G.Quantity) as TQ ';
|
|
|
+ end;
|
|
|
+
|
|
|
sSQL := 'select Code, Name, Unit, TP, Sum(TQ) as TQ1, Format(TQ1 * TP, ''0.00'') AS THJ From (' +
|
|
|
- 'SELECT P.Code, P.name, P.Unit, G.TenderPrice as TP, G.TenderQuantity as TQ FROM ProjectGLJ AS P ' +
|
|
|
- 'LEFT JOIN GLJList AS G ON G.GLJID=P.ID ' +
|
|
|
+ 'SELECT P.Code, P.name, P.Unit, ' + sField +
|
|
|
+ 'FROM ProjectGLJ AS P LEFT JOIN GLJList AS G ON G.GLJID=P.ID ' +
|
|
|
'WHERE P.Type=4 AND G.BillsItemID=' + IntToStr(ABillItem.ID) +
|
|
|
') Group by Code, Name, Unit, TP';
|
|
|
|