| | | | | | | | | | Izpis SQL-I | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| Opcije: | | | | | | | | | | |
| | | | | | | | | | | |
| Kriteriji: | | | | | | | | | | |
| | | | | | | | | | | |
| | | 10 | Izvajanje | | | Naredi začasno tabelo | | | | |
Naredi začasno tabelo | | | | | | | | | | | |
SQL ukaz | | | | | | | | | | | |
create table ##PrenosLicenc | | | | | | | | | | | |
( | | | | | | | | | | | |
IDENT char(16), | | | | | | | | | | | |
KOLICINA money | | | | | | | | | | | |
) | | | | | | | | | | | |
| | | 40 | Izvajanje | | | Naredi računa na NA partnerju | | | | |
Naredi računa na NA partnerju | | | | | | | | | | | |
SQL ukaz | | | | | | | | | | | |
declare | | | | | | | | | | | |
@cKljuc char(9), | | | | | | | | | | | |
@cIdent char(16), | | | | | | | | | | | |
@fKolicina money, | | | | | | | | | | | |
@dtDatum datetime, | | | | | | | | | | | |
@nPoz int, | | | | | | | | | | | |
@cOk char | | | | | | | | | | | |
| | | | | | | | | | | |
set @dtDatum = GetDate() | | | | | | | | | | | |
| | | | | | | | | | | |
exec dl_PrometIzdKreGlavaVse '30', #SIS#, #NA#, @dtDatum, 'AM','', @cKljuc output | | | | | | | | | | | |
| | | | | | | | | | | |
update PROMET | | | | | | | | | | | |
set OPOMBA = 'Prenos licenc iz partnerja: ' + #IZ# + ' na partnerja: ' + #NA# | | | | | | | | | | | |
where KLJUC = @cKljuc | | | | | | | | | | | |
| | | | | | | | | | | |
declare crKurzor cursor local for | | | | | | | | | | | |
select IDENT,KOLICINA from ##PrenosLicenc | | | | | | | | | | | |
open crKurzor | | | | | | | | | | | |
fetch next from crKurzor into @cIdent,@fKolicina | | | | | | | | | | | |
while @@fetch_status = 0 | | | | | | | | | | | |
begin | | | | | | | | | | | |
exec dl_PrometIzdKrePozVse @cKljuc, @cIdent, @fKolicina, '', 'AM', @nPoz output, @cOK output | | | | | | | | | | | |
fetch next from crKurzor into @cIdent,@fKolicina | | | | | | | | | | | |
end | | | | | | | | | | | |
| | | | | | | | | | | |
update PROMETPOZ | | | | | | | | | | | |
set CENA = 0, RABAT=0 | | | | | | | | | | | |
where KLJUC like @cKljuc | | | | | | | | | | | |
| | | | | | | | | | | |
exec dl_SetPrometIzdajaSum 'P',0.1,@cKljuc | | | | | | | | | | | |
| | | | | | | | | | | |
select @cKljuc as KLJUC | | | | | | | | | | | |
| | | 20 | Izvajanje | | | Napolni začasno tabelo | | | | |
Napolni začasno tabelo | | | | | | | | | | | |
SQL ukaz | | | | | | | | | | | |
insert into ##PrenosLicenc (IDENT,KOLICINA) | | | | | | | | | | | |
select PROMETPOZ.IDENT,sum(PROMETPOZ.KOLICINA) as KOL | | | | | | | | | | | |
from PROMETPOZ | | | | | | | | | | | |
join PROMET on PROMET.KLJUC = PROMETPOZ.KLJUC | | | | | | | | | | | |
join MS on PROMETPOZ.IDENT = MS.IDENT | | | | | | | | | | | |
where PROMET.POSLDOG like '3%' | | | | | | | | | | | |
and MS.KLASIF2='LICENCE' | | | | | | | | | | | |
and PROMET.OSEBA3 = #IZ# | | | | | | | | | | | |
group by PROMETPOZ.IDENT | | | | | | | | | | | |
| | | 30 | Izvajanje | | | Naredi dobropis na IZ partnerju | | | | |
Naredi dobropis na IZ partnerju | | | | | | | | | | | |
SQL ukaz | | | | | | | | | | | |
declare | | | | | | | | | | | |
@cKljuc char(9), | | | | | | | | | | | |
@cIdent char(16), | | | | | | | | | | | |
@fKolicina money, | | | | | | | | | | | |
@dtDatum datetime, | | | | | | | | | | | |
@nPoz int, | | | | | | | | | | | |
@cOk char | | | | | | | | | | | |
| | | | | | | | | | | |
set @dtDatum = GetDate() | | | | | | | | | | | |
| | | | | | | | | | | |
exec dl_PrometIzdKreGlavaVse '30', #SIS#, #IZ#, @dtDatum, 'AM','', @cKljuc output | | | | | | | | | | | |
| | | | | | | | Stran: | 1 | | |
Registriran uporabnik: DATALAB d.o.o. | | | | | | | | | | | Obrazec: 11F |
| | | | | | | | | | | |
update PROMET | | | | | | | | | | | |
set OPOMBA = 'Prenos licenc iz partnerja: ' + #IZ# + ' na partnerja: ' + #NA# | | | | | | | | | | | |
where KLJUC = @cKljuc | | | | | | | | | | | |
| | | | | | | | | | | |
declare crKurzor cursor local for | | | | | | | | | | | |
select IDENT,(KOLICINA*-1) as KOLICINA from ##PrenosLicenc | | | | | | | | | | | |
open crKurzor | | | | | | | | | | | |
fetch next from crKurzor into @cIdent,@fKolicina | | | | | | | | | | | |
while @@fetch_status = 0 | | | | | | | | | | | |
begin | | | | | | | | | | | |
exec dl_PrometIzdKrePozVse @cKljuc, @cIdent, @fKolicina, '', 'AM', @nPoz output, @cOK output | | | | | | | | | | | |
fetch next from crKurzor into @cIdent,@fKolicina | | | | | | | | | | | |
end | | | | | | | | | | | |
| | | | | | | | | | | |
update PROMETPOZ | | | | | | | | | | | |
set CENA = 0, RABAT=0 | | | | | | | | | | | |
where KLJUC like @cKljuc | | | | | | | | | | | |
| | | | | | | | | | | |
exec dl_SetPrometIzdajaSum 'P',0.1,@cKljuc | | | | | | | | | | | |
| | | 50 | Izvajanje | | | Prikaži dobropisa | | | | |
Prikaži dobropisa | | | | | | | | | | | |
SQL ukaz | | | | | | | | | | | |
~R~PoisciDokument | | | | | | | | | | | |