mDataRecord.pas 26 KB

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