mDataRecord.pas 24 KB

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