PANTHEON™ Help

 Sadržaj
 Glavna strana- Dobrodošli u PANTHEON uputstva
[Collapse]PANTHEON
 [Collapse]PANTHEON priručnici
  [Expand]Priručnik za PANTHEON
  [Expand]Vodič po DataLab PANTHEON™ Farming
  [Expand]Vodič za mobilni POS
  [Expand]Vodič za PANTHEON Vet
 [Collapse]PANTHEON korisnički priručnici
  [Expand]Korisnički priručnik za PANTHEON
  [Expand]Operativni priručnik za datalab PANTHEON Farming
  [Expand]Korisnički vodič za mobilni POS
  [Expand]Korisnički priručnik za PANTHEON VET
  [Expand]Korisnički priručnik za PANTHEON Farming
[Collapse]PANTHEON Web
 [Collapse]Priručnici za PANTHEON Web
  [Expand]Vodič po PANTHEON Web Light-u
  [Expand]Vodič po PANTHEON Web Terminal-u
  [Expand]Vodič za PANTHEON Web Legal
  [Expand]Arhiva starih proizvoda
 [Collapse]Korisnički priručnici za PANTHEON Web
  [Expand]Kako početi? PANTHEON Web
  [Expand]Korisnički priručnik za PANTHEON Web Light
  [Expand]Korisnički priručnik za PANTHEON Web Terminal
  [Expand]Arhiva starih proizvoda
  [Expand]Korisnički priručnik za PANTHEON Web Legal
[Collapse]PANTHEON Granule
 [Collapse]Priručnik za PANTHEON Granule
  [Expand]Granula Kadrovi
  [Expand]Granula Putni nalozi
  [Expand]Granula Dokumenti i zadaci
  [Expand]Granula Kontrolna tabla
  [Expand]Granula Servis na terenu
  [Expand]Granula B2B naručivanje
  [Expand]Inventar Fiksne Imovine
  [Expand]Granula Inventar skladišta
 [Collapse]Korisnički priručnik za PANTHEON Granule
  [Expand]Kako početi?
  [Expand]PANTHEON Granule i aktivacija
  [Expand]Granula Kadrovi
  [Expand]Granula Putni nalozi
  [Expand]Granula B2B Naručivanje
  [Expand]Granula Kontrolna tabla
  [Expand]Granula Dokumenti i Zadaci
  [Expand]Granula Servis na terenu
   PANTHEON Granule - česta pitanja i odgovori
  [Expand]Inventar Fiksne Imovine
  [Expand]Arhiva
  [Expand]Granula Inventar skladišta
   Arhiva

Load Time: 1265.6403 ms
"
  6613 | 1 | |
Label


Example with  function dlStringReplace


On the report '10A - Material Movements Report - Detailed' that is in the program menu Goods | Material Movement add a "Text" object on the band named 'Detail' and write expression which returns serial numbers display that belong to the selected position and the selected invoice. The SQLExp function returns all records, each in its own row, but we want to display serial numbers in one row, separated by commas.
 
[dlStringReplace(SQLExp('SELECT acSerialNo, FROM tHE_MoveItemSerialNo WHERE acKey = ''' + <qReportIzpis."acKey"> + ''' AND acIdent = ''' + <qReportIzpis."acIdent"> + '''  GROUP BY acSerialNo UNION ALL SELECT acSerialNo FROM tHE_OrderItemSerialNo WHERE acKey = ''' + <qReportIzpis."acKey"> + ''' AND acIdent = ''' + <qReportIzpis."acIdent"> + ''' GROUP BY acSerialNo ORDER BY acSerialNo'), #13#10, ', ', 'rfReplaceAll', '')]
 

Example with Date Fields


On the clone of the '241 - Invoice' report that is in the program in the Goods | Issue | Document (eg. 3000 - Sale) add the balance of the issue invoice recipient to the 2200 account on the day of the invoice. It is important that the date is formatted in the form yyyymmdd.

[SQLExp('SELECT SUM(anValDebit-anValCredit) from tHE_AcctTransItem where acAcct = 2200 and acSubject=''' + <qReportIzpisD."acReceiver"> + ''' and adDateDoc <= ''' + FormatDateTime('yyyymmdd',<qReportIzpisD."adDateInv">) + '''')]

 

Example with Number


In this case we use report '156 -Material Movements Report - Summary by Items' that is in the program menu Goods | Material Movements that shows the quantity in the alternative measurement unit.

Since we do not have a factor for the conversion of the quantity in the primary measurement unit (U/M) into U/M2, we must obtained them from the Units of Measurement register using the SQLExp function.

We do this with the following expression:

[SQLExp('SELECT anUMToUM2 FROM tHE_SetItem WHERE acIdent = ' + dlQuotedStr(<qReportIzpis."acIdent">)+'')]

The above expression returns number as text. Now we want to print the quantity printed in EM2, so we have to convert the value obtained with the dlStrToFloatDef function into a number. Then we divide the amount into the EM with the factor obtained, and using the dlDiv function instead of dividing it from the zero, rather than the ordinary division. Finally, we get:


[dlDiv(<qReportIzpis."anBegState">, dlStrToFloatDef(SQLExp('SELECT anUMToUM2 FROM tHE_SetItem WHERE acIdent =  ' + dlQuotedStr(<qReportIzpis."acIdent">) +''), 1))]

Example with Reading Data from Pantheon Window


We will do the following example can be done on a clone of the report '16B - Invoices Issued Report - by Suppliers and Items', that is in the program menu Goods | Invoices Issued Reports | Invoices Issued/Profit Margin Report. If a warehouse is selected in the window, the expression displays the entire stock of the item, otherwise it only prints the stock in the selected warehouse.

The window in the program from which the report starts is called 'PrometObracunIzdRac', the input field in which we select the warehouse and has the name 'fWarehouse'. The term that returns the text in this object is already known:


[GetFormValue('PrometObracunIzdRac.fWarehouse')]

First we check if warehouse is selected. If not, the first SQLExp expression that returns the entire stock of the selected item in all the warehouses, otherwise the second one returns the stock of the item only in the selected warehouse.

[IIF (GetFormValue('PrometObracunIzdRac.fWarehouse') = '',
SQLExp('select SUM (anStock) from tHE_Stock where acIdent = ' +
dlQuotedStr(<qReportIzpis."acIdent">) + ''),
SQLExp('select anStock from tHE_Stock where acIdent = ' +
dlQuotedStr(<qReportIzpis."acIdent">) + ' and acWarehouse = ''' +
GetFormValue('PrometObracunIzdRac.fSkladisce') + ''''))]

 

An example of using SQLExp function with complex select statement

 

A special treatment deserves the expression on the 3AR report that displays whether the worker is disabled or not.

This information is not directly written in the database, but it contains the disability category in the acDisabilityCode field in the table tHR_PrsnHealth. Since the disability category of an individual worker can change, we must get the one that was last entered. The date of the change of disability is recorded in the adCreationDate field in the same table. The following term gives you the last date when the invalidity category for the selected worker has changed.


[SQLExp('select max(adCreatonDate) from tHR_PrsnHealth where acWorker = ''' + <qryDelavec."acWorker"> + '''')]

Then, with the term below, we get the category of disabillity of the worker

[SQLExp('select acDisabilityCode from tHR_PrsnHealth where acWorker = ''' + <qryDelavec."acWorker"> + ''' and adCreatonDate = (select max(adCreatonDate) from tHR_PrsnHealth where acWorker = ''' + <qryDelavec."acWorker"> + ''')')]
 

If in the above term we replace the acDisabilityCode field with 'YES', the expression returns 'Yes' if the worker is disabled, otherwise it returns an empty string. Since, in the case when a worker is not disabled, the expression returns 'NO', we give the term to conditional sentence IIF and finally get

[IIF(SQLExp('select ''DA'' from tHR_PrsnHealth where acWorker = ''' + <qryDelavec."acWorker"> + ''' and adCreatonDate = (select max(adCreatonDate) from tHR_PrsnHealth where acWorker = ''' + <qryDelavec."acWorker"> + ''' and acDisabilityCode > ''0'')') = 'DA','DA','NE')]

 

Example of using SQLExp function - grouping by field that is not in the dataset


It is very unusual and useful to use the SQLExp function for sorting and grouping by field that is not in the dataset.

As a basis, we will take a report 164 that is in the program menu Goods | Invoices Issued Reports | Invoices Issued/Profit Margin Report. First, we create a copy on which we will operate. The data will be grouped by the account issuer and sorted by the issuer and the account number.

The property of the GroupHeader condition is set to the value


SQLExp('select G.acIssuer from tHE_Move G where G.acKey = ''' + <qReportIzpis."acKey"> + ''''),

We replace the inscription which describes the information that we group, and for the data itself, we enter the same as above, but let's put it all together in square brackets (as shown in the figure). To sort in the Reports register, write:

(select G.acIssuer from tHE_Move G where G.acKey = P.acKey), G.acKey



  

  

     


Oceni ovu temu
Da li je ova tema korisna?
Komentari
Komentari će biti vidljivi i na forumu!