GpStructuredStorage file  !7 "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~sqli.vtd sqliForm.vtdSsqliFormName.vtd. sqliStep.vtd^JsqliStepFile.vtd8sqliStepStr.vtd6sqliStepStrEvent.vtd sqliVar.vtd2 sqliVer.vtdsqliReports.vtdsqliTranslation.vtd racKeyacNamed acIsDebugacType acVarInINI acAutoStart acAutoClose acEndMessageacLocalization2acFormNameAuthoracActive anVersion acLogType acInstCoded anUserChg anUserIns adTimeChg adTimeIns acIsLocalizedacRunOnInstall acRunOnUpdate acRunOnDelete anOldVersion acCryptPassacCompiledScriptacNoteA00000ESprememba davne stopnjeFAFFFTRT0!BBFFFF acKey acFormName2 acDocType acObjectName2acType acKeyShortCut2 anUserChg anUserIns adTimeChg adTimeIns acTabSheetName2 acFormTypeA00000E PrometSprCeneD|e(BB1 acFormName2acName2acKeyanNoacViewacSetOfacDescracReportacFileCreateTableanFileDelimiter acFileNameacFileTableName acFileDest acFileType acFileTypeXML acShowIfEmptyacTitleButtons anTitleLinesanBeginFromRecord anUserChg anUserIns adTimeChg adTimeIns acCharSet2 acStyleSheet acUnitNamed acNewThreadacDFMacPAS acSQLExport2acSQLExpacNoteA00000EGPFAENF)B0)aB windows-1250Popravilo davnih stopenjFProgram AresScript; uses sysutils, classes, forms, dialogs, FForm1; begin ares.executeStep(10); Form1 := tForm1.create(ares); ares.run; end. A00000EGFFAENFeB0)aB windows-1250FForm1FAobject Form1: TForm Tag = 99 Left = 208 Top = 233 Caption = 'Popravilo dav'#269'nih stopenj' ClientHeight = 321 ClientWidth = 317 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False Position = poDesigned PixelsPerInch = 96 TextHeight = 13 object cxGrid1: TcxGrid Left = 0 Top = 52 Width = 317 Height = 269 Align = alClient TabOrder = 0 ExplicitTop = 30 ExplicitHeight = 291 object cxGrid1DBTableView1: TcxGridDBTableView NavigatorButtons.ConfirmDelete = False DataController.DataSource = DataSourceVAT DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.FooterSummaryItems = <> DataController.Summary.SummaryGroups = <> OptionsData.Appending = True OptionsView.GroupByBox = False object cxGrid1DBTableView1Column1: TcxGridDBColumn Caption = #352'ifra iz' DataBinding.FieldName = 'acVATfrom' PropertiesClassName = 'TdlcxLookupComboBoxProperties' Properties.ClearKey = 46 Properties.DropDownAutoSize = True Properties.GridMode = True Properties.ImmediatePost = True Properties.IncrementalFiltering = False Properties.KeyFieldNames = 'acVATCode' Properties.ListColumns = <> Properties.ListOptions.SyncMode = True Properties.PostPopupValueOnTab = True Properties.ShowFieldNameValue = True Properties.LookupType = ltTarSt Properties.VisibleButtons = [lbDropDown, lbEllipsisButton] Width = 131 end object cxGrid1DBTableView1Column2: TcxGridDBColumn Caption = #352'ifra na' DataBinding.FieldName = 'acVATto' PropertiesClassName = 'TdlcxLookupComboBoxProperties' Properties.ClearKey = 46 Properties.DropDownAutoSize = True Properties.GridMode = True Properties.ImmediatePost = True Properties.IncrementalFiltering = False Properties.KeyFieldNames = 'acVATCode' Properties.ListColumns = <> Properties.ListOptions.SyncMode = True Properties.PostPopupValueOnTab = True Properties.ShowFieldNameValue = True Properties.LookupType = ltTarSt Properties.VisibleButtons = [lbDropDown, lbEllipsisButton] Width = 132 end end object cxGrid1Level1: TcxGridLevel GridView = cxGrid1DBTableView1 end end object dlcxPanel1: TdlcxPanel Left = 0 Top = 0 Width = 317 Height = 52 Align = alTop TabOrder = 1 object fBase: TdlcxLabeledImageComboBox Left = 80 Top = 6 AutoSize = False EditValue = 'M' Properties.Items = < item Description = 'Cena brez davka' Value = 'M' end item Description = 'Cena z davkom' ImageIndex = 0 Value = 'P' end> Properties.ReadOnly = False Properties.ClearValue = Null Style.BorderStyle = ebsFlat Style.Color = 15065304 Style.LookAndFeel.Kind = lfFlat Style.LookAndFeel.NativeStyle = False Style.Shadow = False Style.ButtonStyle = btsSimple Style.ButtonTransparency = ebtAlways Style.PopupBorderStyle = epbsDefault StyleDisabled.LookAndFeel.Kind = lfFlat StyleDisabled.LookAndFeel.NativeStyle = False StyleFocused.Color = 14347503 StyleFocused.LookAndFeel.Kind = lfFlat StyleFocused.LookAndFeel.NativeStyle = False StyleHot.LookAndFeel.Kind = lfFlat StyleHot.LookAndFeel.NativeStyle = False TabOrder = 0 LabelPosition = lpoLeft LabelSpacing = 3 LabelVisible = True EditLabel.Left = 40 EditLabel.Top = 9 EditLabel.Width = 37 EditLabel.Height = 13 EditLabel.Caption = 'Osnova' EditLabel.FocusControl = fBase EditLabel.Transparent = True ComponentSize = csSmall Templatable = False Caption = 'Osnova' ReadOnly = False Height = 19 Width = 110 end object bStart: TdlcxButton Left = 224 Top = 5 Width = 75 Height = 22 Caption = 'Po'#382'eni' Default = True TabOrder = 1 end object cbVPPrice: TdlcxCheckBox Left = 40 Top = 27 Caption = 'Sprememba VP1 in VP2' State = cbsChecked TabOrder = 2 Transparent = True Visible = False Width = 138 end end object lbMsg2: TdlcxLabel Left = 198 Top = 277 Caption = 'Ni podatkov!' Visible = False end object lbMsg1: TdlcxLabel Left = 198 Top = 259 Caption = 'Operacija kon'#269'ana!' Visible = False end object _evsaver: TEventCom events = 'fBase.Properties.OnEditValueChanged=fBasePropertiesEditValueChan' + 'ged'#13#10 end object tbVAT: TdlDataset SQL.Strings = ( 'select * from #lHE_VATchg') FieldNamesToUpperCase = False AutoCalcFields = False Cached = False LocateInsert = False Editable = True RequestLive = False KeyFields = 'acVATfrom' QueryRecCount = False DetailDelay = 0 LocalMasterDetail = False StrictUpdate = False TrimFixedChar = True TrimVarChar = True AddRowidToSQL = False ORACompatibility = True Left = 130 Top = 137 end object DataSourceVAT: TDataSource DataSet = tbVAT Left = 181 Top = 133 end end unit FForm1; interface uses Forms, Controls, StdCtrls, SysUtils, Classes, Graphics, dlComponents, Dialogs, cxGrid, dlDatabase, db; type TForm1 = class(TarForm) cxGrid1: TcxGrid; cxGrid1DBTableView1: TcxGridDBTableView; cxGrid1Level1: TcxGridLevel; dlcxPanel1: TdlcxPanel; fBase: TdlcxLabeledImageComboBox; cxGrid1DBTableView1Column1: TcxGridDBColumn; cxGrid1DBTableView1Column2: TcxGridDBColumn; tbVAT: TdlDataset; DataSourceVAT: TDataSource; bStart: TdlcxButton; lbMsg2: TdlcxLabel; lbMsg1: TdlcxLabel; cbVPPrice: TdlcxCheckBox; procedure fBasePropertiesEditValueChanged(Sender: TObject); procedure bStartClick(Sender: TObject); private tbHead: TdlDataset; public constructor Create(AOwner: TComponent); override; end; var Form1: TForm1; implementation constructor TForm1.Create(AOwner: TComponent); begin inherited Create(AOwner); ares.AssignObjectsToForm('FForm1',Self); cxGrid1 := FindComponent('cxGrid1'); cxGrid1DBTableView1 := FindComponent('cxGrid1DBTableView1'); cxGrid1Level1 := FindComponent('cxGrid1Level1'); dlcxPanel1 := FindComponent('dlcxPanel1'); fBase := FindComponent('fBase'); cxGrid1DBTableView1Column1 := FindComponent('cxGrid1DBTableView1Column1'); cxGrid1DBTableView1Column2 := FindComponent('cxGrid1DBTableView1Column2'); tbVAT := FindComponent('tbVAT'); DataSourceVAT := FindComponent('DataSourceVAT'); tbVAT.Open; bStart := FindComponent('bStart'); bStart.OnClick := bStartClick; lbMsg2 := FindComponent('lbMsg2'); lbMsg1 := FindComponent('lbMsg1'); AresFindComponent(cbVPPrice, 'cbVPPrice', Self); TdlcxImageComboBoxProperties(fBase.Properties).OnEditValueChanged := fBasePropertiesEditValueChanged; end; procedure TForm1.bStartClick(Sender: TObject); var ds: TdlDataSet; i: integer; begin tbHead := TdlDataset(OwnerForm.FindComponent('tbPrometSprCene')); Ares.Variables['cKeyChgPrice'] := tbHead['acKey']; Ares.Variables['acWareHouse'] := tbHead['acReceiver']; if (tbVat.State = dsInsert) or (tbVat.State = dsEdit) then tbVat.Post; ds := TdlDataset.create(nil); try ds.sql.text := 'select count(*) from tHE_SetItem M, #lHE_VATchg T where M.acVATCode = T.acVATfrom'; ds.open; if not ds.eof then i:= ds.Fields[0].AsInteger else i:= 0; ds.close; finally ds.free; end; if i > 0 then begin ares.executeStep(30); TdlDataset(OwnerForm.FindComponent('tbPrometSprCenePoz')).Refresh; //dlReopenTable('PrometSPrCene.tbPrometSprCene'); //dlReopenTable('SifMS.tbMS'); //dlReopenTable('SifMS.tbMSCenaSklad'); dlMessageDlg(lbMsg1.Caption, mtInformation, [mbOK], 0); //ShowMessage(lbMsg1.Caption); end else dlMessageDlg(lbMsg2.Caption, mtInformation, [mbOK], 0); //ShowMessage(lbMsg2.Caption); //dlReopenTable('SifMS.tbMS'); TdlDataset(OwnerForm.FindComponent('tbPrometSprCenePoz')).Refresh; end; procedure TForm1.fBasePropertiesEditValueChanged(Sender: TObject); begin if fBase.ItemIndex = 1 then cbVPPrice.Visible := True else cbVPPrice.Visible := False; end; end. A00000E GITEAENFuBNB windows-1250F-if Object_id('tempdb..#lHE_VATchg') is not null drop table #lHE_VATchg create table #lHE_VATchg (acVATfrom Char(2) null, acVATto Char(2) null) insert into #lHE_VATchg (acVATfrom, acVATto) values ('', '') A00000EGETEAENF|(BNB windows-1250F-select * from ~P~UpdateTarSt~P~ order by TSIzA00000EGITEAENF BNB windows-125030F declare @cBankaCenik Char(32), @cNasaValuta Char(3), @nRoundT Money, @cIdent Char(16), @cValuta Char(3), @cIzracunKalk Char(1), @nNabaCena Float, @cTS Char(2), @nDavek Float, @nProdCena Float, @nMpCena Float, @nCena Float, @nMpCenaP Float, @nTecaj Float, @dDatum DateTime, @cSifMSSprMPCena Char(1), @cLocenaKalk Char(1), @cSkladisce Char(30), @cKeyChgPrice Char(13), @nNo Integer, @cError VarChar(1024), @cStatus VarChar(2), @cWareHouse Char(30), @nMpCenaG Float, @nProdCenaG Float, @cSeparSaleCalc Char(1), @cVPPrice VarChar(10), @nWSPrice Float, @nWSPriceG Float, @nWSPrice2 Float, @nWSPrice2G Float, @nChPricePercent Float set @cKeyChgPrice = '#cKeyChgPrice#' set @cWareHouse = '#acWareHouse#' set @cVPPrice = '#cbVPPrice#' select @cBankaCenik = acBankPrice, @cNasaValuta = acPrimCurrency, @nRoundT = anRoundT, @cSifMSSprMPCena = acSetsItemChRTPrice, @cLocenaKalk = acSeparSaleCalc from vPA_SysParam set @dDatum = (SubString(Convert(Char,GetDate(),102),1,10)) set @cNasaValuta = dbo.fHE_GetPrimCurrency(@dDatum) declare crMS cursor local fast_forward for select M.acIdent, M.acCurrency, M.acMakeCalc, M.anBuyPrice, T.acVATCode, T.anVat, M.anSalePrice, M.anRTPrice, M.anPrice, M.anWSPrice, M.anWSPrice2 from tHE_Stock Z JOIN tHE_SetItem M ON M.acIdent = Z.acIdent JOIN #lHE_VATchg P ON M.acVATCode = P.acVATfrom JOIN tHE_SetTax T ON T.acVATCode = P.acVATto where Z.acWareHouse = @cWareHouse open crMS fetch next from crMS into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @nWSPrice, @nWSPrice2 while (@@FETCH_STATUS = 0) begin set @cSeparSaleCalc = 'F' set @nProdCenaG = null set @nMpCenaG = null set @nWSPriceG = null set @nWSPrice2G = null select @cSeparSaleCalc = acSeparSaleCalc from tHE_SetSubj where acSubject = @cWareHouse if @cSeparSaleCalc = 'T' begin select @nProdCenaG = anSalePrice, @nMpCenaG = anRTPrice, @nWSPriceG = anWSPRice, @nWSPrice2G = anWSPrice2 from tHE_SetItemPriceForWrh where acWareHouse = @cWareHouse and acIdent = @cIdent if @nProdCenaG is not null set @nProdCena = @nProdCenaG if @nMpCenaG is not null set @nMpCena = @nMpCenaG if @nWSPriceG is not null set @nWSPrice = @nWSPriceG if @nWSPrice2G is not null set @nWSPrice2 = @nWSPrice2G end if Upper('#fBase#') = 'P' begin exec pPA_SearchFXRate @cBankaCenik, @cValuta, @dDatum, @nTecaj output set @nTecaj = dbo.fHE_GetFxRateCurr(@dDatum, @nTecaj) set @nMpCena = @nProdCena / (1+(@nDavek/100)) set @nMpCenaP = 0 if (@nNabaCena <> 0) and (@nTecaj <> 0) begin if @cIzracunKalk = 'B' set @nMPCenaP = 100 * ((@nMPCena - (@nCena * @nTecaj)) / (@nNabaCena * @nTecaj)) else set @nMPCenaP = 100 * ((@nMPCena - (@nNabaCena * @nTecaj)) / (@nNabaCena * @nTecaj)) end -- update tHE_SetItem set anRTPrice = @nMPCena, anRTPriceP = @nMPCenaP -- where acIdent = @cIdent exec pHE_MoveItemsCreAll @cKeyChgPrice, @cIdent, 0, '', ~U~, @nNo output, @cError output, @cStatus output, 0, 1, '', -1, '', -1, 0, '', '' if @cStatus = 'T' begin update tHE_MoveItem set anRtPriceP = @nMpCena, acVATCode = @cTS, acVATCodeTr = @cTS, anVAT = @nDavek, anVATIn = @nDavek where acKey = @cKeyChgPrice and anno = @nNo if @cVPPrice = 'True' begin select @nChPricePercent = case when IsNull(P.anSalePrice,0) = 0 then 0 else 100 * (P.anRTPriceP - P.anSalePrice) / P.anSalePrice end from tHE_MoveItem P where acKey = @cKeyChgPrice and anno = @nNo set @nWSPrice = @nWSPrice * (1+(@nChPricePercent/100)) set @nWSPrice2 = @nWSPrice2 * (1+(@nChPricePercent/100)) update tHE_MoveItem set anWSPrice2P = @nWSPrice, anTransport = @nWSPrice2 where acKey = @cKeyChgPrice and anno = @nNo end end end else begin set @nProdCena = @nMpCena * (1+(@nDavek/100)) exec pPa_RoundFin @nProdCena, @nRoundT, @nProdCena output -- update tHE_SetItem set anSalePrice = @nProdCena -- where acIdent = @cIdent exec pHE_MoveItemsCreAll @cKeyChgPrice, @cIdent, 0, '', ~U~, @nNo output, @cError output, @cStatus output, 0, 1, '', -1, '', -1, 0, '', '' if @cStatus = 'T' begin update tHE_MoveItem set anRtPrice = @nProdCena, acVATCode = @cTS, acVATCodeTr = @cTS, anVAT = @nDavek, anVATIn = @nDavek, anRebate = @nProdCena - anWSPrice where acKey = @cKeyChgPrice and anno = @nNo end end /* declare crMSskl cursor local fast_forward for select M.acIdent, M.acCurrency, M.acMakeCalc, M.anBuyPrice, T.acVATCode, T.anVat, M2.anSalePrice, M2.anRTPrice, M.anPrice, M2.acWarehouse from tHE_SetItem M JOIN tHE_SetItemPriceForWrh M2 ON M.acIdent = M2.acIdent JOIN #lHE_VATchg P ON M.acVATCode = P.acVATfrom JOIN tHE_SetTax T ON T.acVATCode = P.acVATto WHERE M.acIdent = @cIdent and M2.acWarehouse = @cWarehouse open crMSskl fetch next from crMSskl into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @cSkladisce while (@@FETCH_STATUS = 0) begin if Upper('#fBase#') = 'P' begin exec pPA_SearchFXRate @cBankaCenik, @cValuta, @dDatum, @nTecaj output set @nTecaj = dbo.fHE_GetFxRateCurr(@dDatum, @nTecaj) set @nMpCena = @nProdCena / (1+(@nDavek/100)) set @nMpCenaP = 0 if (@nNabaCena <> 0) and (@nTecaj <> 0) begin if @cIzracunKalk = 'B' set @nMPCenaP = 100 * ((@nMPCena - (@nCena * @nTecaj)) / (@nNabaCena * @nTecaj)) else set @nMPCenaP = 100 * ((@nMPCena - (@nNabaCena * @nTecaj)) / (@nNabaCena * @nTecaj)) end update tHE_SetItemPriceForWrh set anRTPrice = @nMPCena, anRTPriceP = @nMPCenaP where acIdent = @cIdent and acWarehouse = @cSkladisce end else begin set @nProdCena = @nMpCena * (1+(@nDavek/100)) exec pPa_RoundFin @nProdCena, @nRoundT, @nProdCena output update tHE_SetItemPriceForWrh set anSalePrice = @nProdCena where acIdent = @cIdent and acWarehouse = @cSkladisce end fetch next from crMSskl into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @cSkladisce end close crMSskl deallocate crMSskl update tHE_SetItem set acVATCode = @cTS, anVat = @nDavek where acIdent = @cIdent */ fetch next from crMS into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @nWSPrice, @nWSPrice2 end close crMS deallocate crMS acKeyanNoanSeqNoacHField2acHType anHLengthanHDecacPField2acPTypeanPLegthanPDec acPFormat acPSeparator anUserChg anUserIns adTimeChg adTimeIns acKeyanNoanSeqNo acFieldName2 anFieldSize acFieldTitleacFieldReadOnly acEditType acFieldConst anUserChg anUserIns adTimeIns adTimeChg acFieldFormatacFieldDefault acKeyanNo acDataEventacDataReturnValue acKeyAndNo anUserChg anUserIns adTimeChg adTimeIns acKey acWhereKeyanNo acFieldName acParamVar acFieldType acFieldREQacFieldCaption2 acDefaultExpacDefaultValue acLookUpSQL acOperator acVarHint2 acAddApostrof anUserChg anUserIns adTimeChg adTimeIns acPrtCritA00000EOsnova OsnovaTCF+Osnova je P-Cena z davkom/M-Cena brez davka0MFΨBBT acKey anVersionanNoacSQLExpacNote adTimeChg anUserChg adTimeIns anUserInsacReportacLangIdacLocalization2 acFormNamedacNamedacDefaultPrinter acPreviewanMaxPrStLevelacSubstituteSignacPrintIfEmpty acPrintToText anNoOfCopy acOrderBy acRegUserCodeacActive acKeyShortCut2 anUserIns adTimeIns anUserChg adTimeChg acText1acText2acText3acNote acReportDataacKey acUnitName acObjectName acTranslationacLocalisation