sthar_detay.sql 598 B

1234567891011121314
  1. set @dbakiye := 0;
  2. select t.sira,t.kod,
  3. (case
  4. when t.ack='' then
  5. (select stok_adi from tblstsabit where stok_kodu=t.kod)
  6. when t.ack<>'' then t.ack
  7. end
  8. )as isim,round(t.miktar,3) as miktar,t.birim,round(t.kdvsizbf,3) as nf,round(t.kdvlibf,3) as bf ,round(t.miktar*round(t.kdvlibf,8),2) as tutar,
  9. round((@dbakiye := @dbakiye + miktar),2) as bakiye,kdvoran as kdv,incno from(
  10. select sira,aciklama as ack,stok_kodu as kod,olcubr as birim,fisno as fiþno,nf as kdvsizbf,bf as kdvlibf , miktar as miktar,kdvoran,
  11. inckeyno as incno
  12. from sthar where finckeyno='@fkod@'
  13. order by inckeyno
  14. )as t;