Автоматизированное рабочее место оператора автоматизированного переговорного пункта и информационной системыРефераты >> Программирование и компьютеры >> Автоматизированное рабочее место оператора автоматизированного переговорного пункта и информационной системы
ПРИЛОЖЕНИЕ 4
Текст программы АРМ АПП РК
; IAKoff Save, %n, 05/06/96 | |
iaphand | |
iaphand |
;IAKoff;12:49 PM 2 Mar 1996 |
n %T,%DEMO | |
s %DEMO="DEMO VERSION FOR DOORS" | |
l +^ReestrIndRK:1 | |
s %T=$TEST | |
i %T=0 l -^ReestrIndRK q | |
d ^iaphandinit | |
d ORDERLIST^iaphandsub | |
l -^ReestrIndRK | |
q | |
; ----------------------------------------------------------- | |
ADDORDER(%nord) | |
n %f,%addtime,%zone,%tarif,%tarif1,%notify,%key,%ef,%DDDD,%HHHH | |
n %month,%ltarif | |
s %ltarif=0 | |
s %DDDD=$p($h,",",1) | |
s %HHHH=$p($h,",",2) | |
s %f("FAST")=0 s %f("TOTAL")=0 s %f("TIME")=3 | |
i $g(%nord)="" g add | |
i $p(^appstat("ORDERS",%nord),$c(30),20)'="" g VIEWORDER | |
d str2frm^uf58("%f",^appstat("ORDERS",%nord),$c(30),"iap!HORD") | |
s %notify=$p(^appstat("ORDERS",%nord),$c(30),18) | |
s %ef=1 | |
g edd | |
add | |
s %ef=0 | |
s %key=$$^dp58dlg(10,30,15,50,"ОФОРМЛЕНИЕ ЗАКАЗА","ТЕКУЩИЙ"_%_"УВЕДОМЛЕНИЕ","",2,"","VC") i $p(%key,%,2)="KEYESC" q | |
s %notify=$p(%key,%,1)-1 | |
s %nord=$g(^appstat("LASTORDER"))+1 | |
s %month=$g(^appstat("LASTORDER","MONTH")) | |
i ($p($zdate,"/",1)+0)'=%month s %nord=1 s %month=($p($zdate,"/",1)+0) | |
edd | |
d drscr^uf58($s(%notify=0:"iap!HORD",%notify=1:"iap!NORD")) | |
w /color(7,0),/c(20,3),$j(%nord,3) | |
i $$get^uf58($s(%notify=0:"iap!HORD",%notify=1:"iap!NORD"),"%f")="ESC" q | |
s %f("X")=%addtime,%f("Y")=%tarif,%f("Z")=%zone,%f("ZZ")=%notify | |
s ^appstat("ORDERS",%nord)=$$frm2str^uf58("%f",%)_%_$h_%_""_%_%APPSYS("NOM_OPER") | |
s $p(^appstat("ORDERS",%nord),$c(30),25)=%ltarif | |
i %ef=0 s ^appstat("LASTORDER")=%nord s ^appstat("LASTORDER","MONTH")=%month | |
q | |
; ----------------------------------------------------------- | |
VIEWORDER | |
d str2frm^uf58("%f",^appstat("ORDERS",%nord),$c(30),"iap!HORD") | |
s %notify=$p(^appstat("ORDERS",%nord),$c(30),18) | |
s %tarif1=$p(^appstat("ORDERS",%nord),$c(30),16) | |
s %addtime=$p(^appstat("ORDERS",%nord),$c(30),15) | |
d drscr^uf58($s(%notify=0:"iap!HORD",%notify=1:"iap!NORD",%notify=2:"iap!FORD")) | |
w /color(7,0),/c(20,3),$j(%nord,3) | |
d redraw^uf58($s(%notify=0:"iap!HORD",%notify=1:"iap!NORD",%notify=2:"iap!FORD"),"%f") | |
w /c(57,5),/color(7,0),$zzc(%tarif1,13) | |
w /color(7,0),/c(38,10),$j(%addtime,3) | |
w /color(7,0),/c(26,3),"Оператор МТТС : "_$j($p(^appstat("ORDERS",%nord),$c(30),24),3) | |
vo1 | |
s %key=$$RKey^uf58() i %key="KEYNOPRESS" g vo1 | |
q | |
; ----------------------------------------------------------- | |
OutCOUNTRY() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q %ufNEWDATA | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
i $p(%ufNEWDATA,$c(30),1)="" q "СНГ"_$c(30)_$p(%ufNEWDATA,$c(30),2) | |
i $p(%ufNEWDATA,$c(30),1)="СНГ" q %ufNEWDATA | |
n %id,%res | |
s %id=$p(%ufNEWDATA,$c(30),1) | |
i $d(^appACDC(%id))>0 q %ufNEWDATA | |
s %res=$$LIST^dp58Sel("^appACDC(%id)","%id",20,13,40,8,"",0,"SINGLE","","DrawCOUNTRY^iaphand") | |
i $p(%res,$c(30),2)="KEYESC" q "PROBLEM" | |
q %id_$c(30)_"KEYENTER" | |
DrawCOUNTRY | |
i %dpINDEX="DRAWFREE" w $j("",%dpSX) q | |
w $j(%id,%dpSX) q | |
OutSHTAT() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
n %id,%id1,%res | |
s %id=$p(%ufNEWDATA,$c(30),1) | |
s %id1=%f("COUNTRY") i %id1="СНГ" g OutSHT1 | |
i %id="" g OutSHT0 | |
i $d(^appACDC(%id1,%id))>0 q %ufNEWDATA | |
OutSHT0 | |
s %res=$$LIST^dp58Sel("^appACDC(%id1,%id)","%id",20,13,40,8,"",0,"SINGLE","","DrawCOUNTRY^iaphand") | |
g OutSHT2 | |
OutSHT1 | |
i %id="" g OutSHT3 | |
i $d(^app8ACDC(%id))>0 q %ufNEWDATA | |
OutSHT3 | |
s %res=$$LIST^dp58Sel("^app8ACDC(%id)","%id",20,13,40,8,"",0,"SINGLE","","DrawCOUNTRY^iaphand") | |
OutSHT2 | |
i $p(%res,$c(30),2)="KEYESC" q "PROBLEM" | |
q %id_$c(30)_"KEYENTER" | |
InREGION() | |
s %f("REGION")="" | |
i %f("COUNTRY")'="СНГ" q "FIELDOFF" | |
q %ufOLDDATA | |
OutREGION() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
n %id1,%id,%res | |
s %id1=%f("SHTAT") | |
s %id=$p(%ufNEWDATA,$c(30),1) | |
i %id="" q %ufNEWDATA | |
i $d(^app8ACDC(%id1,%id))>0 q %ufNEWDATA | |
s %res=$$LIST^dp58Sel("^app8ACDC(%id1,%id)","%id",20,13,40,8,"",0,"SINGLE","","DrawCOUNTRY^iaphand") | |
i $p(%res,$c(30),2)="KEYESC" q "PROBLEM" | |
q %id_$c(30)_"KEYENTER" | |
OutTARGET() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
q %ufNEWDATA | |
InCODE() | |
i %f("COUNTRY")'="СНГ" q ^appACDC(%f("COUNTRY"),%f("SHTAT")) | |
i (^app8ACDC(%f("SHTAT"))=^AppSys58("KOD_OBLS"))&(%f("REGION")="") q 2 | |
i %f("REGION")="" q ^app8ACDC(%f("SHTAT")) | |
i ^app8ACDC(%f("SHTAT"))=^AppSys58("KOD_OBLS") q 2_^app8ACDC(%f("SHTAT"),%f("REGION")) | |
q ^app8ACDC(%f("SHTAT"))_^app8ACDC(%f("SHTAT"),%f("REGION")) | |
OutCODE() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
i $l($p(%ufNEWDATA,$c(30),1))<3 q "PROBLEM" | |
n %code s %code=$e($p(%ufNEWDATA,$c(30),1),1,3) | |
i %f("COUNTRY")="СНГ" g outcod | |
i $g(^appMGTRF(%code))="" s ^appMGTRF(%code)=3 | |
s %zone=^appMGTRF(%code) | |
i $g(^appstat("TARIF","HAND810",%zone))="" s ^appstat("TARIF","HAND810",%zone)=^appstat("TARIF","HAND810",3) | |
s %tarif1=$$NTARIF(^appstat("TARIF","HAND810",%zone)) | |
g outcod1 | |
outcod | |
i $e(%code,1,1)="2" s %code=^AppSys58("KOD_OBLS") | |
i $g(^app8MTRF(%code))="" s ^app8MTRF(%code)=3 | |
s %zone=^app8MTRF(%code) | |
i $g(^appstat("TARIF","HAND8",%zone))="" s ^appstat("TARIF","HAND8",%zone)=^appstat("TARIF","HAND8",3) | |
s %tarif1=$$NTARIF(^appstat("TARIF","HAND8",%zone)) | |
outcod1 | |
w /c(57,5),/color(7,0),$zzc(%tarif1,13) | |
q %ufNEWDATA | |
NTARIF(Str) | |
s %ltarif=$$SHARE^AppSyst(%DDDD,%HHHH) | |
s Str=$p(Str,$c(30),%ltarif+1) | |
i Str<20 s Str=Str*^AppSys58("USD_KURS") | |
q Str | |
q %ufNEWDATA | |
InPH1() | |
i %notify s %f("PH1")="" q "FIELDOFF" | |
q %ufOLDDATA | |
OutPH1() | |
i %notify q $p(%ufNEWDATA,$c(30),1)_%_"KEYENTER" | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
;i $p(%ufNEWDATA,$c(30),1)="" q "PROBLEM" | |
q %ufNEWDATA | |
InDATE() | |
;n %dd s %dd=$$DATE^dp58sys() | |
;i %ufOLDDATA="" q $p(%dd,"/",1)_$p(%dd,"/",2)_$p(%dd,"/",3) | |
q %ufOLDDATA | |
OutDATE() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
i $e($p(%ufNEWDATA,$c(30),1),5,6)="" s $p(%ufNEWDATA,$c(30),1)=$p(%ufNEWDATA,$c(30),1)_"96" | |
n %d s %d=$p(%ufNEWDATA,$c(30),1) | |
s %DDDD=$$DATE2SYS^dp58sys($e(%d,1,2)_"/"_$e(%d,3,4)_"/"_$e(%d,5,6)) | |
q %ufNEWDATA | |
InNTIME() | |
;n %dd s %dd=$$TIME^dp58sys() | |
;i %ufOLDDATA="" q $p(%dd,":",1)_$p(%dd,":",2) | |
q %ufOLDDATA | |
OutNTIME() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
n %t s %t=$p(%ufNEWDATA,$c(30),1) | |
s %HHHH=$$TIME2SYS^dp58sys($e(%t,1,2)_":"_$e(%t,3,4)) | |
i %f("COUNTRY")="СНГ" s %tarif1=$$NTARIF(^appstat("TARIF","HAND8",%zone)) | |
i %f("COUNTRY")'="СНГ" s %tarif1=$$NTARIF(^appstat("TARIF","HAND810",%zone)) | |
w /c(57,5),/color(7,0),$zzc(%tarif1,13) | |
q %ufNEWDATA | |
InADDR() | |
q "" | |
OutADDR() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
q %ufNEWDATA | |
InPH() | |
i %notify s %f(%ufII)="" q "FIELDOFF" | |
i %f("PH"_($e(%ufII,3,3)-1))="" s %f(%ufII)="" q "FIELDOFF" | |
q %ufOLDDATA | |
OutPH() | |
i %notify q ""_%_"KEYENTER" | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
q %ufNEWDATA | |
OutCALL() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
i (%notify)&($p(%ufNEWDATA,$c(30),1)="") q "PROBLEM" | |
q %ufNEWDATA | |
OutTIME() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
i ($p(%ufNEWDATA,$c(30),1)="")&(%f("PH1")="") g outime2 | |
i ($p(%ufNEWDATA,$c(30),1)+0)<3 q "PROBLEM" | |
i ($p(%ufNEWDATA,$c(30),1)+0)>255 q "PROBLEM" | |
outime2 | |
s %addtime=0 | |
s %addtime=$p(^SpravUsl(61+%notify),%,4) | |
i %f("CALL")'="" s %addtime=%addtime+$p(^SpravUsl(61+%notify,31),%,4) | |
i %notify g outime1 | |
i %f("PH1")="" s %addtime=%addtime+$p(^SpravUsl(61,32),%,4) g outime1 | |
i %f("PH5")'="" s %addtime=%addtime+$p(^SpravUsl(61,35),%,4) g outime1 | |
i %f("PH4")'="" s %addtime=%addtime+$p(^SpravUsl(61,34),%,4) g outime1 | |
i %f("PH3")'="" s %addtime=%addtime+$p(^SpravUsl(61,33),%,4) g outime1 | |
outime1 | |
w /color(7,0),/c(38,10),$j(%addtime,3) | |
q %ufNEWDATA | |
OutFAST() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
q %ufNEWDATA | |
InTOTAL() | |
n %summ | |
s %tarif=%tarif1*$p(^SpravUsl(61+%notify,10+%f("FAST")),%,4) | |
s %summ=%tarif*(%f("TIME")+%addtime) | |
w /c(57,5),/color(7,0),$zzc(%tarif,13) | |
q $zzoo(%summ) | |
OutTOTAL() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q $p(%ufNEWDATA,$c(30),1)_$c(30)_"KEYUP" | |
i $p(%ufNEWDATA,$c(30),2)'="KEYENTER" q "PROBLEM" | |
q %ufNEWDATA | |
AskPrint() | |
n %Ret | |
askdel | |
s %Ret=$$^dp58dlg(20,42,23,77,"ПОДТВЕРДИТЕ ПЕЧАТЬ"," Печатать "_%_" Не печатать ","",2,"7,0,7,0,0,7,7,0") | |
w /color(0,8) | |
d ^dp58box(20,42,23,77,0," ") | |
i $p(%Ret,%,2)="KEYENTER" q (2-%Ret) | |
i $p(%Ret,%,2)="KEYESC" q 0 | |
g askdel | |
; IAKoff Save, %n, 05/06/96 | |
iaphandsub | |
iaphandsub |
;IAKoff;02:41 PM 2 Mar 1996; |
q | |
SYSH() |
q %APPSYS("NOM_OPER")_","_%APPSYS("NOM_SMEN")_","_%APPSYS("NOM_DENN")_","_%APPSYS("NOM_MESS") |
ORDERLIST | |
n %key,%title,%id | |
s %title="Nзк Опр "_$zzr("СТРАНА",7)_$zzr("ОБЛАСТЬ",8)_$zzr("РЕГИОН",7)_$zzr("НАС.ПУНКТ",10)_$zzr("ПРИНЯТ",9)_$zzr("ПЕРЕДАН",9)_$zzr("ЖДЕТ",6) | |
ordlist | |
s %key=$$LIST^dp58Sel("^appstat(""ORDERS"",%id)","%id",2,3,65,8,"",0,"SINGLE"," Список заказов "_%_$zzr(%title,58)_%_"F2-Принять F4-Ред/Смтр F8-Снять <ENTER>-Прд/Вып/Ост","DrawORDERS^iaphandsub","KEYF2,KEYF8,KEYF4") | |
i $p(%key,%,2)="KEYESC" q | |
i $p(%key,%,2)="KEYF2" d ADDORDER^iaphand() g ordlist | |
i %id="" g ordlist | |
i $p(%key,%,2)="KEYF4" d ADDORDER^iaphand(%id) g ordlist | |
i ($p(%key,%,2)="KEYENTER")&($p(^appstat("ORDERS",%id),%,23)'="") d REST(%id) g ordlist | |
i ($p(%key,%,2)="KEYENTER")&($p(^appstat("ORDERS",%id),%,20)="") d SENT(%id) g ordlist | |
i $p(%key,%,2)="KEYENTER" d EXECUTE(%id) g ordlist | |
i $p(%key,%,2)="KEYF8" d ABORT(%id) g ordlist | |
g ordlist | |
DrawORDERS | |
i %dpINDEX="DRAWFREE" w $j("",%dpSX) q | |
i %id="" w $zzr(" НЕТ ЗАКАЗОВ ",%dpSX) q | |
w $zzr(%id,4) | |
w $zzr($e($p(^appstat("ORDERS",%id),%,21),1,3),4) | |
w $zzr($e($p(^appstat("ORDERS",%id),%,3),1,6),7) | |
w $zzr($e($p(^appstat("ORDERS",%id),%,11),1,7),8) | |
w $zzr($e($p(^appstat("ORDERS",%id),%,10),1,6),7) | |
w $zzr($e($p(^appstat("ORDERS",%id),%,12),1,9),10) | |
i $p(^appstat("ORDERS",%id),%,23)="" g drord3 | |
w "Остаток:"_$zzc($p(^appstat("ORDERS",%id),%,23),17) g drord2 | |
drord3 | |
i $p(^appstat("ORDERS",%id),%,18) g drord1 | |
w $$TIME^dp58sys($p($p(^appstat("ORDERS",%id),%,19),",",2))_" " | |
i $p(^appstat("ORDERS",%id),%,20)="" w "----- " | |
e w $$TIME^dp58sys($p($p(^appstat("ORDERS",%id),%,20),",",2))_" " | |
w $zzr(($p($h,",",2)-$p($p(^appstat("ORDERS",%id),%,19),",",2))\60,3)_"мин " | |
g drord2 | |
drord1 | |
n %d s %d=$p(^appstat("ORDERS",%id),$c(30),5) | |
w $j($e(%d,1,2)_"/"_$e(%d,3,4)_"/"_$e(%d,5,6),9) | |
s %d=$p(^appstat("ORDERS",%id),$c(30),6) w $j($e(%d,1,2)_":"_$e(%d,3,4),9) | |
w $j("",7) | |
drord2 | |
q | |
SENT(%nord) | |
n %key,%msg,%notify,%ord,%reestr,%fff | |
s %ord=^appstat("ORDERS",%nord) | |
s %notify=$p(%ord,%,18) | |
s %msg=%APPSYS("NOM_GOES")_"-му отд. связи"_% | |
i $p(%ord,%,4)=1 s %msg=%msg_"СРОЧНЫЙ"_% | |
s %msg=%msg_$p(%ord,%,3)_% | |
i %notify s %msg=%msg_$p(%ord,%,11)_% | |
i %notify s %msg=%msg_$p(%ord,%,10)_% | |
i %notify s %msg=%msg_$p(%ord,%,12)_% | |
i '%notify s %msg=%msg_"Код:"_$p(%ord,%,2)_% | |
i %notify s %msg=%msg_$tr($p(%ord,%,7)," ",%)_% | |
i %notify s %msg=%msg_"Дата:"_$p(%ord,%,5)_% | |
e s %msg=%msg_"Тел:"_$p(%ord,%,5)_% | |
i %notify s %msg=%msg_"Время:"_$p(%ord,%,6)_% | |
i '%notify f %key=6:1:9 i $p(%ord,%,%key)'="" s %msg=%msg_" или "_$p(%ord,%,%key)_% | |
i $p(%ord,%,1)'="" s %msg=%msg_"Пригласить "_$p(%ord,%,1)_% | |
s %msg=%msg_$p(%ord,%,13)_" минут"_% | |
s %key=$$^dp58dlg(3,20,5+$l(%msg,%),60,%msg,"ПЕРЕДАН"_%_"ОТКАЗ","",2,"","") | |
i $p(%key,$c(30),2)="KEYESC" q | |
i $p(%key,$c(30),1)=2 q | |
s %fff("NOPER")="" | |
d drscr^uf58("iap!HSENT") | |
i $$get^uf58("iap!HSENT","%fff")="ESC" q | |
s $p(%ord,%,24)=%fff("NOPER") | |
s $p(%ord,%,20)=$p($h,",",2-$p(%ord,%,18)) | |
s $p(%ord,%,28)=$$SYSH | |
s ^appstat("ORDERS",%nord)=%ord | |
s %reestr=$$REESTR^iaphandsub("ПРН",%nord,$p(%ord,%,13),,$p(%ord,%,14),,) | |
d AddOplata^AppSys($s($p(%ord,%,3)="СНГ":81,1:881),$p(%ord,%,14),%reestr,"",$$KVITAN(%nord,%ord,0)) | |
d ADDRRR(%reestr) | |
i $$AskPrint^iaphand() d PrintKvit^AppSysd | |
e d NewKvit^AppSysd | |
q | |
InTIME() | |
i ($p(^appstat("ORDERS",%id),%,13)+0)<3 s %fff("TIME")=0 q "FIELDOFF" | |
i $p(^appstat("ORDERS",%id),%,13)'>3 s %fff("TIME")=3 q "FIELDOFF" | |
q $p(^appstat("ORDERS",%id),%,13) | |
OutTIME() | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q %ufNEWDATA | |
i ($p(%ufNEWDATA,$c(30),1)+0)<3 q "PROBLEM" | |
i ($p(%ufNEWDATA,$c(30),1)+0)>$p(^appstat("ORDERS",%id),%,13) q "PROBLEM" | |
q %ufNEWDATA | |
InTEL() | |
n %ntel,%i | |
i $p(^appstat("ORDERS",%id),%,18)=1 s %fff("TEL")=0 q "FIELDOFF" | |
s %ntel=0 f %i=5:1:9 i $p(^appstat("ORDERS",%id),%,%i)'="" s %ntel=%ntel+1 | |
i %ntel=1 s %fff("TEL")=1 q "FIELDOFF" | |
q %ntel | |
OutTEL() | |
n %ntel,%i | |
s %ntel=0 f %i=5:1:9 i $p(^appstat("ORDERS",%id),%,%i)'="" s %ntel=%ntel+1 | |
i %ntel=0 q %ufNEWDATA | |
i ($p(%ufNEWDATA,$c(30),1)+0)<1 q "PROBLEM" | |
i ($p(%ufNEWDATA,$c(30),1)+0)>%ntel q "PROBLEM" | |
q %ufNEWDATA | |
EXECUTE(%nord) | |
n %fff,%reestr,%tsumm,%ord,%ntel,%i,%key | |
s %ntel=0 | |
i $p(^appstat("ORDERS",%nord),%,18) g exec2 | |
f %i=5:1:9 i $p(^appstat("ORDERS",%id),%,%i)'="" s %ntel=%ntel+1 | |
exec2 | |
s %ord=^appstat("ORDERS",%nord) | |
s %fff("TIME")=$p(%ord,%,13) | |
d drscr^uf58("iap!HEXEC") | |
i $$get^uf58("iap!HEXEC","%fff")="ESC" q | |
s %fff("NOPER")=$p(%ord,%,24) | |
d drscr^uf58("iap!HSTOL") | |
i $$get^uf58("iap!HSTOL","%fff")="ESC" q | |
s $p(%ord,%,24)=%fff("NOPER") | |
s %key=$$^dp58dlg(7,20,11,60,"Подтвердите выполнение","ВЫПОЛНИТЬ"_%_"ОТМЕНА","",2,"","") | |
i $p(%key,$c(30),2)="KEYESC" g exec2 | |
i $p(%key,$c(30),1)=2 q | |
s $p(%ord,%,22)=%fff("TIME") | |
i %ntel=0 s $p(%ord,%,27)=%fff("TEL") g exec1 | |
s %i=0 i %ntel>2 s %i=$p(^SpravUsl(61,30+%ntel),%,4) | |
s $p(%ord,%,15)=$p(%ord,%,15)-%i | |
s %i=0 i %fff("TEL")>2 s %i=$p(^SpravUsl(61,30+%fff("TEL")),%,4) | |
s $p(%ord,%,15)=$p(%ord,%,15)+%i | |
s $p(%ord,%,27)=%fff("TEL") | |
exec1 | |
s %tsumm=$zzoo((%fff("TIME")+$p(%ord,%,15))*$p(%ord,%,16)) | |
s %rest=$p(%ord,%,14)-%tsumm | |
s $p(%ord,%,23)=%rest | |
i %rest=0 s %key=1 g exec11 | |
s %key=$$^dp58dlg(3,20,7,60,"Неужели клиент явился за остатком ?","ЯВИЛСЯ"_%_"НЕ ЯВИЛСЯ","",2,"","") | |
i $p(%key,$c(30),2)="KEYESC" g exec2 | |
exec11 | |
s ^appstat("ORDERS",%nord)=%ord | |
s %reestr=$$REESTR("ВЫП",%nord,$p(%ord,%,13),$p(%ord,%,22),,%tsumm,) | |
;d AddOplata^AppSys($s($p(%ord,%,3)="СНГ":82,1:882),%tsumm,%reestr) | |
d AddOplata^AppSys($s($p(%ord,%,3)="СНГ":82,1:882),0,%reestr) | |
d ADDRRR(%reestr) | |
i $p(%key,$c(30),1)=1 g exec4 | |
s %reestr=$$REESTR("НЕВ",%nord,$p(%ord,%,13),$p(%ord,%,22),,,%rest) | |
d AddOplata^AppSys($s($p(%ord,%,3)="СНГ":84,1:884),0,%reestr,"","Заказ "_%nord) | |
d ADDRRR(%reestr) | |
g exec3 | |
exec4 | |
s %reestr=$$REESTR("ОСТ",%nord,$p(%ord,%,13),$p(%ord,%,22),,,%rest) | |
s %i=$s($p(%ord,%,3)="СНГ":85,1:885) | |
s %i=%i+($$SYSH=$p(%ord,%,28)) | |
d AddOplata^AppSys(81,$p(%ord,%,14),"","",$$KVITAN(%nord,%ord,1),"p") | |
d AddOplata^AppSys(%i,-%rest,%reestr) | |
d ADDRRR(%reestr) | |
i %rest>0 s %key=$$^dp58msg(3,20,"Барышня,"_%_"верните пожалуста клиенту остаток"_%_$zzc(%rest),0) | |
k ^appstat("ORDERS",%nord) | |
i $$AskPrint^iaphand() d PrintKvit^AppSysd | |
e d NewKvit^AppSysd | |
exec3 | |
q | |
ABORT(%nord) | |
n %ord,%notify,%tarif,%key,%id,%tsumm,%rest,%reestr,%ttime,%fff | |
s %ord=^appstat("ORDERS",%nord) s %notify=$p(%ord,%,18) | |
i $p(%ord,%,20)="" s %key=$$^dp58msg(3,20,"Девушка с двумя веслами,"_%_"нельзя снимать заказ"_%_"если вы его еще не педерали",0) q | |
s %tarif=$p(%ord,%,16) | |
abr2 | |
s %id="" | |
s %key=$$LIST^dp58Sel("^SpravUsl(61+%notify,51,%id)","%id",60,3,10,11,"",0,"SINGLE","Причина","DrawREASON^iaphandsub") | |
i $p(%key,%,2)="KEYESC" q | |
s $p(%ord,%,26)=$p(^SpravUsl(61+%notify,51,%id),%,1) | |
s %ttime=$p(^SpravUsl(61+%notify,50,%id),%,4) | |
i $p(%ord,%,1)'="" s %ttime=%ttime+$p(^SpravUsl(61+%notify,51,%id),%,4) | |
i %notify g abr1 | |
i $p(%ord,%,5)="" s %ttime=%ttime+$p(^SpravUsl(61,52,%id),%,4) g abr1 | |
i $p(%ord,%,9)'="" s %ttime=%ttime+$p(^SpravUsl(61,55,%id),%,4) g abr1 | |
i $p(%ord,%,8)'="" s %ttime=%ttime+$p(^SpravUsl(61,54,%id),%,4) g abr1 | |
i $p(%ord,%,7)'="" s %ttime=%ttime+$p(^SpravUsl(61,53,%id),%,4) g abr1 | |
abr1 | |
s %fff("NOPER")=$p(%ord,%,24) | |
d drscr^uf58("iap!HSTOL") | |
i $$get^uf58("iap!HSTOL","%fff")="ESC" g abr2 | |
s $p(%ord,%,24)=%fff("NOPER") | |
s %tsumm=$zzoo(%ttime*$p(%ord,%,16)) | |
s %rest=$p(%ord,%,14)-%tsumm | |
s $p(%ord,%,23)=%rest | |
s %key=$$^dp58dlg(3,20,7,60,"Неужели клиент явился за остатком ?","ЯВИЛСЯ"_%_"НЕ ЯВИЛСЯ","",2,"","") | |
i $p(%key,$c(30),2)="KEYESC" g abr2 | |
s ^appstat("ORDERS",%nord)=%ord | |
s %reestr=$$REESTR("СНТ",%nord,$p(%ord,%,13),$p(%ord,%,22),,%tsumm,) | |
d AddOplata^AppSys($s($p(%ord,%,3)="СНГ":82,1:882),0,%reestr) | |
d ADDRRR(%reestr) | |
i $p(%key,$c(30),1)=1 g abr4 | |
s %reestr=$$REESTR("НЕВ",%nord,$p(%ord,%,13),$p(%ord,%,22),,,%rest) | |
d AddOplata^AppSys($s($p(%ord,%,3)="СНГ":84,1:884),0,%reestr,"","Заказ "_%nord) | |
d ADDRRR(%reestr) | |
g abr3 | |
abr4 | |
s %reestr=$$REESTR("ОСТ",%nord,$p(%ord,%,13),$p(%ord,%,22),,,%rest) | |
s %i=$s($p(%ord,%,3)="СНГ":85,1:885) | |
s %i=%i+($$SYSH=$p(%ord,%,28)) | |
d AddOplata^AppSys(81,$p(%ord,%,14),"","",$$KVITAN(%nord,%ord,1),"p") | |
d AddOplata^AppSys(%i,-%rest,%reestr) | |
d ADDRRR(%reestr) | |
i %rest>0 s %key=$$^dp58msg(3,20,"Барышня,"_%_"верните пожалуста клиенту остаток"_%_$zzc(%rest),0) | |
k ^appstat("ORDERS",%nord) | |
i $$AskPrint^iaphand() d PrintKvit^AppSysd | |
e d NewKvit^AppSysd | |
abr3 | |
q | |
DrawREASON | |
i %dpINDEX="DRAWFREE" w $j("",%dpSX) q | |
w $zzr($p(^SpravUsl(61+%notify,51,%id),%,1),%dpSX) q | |
REST(%nord) | |
n %ord,%notify,%tarif,%key,%id,%tsumm,%rest,%reestr,%ttime,%i |