Skip to end of banner
Go to start of banner

Payroll Summary (historical period)

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 4 Next »

Summary

The view provides an overview of payments for the historical payroll periods.

Keywords

Payroll, Payments

Category

Analytical View

Description

The view provides an overview of payments for the historical payroll periods.

Main Data Selection

All the crew members have payments within the historical payroll periods. Only calculatedamount1 is considered by this view.

Setup and Configuration

SQL statement

 SQL statement
SELECT pyh.PIN,
       p01.Name,
       persorg.name               AS Organization,
       pyh.accountdim2            AS VesOrgID,
       ISNULL(ves.name, 'N/A')    AS 'Vessel Name',
       CASE 
            WHEN pyh.ACCOUNTDIM3 IS NULL OR pyh.ACCOUNTDIM3 = '' THEN 'N/A'
            ELSE pyh.ACCOUNTDIM3
       END 'Department',
       ISNULL(CAT.NAME, 'Other')  AS 'Category',
       CAST(
           REPLACE(
               CASE 
                    WHEN pyh.ENTRYFIELD2 = '' THEN '0'
                    ELSE pyh.ENTRYFIELD2
               END,
               ',',
               '.'
           ) AS FLOAT
       )                          AS Days,
       CASE 
            WHEN pyh.entryfield3 = '' THEN 0
            ELSE ROUND(
                     (
                         dbo.ad_StrToFloat(
                             RIGHT(
                                 pyh.entryfield3,
                                 LEN(pyh.entryfield3) - PATINDEX('%[0-9]%', pyh.entryfield3) + 1
                             )
                         )
                     ),
                     2
                 )
       END                        AS 'Daily Rate',
       pyh.periodeused            AS Period,
       CONVERT(VARCHAR, pyh.ENTRYCODE) + ' ' + EC.TEXT AS 'Entry Code',
       CASE 
            WHEN pyh.ENTRYCODE BETWEEN 30 AND 39 THEN pyh.CALCULATEDAMOUNT10
            ELSE pyh.CALCULATEDAMOUNT1
       END 'Amount',
       pyh.payscaletable          AS 'Pay Scale Table',
       pyh.payscalecode           AS 'Pay Scale Code',
       payscaleinfo.Table_Name 'PayScale Table Name',
       payscaleinfo.Payscale_Name 'PayScale Name',
       pyh.rank                   AS RANK,
       pyh.currencyforpayment     AS 'Currency for Payment',
       pyh.currencyrateforpayment 'Currency Rate for Payment',
       p01.client                    numorgid,
       p01.employmentstartdate,
       p01.employmentenddate
FROM   pw001pyh pyh
       LEFT JOIN pw001p01 p01
            ON  p01.pin = pyh.pin
       LEFT JOIN pworg ves
            ON  ves.numorgid = pyh.accountdim2
       LEFT JOIN pyety001 ec
            ON  ec.entrycode = pyh.entrycode
       LEFT JOIN pworg persorg
            ON  persorg.numorgid = p01.client
       LEFT JOIN PW001C117 CAT
            ON  ec.CATEGORY = CAT.SEQUENCENO
            AND pyh.ENTRYCODE = ec.ENTRYCODE
                --left join pw001p03 p03 on p03.SEQUENCENO=pyh.ACTIVITYSEQ
                --left join pw001c12 c12 on c12.CODE=p03.CODE
                --LEFT JOIN dbo.PWORG DEP ON DEP.NUMORGID = dbo.ad_scanorgtree(P03.NUMORGID, 4)
                --LEFT JOIN dbo.PWORG POS ON POS.NUMORGID = dbo.ad_scanorgtree(P03.NUMORGID, 5)
                
       LEFT JOIN (
                SELECT C0.REGULATIVECODE  AS 'Table_Code',
                       C0.REGULATIVENAME  AS 'Table_Name',
                       C1.PAYSCALECODE    AS 'Payscale_Code',
                       C1.PAYSCALENAME    AS 'Payscale_Name'
                FROM   PWPSC000 C0
                       LEFT JOIN PWPSC001 C1
                            ON  C1.SEQNO = C0.SEQNO
            ) payscaleinfo
            ON  payscaleinfo.Table_Code = pyh.PAYSCALETABLE
            AND payscaleinfo.Payscale_Code = pyh.PAYSCALECODE

Fields Definition

View Configuration (Column/Raw/Data Fields)

Rows/ Columns Specification

Row/Column

Description/ Location in APM

PIN

The PIN from the Personal Details.

Name

The Full Name from the Personal Details.

Organization

The Employment Organization from the Personal Details.

VesOrgID

The ID of the vessel linked to the payment entry in Account Dim 2.

Vessel Name

The Name of the vessel linked to the payment entry Account Dim 2.

Department

The Code of the department linked to the payment entry Account Dim 3.

Category

The category of the payment entry.

Days/Quantity

The days (Entry Field 2) of the payment entry.

Rate

The rate (Entry Field 3) of the payment entry.

Period

The period of the payment entry.

Entry Code

The Code of the payment entry.

Amount

The Amount (Entry Field 1) value of the payment entry.

Payscale Table

The payscale table of the payment entry.

Payscale Code

The payscale code of the payment entry.

Payscale Table Name

The payscale table name of the payment entry.

Payscale Code Name

The payscale code name of the payment entry.

Rank

The Name of the rank linked to the payment entry.

Payment Currency

The payment currency of the payment entry.

Payment Currency Rate

The exchange rate of the payment entry.

numorgid

The emplyment organization ID from the Personal Details.

employmentstratdate

The emplyment start date from the Personal Details.

employmentenddate

The emplyment end date from the Personal Details.

Other

  • No labels