GpStructuredStorage file  "7 #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~sqli.vtd sqliForm.vtdKsqliFormName.vtd. sqliStep.vtdNsqliStepFile.vtd8sqliStepStr.vtd6sqliStepStrEvent.vtd sqliVar.vtd2 sqliVer.vtdsqliReports.vtd sqliTranslation.vtd!racKeyacNamed acIsDebugacType acVarInINI acAutoStart acAutoClose acEndMessageacLocalization2acFormNameAuthoracActive anVersion acLogType acInstCoded anUserChg anUserIns adTimeChg adTimeIns acIsLocalizedacRunOnInstall acRunOnUpdate acRunOnDelete anOldVersion acCryptPassacCompiledScriptacNoteADL0051Popravilo davnih stopenjFAFFFTRT0thBBFFFF acKey acFormName2 acDocType acObjectName2acType acKeyShortCut2 anUserChg anUserIns adTimeChg adTimeIns acTabSheetName2 acFormTypeADL0051SifMSD|e(BB1 acFormName2acName2acKeyanNoacViewacSetOfacDescracReportacFileCreateTableanFileDelimiter acFileNameacFileTableName acFileDest acFileType acFileTypeXML acShowIfEmptyacTitleButtons anTitleLinesanBeginFromRecord anUserChg anUserIns adTimeChg adTimeIns acCharSet2 acStyleSheet acUnitNamed acNewThreadacDFMacPAS acSQLExport2acSQLExpacNote ADL0051GPFAENFdQtB0)aB windows-1250Popravilo davnih stopenjF:Program AresScript; uses sysutils, classes, forms, dialogs, FForm1; procedure MyExecuteUnit(id: integer); begin ares.nextstep := -1; ares.executeStep(id); if (ares.GetSetOf(id) IN ['I','D','R']) and (ares.NextStep > 0) then MyExecuteUnit(ares.NextStep); end; procedure MyFullExecuteUnit(AJumpTo: string); var AacKey: string; AanNo: integer; begin RepairAcKeyAndAnNo(AJumpTo, AacKey, AanNo); if AanNo > 0 then MyExecuteUnit(Aanno); end; begin ares.executeStep(10); Form1 := tForm1.create(ares); ares.run; end. ADL0051GFFAENF|B0)aB windows-1250FForm1Fsobject Form1: TForm Tag = 99 Left = 208 Top = 233 Caption = 'Popravilo dav'#269'nih stopenj' ClientHeight = 321 ClientWidth = 320 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 = 51 Width = 320 Height = 270 Align = alClient TabOrder = 0 ExplicitTop = 30 ExplicitWidth = 306 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 = 139 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 = 146 end end object cxGrid1Level1: TcxGridLevel GridView = cxGrid1DBTableView1 end end object dlcxPanel1: TdlcxPanel Left = 0 Top = 0 Width = 320 Height = 51 Align = alTop TabOrder = 1 ExplicitWidth = 306 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 = 42 Top = 26 Caption = 'Sprememba VP1 in VP2' State = cbsChecked TabOrder = 2 Transparent = True Visible = False Width = 136 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 J 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 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 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); 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'); end; procedure TForm1.fBasePropertiesEditValueChanged(Sender: TObject); begin if fBase.ItemIndex = 1 then cbVPPrice.Visible := True else cbVPPrice.Visible := False; end; end. ADL0051 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 ('', '') ADL0051GETEAENF|(BNB windows-1250F-select * from ~P~UpdateTarSt~P~ order by TSIzADL0051GITEAENFshBNB windows-125030Fdeclare @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), @cVPPrice VarChar(10), @nWSPrice Float, @nWSPrice2 Float, @nChPricePercent Float, @nMpCenaG Float, @nWSPriceP Float, @nWSPrice2P Float 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_SetItem M JOIN #lHE_VATchg P ON M.acVATCode = P.acVATfrom JOIN tHE_SetTax T ON T.acVATCode = P.acVATto open crMS fetch next from crMS into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @nWSPrice, @nWSPrice2 while (@@FETCH_STATUS = 0) begin if Upper('#fBase#') = 'P' begin set @nMPCenaG = @nMPCena 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 if @cVPPrice = 'True' begin set @nChPricePercent = case when IsNull(@nMPCenaG, 0) = 0 then 0 else 100 * (@nMPCena - @nMPCenaG) / @nMPCenaG end set @nWSPrice = @nWSPrice * (1+(@nChPricePercent/100)) set @nWSPrice2 = @nWSPrice2 * (1+(@nChPricePercent/100)) set @nWSPriceP = 0 set @nWSPrice2P = 0 if (@nNabaCena <> 0) and (@nTecaj <> 0) begin if @cIzracunKalk = 'B' begin set @nWSPriceP = 100 * ((@nWSPrice - (@nCena * @nTecaj)) / (@nNabaCena * @nTecaj)) set @nWSPrice2P = 100 * ((@nWSPrice2 - (@nCena * @nTecaj)) / (@nNabaCena * @nTecaj)) end else begin set @nWSPriceP = 100 * ((@nWSPrice - (@nNabaCena * @nTecaj)) / (@nNabaCena * @nTecaj)) set @nWSPrice2P = 100 * ((@nWSPrice2 - (@nNabaCena * @nTecaj)) / (@nNabaCena * @nTecaj)) end end update tHE_SetItem set anWSPrice = @nWSPrice, anWSPrice2 = @nWSPrice2, anWSPriceP = @nWSPriceP, anWSPrice2P = @nWSPrice2P where acIdent = @cIdent 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 end fetch next from crMS into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @nWSPrice, @nWSPrice2 end close crMS deallocate crMS 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, M2.anWSPrice, M2.anWSPrice2 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 open crMSskl fetch next from crMSskl into @cIdent, @cValuta, @cIzracunKalk, @nNabaCena, @cTS, @nDavek, @nProdCena, @nMpCena, @nCena, @cSkladisce, @nWSPrice, @nWSPrice2 while (@@FETCH_STATUS = 0) begin if Upper('#fBase#') = 'P' begin set @nMPCenaG = @nMPCena 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 if @cVPPrice = 'True' begin set @nChPricePercent = case when IsNull(@nMPCenaG, 0) = 0 then 0 else 100 * (@nMPCena - @nMPCenaG) / @nMPCenaG end set @nWSPrice = @nWSPrice * (1+(@nChPricePercent/100)) set @nWSPrice2 = @nWSPrice2 * (1+(@nChPricePercent/100)) set @nWSPriceP = 0 set @nWSPrice2P = 0 if (@nNabaCena <> 0) and (@nTecaj <> 0) begin if @cIzracunKalk = 'B' begin set @nWSPriceP = 100 * ((@nWSPrice - (@nCena * @nTecaj)) / (@nNabaCena * @nTecaj)) set @nWSPrice2P = 100 * ((@nWSPrice2 - (@nCena * @nTecaj)) / (@nNabaCena * @nTecaj)) end else begin set @nWSPriceP = 100 * ((@nWSPrice - (@nNabaCena * @nTecaj)) / (@nNabaCena * @nTecaj)) set @nWSPrice2P = 100 * ((@nWSPrice2 - (@nNabaCena * @nTecaj)) / (@nNabaCena * @nTecaj)) end end update tHE_SetItemPriceForWrh set anWSPrice = @nWSPrice, anWSPrice2 = @nWSPrice2, anWSPriceP = @nWSPriceP, anWSPrice2P = @nWSPrice2P where acIdent = @cIdent and acWarehouse = @cSkladisce end 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, @nWSPrice, @nWSPrice2 end close crMSskl deallocate crMSskl update M set acVATCode = T.acVatCode, anVat = T.anVat from tHE_SetItem M JOIN #lHE_VATchg P ON M.acVATCode = P.acVATfrom JOIN tHE_SetTax T ON T.acVATCode = P.acVATto update tHE_SetItemCateg set acVATCode = tHE_SetTax.acVATCode from tHE_SetItemCateg, #lHE_VATchg, tHE_SetTax where tHE_SetItemCateg.acVATCode = #lHE_VATchg.acVATfrom and tHE_SetTax.acVATCode = #lHE_VATchg.acVATto ADL0051(G0KomentarTEAENFSbBNB windows-125040FADL00512G0KomentarTEAENF}bBNB windows-125050FADL0051<G0KomentarTEAENFXbBNB windows-125060FADL0051FG0KomentarTEAENFabBPB windows-125070FADL0051PG0KomentarTEAENFbBPB windows-125080FADL0051ZG0KomentarTEAENFJbBPB windows-125090FacKeyanNoanSeqNoacHField2acHType 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 acPrtCritADL0051Osnova OsnovaTCF+Osnova je P-Cena z davkom/M-Cena brez davka0MF'_