<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.standart-n.ru/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wiki.standart-n.ru/wiki/index.php?action=history&amp;feed=atom&amp;title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82</id>
		<title>Убрать пересорт - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.standart-n.ru/wiki/index.php?action=history&amp;feed=atom&amp;title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82"/>
		<link rel="alternate" type="text/html" href="http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;action=history"/>
		<updated>2026-05-02T10:06:11Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=4235&amp;oldid=prev</id>
		<title>Agk: /* Текст подпрограммы */</title>
		<link rel="alternate" type="text/html" href="http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=4235&amp;oldid=prev"/>
				<updated>2016-07-08T07:51:55Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Текст подпрограммы&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 07:51, 8 июля 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; trn:=CREATEIBTRANSACTION;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; trn:=CREATEIBTRANSACTION;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; STARTIBTRANSACTION(trn,1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; STARTIBTRANSACTION(trn,1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;try&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;try &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;// m_manager.logit('select doc_id&amp;#160; from PR_NEWDOC(18,(select USER_ID from SESSIONS where id ='+floattostr(m_session_id)+' ),0,(select max(vnum)+1 from docs where doc_type=18),current_date,'+floattostr(m_session_id)+')'); &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; query:=ExecIBQuery(trn,'select doc_id&amp;#160; from PR_NEWDOC(18,(select USER_ID from SESSIONS where id ='+floattostr(m_session_id)+' ),0,(select max(vnum)+1 from docs where doc_type=18),current_date,'+floattostr(m_session_id)+')',1); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; query:=ExecIBQuery(trn,'select doc_id&amp;#160; from PR_NEWDOC(18,(select USER_ID from SESSIONS where id ='+floattostr(m_session_id)+' ),0,(select max(vnum)+1 from docs where doc_type=18),current_date,'+floattostr(m_session_id)+')',1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; if not IBQUERY_EOF(query) then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; if not IBQUERY_EOF(query) then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; while not IBQUERY_EOF(query) do&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; while not IBQUERY_EOF(query) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;//&amp;#160;  m_manager.logit&lt;/del&gt;('Select first 1 part_id,quant,price,price*quant as summa,sname,price_o&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,seria &lt;/del&gt;from warebase where &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;quant&lt;/del&gt;&amp;gt;=((-1)*('+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname')+''')&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;;');&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160;  query2:=ExecIBQuery&lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;trn,&lt;/ins&gt;'Select first 1 part_id,quant,price,price*quant&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,seria &lt;/ins&gt;as summa,sname,price_o from warebase where &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;part_id not in (select part_id from doc_detail_active where doc_id='+new_id_doc+') and realquant&lt;/ins&gt;&amp;gt;=((-1)*('+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname')+''') &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/ins&gt;price='+Stringreplace(IBQuery_FieldByName_s(query, '&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;price&lt;/ins&gt;'),',','.',1)+' and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;abs&lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;price_o-&lt;/ins&gt;'+&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Stringreplace(&lt;/ins&gt;IBQuery_FieldByName_s(query, '&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;price_o&lt;/ins&gt;')&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/ins&gt;'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/ins&gt;'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/ins&gt;'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.',1&lt;/ins&gt;)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;+') &amp;lt;= 0.01 &lt;/ins&gt;;',1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; query2:=ExecIBQuery(trn,'Select first 1 part_id,quant,&lt;/del&gt;price&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,price*quant as summa,sname,price_o,seria from warebase where quant&amp;gt;&lt;/del&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;((-1)*(&lt;/del&gt;'+Stringreplace(IBQuery_FieldByName_s(query, '&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;quant&lt;/del&gt;'),',','.',1)+'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)) &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;trim(sname)=trim&lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;'+IBQuery_FieldByName_s(query, '&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sname&lt;/del&gt;')&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;+&lt;/del&gt;''');',1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  if not IBQUERY_EOF(query2) then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  if not IBQUERY_EOF(query2) then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &lt;/del&gt;showmessage(IBQuery_FieldByName_s(query2, 'part_id'));&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160;  &lt;/ins&gt;//showmessage(IBQuery_FieldByName_s(query2, 'part_id'));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query, 'part_id')+','+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+','+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query, 'part_id')+','+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+','+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query2, 'part_id')+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1);&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query2, 'part_id')+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1);&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; end&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; else&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; begin&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; showmessage('Ничего не нашли'); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; query:=ExecIBQuery(trn,'delete from docs where id='+new_id_doc,1); &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; showmessage('Ничего не нашли');&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; end&amp;#160; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;except&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;except&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; showmessage('Ошибка'); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; showmessage('Ошибка'); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Agk</name></author>	</entry>

	<entry>
		<id>http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=4045&amp;oldid=prev</id>
		<title>Agk: /* Текст подпрограммы */</title>
		<link rel="alternate" type="text/html" href="http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=4045&amp;oldid=prev"/>
				<updated>2016-05-04T07:08:24Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Текст подпрограммы&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 07:08, 4 мая 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; trn:=CREATEIBTRANSACTION;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; trn:=CREATEIBTRANSACTION;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; STARTIBTRANSACTION(trn,1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; STARTIBTRANSACTION(trn,1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;try &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;try&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; query:=ExecIBQuery(trn,'select doc_id&amp;#160; from PR_NEWDOC(18,&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-2&lt;/del&gt;,0,&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''''&lt;/del&gt;,&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;null&lt;/del&gt;,'+floattostr(m_session_id)+')',1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;// m_manager.logit('select doc_id&amp;#160; from PR_NEWDOC(18,(select USER_ID from SESSIONS where id ='+floattostr(m_session_id)+' ),0,(select max(vnum)+1 from docs where doc_type=18),current_date,'+floattostr(m_session_id)+')'); &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; query:=ExecIBQuery(trn,'select doc_id&amp;#160; from PR_NEWDOC(18,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(select USER_ID from SESSIONS where id ='+floattostr(m_session_id)+' )&lt;/ins&gt;,0,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(select max(vnum)+1 from docs where doc_type=18)&lt;/ins&gt;,&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;current_date&lt;/ins&gt;,'+floattostr(m_session_id)+')',1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; if not IBQUERY_EOF(query) then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; if not IBQUERY_EOF(query) then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; while not IBQUERY_EOF(query) do&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; while not IBQUERY_EOF(query) do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//&amp;#160;  m_manager.logit('Select first 1 part_id,quant,price,price*quant&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,seria &lt;/del&gt;as summa,sname,price_o from warebase where quant&amp;gt;=((-1)*(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'+IBQuery_FieldByName_s(query, 'quant')+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname')+''') and price=&lt;/del&gt;'+Stringreplace(IBQuery_FieldByName_s(query, '&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;price&lt;/del&gt;'),',','.',1)+&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;' and abs(price_o-'+Stringreplace(IBQuery_FieldByName_s(query, 'price_o&lt;/del&gt;')&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,',','.',1&lt;/del&gt;)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;+') &amp;lt;= 0.01 &lt;/del&gt;and trim(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;seria&lt;/del&gt;)=trim('''+IBQuery_FieldByName_s(query, '&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;seria&lt;/del&gt;')+''');');&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;//&amp;#160;  m_manager.logit('Select first 1 part_id,quant,price,price*quant as summa,sname,price_o&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,seria &lt;/ins&gt;from warebase where quant&amp;gt;=((-1)*('+Stringreplace(IBQuery_FieldByName_s(query, '&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;quant&lt;/ins&gt;'),',','.',1)+')) and trim(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sname&lt;/ins&gt;)=trim('''+IBQuery_FieldByName_s(query, '&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sname&lt;/ins&gt;')+''');');&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160;  &lt;/del&gt;query2:=ExecIBQuery(trn,'Select first 1 part_id,quant,price,price*quant&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,seria &lt;/del&gt;as summa,sname,price_o from warebase where quant&amp;gt;=((-1)*('+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;')+''') and price='+Stringreplace(IBQuery_FieldByName_s(query, 'price'),',','.',1)+' and abs(price_o-'+Stringreplace(IBQuery_FieldByName_s(query, 'price_o'),',','.',1)+') &amp;lt;= 0.01 and trim(seria)=trim('''+IBQuery_FieldByName_s(query, 'seria&lt;/del&gt;')+''');',1);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;query2:=ExecIBQuery(trn,'Select first 1 part_id,quant,price,price*quant as summa,sname,price_o&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,seria &lt;/ins&gt;from warebase where quant&amp;gt;=((-1)*('+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname')+''');',1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  if not IBQUERY_EOF(query2) then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  if not IBQUERY_EOF(query2) then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160;  &lt;/del&gt;//showmessage(IBQuery_FieldByName_s(query2, 'part_id'));&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &lt;/ins&gt;showmessage(IBQuery_FieldByName_s(query2, 'part_id'));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query, 'part_id')+','+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+','+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query, 'part_id')+','+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+','+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query2, 'part_id')+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1);&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query2, 'part_id')+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1);&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; end&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; else&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; showmessage('Ничего не нашли'); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; begin&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; query:=ExecIBQuery(trn,'delete from docs where id='+new_id_doc,1); &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; showmessage('Ничего не нашли');&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; end&amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;except&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;except&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; showmessage('Ошибка'); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; showmessage('Ошибка'); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Agk</name></author>	</entry>

	<entry>
		<id>http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=2706&amp;oldid=prev</id>
		<title>Agk в 12:25, 26 мая 2015</title>
		<link rel="alternate" type="text/html" href="http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=2706&amp;oldid=prev"/>
				<updated>2015-05-26T12:25:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 12:25, 26 мая 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 58:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Теги==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Пересортица, пересорт, убрать пересорт&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Agk</name></author>	</entry>

	<entry>
		<id>http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=2705&amp;oldid=prev</id>
		<title>Agk: Новая страница: «==Общие сведения== ТМС (подпрограмма) позволяет при возникновении пересорта, например, пр…»</title>
		<link rel="alternate" type="text/html" href="http://wiki.standart-n.ru/index.php?title=%D0%A3%D0%B1%D1%80%D0%B0%D1%82%D1%8C_%D0%BF%D0%B5%D1%80%D0%B5%D1%81%D0%BE%D1%80%D1%82&amp;diff=2705&amp;oldid=prev"/>
				<updated>2015-05-26T12:24:14Z</updated>
		
		<summary type="html">&lt;p&gt;Новая страница: «==Общие сведения== ТМС (подпрограмма) позволяет при возникновении пересорта, например, пр…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Общие сведения==&lt;br /&gt;
ТМС (подпрограмма) позволяет при возникновении пересорта, например, при открытии накладной на редактирование, по которой уже были продажи, создать автоматически документ корректировки пересорта для взаимного объединения этих позиций.&lt;br /&gt;
Поиск производится по наименованию, цене, серии.&lt;br /&gt;
&lt;br /&gt;
==Установка==&lt;br /&gt;
Менеджер - Сервис - Подпрограммы - Общие - правой кнопкой мышки - Создать новую группу - Убрать пересорт. Код процедуры взять из раздела ниже.&lt;br /&gt;
&lt;br /&gt;
==Текст подпрограммы==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
program GroupProgram;&lt;br /&gt;
var  trn, query, query1, query2, query3: cardinal; &lt;br /&gt;
     new_date_doc,new_id_doc,new_part_id,part_str: string;&lt;br /&gt;
     fl: integer;&lt;br /&gt;
begin&lt;br /&gt;
 part_str:='';  &lt;br /&gt;
 trn:=CREATEIBTRANSACTION;    &lt;br /&gt;
 STARTIBTRANSACTION(trn,1);&lt;br /&gt;
try &lt;br /&gt;
 query:=ExecIBQuery(trn,'select doc_id  from PR_NEWDOC(18,-2,0,'''',null,'+floattostr(m_session_id)+')',1);&lt;br /&gt;
 if not IBQUERY_EOF(query) then&lt;br /&gt;
 begin&lt;br /&gt;
  new_id_doc:=IBQuery_FieldByName_s(query, 'doc_id');  &lt;br /&gt;
 end;&lt;br /&gt;
 &lt;br /&gt;
 query:=ExecIBQuery(trn,'Select part_id,quant,price,price*quant as summa,sname,price_o,seria from warebase where quant&amp;lt;0 and price_o &amp;gt;=0 and price &amp;gt; 0',1);&lt;br /&gt;
 while not IBQUERY_EOF(query) do&lt;br /&gt;
 begin&lt;br /&gt;
//   m_manager.logit('Select first 1 part_id,quant,price,price*quant,seria as summa,sname,price_o from warebase where quant&amp;gt;=((-1)*('+IBQuery_FieldByName_s(query, 'quant')+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname')+''') and price='+Stringreplace(IBQuery_FieldByName_s(query, 'price'),',','.',1)+' and abs(price_o-'+Stringreplace(IBQuery_FieldByName_s(query, 'price_o'),',','.',1)+') &amp;lt;= 0.01 and trim(seria)=trim('''+IBQuery_FieldByName_s(query, 'seria')+''');');&lt;br /&gt;
   query2:=ExecIBQuery(trn,'Select first 1 part_id,quant,price,price*quant,seria as summa,sname,price_o from warebase where quant&amp;gt;=((-1)*('+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+')) and trim(sname)=trim('''+IBQuery_FieldByName_s(query, 'sname')+''') and price='+Stringreplace(IBQuery_FieldByName_s(query, 'price'),',','.',1)+' and abs(price_o-'+Stringreplace(IBQuery_FieldByName_s(query, 'price_o'),',','.',1)+') &amp;lt;= 0.01 and trim(seria)=trim('''+IBQuery_FieldByName_s(query, 'seria')+''');',1);&lt;br /&gt;
   if not IBQUERY_EOF(query2) then&lt;br /&gt;
   begin&lt;br /&gt;
     //showmessage(IBQuery_FieldByName_s(query2, 'part_id'));&lt;br /&gt;
     query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query, 'part_id')+','+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+','+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1); &lt;br /&gt;
     query3:=ExecIBQuery(trn,'select id,msg from PR_RASHODPART('+new_id_doc+','+IBQuery_FieldByName_s(query2, 'part_id')+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'quant'),',','.',1)+',(-1)*'+Stringreplace(IBQuery_FieldByName_s(query, 'summa'),',','.',1)+','''',1,0,null,0);',1);      &lt;br /&gt;
   end;&lt;br /&gt;
   IBQUERY_NEXT(query); &lt;br /&gt;
 end  &lt;br /&gt;
 query:=ExecIBQuery(trn,'select *  from doc_detail_active where doc_id='+new_id_doc,1);&lt;br /&gt;
 if not IBQUERY_EOF(query) then&lt;br /&gt;
 begin&lt;br /&gt;
   //query:=ExecIBQuery(trn,'execute procedure PR_DOC_COMMIT('+new_id_doc+','+inttostr(m_session_id)+')',1);&lt;br /&gt;
   &lt;br /&gt;
   query:=ExecIBQuery(trn,'select caption from docs where id='+new_id_doc,1);&lt;br /&gt;
   showmessage('Создан новый документ : '+trim(IBQuery_FieldByName_s(query, 'caption')));&lt;br /&gt;
  // m_docarchive.show;      &lt;br /&gt;
   EndIBTransaction(trn,1); &lt;br /&gt;
 end&lt;br /&gt;
 else&lt;br /&gt;
  showmessage('Ничего не нашли'); &lt;br /&gt;
except&lt;br /&gt;
 showmessage('Ошибка'); &lt;br /&gt;
 EndIBTransaction(trn,0);&lt;br /&gt;
end;    &lt;br /&gt;
&lt;br /&gt;
 FREEIBQUERY(query);        &lt;br /&gt;
 FREEIBTRANSACTION(trn);&lt;br /&gt;
 m_manager.INITACTIVEDOCS;&lt;br /&gt;
end.&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Agk</name></author>	</entry>

	</feed>