mDataRecord.pas 26 KB

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