I used library routnies ,which i took from Autoline help .
Report detail is :
1.S0-HEADER (HEADER RECORDS) TYPE ID PATH
2.SO-LOGLA (LABOUR LOG FILE) S 0 1
3.S0-LOGPA (PARTS LOG FILE) S 0 1
LABV 0: !2_WIPNO = !1_WIPNO : !2_LINE = 0
LABC 0:GOSUB 'rg_build(RG_HANDLE(2) , 1 , SYM(RG_RECORD2$()))
PARV 0:GOSUB 'rg_start(RG_HANDLE(2),REC_KEY$,1)
PARC 0:GOSUB 'rg_read_next(RG_HANDLE(2),1,SYM(RG_RECORD2$()))
WHILE ki_status = 0 AND !2_WIPNO = !1_WIPNO DO
LABC !0_LABC + 1
LABV !0_LABV + (!2_ALLOWED * !2_RATE)
!3_WIPNO = !1_WIPNO : !3_LINE = 0
GOSUB 'rg_build(RG_HANDLE(3) , 1 , SYM(RG_RECORD3$()))
WHILE ki_status = 0 AND !3_WIPNO = !1_WIPNO DO
PARC !0_PARC + 1
PARV !0_PARV + (!3_SELLPRCE * !3_ORDERQTY)
TOTV !0_LABV + !0_PARV
!1_CREATED >= !0_FROM and !1_CREATED <= !0_TO
Report is executing fine , but i am not able to get results like parts sold ,labour cost & Total.
I think the problem is in connections of tables. Any body help me to sort out this report problem.
If I had written this I would have changed the table connections to 'Calculated'
What are you trying to acheive with !0_LABC ?
I'm gueesing this is the labour cost but all you're doing in that line is increasing the LABC (and PARC) by an increment of 1 (i.e. your just counting the lines)
Other than that it doesn't look too bad. One thing to remember though with value reports like this is taking into account Discounts applied to individual lines and Menu Pricing variances.
Your selection doesn't take into account if the WIP is closed. That is fine but don't forget that the allowed time and rate can be changed at the point of invoicing so forecasting from these figures cpould be way out!
Hope that helps.
I also tried the "=" calculated link connection between tables but the same result. I cant get variable values and even if i want to take any field from Labour log or parts log table its giving null in output. The problem is same even by using calculated "=" connection in tables.
Actually i want to make the report inwhich i could get parts price and labour price of costed wips . Well these routines i find out in examples ,but its giving no results. If you have any better logic for taking invoiced wips parts and labour details ,kindly give it to me .
1 SO 10 loghd Header log
2 SL 10 accts Sales ledger accounts
3 SO ** depts Department codes
4 SO ** logpa Parts log file
5 SO ** logla Labour log file
6 NL ** accts Nominal account codes
7 NL ** ccent Nominal department codes
8 NL ** expen Nominal expense codes
Type !id Column Path
S 1 SLPLAC 1
S 1 DEPT 1
S 0 3
S 0 2
S 2 NLCONTRL 1
S 6 COSTCENT 1
S 6 EXPENSE 1
PRTVAL (!1_DEPT = "P" OR !1_DEPT ="R" ?!1_GROSS:0)
LBLVAL (!1_DEPT <> "P" AND !1_DEPT <> "R"?!1_GROSS:0)
!4_RECTYPE="S":!4_WIPNO = !1_WIPNO:!4_LINE=0:!4_MAGIC=0
while true do : 'rg_read_next(rg_handle(4),3,sym(rg_Record4$()))
if ki_status <> 0 or !4_wipno <> !1_wipno then break
SIGN !0_SIGN * !4_CONTRIB/100
ORDERQTY!4_ORDERQTY * !0_SIGN
SALEVAL !4_SELLPRCE * !0_ORDERQTY * ((100 - !4_DISCOUNT)/100)
COSTVAL !4_COSTPRCE * !0_ORDERQTY
PROFIT !0_SALEVAL - !0_COSTVAL
PSVAL !0_PSVAL + (!4_INVOICE=!1_INVOICE?!0_SALEVAL:0)
PCVAL !0_PCVAL + (!4_INVOICE=!1_INVOICE?!0_COSTVAL:0)
while true do : 'rg_read_next(rg_handle(5),2,sym(rg_Record5$()))
if ki_status <> 0 or !5_wipno <> !1_wipno then break
SIGN (!5_INVSTAT = "C" ? -1 : 1 )
SIGN !0_SIGN * !5_CONTRIB / 100
SALEVAL !5_ALLOWED*!5_RATE*!5_MINSUNIT/60 *!0_SIGN*((100-!5_DISCPC)/100)
COSTVAL !5_TAKEN * !5_HOURCOST * !0_SIGN
LSVAL !0_LSVAL + (!5_INVOICE=!1_INVOICE?!0_SALEVAL:0)
LCVAL !0_LCVAL + (!5_INVOICE=!1_INVOICE?!0_COSTVAL:0)
PPROFIT !0_PSVAL - !0_PCVAL
LPROFIT !0_LSVAL - !0_LCVAL
PPC (100/!0_PSVAL) * !0_PPROFIT:ERROR DO : !0_PPC =0:END DO
LPC (100/!0_LSVAL)*!0_LPROFIT:ERROR DO : !0_LPC =0:END DO
WAR ( !2_ACTYPE="W" ? !0_PSVAL+!0_LSVAL : 0 )
INT ( !2_ACTYPE="I" ? !0_PSVAL+!0_LSVAL : 0 )
RETAIL (!2_ACTYPE <> "W" and !2_ACTYPE <> "I" ? !0_PSVAL+!0_LSVAL : 0)
Who is online
Users browsing this forum: No registered users and 1 guest