mDataRecord.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  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. FPreUsedQuantity: TsdValue;
  286. FPreUsedTotalPrice: TsdValue;
  287. FUsedQuantity: TsdValue;
  288. FUsedTotalPrice: TsdValue;
  289. FPrePAL_UsedQuantity: TsdValue;
  290. FPrePAL_UsedTotalPrice: TsdValue;
  291. FPrePAL_DeltaPrice: TsdValue;
  292. FPrePAL_Total: TsdValue;
  293. FPAL_UsedQuantity: TsdValue;
  294. FPAL_UsedTotalPrice: TsdValue;
  295. FPAL_DeltaPrice: TsdValue;
  296. FPAL_Total: TsdValue;
  297. protected
  298. procedure DoAfterAddFields; override;
  299. public
  300. property ID: TsdValue read FID;
  301. property Code: TsdValue read FCode;
  302. property Name: TsdValue read FName;
  303. property Units: TsdValue read FUnits;
  304. property Specs: TsdValue read FSpecs;
  305. property BasePrice: TsdValue read FBasePrice;
  306. property RiskRange: TsdValue read FRiskRange;
  307. property LockedPhaseID: TsdValue read FLockedPhaseID;
  308. property CreatePhaseID: TsdValue read FCreatePhaseID;
  309. property InfoPrice: TsdValue read FInfoPrice;
  310. property InfoDate: TsdValue read FInfoDate;
  311. property DeltaPrice: TsdValue read FDeltaPrice;
  312. property ValidDeltaPrice: TsdValue read FValidDeltaPrice;
  313. property PM_PreQuantity: TsdValue read FPM_PreQuantity;
  314. property PM_PreTotalPrice: TsdValue read FPM_PreTotalPrice;
  315. property PM_Quantity: TsdValue read FPM_Quantity;
  316. property PM_TotalPrice: TsdValue read FPM_TotalPrice;
  317. property PreUsedQuantity: TsdValue read FPreUsedQuantity;
  318. property PreUsedTotalPrice: TsdValue read FPreUsedTotalPrice;
  319. property UsedQuantity: TsdValue read FUsedQuantity;
  320. property UsedTotalPrice: TsdValue read FUsedTotalPrice;
  321. property PrePAL_UsedQuantity: TsdValue read FPrePAL_UsedQuantity;
  322. property PrePAL_UsedTotalPrice: TsdValue read FPrePAL_UsedTotalPrice;
  323. property PrePAL_DeltaPrice: TsdValue read FPrePAL_DeltaPrice;
  324. property PrePAL_Total: TsdValue read FPrePAL_Total;
  325. property PAL_UsedQuantity: TsdValue read FPAL_UsedQuantity;
  326. property PAL_UsedTotalPrice: TsdValue read FPAL_UsedTotalPrice;
  327. property PAL_DeltaPrice: TsdValue read FPAL_DeltaPrice;
  328. property PAL_Total: TsdValue read FPAL_Total;
  329. end;
  330. TDetailGLRecord = class(TMeasureBaseRecord)
  331. private
  332. FID: TsdValue;
  333. FBillsID: TsdValue;
  334. FGLID: TsdValue;
  335. FCode: TsdValue;
  336. FQuantity: TsdValue;
  337. FCreatePhaseID: TsdValue;
  338. FLastBillsQuantity: TsdValue;
  339. FLockedPhaseID: TsdValue;
  340. FRelaProjectGL: TProjectGLRecord;
  341. protected
  342. procedure DoAfterAddFields; override;
  343. public
  344. property ID: TsdValue read FID;
  345. property BillsID: TsdValue read FBillsID;
  346. property GLID: TsdValue read FGLID;
  347. property Code: TsdValue read FCode;
  348. property Quantity: TsdValue read FQuantity;
  349. property CreatePhaseID: TsdValue read FCreatePhaseID;
  350. property LastBillsQuantity: TsdValue read FLastBillsQuantity;
  351. property LockedPhaseID: TsdValue read FLockedPhaseID;
  352. property RelaProjectGL: TProjectGLRecord read FRelaProjectGL write FRelaProjectGL;
  353. end;
  354. TStageCompareRecord = class(TMeasureBaseRecord)
  355. private
  356. FID: TsdValue;
  357. FQuantity0: TsdValue;
  358. FTotalPrice0: TsdValue;
  359. FQuantity1: TsdValue;
  360. FTotalPrice1: TsdValue;
  361. FQuantity2: TsdValue;
  362. FTotalPrice2: TsdValue;
  363. FQuantity3: TsdValue;
  364. FTotalPrice3: TsdValue;
  365. FQuantity4: TsdValue;
  366. FTotalPrice4: TsdValue;
  367. FQuantity5: TsdValue;
  368. FTotalPrice5: TsdValue;
  369. FQuantity6: TsdValue;
  370. FTotalPrice6: TsdValue;
  371. FQuantity7: TsdValue;
  372. FTotalPrice7: TsdValue;
  373. FQuantity8: TsdValue;
  374. FTotalPrice8: TsdValue;
  375. FQuantity9: TsdValue;
  376. FTotalPrice9: TsdValue;
  377. FQuantity10: TsdValue;
  378. FTotalPrice10: TsdValue;
  379. FQuantity11: TsdValue;
  380. FTotalPrice11: TsdValue;
  381. FQuantity12: TsdValue;
  382. FTotalPrice12: TsdValue;
  383. FQuantity13: TsdValue;
  384. FTotalPrice13: TsdValue;
  385. FQuantity14: TsdValue;
  386. FTotalPrice14: TsdValue;
  387. protected
  388. procedure DoAfterAddFields; override;
  389. public
  390. property ID: TsdValue read FID;
  391. property Quantity0: TsdValue read FQuantity0;
  392. property TotalPrice0 : TsdValue read FTotalPrice0;
  393. property Quantity1: TsdValue read FQuantity0;
  394. property TotalPrice1 : TsdValue read FTotalPrice0;
  395. property Quantity2: TsdValue read FQuantity0;
  396. property TotalPrice2 : TsdValue read FTotalPrice0;
  397. property Quantity3: TsdValue read FQuantity0;
  398. property TotalPrice3: TsdValue read FTotalPrice0;
  399. property Quantity4: TsdValue read FQuantity0;
  400. property TotalPrice4 : TsdValue read FTotalPrice0;
  401. property Quantity5: TsdValue read FQuantity0;
  402. property TotalPrice5 : TsdValue read FTotalPrice0;
  403. property Quantity6: TsdValue read FQuantity0;
  404. property TotalPrice6 : TsdValue read FTotalPrice0;
  405. property Quantity7: TsdValue read FQuantity0;
  406. property TotalPrice7 : TsdValue read FTotalPrice0;
  407. property Quantity8: TsdValue read FQuantity0;
  408. property TotalPrice8 : TsdValue read FTotalPrice0;
  409. property Quantity9: TsdValue read FQuantity0;
  410. property TotalPrice9 : TsdValue read FTotalPrice0;
  411. property Quantity10: TsdValue read FQuantity0;
  412. property TotalPrice10 : TsdValue read FTotalPrice0;
  413. property Quantity11: TsdValue read FQuantity0;
  414. property TotalPrice11 : TsdValue read FTotalPrice0;
  415. property Quantity12: TsdValue read FQuantity0;
  416. property TotalPrice12 : TsdValue read FTotalPrice0;
  417. property Quantity13: TsdValue read FQuantity0;
  418. property TotalPrice13 : TsdValue read FTotalPrice0;
  419. property Quantity14: TsdValue read FQuantity0;
  420. property TotalPrice14 : TsdValue read FTotalPrice0;
  421. end;
  422. implementation
  423. { TBillsRecord }
  424. procedure TBillsRecord.DoAfterAddFields;
  425. begin
  426. inherited;
  427. FID := ValueByName('ID');
  428. FParentID := ValueByName('ParentID');
  429. FNextSiblingID := ValueByName('NextSiblingID');
  430. FSerialNo := ValueByName('SerialNo');
  431. FIsLeaf := ValueByName('IsLeaf');
  432. FLeafXmjParentID := ValueByName('LeafXmjParentID');
  433. FXiangCode := ValueByName('XiangCode');
  434. FMuCode := ValueByName('MuCode');
  435. FJieCode := ValueByName('JieCode');
  436. FXimuCode := ValueByName('XimuCode');
  437. FIndexCode := ValueByName('IndexCode');
  438. FChapterParentID := ValueByName('ChapterParentID');
  439. FCode := ValueByName('Code');
  440. FB_Code := ValueByName('B_Code');
  441. FName := ValueByName('Name');
  442. FUnits := ValueByName('Units');
  443. FAlias := ValueByName('Alias');
  444. FPrice := ValueByName('Price');
  445. FNewPrice := ValueByName('NewPrice');
  446. FOrgQuantity := ValueByName('OrgQuantity');
  447. FOrgTotalPrice := ValueByName('OrgTotalPrice');
  448. FMisQuantity := ValueByName('MisQuantity');
  449. FMisTotalPrice := ValueByName('MisTotalPrice');
  450. FOthQuantity := ValueByName('OthQuantity');
  451. FOthTotalPrice := ValueByName('OthTotalPrice');
  452. FQuantity := ValueByName('Quantity');
  453. FTotalPrice := ValueByName('TotalPrice');
  454. FCalcType := ValueByName('CalcType');
  455. FAddDealQuantity := ValueByName('AddDealQuantity');
  456. FAddDealTotalPrice := ValueByName('AddDealTotalPrice');
  457. FAddQcQuantity := ValueByName('AddQcQuantity');
  458. FAddQcTotalPrice := ValueByName('AddQcTotalPrice');
  459. FAddQcBGLCode := ValueByName('AddQcBGLCode');
  460. FAddQcBGLNum := ValueByName('AddQcBGLNum');
  461. FAddPcQuantity := ValueByName('AddPcQuantity');
  462. FAddPcTotalPrice := ValueByName('AddPcTotalPrice');
  463. FAddPcBGLCode := ValueByName('AddPcBGLCode');
  464. FAddPcBGLNum := ValueByName('AddPcBGLNum');
  465. FAddGatherQuantity := ValueByName('AddGatherQuantity');
  466. FAddGatherTotalPrice := ValueByName('AddGatherTotalPrice');
  467. FLockedLevel := ValueByName('LockedLevel');
  468. FLockedInfo := ValueByName('LockedInfo');
  469. FLockedNewPrice := ValueByName('LockedNewPrice');
  470. FCreatePhaseID := ValueByName('CreatePhaseID');
  471. FIsMeasureAdd := ValueByName('IsMeasureAdd');
  472. FPeg := ValueByName('Peg');
  473. FDrawingCode := ValueByName('DrawingCode');
  474. FMemoStr := ValueByName('MemoStr');
  475. FDgnQuantity1 := ValueByName('DgnQuantity1');
  476. FDgnQuantity2 := ValueByName('DgnQuantity2');
  477. FDgnPrice := ValueByName('DgnPrice');
  478. FDealDgnQuantity1 := ValueByName('DealDgnQuantity1');
  479. FDealDgnQuantity2 := ValueByName('DealDgnQuantity2');
  480. FCDgnQuantity1 := ValueByName('CDgnQuantity1');
  481. FCDgnQuantity2 := ValueByName('CDgnQuantity2');
  482. FAddDgnPrice := ValueByName('AddDgnPrice');
  483. FHasBookMark := ValueByName('HasBookMark');
  484. FMarkMemo := ValueByName('MarkMemo');
  485. FDealCode := ValueByName('DealCode');
  486. FDealCompany := ValueByName('DealCompany');
  487. FDealType := ValueByName('DealType');
  488. FAddCutTotalPrice := ValueByName('AddCutTotalPrice');
  489. FAddPayTotalPrice := ValueByName('AddPayTotalPrice');
  490. FAddCompleteRate := ValueByName('AddCompleteRate');
  491. FPM_AddTotalPrice := ValueByName('PM_AddTotalPrice');
  492. end;
  493. { TStageRecord }
  494. procedure TStageRecord.DoAfterAddFields;
  495. begin
  496. inherited;
  497. FBillsID := ValueByName('BillsID');
  498. FDealQuantity := ValueByName('DealQuantity');
  499. FDealTotalPrice := ValueByName('DealTotalPrice');
  500. FDealFlag := ValueByName('DealFlag');
  501. FDealFormula := ValueByName('DealFormula');
  502. FQcQuantity := ValueByName('QcQuantity');
  503. FQcTotalPrice := ValueByName('QcTotalPrice');
  504. FQcFlag := ValueByName('QcFlag');
  505. FQcFormula := ValueByName('QcFormula');
  506. FQcBGLCode := ValueByName('QcBGLCode');
  507. FQcBGLNum := ValueByName('QcBGLNum');
  508. FPcQuantity := ValueByName('PcQuantity');
  509. FPcTotalPrice := ValueByName('PcTotalPrice');
  510. FPcFlag := ValueByName('PcFlag');
  511. FPcFormula := ValueByName('PcFormula');
  512. FPcBGLCode := ValueByName('PcBGLCode');
  513. FPcBGLNum := ValueByName('PcBGLNum');
  514. FGatherQuantity := ValueByName('GatherQuantity');
  515. FGatherTotalPrice := ValueByName('GatherTotalPrice');
  516. FEndDealQuantity := ValueByName('EndDealQuantity');
  517. FEndDealTotalPrice := ValueByName('EndDealTotalPrice');
  518. FEndQcQuantity := ValueByName('EndQcQuantity');
  519. FEndQcTotalPrice := ValueByName('EndQcTotalPrice');
  520. FEndQcBGLCode := ValueByName('EndQcBGLCode');
  521. FEndQcBGLNum := ValueByName('EndQcBGLNum');
  522. FEndPcQuantity := ValueByName('EndPcQuantity');
  523. FEndPcTotalPrice := ValueByName('EndPcTotalPrice');
  524. FEndPcBGLCode := ValueByName('EndPcBGLCode');
  525. FEndPcBGLNum := ValueByName('EndPcBGLNum');
  526. FEndGatherQuantity := ValueByName('EndGatherQuantity');
  527. FEndGatherTotalPrice := ValueByName('EndGatherTotalPrice');
  528. FPreDealQuantity := ValueByName('PreDealQuantity');
  529. FPreDealTotalPrice := ValueByName('PreDealTotalPrice');
  530. FPreQcQuantity := ValueByName('PreQcQuantity');
  531. FPreQcTotalPrice := ValueByName('PreQcTotalPrice');
  532. FPreQcBGLCode := ValueByName('PreQcBGLCode');
  533. FPreQcBGLNum := ValueByName('PreQcBGLNum');
  534. FPrePcQuantity := ValueByName('PrePcQuantity');
  535. FPrePcTotalPrice := ValueByName('PrePcTotalPrice');
  536. FPrePcBGLCode := ValueByName('PrePcBGLCode');
  537. FPrePcBGLNum := ValueByName('PrePcBGLNum');
  538. FPreGatherQuantity := ValueByName('PreGatherQuantity');
  539. FPreGatherTotalPrice := ValueByName('PreGatherTotalPrice');
  540. FHasBookMark := ValueByName('HasBookMark');
  541. FMarkMemo := ValueByName('MarkMemo');
  542. FPM_PreTotalPrice := ValueByName('PM_PreTotalPrice');
  543. FPM_TotalPrice := ValueByName('PM_TotalPrice');
  544. end;
  545. { TProjectGLRecord }
  546. procedure TProjectGLRecord.DoAfterAddFields;
  547. begin
  548. inherited;
  549. FID := ValueByName('ID');
  550. FCode := ValueByName('Code');
  551. FName := ValueByName('Name');
  552. FUnits := ValueByName('Units');
  553. FSpecs := ValueByName('Specs');
  554. FBasePrice := ValueByName('BasePrice');
  555. FRiskRange := ValueByName('RiskRange');
  556. FLockedPhaseID := ValueByName('LockedPhaseID');
  557. FCreatePhaseID := ValueByName('CreatePhaseID');
  558. FInfoPrice := ValueByName('InfoPrice');
  559. FInfoDate := ValueByName('InfoDate');
  560. FDeltaPrice := ValueByName('DeltaPrice');
  561. FValidDeltaPrice := ValueByName('ValidDeltaPrice');
  562. FPM_PreQuantity := ValueByName('PM_PreQuantity');
  563. FPM_PreTotalPrice := ValueByName('PM_PreTotalPrice');
  564. FPM_Quantity := ValueByName('PM_Quantity');
  565. FPM_TotalPrice := ValueByName('PM_TotalPrice');
  566. FUsedQuantity := ValueByName('UsedQuantity');
  567. FUsedTotalPrice := ValueByName('UsedTotalPrice');
  568. FPAL_UsedQuantity := ValueByName('PAL_UsedQuantity');
  569. FPAL_UsedTotalPrice := ValueByName('PAL_UsedTotalPrice');
  570. FPAL_DeltaPrice := ValueByName('PAL_DeltaPrice');
  571. FPAL_Total := ValueByName('PAL_Total');
  572. end;
  573. { TDetailGLRecord }
  574. procedure TDetailGLRecord.DoAfterAddFields;
  575. begin
  576. inherited;
  577. FID := ValueByName('ID');
  578. FBillsID := ValueByName('BillsID');
  579. FGLID := ValueByName('GLID');
  580. FCode := ValueByName('Code');
  581. FQuantity := ValueByName('Quantity');
  582. FCreatePhaseID := ValueByName('CreatePhaseID');
  583. FLastBillsQuantity := ValueByName('LastBillsQuantity');
  584. FLockedPhaseID := ValueByName('LockedPhaseID');
  585. end;
  586. { TMeasureBaseRecord }
  587. procedure TMeasureBaseRecord.AddDifferValue(AValue: TsdValue;
  588. ADiffer: Double);
  589. begin
  590. if ADiffer <> 0 then
  591. AValue.AsFloat := AValue.AsFloat + ADiffer;
  592. end;
  593. procedure TMeasureBaseRecord.SetBoolValue(AValue: TsdValue;
  594. ABool: Boolean);
  595. begin
  596. if AValue.AsBoolean <> ABool then
  597. AValue.AsBoolean := ABool;
  598. end;
  599. procedure TMeasureBaseRecord.SetFloatValue(AValue: TsdValue;
  600. AFloat: Double);
  601. begin
  602. if AValue.AsFloat <> AFloat then
  603. AValue.AsFloat := AFloat;
  604. end;
  605. procedure TMeasureBaseRecord.SetIntValue(AValue: TsdValue; AInt: Integer);
  606. begin
  607. if AValue.AsInteger <> AInt then
  608. AValue.AsInteger := AInt;
  609. end;
  610. procedure TMeasureBaseRecord.SetStrValue(AValue: TsdValue; AStr: string);
  611. begin
  612. if AValue.AsString <> AStr then
  613. AValue.AsString := AStr;
  614. end;
  615. { TStageCompareRecord }
  616. procedure TStageCompareRecord.DoAfterAddFields;
  617. begin
  618. inherited;
  619. FID := ValueByName('ID');
  620. FQuantity0 := ValueByName('Quantity0');
  621. FTotalPrice0 := ValueByName('TotalPrice0');
  622. FQuantity1 := ValueByName('Quantity1');
  623. FTotalPrice1 := ValueByName('TotalPrice1');
  624. FQuantity2 := ValueByName('Quantity2');
  625. FTotalPrice2 := ValueByName('TotalPrice2');
  626. FQuantity3 := ValueByName('Quantity3');
  627. FTotalPrice3 := ValueByName('TotalPrice3');
  628. FQuantity4 := ValueByName('Quantity4');
  629. FTotalPrice4 := ValueByName('TotalPrice4');
  630. FQuantity5 := ValueByName('Quantity5');
  631. FTotalPrice5 := ValueByName('TotalPrice5');
  632. FQuantity6 := ValueByName('Quantity6');
  633. FTotalPrice6 := ValueByName('TotalPrice6');
  634. FQuantity7 := ValueByName('Quantity7');
  635. FTotalPrice7 := ValueByName('TotalPrice7');
  636. FQuantity8 := ValueByName('Quantity8');
  637. FTotalPrice8 := ValueByName('TotalPrice8');
  638. FQuantity9 := ValueByName('Quantity9');
  639. FTotalPrice9 := ValueByName('TotalPrice9');
  640. FQuantity10 := ValueByName('Quantity10');
  641. FTotalPrice10 := ValueByName('TotalPrice10');
  642. FQuantity11 := ValueByName('Quantity11');
  643. FTotalPrice11 := ValueByName('TotalPrice11');
  644. FQuantity12 := ValueByName('Quantity12');
  645. FTotalPrice12 := ValueByName('TotalPrice12');
  646. FQuantity13 := ValueByName('Quantity13');
  647. FTotalPrice13 := ValueByName('TotalPrice13');
  648. FQuantity14 := ValueByName('Quantity14');
  649. FTotalPrice14 := ValueByName('TotalPrice14');
  650. end;
  651. end.