|
@@ -36,6 +36,7 @@ type
|
|
|
|
|
|
procedure SetFieldValidChar;
|
|
|
function GetBqwc(AType: Integer): Double;
|
|
|
+ function GetTableName: string;
|
|
|
public
|
|
|
constructor Create(APhaseData: TObject);
|
|
|
destructor Destroy; override;
|
|
@@ -52,8 +53,10 @@ type
|
|
|
procedure CalculateCurPay;
|
|
|
|
|
|
procedure UpdateDataForNewAudit;
|
|
|
- procedure CopyPrePhasePayData;
|
|
|
+ procedure CopyPrePhasePayData; overload;
|
|
|
+ procedure CopyPrePhasePayData(const APreFile: string; APreFinalIndex: Integer); overload;
|
|
|
|
|
|
+ property TableName: string read GetTableName;
|
|
|
property PayablePrice[AIndex: Integer]: Double read GetPayablePrice;
|
|
|
// ±¾ÆÚÓ¦¸¶
|
|
|
property CurPayable: Double read GetCurPayable;
|
|
@@ -67,7 +70,7 @@ type
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
- PhaseData, ProjectData, DealPaymentDm, BillsDm, ConstUnit;
|
|
|
+ PhaseData, ProjectData, DealPaymentDm, BillsDm, ConstUnit, UtilMethods;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
@@ -470,4 +473,29 @@ begin
|
|
|
Result := Rec.ValueByName('Name').AsString;
|
|
|
end;
|
|
|
|
|
|
+procedure TPhasePayData.CopyPrePhasePayData(const APreFile: string;
|
|
|
+ APreFinalIndex: Integer);
|
|
|
+const
|
|
|
+ sCopySql = 'Insert Into %s (' +
|
|
|
+ ' ID, PreTotalPrice0, EndTotalPrice0, Formula0, StopCalc' +
|
|
|
+ ' ) Select ID, PreTotalPrice%d, EndTotalPrice%d, Formula%d, StopCalc' +
|
|
|
+ ' From %s' +
|
|
|
+ ' In ''%s''';
|
|
|
+var
|
|
|
+ sPre, sSql: string;
|
|
|
+begin
|
|
|
+ try
|
|
|
+ sSql := Format(sCopySql, [TableName, APreFinalIndex, APreFinalIndex,
|
|
|
+ APreFinalIndex, TableName, APreFile]);
|
|
|
+ ExecuteSql(TPhaseData(FPhaseData).ADOConnection, sSql);
|
|
|
+ finally
|
|
|
+ sddPhasePay.Reload;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+function TPhasePayData.GetTableName: string;
|
|
|
+begin
|
|
|
+ Result := sdpPhasePay.TableName;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|