mDataRecord.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. unit mDataRecord;
  2. interface
  3. uses
  4. Classes, sdDB;
  5. type
  6. TMeasureBaseRecord = class(TsdDataRecord)
  7. public
  8. procedure SetFloatValue(AValue: TsdValue; AFloat: Double);
  9. procedure SetIntValue(AValue: TsdValue; AInt: Integer);
  10. procedure SetBoolValue(AValue: TsdValue; ABool: Boolean);
  11. procedure SetStrValue(AValue: TsdValue; AStr: string);
  12. procedure AddDifferValue(AValue: TsdValue; ADiffer: Double);
  13. end;
  14. TBillsRecord = class(TMeasureBaseRecord)
  15. private
  16. // 树结构
  17. FID: TsdValue;
  18. FParentID: TsdValue;
  19. FNextSiblingID: TsdValue;
  20. // 报表专用
  21. FSerialNo: TsdValue;
  22. FIsLeaf: TsdValue;
  23. FLeafXmjParentID: TsdValue;
  24. FXiangCode: TsdValue;
  25. FMuCode: TsdValue;
  26. FJieCode: TsdValue;
  27. FXimuCode: TsdValue;
  28. FIndexCode: TsdValue;
  29. FChapterParentID: TsdValue;
  30. // 基础数据
  31. FCode: TsdValue;
  32. FB_Code: TsdValue;
  33. FName: TsdValue;
  34. FUnits: TsdValue;
  35. FAlias: TsdValue;
  36. // 单价
  37. FPrice: TsdValue;
  38. FNewPrice: TsdValue;
  39. // 0号台账计算相关
  40. FOrgQuantity: TsdValue;
  41. FOrgTotalPrice: TsdValue;
  42. FMisQuantity: TsdValue;
  43. FMisTotalPrice: TsdValue;
  44. FOthQuantity: TsdValue;
  45. FOthTotalPrice: TsdValue;
  46. FQuantity: TsdValue;
  47. FTotalPrice: TsdValue;
  48. // 计算模式标记
  49. FCalcType: TsdValue;
  50. // 累计
  51. FAddDealQuantity: TsdValue;
  52. FAddDealTotalPrice: TsdValue;
  53. FAddQcQuantity: TsdValue;
  54. FAddQcTotalPrice: TsdValue;
  55. FAddQcBGLCode: TsdValue;
  56. FAddQcBGLNum: TsdValue;
  57. FAddPcQuantity: TsdValue;
  58. FAddPcTotalPrice: TsdValue;
  59. FAddPcBGLCode: TsdValue;
  60. FAddPcBGLNum: TsdValue;
  61. FAddGatherQuantity: TsdValue;
  62. FAddGatherTotalPrice: TsdValue;
  63. FLockedLevel: TsdValue;
  64. FLockedInfo: TsdValue;
  65. FLockedNewPrice: TsdValue;
  66. FCreatePhaseID: TsdValue;
  67. FIsMeasureAdd: TsdValue;
  68. FPeg: TsdValue;
  69. FDrawingCode: TsdValue;
  70. FMemoStr: TsdValue;
  71. FDgnQuantity1: TsdValue;
  72. FDgnQuantity2: TsdValue;
  73. FDgnPrice: TsdValue;
  74. FDealDgnQuantity1: TsdValue;
  75. FDealDgnQuantity2: TsdValue;
  76. FCDgnQuantity1: TsdValue;
  77. FCDgnQuantity2: TsdValue;
  78. FAddDgnPrice: TsdValue;
  79. FHasBookMark: TsdValue;
  80. FMarkMemo: TsdValue;
  81. FDealCode: TsdValue;
  82. FDealCompany: TsdValue;
  83. FDealType: TsdValue;
  84. FAddCutTotalPrice: TsdValue;
  85. FAddPayTotalPrice: TsdValue;
  86. FAddCompleteRate: TsdValue;
  87. FCacheMisTP: Double;
  88. FCacheOrgTP: Double;
  89. FCacheOthTP: Double;
  90. FPM_AddTotalPrice: TsdValue;
  91. protected
  92. procedure DoAfterAddFields; override;
  93. public
  94. property ID: TsdValue read FID;
  95. property ParentID: TsdValue read FParentID;
  96. property NextSiblingID: TsdValue read FNextSiblingID;
  97. property SerialNo: TsdValue read FSerialNo;
  98. property IsLeaf: TsdValue read FIsLeaf;
  99. property LeafXmjParentID: TsdValue read FLeafXmjParentID;
  100. property XiangCode: TsdValue read FXiangCode;
  101. property MuCode: TsdValue read FMuCode;
  102. property JieCode: TsdValue read FJieCode;
  103. property XimuCode: TsdValue read FXimuCode;
  104. property IndexCode: TsdValue read FIndexCode;
  105. property ChapterParentID: TsdValue read FChapterParentID;
  106. property Code: TsdValue read FCode;
  107. property B_Code: TsdValue read FB_Code;
  108. property Name: TsdValue read FName;
  109. property Units: TsdValue read FUnits;
  110. property Alias: TsdValue read FAlias;
  111. property Price: TsdValue read FPrice;
  112. property NewPrice: TsdValue read FNewPrice;
  113. property OrgQuantity: TsdValue read FOrgQuantity;
  114. property OrgTotalPrice: TsdValue read FOrgTotalPrice;
  115. property MisQuantity: TsdValue read FMisQuantity;
  116. property MisTotalPrice: TsdValue read FMisTotalPrice;
  117. property OthQuantity: TsdValue read FOthQuantity;
  118. property OthTotalPrice: TsdValue read FOthTotalPrice;
  119. property Quantity: TsdValue read FQuantity;
  120. property TotalPrice: TsdValue read FTotalPrice;
  121. property CalcType: TsdValue read FCalcType;
  122. property AddDealQuantity: TsdValue read FAddDealQuantity;
  123. property AddDealTotalPrice: TsdValue read FAddDealTotalPrice;
  124. property AddQcQuantity: TsdValue read FAddQcQuantity;
  125. property AddQcTotalPrice: TsdValue read FAddQcTotalPrice;
  126. property AddQcBGLCode: TsdValue read FAddQcBGLCode;
  127. property AddQcBGLNum: TsdValue read FAddQcBGLNum;
  128. property AddPcQuantity: TsdValue read FAddPcQuantity;
  129. property AddPcTotalPrice: TsdValue read FAddPcTotalPrice;
  130. property AddPcBGLCode: TsdValue read FAddPcBGLCode;
  131. property AddPcBGLNum: TsdValue read FAddPcBGLNum;
  132. property AddGatherQuantity: TsdValue read FAddGatherQuantity;
  133. property AddGatherTotalPrice: TsdValue read FAddGatherTotalPrice;
  134. property LockedLevel: TsdValue read FLockedLevel;
  135. property LockedInfo: TsdValue read FLockedInfo;
  136. property LockedNewPrice: TsdValue read FLockedNewPrice;
  137. property CreatePhaseID: TsdValue read FCreatePhaseID;
  138. property IsMeasureAdd: TsdValue read FIsMeasureAdd;
  139. property Peg: TsdValue read FPeg;
  140. property DrawingCode: TsdValue read FDrawingCode;
  141. property MemoStr: TsdValue read FMemoStr;
  142. property DgnQuantity1: TsdValue read FDgnQuantity1;
  143. property DgnQuantity2: TsdValue read FDgnQuantity2;
  144. property DgnPrice: TsdValue read FDgnPrice;
  145. property DealDgnQuantity1: TsdValue read FDealDgnQuantity1;
  146. property DealDgnQuantity2: TsdValue read FDealDgnQuantity2;
  147. property CDgnQuantity1: TsdValue read FCDgnQuantity1;
  148. property CDgnQuantity2: TsdValue read FCDgnQuantity2;
  149. property AddDgnPrice: TsdValue read FAddDgnPrice;
  150. property HasBookMark: TsdValue read FHasBookMark;
  151. property MarkMemo: TsdValue read FMarkMemo;
  152. property DealCode: TsdValue read FDealCode;
  153. property DealCompany: TsdValue read FDealCompany;
  154. property DealType: TsdValue read FDealType;
  155. property AddCutTotalPrice: TsdValue read FAddCutTotalPrice;
  156. property AddPayTotalPrice: TsdValue read FAddPayTotalPrice;
  157. property AddCompleteRate: TsdValue read FAddCompleteRate;
  158. // Cache Data 用于增量计算,记录原始值
  159. property CacheOrgTP: Double read FCacheOrgTP write FCacheOrgTP;
  160. property CacheMisTP: Double read FCacheMisTP write FCacheMisTP;
  161. property CacheOthTP: Double read FCacheOthTP write FCacheOthTP;
  162. property PM_AddTotalPrice: TsdValue read FPM_AddTotalPrice;
  163. end;
  164. TStageRecord = class(TMeasureBaseRecord)
  165. private
  166. FBillsID: TsdValue;
  167. FDealQuantity: TsdValue;
  168. FDealTotalPrice: TsdValue;
  169. FDealFlag: TsdValue;
  170. FDealFormula: TsdValue;
  171. FQcQuantity: TsdValue;
  172. FQcTotalPrice: TsdValue;
  173. FQcFlag: TsdValue;
  174. FQcFormula: TsdValue;
  175. FQcBGLCode: TsdValue;
  176. FQcBGLNum: TsdValue;
  177. FPcQuantity: TsdValue;
  178. FPcTotalPrice: TsdValue;
  179. FPcFlag: TsdValue;
  180. FPcFormula: TsdValue;
  181. FPcBGLCode: TsdValue;
  182. FPcBGLNum: TsdValue;
  183. FGatherQuantity: TsdValue;
  184. FGatherTotalPrice: TsdValue;
  185. FEndDealQuantity: TsdValue;
  186. FEndDealTotalPrice: TsdValue;
  187. FEndQcQuantity: TsdValue;
  188. FEndQcTotalPrice: TsdValue;
  189. FEndQcBGLCode: TsdValue;
  190. FEndQcBGLNum: TsdValue;
  191. FEndPcQuantity: TsdValue;
  192. FEndPcTotalPrice: TsdValue;
  193. FEndPcBGLCode: TsdValue;
  194. FEndPcBGLNum: TsdValue;
  195. FEndGatherQuantity: TsdValue;
  196. FEndGatherTotalPrice: TsdValue;
  197. FPreDealQuantity: TsdValue;
  198. FPreDealTotalPrice: TsdValue;
  199. FPreQcQuantity: TsdValue;
  200. FPreQcTotalPrice: TsdValue;
  201. FPreQcBGLCode: TsdValue;
  202. FPreQcBGLNum: TsdValue;
  203. FPrePcQuantity: TsdValue;
  204. FPrePcTotalPrice: TsdValue;
  205. FPrePcBGLCode: TsdValue;
  206. FPrePcBGLNum: TsdValue;
  207. FPreGatherQuantity: TsdValue;
  208. FPreGatherTotalPrice: TsdValue;
  209. FHasBookMark: TsdValue;
  210. FMarkMemo: TsdValue;
  211. FCacheDealTP: Double;
  212. FPM_PreTotalPrice: TsdValue;
  213. FPM_TotalPrice: TsdValue;
  214. protected
  215. procedure DoAfterAddFields; override;
  216. public
  217. property BillsID: TsdValue read FBillsID;
  218. property DealQuantity: TsdValue read FDealQuantity;
  219. property DealTotalPrice: TsdValue read FDealTotalPrice;
  220. property DealFlag: TsdValue read FDealFlag;
  221. property DealFormula: TsdValue read FDealFormula;
  222. property QcQuantity: TsdValue read FQcQuantity;
  223. property QcTotalPrice: TsdValue read FQcTotalPrice;
  224. property QcFlag: TsdValue read FQcFlag;
  225. property QcFormula: TsdValue read FQcFormula;
  226. property QcBGLCode: TsdValue read FQcBGLCode;
  227. property QcBGLNum: TsdValue read FQcBGLNum;
  228. property PcQuantity: TsdValue read FPcQuantity;
  229. property PcTotalPrice: TsdValue read FPcTotalPrice;
  230. property PcFlag: TsdValue read FPcFlag;
  231. property PcFormula: TsdValue read FPcFormula;
  232. property PcBGLCode: TsdValue read FPcBGLCode;
  233. property PcBGLNum: TsdValue read FPcBGLNum;
  234. property GatherQuantity: TsdValue read FGatherQuantity;
  235. property GatherTotalPrice: TsdValue read FGatherTotalPrice;
  236. property EndDealQuantity: TsdValue read FEndDealQuantity;
  237. property EndDealTotalPrice: TsdValue read FEndDealTotalPrice;
  238. property EndQcQuantity: TsdValue read FEndQcQuantity;
  239. property EndQcTotalPrice: TsdValue read FEndQcTotalPrice;
  240. property EndQcBGLCode: TsdValue read FEndQcBGLCode;
  241. property EndQcBGLNum: TsdValue read FEndQcBGLNum;
  242. property EndPcQuantity: TsdValue read FEndPcQuantity;
  243. property EndPcTotalPrice: TsdValue read FEndPcTotalPrice;
  244. property EndPcBGLCode: TsdValue read FEndPcBGLCode;
  245. property EndPcBGLNum: TsdValue read FEndPcBGLNum;
  246. property EndGatherQuantity: TsdValue read FEndGatherQuantity;
  247. property EndGatherTotalPrice: TsdValue read FEndGatherTotalPrice;
  248. property PreDealQuantity: TsdValue read FPreDealQuantity;
  249. property PreDealTotalPrice: TsdValue read FPreDealTotalPrice;
  250. property PreQcQuantity: TsdValue read FPreQcQuantity;
  251. property PreQcTotalPrice: TsdValue read FPreQcTotalPrice;
  252. property PreQcBGLCode: TsdValue read FPreQcBGLCode;
  253. property PreQcBGLNum: TsdValue read FPreQcBGLNum;
  254. property PrePcQuantity: TsdValue read FPrePcQuantity;
  255. property PrePcTotalPrice: TsdValue read FPrePcTotalPrice;
  256. property PrePcBGLCode: TsdValue read FPrePcBGLCode;
  257. property PrePcBGLNum: TsdValue read FPrePcBGLNum;
  258. property PreGatherQuantity: TsdValue read FPreGatherQuantity;
  259. property PreGatherTotalPrice: TsdValue read FPreGatherTotalPrice;
  260. property HasBookMark: TsdValue read FHasBookMark;
  261. property MarkMemo: TsdValue read FMarkMemo;
  262. property CacheDealTP: Double read FCacheDealTP write FCacheDealTP;
  263. property PM_PreTotalPrice: TsdValue read FPM_PreTotalPrice;
  264. property PM_TotalPrice: TsdValue read FPM_TotalPrice;
  265. end;
  266. TProjectGLRecord = class(TMeasureBaseRecord)
  267. private
  268. FID: TsdValue;
  269. FCode: TsdValue;
  270. FName: TsdValue;
  271. FUnits: TsdValue;
  272. FSpecs: TsdValue;
  273. FBasePrice: TsdValue;
  274. FRiskRange: TsdValue;
  275. FLockedPhaseID: TsdValue;
  276. FCreatePhaseID: TsdValue;
  277. FInfoPrice: TsdValue;
  278. FInfoDate: TsdValue;
  279. FDeltaPrice: TsdValue;
  280. FValidDeltaPrice: TsdValue;
  281. FPM_PreQuantity: TsdValue;
  282. FPM_PreTotalPrice: TsdValue;
  283. FPM_Quantity: TsdValue;
  284. FPM_TotalPrice: TsdValue;
  285. protected
  286. procedure DoAfterAddFields; override;
  287. public
  288. property ID: TsdValue read FID;
  289. property Code: TsdValue read FCode;
  290. property Name: TsdValue read FName;
  291. property Units: TsdValue read FUnits;
  292. property Specs: TsdValue read FSpecs;
  293. property BasePrice: TsdValue read FBasePrice;
  294. property RiskRange: TsdValue read FRiskRange;
  295. property LockedPhaseID: TsdValue read FLockedPhaseID;
  296. property CreatePhaseID: TsdValue read FCreatePhaseID;
  297. property InfoPrice: TsdValue read FInfoPrice;
  298. property InfoDate: TsdValue read FInfoDate;
  299. property DeltaPrice: TsdValue read FDeltaPrice;
  300. property ValidDeltaPrice: TsdValue read FValidDeltaPrice;
  301. property PM_PreQuantity: TsdValue read FPM_PreQuantity;
  302. property PM_PreTotalPrice: TsdValue read FPM_PreTotalPrice;
  303. property PM_Quantity: TsdValue read FPM_Quantity;
  304. property PM_TotalPrice: TsdValue read FPM_TotalPrice;
  305. end;
  306. TDetailGLRecord = class(TMeasureBaseRecord)
  307. private
  308. FID: TsdValue;
  309. FBillsID: TsdValue;
  310. FGLID: TsdValue;
  311. FCode: TsdValue;
  312. FQuantity: TsdValue;
  313. FCreatePhaseID: TsdValue;
  314. FLastBillsQuantity: TsdValue;
  315. FLockedPhaseID: TsdValue;
  316. FRelaProjectGL: TProjectGLRecord;
  317. protected
  318. procedure DoAfterAddFields; override;
  319. public
  320. property ID: TsdValue read FID;
  321. property BillsID: TsdValue read FBillsID;
  322. property GLID: TsdValue read FGLID;
  323. property Code: TsdValue read FCode;
  324. property Quantity: TsdValue read FQuantity;
  325. property CreatePhaseID: TsdValue read FCreatePhaseID;
  326. property LastBillsQuantity: TsdValue read FLastBillsQuantity;
  327. property LockedPhaseID: TsdValue read FLockedPhaseID;
  328. property RelaProjectGL: TProjectGLRecord read FRelaProjectGL write FRelaProjectGL;
  329. end;
  330. TStageCompareRecord = class(TMeasureBaseRecord)
  331. private
  332. FID: TsdValue;
  333. FQuantity0: TsdValue;
  334. FTotalPrice0: TsdValue;
  335. FQuantity1: TsdValue;
  336. FTotalPrice1: TsdValue;
  337. FQuantity2: TsdValue;
  338. FTotalPrice2: TsdValue;
  339. FQuantity3: TsdValue;
  340. FTotalPrice3: TsdValue;
  341. FQuantity4: TsdValue;
  342. FTotalPrice4: TsdValue;
  343. FQuantity5: TsdValue;
  344. FTotalPrice5: TsdValue;
  345. FQuantity6: TsdValue;
  346. FTotalPrice6: TsdValue;
  347. FQuantity7: TsdValue;
  348. FTotalPrice7: TsdValue;
  349. FQuantity8: TsdValue;
  350. FTotalPrice8: TsdValue;
  351. FQuantity9: TsdValue;
  352. FTotalPrice9: TsdValue;
  353. FQuantity10: TsdValue;
  354. FTotalPrice10: TsdValue;
  355. FQuantity11: TsdValue;
  356. FTotalPrice11: TsdValue;
  357. FQuantity12: TsdValue;
  358. FTotalPrice12: TsdValue;
  359. FQuantity13: TsdValue;
  360. FTotalPrice13: TsdValue;
  361. FQuantity14: TsdValue;
  362. FTotalPrice14: TsdValue;
  363. protected
  364. procedure DoAfterAddFields; override;
  365. public
  366. property ID: TsdValue read FID;
  367. property Quantity0: TsdValue read FQuantity0;
  368. property TotalPrice0 : TsdValue read FTotalPrice0;
  369. property Quantity1: TsdValue read FQuantity0;
  370. property TotalPrice1 : TsdValue read FTotalPrice0;
  371. property Quantity2: TsdValue read FQuantity0;
  372. property TotalPrice2 : TsdValue read FTotalPrice0;
  373. property Quantity3: TsdValue read FQuantity0;
  374. property TotalPrice3: TsdValue read FTotalPrice0;
  375. property Quantity4: TsdValue read FQuantity0;
  376. property TotalPrice4 : TsdValue read FTotalPrice0;
  377. property Quantity5: TsdValue read FQuantity0;
  378. property TotalPrice5 : TsdValue read FTotalPrice0;
  379. property Quantity6: TsdValue read FQuantity0;
  380. property TotalPrice6 : TsdValue read FTotalPrice0;
  381. property Quantity7: TsdValue read FQuantity0;
  382. property TotalPrice7 : TsdValue read FTotalPrice0;
  383. property Quantity8: TsdValue read FQuantity0;
  384. property TotalPrice8 : TsdValue read FTotalPrice0;
  385. property Quantity9: TsdValue read FQuantity0;
  386. property TotalPrice9 : TsdValue read FTotalPrice0;
  387. property Quantity10: TsdValue read FQuantity0;
  388. property TotalPrice10 : TsdValue read FTotalPrice0;
  389. property Quantity11: TsdValue read FQuantity0;
  390. property TotalPrice11 : TsdValue read FTotalPrice0;
  391. property Quantity12: TsdValue read FQuantity0;
  392. property TotalPrice12 : TsdValue read FTotalPrice0;
  393. property Quantity13: TsdValue read FQuantity0;
  394. property TotalPrice13 : TsdValue read FTotalPrice0;
  395. property Quantity14: TsdValue read FQuantity0;
  396. property TotalPrice14 : TsdValue read FTotalPrice0;
  397. end;
  398. implementation
  399. { TBillsRecord }
  400. procedure TBillsRecord.DoAfterAddFields;
  401. begin
  402. inherited;
  403. FID := ValueByName('ID');
  404. FParentID := ValueByName('ParentID');
  405. FNextSiblingID := ValueByName('NextSiblingID');
  406. FSerialNo := ValueByName('SerialNo');
  407. FIsLeaf := ValueByName('IsLeaf');
  408. FLeafXmjParentID := ValueByName('LeafXmjParentID');
  409. FXiangCode := ValueByName('XiangCode');
  410. FMuCode := ValueByName('MuCode');
  411. FJieCode := ValueByName('JieCode');
  412. FXimuCode := ValueByName('XimuCode');
  413. FIndexCode := ValueByName('IndexCode');
  414. FChapterParentID := ValueByName('ChapterParentID');
  415. FCode := ValueByName('Code');
  416. FB_Code := ValueByName('B_Code');
  417. FName := ValueByName('Name');
  418. FUnits := ValueByName('Units');
  419. FAlias := ValueByName('Alias');
  420. FPrice := ValueByName('Price');
  421. FNewPrice := ValueByName('NewPrice');
  422. FOrgQuantity := ValueByName('OrgQuantity');
  423. FOrgTotalPrice := ValueByName('OrgTotalPrice');
  424. FMisQuantity := ValueByName('MisQuantity');
  425. FMisTotalPrice := ValueByName('MisTotalPrice');
  426. FOthQuantity := ValueByName('OthQuantity');
  427. FOthTotalPrice := ValueByName('OthTotalPrice');
  428. FQuantity := ValueByName('Quantity');
  429. FTotalPrice := ValueByName('TotalPrice');
  430. FCalcType := ValueByName('CalcType');
  431. FAddDealQuantity := ValueByName('AddDealQuantity');
  432. FAddDealTotalPrice := ValueByName('AddDealTotalPrice');
  433. FAddQcQuantity := ValueByName('AddQcQuantity');
  434. FAddQcTotalPrice := ValueByName('AddQcTotalPrice');
  435. FAddQcBGLCode := ValueByName('AddQcBGLCode');
  436. FAddQcBGLNum := ValueByName('AddQcBGLNum');
  437. FAddPcQuantity := ValueByName('AddPcQuantity');
  438. FAddPcTotalPrice := ValueByName('AddPcTotalPrice');
  439. FAddPcBGLCode := ValueByName('AddPcBGLCode');
  440. FAddPcBGLNum := ValueByName('AddPcBGLNum');
  441. FAddGatherQuantity := ValueByName('AddGatherQuantity');
  442. FAddGatherTotalPrice := ValueByName('AddGatherTotalPrice');
  443. FLockedLevel := ValueByName('LockedLevel');
  444. FLockedInfo := ValueByName('LockedInfo');
  445. FLockedNewPrice := ValueByName('LockedNewPrice');
  446. FCreatePhaseID := ValueByName('CreatePhaseID');
  447. FIsMeasureAdd := ValueByName('IsMeasureAdd');
  448. FPeg := ValueByName('Peg');
  449. FDrawingCode := ValueByName('DrawingCode');
  450. FMemoStr := ValueByName('MemoStr');
  451. FDgnQuantity1 := ValueByName('DgnQuantity1');
  452. FDgnQuantity2 := ValueByName('DgnQuantity2');
  453. FDgnPrice := ValueByName('DgnPrice');
  454. FDealDgnQuantity1 := ValueByName('DealDgnQuantity1');
  455. FDealDgnQuantity2 := ValueByName('DealDgnQuantity2');
  456. FCDgnQuantity1 := ValueByName('CDgnQuantity1');
  457. FCDgnQuantity2 := ValueByName('CDgnQuantity2');
  458. FAddDgnPrice := ValueByName('AddDgnPrice');
  459. FHasBookMark := ValueByName('HasBookMark');
  460. FMarkMemo := ValueByName('MarkMemo');
  461. FDealCode := ValueByName('DealCode');
  462. FDealCompany := ValueByName('DealCompany');
  463. FDealType := ValueByName('DealType');
  464. FAddCutTotalPrice := ValueByName('AddCutTotalPrice');
  465. FAddPayTotalPrice := ValueByName('AddPayTotalPrice');
  466. FAddCompleteRate := ValueByName('AddCompleteRate');
  467. FPM_AddTotalPrice := ValueByName('PM_AddTotalPrice');
  468. end;
  469. { TStageRecord }
  470. procedure TStageRecord.DoAfterAddFields;
  471. begin
  472. inherited;
  473. FBillsID := ValueByName('BillsID');
  474. FDealQuantity := ValueByName('DealQuantity');
  475. FDealTotalPrice := ValueByName('DealTotalPrice');
  476. FDealFlag := ValueByName('DealFlag');
  477. FDealFormula := ValueByName('DealFormula');
  478. FQcQuantity := ValueByName('QcQuantity');
  479. FQcTotalPrice := ValueByName('QcTotalPrice');
  480. FQcFlag := ValueByName('QcFlag');
  481. FQcFormula := ValueByName('QcFormula');
  482. FQcBGLCode := ValueByName('QcBGLCode');
  483. FQcBGLNum := ValueByName('QcBGLNum');
  484. FPcQuantity := ValueByName('PcQuantity');
  485. FPcTotalPrice := ValueByName('PcTotalPrice');
  486. FPcFlag := ValueByName('PcFlag');
  487. FPcFormula := ValueByName('PcFormula');
  488. FPcBGLCode := ValueByName('PcBGLCode');
  489. FPcBGLNum := ValueByName('PcBGLNum');
  490. FGatherQuantity := ValueByName('GatherQuantity');
  491. FGatherTotalPrice := ValueByName('GatherTotalPrice');
  492. FEndDealQuantity := ValueByName('EndDealQuantity');
  493. FEndDealTotalPrice := ValueByName('EndDealTotalPrice');
  494. FEndQcQuantity := ValueByName('EndQcQuantity');
  495. FEndQcTotalPrice := ValueByName('EndQcTotalPrice');
  496. FEndQcBGLCode := ValueByName('EndQcBGLCode');
  497. FEndQcBGLNum := ValueByName('EndQcBGLNum');
  498. FEndPcQuantity := ValueByName('EndPcQuantity');
  499. FEndPcTotalPrice := ValueByName('EndPcTotalPrice');
  500. FEndPcBGLCode := ValueByName('EndPcBGLCode');
  501. FEndPcBGLNum := ValueByName('EndPcBGLNum');
  502. FEndGatherQuantity := ValueByName('EndGatherQuantity');
  503. FEndGatherTotalPrice := ValueByName('EndGatherTotalPrice');
  504. FPreDealQuantity := ValueByName('PreDealQuantity');
  505. FPreDealTotalPrice := ValueByName('PreDealTotalPrice');
  506. FPreQcQuantity := ValueByName('PreQcQuantity');
  507. FPreQcTotalPrice := ValueByName('PreQcTotalPrice');
  508. FPreQcBGLCode := ValueByName('PreQcBGLCode');
  509. FPreQcBGLNum := ValueByName('PreQcBGLNum');
  510. FPrePcQuantity := ValueByName('PrePcQuantity');
  511. FPrePcTotalPrice := ValueByName('PrePcTotalPrice');
  512. FPrePcBGLCode := ValueByName('PrePcBGLCode');
  513. FPrePcBGLNum := ValueByName('PrePcBGLNum');
  514. FPreGatherQuantity := ValueByName('PreGatherQuantity');
  515. FPreGatherTotalPrice := ValueByName('PreGatherTotalPrice');
  516. FHasBookMark := ValueByName('HasBookMark');
  517. FMarkMemo := ValueByName('MarkMemo');
  518. FPM_PreTotalPrice := ValueByName('PM_PreTotalPrice');
  519. FPM_TotalPrice := ValueByName('PM_TotalPrice');
  520. end;
  521. { TProjectGLRecord }
  522. procedure TProjectGLRecord.DoAfterAddFields;
  523. begin
  524. inherited;
  525. FID := ValueByName('ID');
  526. FCode := ValueByName('Code');
  527. FName := ValueByName('Name');
  528. FUnits := ValueByName('Units');
  529. FSpecs := ValueByName('Specs');
  530. FBasePrice := ValueByName('BasePrice');
  531. FRiskRange := ValueByName('RiskRange');
  532. FLockedPhaseID := ValueByName('LockedPhaseID');
  533. FCreatePhaseID := ValueByName('CreatePhaseID');
  534. FInfoPrice := ValueByName('InfoPrice');
  535. FInfoDate := ValueByName('InfoDate');
  536. FDeltaPrice := ValueByName('DeltaPrice');
  537. FValidDeltaPrice := ValueByName('ValidDeltaPrice');
  538. FPM_PreQuantity := ValueByName('PM_PreQuantity');
  539. FPM_PreTotalPrice := ValueByName('PM_PreTotalPrice');
  540. FPM_Quantity := ValueByName('PM_Quantity');
  541. FPM_TotalPrice := ValueByName('PM_TotalPrice');
  542. end;
  543. { TDetailGLRecord }
  544. procedure TDetailGLRecord.DoAfterAddFields;
  545. begin
  546. inherited;
  547. FID := ValueByName('ID');
  548. FBillsID := ValueByName('BillsID');
  549. FGLID := ValueByName('GLID');
  550. FCode := ValueByName('Code');
  551. FQuantity := ValueByName('Quantity');
  552. FCreatePhaseID := ValueByName('CreatePhaseID');
  553. FLastBillsQuantity := ValueByName('LastBillsQuantity');
  554. FLockedPhaseID := ValueByName('LockedPhaseID');
  555. end;
  556. { TMeasureBaseRecord }
  557. procedure TMeasureBaseRecord.AddDifferValue(AValue: TsdValue;
  558. ADiffer: Double);
  559. begin
  560. if ADiffer <> 0 then
  561. AValue.AsFloat := AValue.AsFloat + ADiffer;
  562. end;
  563. procedure TMeasureBaseRecord.SetBoolValue(AValue: TsdValue;
  564. ABool: Boolean);
  565. begin
  566. if AValue.AsBoolean <> ABool then
  567. AValue.AsBoolean := ABool;
  568. end;
  569. procedure TMeasureBaseRecord.SetFloatValue(AValue: TsdValue;
  570. AFloat: Double);
  571. begin
  572. if AValue.AsFloat <> AFloat then
  573. AValue.AsFloat := AFloat;
  574. end;
  575. procedure TMeasureBaseRecord.SetIntValue(AValue: TsdValue; AInt: Integer);
  576. begin
  577. if AValue.AsInteger <> AInt then
  578. AValue.AsInteger := AInt;
  579. end;
  580. procedure TMeasureBaseRecord.SetStrValue(AValue: TsdValue; AStr: string);
  581. begin
  582. if AValue.AsString <> AStr then
  583. AValue.AsString := AStr;
  584. end;
  585. { TStageCompareRecord }
  586. procedure TStageCompareRecord.DoAfterAddFields;
  587. begin
  588. inherited;
  589. FID := ValueByName('ID');
  590. FQuantity0 := ValueByName('Quantity0');
  591. FTotalPrice0 := ValueByName('TotalPrice0');
  592. FQuantity1 := ValueByName('Quantity1');
  593. FTotalPrice1 := ValueByName('TotalPrice1');
  594. FQuantity2 := ValueByName('Quantity2');
  595. FTotalPrice2 := ValueByName('TotalPrice2');
  596. FQuantity3 := ValueByName('Quantity3');
  597. FTotalPrice3 := ValueByName('TotalPrice3');
  598. FQuantity4 := ValueByName('Quantity4');
  599. FTotalPrice4 := ValueByName('TotalPrice4');
  600. FQuantity5 := ValueByName('Quantity5');
  601. FTotalPrice5 := ValueByName('TotalPrice5');
  602. FQuantity6 := ValueByName('Quantity6');
  603. FTotalPrice6 := ValueByName('TotalPrice6');
  604. FQuantity7 := ValueByName('Quantity7');
  605. FTotalPrice7 := ValueByName('TotalPrice7');
  606. FQuantity8 := ValueByName('Quantity8');
  607. FTotalPrice8 := ValueByName('TotalPrice8');
  608. FQuantity9 := ValueByName('Quantity9');
  609. FTotalPrice9 := ValueByName('TotalPrice9');
  610. FQuantity10 := ValueByName('Quantity10');
  611. FTotalPrice10 := ValueByName('TotalPrice10');
  612. FQuantity11 := ValueByName('Quantity11');
  613. FTotalPrice11 := ValueByName('TotalPrice11');
  614. FQuantity12 := ValueByName('Quantity12');
  615. FTotalPrice12 := ValueByName('TotalPrice12');
  616. FQuantity13 := ValueByName('Quantity13');
  617. FTotalPrice13 := ValueByName('TotalPrice13');
  618. FQuantity14 := ValueByName('Quantity14');
  619. FTotalPrice14 := ValueByName('TotalPrice14');
  620. end;
  621. end.