lv:procedures
Atšķirības
Norādītais vecais variants no patreizējās lapas atšķiras ar.
Abās pusēs iepriekšējo versijuIepriekšējā versijaNākamā versija | Iepriekšējā versija | ||
lv:procedures [2020/07/23 14:40] – marija | lv:procedures [2020/10/27 19:06] (patlaban) – ALG_rek_0610 marija | ||
---|---|---|---|
Rinda 1: | Rinda 1: | ||
- | Code versions test | + | < |
- | + | <?xml version=" | |
- | < | + | < |
- | ALTER PROCEDURE [dbo].[xml_core_SISSE] AS | + | xmlns: |
- | DECLARE @klient_kood bigint, @kood bigint, @nimitmp nvarchar(255), | + | xmlns: |
- | declare @ladu nvarchar(32), | + | xmlns: |
- | declare @number int, @maa int, @kmk nvarchar(32), | + | xmlns: |
- | DECLARE @myyja nvarchar(32), | + | exclude-result-prefixes=" |
- | declare @key nvarchar(32) | + | < |
- | declare @web_kood nvarchar(32), | + | < |
- | declare @fintype nvarchar(32) | + | < |
- | declare @result1 xml, @result2 nvarchar(max) | + | < |
- | declare @artikkel nvarchar(32), | + | < |
- | declare @kl_kood nvarchar(32), | + | < |
- | declare @sims_kood nvarchar(32), | + | < |
- | declare @koer nvarchar(max) | + | 1.42287181 |
- | declare @ag datetime | + | </ |
- | declare @fcomment nvarchar(255) | + | < |
- | declare @err nvarchar(32) | + | 1.42287181 |
- | set nocount on; | + | </ |
- | set @key=CONVERT(nvarchar(max), | + | < |
- | update in_kliendid2 set x=@key where x is null --customers in | + | 0.702804 |
- | update in_artiklid2 set x=@key where x is null --items in | + | </ |
- | update in_tell_tellimused2 set x=@key where x is null --items in | + | < |
- | update in_mr_arved2 set x=@key where x is null --items in | + | < |
- | update in_ladu_sissetulekud set x=@key where x is null --items in | + | </ |
- | + | </ | |
- | create TABLE #changes | + | </ |
- | ( | + | < |
- | kood nvarchar(32), | + | < |
- | field nvarchar(32), | + | < |
- | enne nvarchar(255), | + | < |
- | nyyd nvarchar(255), | + | < |
- | cu nvarchar(32), | + | < |
- | aeg datetime | + | </ |
- | + | </ | |
- | ) | + | </ |
- | create table #results | + | < |
- | (number | + | < |
- | + | < | |
- | select | + | < |
- | + | < | |
- | + | </ | |
- | + | </ | |
- | declare customers cursor for select | + | < |
- | open customers | + | < |
- | FETCH NEXT FROM customers INTO @webid, @appkey_event | + | < |
- | WHILE @@FETCH_STATUS | + | < |
- | BEGIN | + | </ |
- | set @kl_kood=@webid | + | < |
- | if @appkey_event=@appkey | + | < |
- | begin | + | </ |
- | if (select | + | < |
- | begin | + | < |
- | if (select count(kood) from pangad where kood=(select pank_swift from in_kliendid2 where kood=@webid and x=@key))=0 | + | </ |
- | BEGIN | + | </ |
- | insert pangad | + | </ |
- | select | + | < |
- | end | + | < |
- | insert kliendid | + | < |
- | ( | + | < |
- | kood | + | </ |
- | , | + | < |
- | , | + | < |
- | , | + | </ |
- | , | + | </ |
- | , | + | |
- | , | + | </ |
- | , | + | < |
- | , | + | < |
- | , | + | </ |
- | , | + | < |
- | , | + | < |
- | ) | + | < |
- | select | + | < |
- | kood | + | </ |
- | , nimi | + | < |
- | , kmregnr | + | < |
- | , | + | </ |
- | , | + | </ |
- | , | + | </ |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | </ |
- | , | + | </ |
- | , | + | < |
- | from in_kliendid2 where kood=@webid | + | < |
- | + | < | |
- | insert into #results values (@kl_kood, ' | + | < |
- | END | + | </ |
- | ELSE | + | </ |
- | BEGIN | + | </ |
- | if (select count(kood) from pangad where kood=(select pank_swift from in_kliendid2 where kood=@webid and x=@key))=0 | + | |
- | BEGIN | + | < |
- | insert pangad (kood, nimi, swift) | + | if (document.getElementById(' |
- | select pank_swift, pank_nimi, pank_swift from in_kliendid2 where kood=@webid and x=@key | + | |
- | end | + | } else { |
- | insert #changes | + | document.write('< |
- | select kood, ' | + | } |
- | union | + | |
- | select kood, 'aadress2', aadress2, (select | + | |
- | union | + | < |
- | select kood, 'aadress3', aadress3, (select aadress3 from in_kliendid2 where kood=@webid and x=@key), | + | < |
- | union | + | < |
- | select kood, 'nimi', nimi, (select nimi from in_kliendid2 where kood=@webid | + | |
- | union | + | <style type=" |
- | select kood, 'lahaadress1', lahaadress1, | + | body { |
- | union | + | |
- | select kood, 'lahaadress2', lahaadress2, | + | |
- | union | + | |
- | select | + | } |
- | union | + | |
- | select kood, 'pank', pank, (select pank_swift from in_kliendid2 where kood=@webid and x=@key), | + | |
- | union | + | |
- | select kood, 'arveldusarve', arveldusarve, | + | |
- | union | + | |
- | select kood, 'regnr', regnr, (select regnr from in_kliendid2 where kood=@webid and x=@key), | + | |
- | union | + | } |
- | select kood, 'kmregnr', kmregnr, (select kmregnr from in_kliendid2 where kood=@webid and x=@key), | + | |
- | + | | |
- | insert kliendid_ajalugu (kood, aeg, field, enne, nyyd, cu) | + | |
- | select kood, aeg, field, enne, nyyd, cu from #changes where enne!=nyyd and kood=@webid | + | |
- | + | } | |
- | update kliendid | + | |
- | SET | + | |
- | nimi=z.nimi | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | } |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | padding: |
- | , | + | border:1px solid #B4B4B4; |
- | from | + | } |
- | (select * from in_kliendid2 where kood=@webid and x=@key) z | + | |
- | where kliendid.kood=@webid | + | .main_table td.nos, .main_table td.kods, .main_table th.nos, .main_table th.kods { |
- | + | | |
- | /* | + | } |
- | insert artiklid_ajalugu | + | |
- | select | + | |
- | */ | + | height: |
- | + | } | |
- | insert into #results values | + | |
- | + | .left { | |
- | END | + | float: |
- | end | + | padding: |
- | else | + | font-size: |
- | begin | + | } |
+ | |||
+ | .right { | ||
+ | float: | ||
+ | text-align: | ||
+ | font-size: | ||
+ | } | ||
+ | .left2 { | ||
+ | float: | ||
+ | text-align: | ||
+ | font-size: | ||
+ | } | ||
+ | |||
+ | .right_small { | ||
+ | float: | ||
+ | text-align: | ||
+ | } | ||
+ | |||
+ | .spacer { | ||
+ | height: | ||
+ | clear: | ||
+ | } | ||
+ | |||
+ | .divider { | ||
+ | clear: | ||
+ | } | ||
+ | |||
+ | .pbreak { | ||
+ | page-break-after: | ||
+ | } | ||
+ | |||
+ | h4.pb { | ||
+ | display: | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div class=" | ||
+ | <div style=" | ||
+ | <IMG height=" | ||
+ | </ | ||
+ | < | ||
+ | <br /> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <xsl:if test=" | ||
+ | <xsl:if test=" | ||
+ | < | ||
+ | <xsl:if test=" | ||
+ | <xsl:if test=" | ||
+ | < | ||
+ | <xsl:if test=" | ||
+ | <xsl:if test=" | ||
+ | < | ||
+ | <xsl:if test=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </xsl: | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <br /> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
- | insert into #results values (null, ' | + | </ |
- | end | + | |
- | + | < | |
- | set @x=@x+1 | + | |
- | FETCH NEXT FROM customers INTO @webid, @appkey_event | + | < |
- | END | + | <xsl:if test="/ |
- | CLOSE customers | + | < |
- | DEALLOCATE customers | + | <xsl:if test="/ |
- | + | <xsl:if test="/ | |
- | DECLARE items cursor for select kood, appkey from in_artiklid2 where x=@key | + | < |
- | open items | + | < |
- | FETCH NEXT FROM items INTO @webid, @appkey_event | + | < |
- | WHILE @@FETCH_STATUS | + | < |
- | BEGIN | + | </ |
- | set @kl_kood=@webid | + | < |
- | if @appkey_event=@appkey | + | < |
- | begin | + | < |
- | if (select | + | < |
- | BEGIN | + | </ |
- | insert artiklid ( | + | < |
- | kood | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | </ |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | ) | + | < |
- | select | + | </ |
- | kood | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | </ |
- | from in_artiklid2 where kood=@webid | + | < |
- | + | </ | |
- | insert into #results values (@kl_kood, | + | </ |
- | end | + | </ |
- | ELSE | + | |
- | BEGIN | + | < |
- | insert #changes | + | < |
- | select | + | <xsl:if test="/ |
- | UNION | + | < |
- | select kood, 'klass', klass, (select | + | < |
- | UNION | + | < |
- | select kood, 'hind', convert(nvarchar(max), | + | < |
- | UNION | + | < |
- | select kood, ' | + | </ |
- | + | < | |
- | + | < | |
- | update artiklid | + | < |
- | set | + | </ |
- | nimi=z.nimi | + | </ |
- | , | + | |
- | , | + | < |
- | , | + | |
- | from | + | < |
- | (select | + | < |
- | where artiklid.kood=z.kood | + | < |
- | + | < | |
- | insert into #results values (@kl_kood, ' | + | < |
- | + | < | |
- | end | + | </ |
- | END | + | < |
- | else | + | < |
- | BEGIN | + | < |
- | insert into #results values (null, | + | < |
- | END | + | </ |
- | + | </th> | |
- | set @x=@x+1 | + | < |
- | FETCH NEXT FROM items INTO @webid, @appkey_event | + | < |
- | END | + | < |
- | CLOSE items | + | </ |
- | DEALLOCATE items | + | < |
- | + | < | |
- | + | < | |
- | DECLARE orders cursor for select | + | </ |
- | open orders | + | < |
- | FETCH NEXT FROM orders INTO @webid, @appkey_event | + | < |
- | WHILE @@FETCH_STATUS = 0 | + | < |
- | BEGIN | + | < |
- | set @kl_kood=@webid | + | </ |
- | if @appkey_event=@appkey | + | </ |
- | begin | + | |
- | if (select count(number) from tell_tellimused where kliendi_tellimus=@webid)=0 | + | < |
- | BEGIN | + | < |
- | EXEC dbo.get_dok_number @moodul='tellimus', @seeria=' | + | < |
- | + | </ | |
- | update tell_tellimused | + | < |
- | set kliendi_tellimus=@webid | + | < |
- | , | + | < |
- | , | + | </ |
- | , | + | </tr> |
- | , | + | |
- | , | + | < |
- | , | + | |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | <td class=" |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | <xsl:if test=" |
- | , | + | <td class=" |
- | , | + | < |
- | from (select klient_kood, | + | < |
- | where tell_tellimused.number=@number | + | < |
- | + | </ | |
- | select @maa = isnull(maa,0) from kliendid where kood=(select klient_kood from tell_tellimused where number=@number) | + | </td> |
- | + | </ | |
- | insert tell_tellimused_read | + | < |
- | ( | + | < |
- | number | + | </ |
- | ,rn | + | < |
- | ,rv | + | < |
- | , | + | <td class=" |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | <xsl:if test=" |
- | , | + | < |
- | , | + | </ |
- | , | + | </ |
- | , | + | </ |
- | ) | + | </tr> |
- | select | + | |
- | @number | + | <xsl:if test="((position() mod $item_per_page)=0) and (position()!=last())"> |
- | ,rn | + | < |
- | ,rn | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | < |
- | , | + | </ |
- | , | + | < |
- | , | + | |
- | , | + | < |
- | , | + | |
- | + | < | |
- | , | + | < |
- | when (@maa = 0) | + | < |
- | then | + | < |
- | isnull((select konto_myyk from artiklid where kood=artikkel),(select | + | < |
- | when (@maa = 1) | + | </ |
- | then | + | < |
- | isnull((select konto_myyk_EU from artiklid where kood=artikkel),(select | + | <tr class=" |
- | end as konto | + | < |
- | /*,iif( | + | < |
- | isnull(kmkood,'' | + | < |
- | when (@maa = 0) | + | < |
- | then | + | </ |
- | isnull((select KMkood from artiklid where kood=artikkel),(select kmk_eesti from artikliklassid where kood=(select | + | <th class=" |
- | when (@maa = 1) | + | < |
- | then | + | < |
- | isnull((select KMkood_EU from artiklid where kood=artikkel), | + | < |
- | end )) as kmkood*/ | + | </ |
- | , | + | </th> |
- | when (@maa = 0) | + | < |
- | then | + | < |
- | isnull((select KMkood from artiklid where kood=artikkel),(select | + | < |
- | when (@maa = 1) | + | </ |
- | then | + | < |
- | isnull((select KMkood_EU from artiklid where kood=artikkel), | + | < |
- | end )) | + | < |
- | from in_tell_tellimused_read2 where number=@webid | + | </ |
- | + | < | |
- | + | < | |
- | + | < | |
- | --update tell_tellimused set saldo=(select sum(tkkm) from tell_tellimused_read where number=@number) where number=@number | + | < |
- | insert into #results values (@kl_kood, 'Order', | + | </ |
- | + | </ | |
- | update tell_tellimused_read | + | |
- | set tkkm=( rv_summa * (select | + | < |
- | + | < | |
- | update tell_tellimused_read | + | < |
- | set rsum=rv_summa + tkkm where number=@number | + | </ |
- | + | < | |
- | update tell_tellimused | + | < |
- | set summa = (select sum(summa) from tell_tellimused_read where number=@number), summakokku=(select | + | < |
- | where number=@number | + | </ |
- | end | + | </tr> |
- | else | + | </ |
- | begin | + | |
- | insert into #results values (@kl_kood, ' | + | <xsl:if test=" |
- | end | + | < |
- | END | + | </ |
- | else | + | |
- | BEGIN | + | </ |
- | insert into #results values (null, ' | + | |
- | END | + | </ |
- | + | ||
- | set @x=@x+1 | + | |
- | FETCH NEXT FROM orders INTO @webid, @appkey_event | + | |
- | END | + | |
- | CLOSE orders | + | |
- | DEALLOCATE orders | + | |
- | + | ||
- | DECLARE invoices cursor for select convert(nvarchar(max),number), appkey from in_mr_arved2 where x=@key | + | |
- | open invoices | + | |
- | FETCH NEXT FROM invoices INTO @webid, @appkey_event | + | |
- | WHILE @@FETCH_STATUS | + | |
- | BEGIN | + | |
- | set @kl_kood=@webid | + | |
- | if @appkey_event=@appkey | + | |
- | begin | + | |
- | if (select count(number) from mr_arved where klienditellimus=@webid)=0 | + | |
- | BEGIN | + | |
- | EXEC dbo.get_dok_number @moodul=' | + | |
- | + | ||
- | update mr_arved | + | |
- | set aeg=z.aeg | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | from (select * from in_mr_arved2 where number=@webid)z | + | |
- | where mr_arved.number=@number | + | |
- | + | ||
- | select | + | |
- | + | ||
- | insert mr_arved_read | + | |
- | ( | + | |
- | number | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | ) | + | |
- | select | + | |
- | @number | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | when (@maa = 0) | + | |
- | then | + | |
- | isnull((select | + | |
- | when (@maa = 1) | + | |
- | then | + | |
- | isnull((select konto_myyk_EU from artiklid where kood=artikkel), | + | |
- | end | + | |
- | , | + | |
- | when (@maa = 0) | + | |
- | then | + | |
- | isnull((select KMkood from artiklid where kood=artikkel), | + | |
- | when (@maa = 1) | + | |
- | then | + | |
- | isnull((select KMkood_EU from artiklid where kood=artikkel), | + | |
- | end | + | |
- | from in_mr_arved_read2 where number=@webid | + | |
- | + | ||
- | --update tell_tellimused set saldo=(select sum(tkkm) from tell_tellimused_read where number=@number) where number=@number | + | |
- | insert into #results values (@kl_kood, ' | + | |
- | exec dbo.after_save_klient | + | |
- | end | + | |
- | else | + | |
- | begin | + | |
- | insert into #results values (@kl_kood, ' | + | |
- | end | + | |
- | END | + | |
- | else | + | |
- | BEGIN | + | |
- | insert into #results values (null, | + | |
- | END | + | |
- | + | ||
- | set @x=@x+1 | + | |
- | FETCH NEXT FROM invoices INTO @webid, @appkey_event | + | |
- | END | + | |
- | CLOSE invoices | + | |
- | DEALLOCATE invoices | + | |
- | + | ||
- | DECLARE sreceipts cursor for select convert(nvarchar(max), | + | |
- | open sreceipts | + | |
- | FETCH NEXT FROM sreceipts INTO @webid, @appkey_event | + | |
- | WHILE @@FETCH_STATUS | + | |
- | BEGIN | + | |
- | set @kl_kood=@webid | + | |
- | if @appkey_event=@appkey | + | |
- | begin | + | |
- | if (select count(number) from ladu_sissetulekud where hankija_arve=@webid)=0 | + | |
- | BEGIN | + | |
- | EXEC dbo.get_dok_number @moodul=' | + | |
- | + | ||
- | update ladu_sissetulekud | + | |
- | set aeg=z.aeg | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | from (select | + | |
- | where ladu_sissetulekud.number=@number | + | |
- | + | ||
- | --select | + | |
- | + | ||
- | insert ladu_sissetulekud_read | + | |
- | ( | + | |
- | number | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | + | ||
- | ) | + | |
- | select | + | |
- | @number | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | , | + | |
- | from in_ladu_sissetulekud_read where number=@webid | + | |
- | + | ||
- | --update tell_tellimused set saldo=(select | + | |
- | insert into #results values (@kl_kood, 'STOCK RECEIPT', | + | |
- | end | + | |
- | else | + | |
- | begin | + | |
- | insert into #results values | + | |
- | end | + | |
- | END | + | |
- | else | + | |
- | BEGIN | + | |
- | insert into #results values | + | |
- | END | + | |
- | + | ||
- | set @x=@x+1 | + | |
- | FETCH NEXT FROM sreceipts INTO @webid, @appkey_event | + | |
- | END | + | |
- | CLOSE sreceipts | + | |
- | DEALLOCATE sreceipts | + | |
+ | <table class=" | ||
+ | < | ||
+ | </ | ||
- | select @result1= | + | <table class=" |
- | (select | + | < |
- | from #results | + | <td style=" |
+ | |||
+ | <div style=" | ||
+ | |||
+ | < | ||
+ | <table width=" | ||
+ | < | ||
+ | <td align=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <td align=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | &# | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <table width=" | ||
+ | <xsl:if test=" | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <xsl:if test="/ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <xsl:if test="/ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <table width=" | ||
+ | <xsl:if test=" | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </xsl:for-each> | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | <xsl:if test="/ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <xsl:if test="/ | ||
+ | < | ||
+ | <td width=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <table width=" | ||
+ | < | ||
+ | < | ||
+ | <td style=" | ||
+ | &# | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td style=" | ||
+ | &# | ||
+ | </ | ||
+ | <td style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | &# | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td style=" | ||
+ | &# | ||
+ | </ | ||
+ | <td style=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | </ | ||
+ | < | ||
+ | <div style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | Neapmaksāto rēķinu kopsumma: < | ||
+ | Neapmaksāto rēķinu kopsumma: < | ||
+ | </ | ||
+ | < | ||
+ | Neapmaksāto rēķinu kopsumma: < | ||
+ | Neapmaksāto rēķinu kopsumma: < | ||
+ | </ | ||
+ | </ | ||
+ | Neapmaksāto rēķinu kopsumma: < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | Unpaid invoices total:< | ||
+ | Unpaid invoices total:< | ||
+ | </ | ||
+ | < | ||
+ | Unpaid invoices total:< | ||
+ | Unpaid invoices total:< | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | <div style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td style=" | ||
+ | <img SRC=" | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <td style=" | ||
+ | |||
+ | |||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | var cipariEng=['',' | ||
+ | var padsmitiEng=[' | ||
+ | var desmitiEng=['','',' | ||
- | set @result2='<?xml version="1.0" encoding=" | + | |
+ | res=''; | ||
+ | |||
+ | // pirmais cipars no labaas | ||
+ | if (str.charAt(1)=='1') // chekojam pirmspeedeejo ciparu - ja viens tad vai nu desmit vai padsmit | ||
+ | | ||
+ | else res=cipariEng[parseInt(str.charAt(2))]; | ||
+ | |||
+ | // otrais cipars no labaas | ||
+ | if (str.charAt(0)==' | ||
+ | | ||
+ | else if (str.charAt(0)!='0' | ||
+ | res='hundred ' | ||
+ | else // ja nav simtu | ||
+ | | ||
+ | |||
+ | // treshais cipars no labaas | ||
+ | res=cipariEng[parseInt(str.charAt(0))]+res; | ||
+ | return res; | ||
+ | } | ||
- | select @result1= | + | |
- | (select result as " | + | fullStr=' |
- | from #results for xml path ('Result')) | + | |
+ | tempRes=''; | ||
+ | resStr=''; | ||
+ | minus=''; | ||
+ | |||
+ | punkts=skaitlis.indexOf(' | ||
+ | if (punkts==-1) { | ||
+ | | ||
+ | | ||
+ | } else { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (pirmspStr.charAt(0)==' | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | for (i=pirmspStr.length-1, j=9; i>=0; i--, j--) { // paarliekam uz fullstr, kas sastaav no desmit cipariem | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (fullStr.length> | ||
+ | |||
+ | if (nauda=='EUR' | ||
+ | if (parseInt(fullStr, | ||
+ | else if (parseInt(fullStr, | ||
+ | else resStr+=' | ||
+ | } else if (parseInt(fullStr, | ||
+ | | ||
+ | } else resStr+=' | ||
+ | |||
+ | if (parseInt(fullStr.substring(7), | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (parseInt(fullStr.substring(4, | ||
+ | | ||
+ | | ||
+ | if ((tempStr.charAt(2)==' | ||
+ | else if (parseInt(tempStr, | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (parseInt(fullStr.substring(1, | ||
+ | | ||
+ | | ||
+ | if ((tempStr.charAt(2)==' | ||
+ | else if (parseInt(tempStr, | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (fullStr.charAt(0)!=' | ||
+ | if (fullStr.charAt(0)==' | ||
+ | else resStr=cipariEng[parseInt(fullStr.charAt(0), | ||
+ | } | ||
+ | |||
+ | if (resStr!='' | ||
+ | | ||
+ | } | ||
+ | |||
+ | santimi=parseInt(aizpStr, | ||
+ | if (santimi> | ||
+ | | ||
+ | if (santimi==1) { | ||
+ | resStr+=' | ||
+ | } else { | ||
+ | resStr+=' | ||
+ | } | ||
+ | } else { | ||
+ | resStr+=' | ||
+ | } | ||
+ | |||
+ | return (minus+resStr); | ||
+ | |||
+ | } | ||
+ | var cipari=['',' | ||
+ | var padsmiti=[' | ||
+ | var desmiti=['','',' | ||
- | set @result2='<?xml version="1.0" encoding=" | + | |
+ | res=''; | ||
+ | |||
+ | // pirmais cipars no labaas | ||
+ | if (str.charAt(1)=='1') // chekojam pirmspeedeejo ciparu - ja viens tad vai nu desmit vai padsmit | ||
+ | | ||
+ | else res=cipari[parseInt(str.charAt(2))]; | ||
+ | |||
+ | // otrais cipars no labaas | ||
+ | if (str.charAt(0)==' | ||
+ | | ||
+ | else if (str.charAt(0)!='0' | ||
+ | res='simti ' | ||
+ | else // ja nav simtu | ||
+ | | ||
+ | |||
+ | // treshais cipars no labaas | ||
+ | res=cipari[parseInt(str.charAt(0))]+res; | ||
+ | return res; | ||
+ | } | ||
- | select @result2 | + | |
- | drop table #results | + | |
- | drop table #changes | + | |
+ | tempRes=''; | ||
+ | resStr=''; | ||
+ | minus=''; | ||
+ | |||
+ | punkts=skaitlis.indexOf(' | ||
+ | if (punkts==-1) { | ||
+ | | ||
+ | | ||
+ | } else { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (pirmspStr.charAt(0)==' | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | for (i=pirmspStr.length-1, | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (fullStr.length> | ||
+ | |||
+ | if (parseInt(fullStr, | ||
+ | resStr+=nauda; | ||
+ | } else resStr+=' | ||
+ | |||
+ | if (parseInt(fullStr.substring(7), | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (parseInt(fullStr.substring(4, | ||
+ | | ||
+ | | ||
+ | if ((tempStr.charAt(2)==' | ||
+ | else if (parseInt(tempStr, | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (parseInt(fullStr.substring(1, | ||
+ | | ||
+ | | ||
+ | if ((tempStr.charAt(2)==' | ||
+ | else if (parseInt(tempStr, | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (fullStr.charAt(0)!=' | ||
+ | if (fullStr.charAt(0)==' | ||
+ | else resStr=cipari[parseInt(fullStr.charAt(0), | ||
+ | } | ||
+ | |||
+ | if (resStr!='' | ||
+ | | ||
+ | } | ||
+ | |||
+ | santimi=parseInt(aizpStr, | ||
+ | if (santimi> | ||
+ | | ||
+ | | ||
+ | if ((tmpSant.charAt(tmpSant.length-1)==' | ||
+ | resStr+=' | ||
+ | } else { | ||
+ | resStr+=' | ||
+ | } | ||
+ | } else { | ||
+ | resStr+=' | ||
+ | } | ||
+ | |||
+ | return (minus+resStr); | ||
+ | } | ||
- | --cleanup | + | |
- | --delete temp customers and put in log table | + | |
- | insert log_in_kliendid2 | + | |
- | select * from in_kliendid2 where x=@key | + | |
- | delete from in_kliendid2 where x=@key | + | |
- | --delete temp items and put in log table | + | |
- | insert log_in_artiklid2 | + | |
- | select * from in_artiklid2 where x=@key | + | |
- | delete from in_artiklid2 where x=@key | + | |
- | --delete temp items and put in log table | + | |
- | insert log_in_tell_tellimused2 | + | |
- | select * from in_tell_tellimused2 where x=@key | + | |
- | insert log_in_tell_tellimused_read2 | + | |
- | select * from in_tell_tellimused_read2 where number in (select number from in_tell_tellimused2 where x=@key) | + | |
- | delete from in_tell_tellimused_read2 where number in (select number from in_tell_tellimused2 where x=@key) | + | |
- | delete from in_tell_tellimused2 where x=@key | + | |
- | --delete temp items and put in log table | + | |
- | insert log_in_mr_arved2 | + | |
- | select * from in_mr_arved2 where x=@key | + | |
- | insert log_in_mr_arved_read2 | + | |
- | select * from in_mr_arved_read2 where number in (select number from in_mr_arved2 where x=@key) | + | |
- | delete from in_mr_arved_read2 where number in (select number from in_mr_arved2 where x=@key) | + | |
- | delete from in_mr_arved2 where x=@key | + | |
- | --delete temp items and put in log table | + | |
- | insert log_in_ladu_sissetulekud | + | |
- | select * from in_ladu_sissetulekud where x=@key | + | |
- | insert log_in_ladu_sissetulekud_read | + | |
- | select * from in_ladu_sissetulekud_read where number in (select number from in_ladu_sissetulekud where x=@key) | + | |
- | delete from in_ladu_sissetulekud_read where number in (select number from in_ladu_sissetulekud where x=@key) | + | |
- | delete from in_ladu_sissetulekud where x=@key | + | |
- | --08.06.2020 range change from 2019 to veikaliemlv, | + | </ |
- | --17.07.2020 corrections in orders, lahetusaadress3=z.lahetusaadress1 to lahetusaadress3=z.lahetusaadress3 | + | |
</ | </ |
lv/procedures.1595504402.txt.gz · Labota: 2020/07/23 14:40 , labojis marija