Within Eralis Job you have the ability to set the GL determination by:
- Job type - The system will use the sales and COGS accounts set on the header of the master job
OR - Item determination - The system will update the sales and COGS accounts on the job line based on the sales and COGS accounts determined using the SAP Business One GL determination method specified on the item code used on the line.
In the case of GL determination by job type, when configuring the Job Types inside Eralis Job, the company can default the sales and COGS accounts for each job type, which are then copied through to the Sales and COGS account fields on the master job when the user updates the Job Type on the master job.
However, we have had requests for the ability to use the GL accounts based on the subjob type rather than only using the master job type. In this way, where there are multiple subjobs to a master job, they can each be assigned to different job types and hence have different revenue and cost postings.
There is no specific configuration option to achieve this, but we have created a trigger that can update any newly inserted job lines and sets the sales and COGS accounts on the job lines to the sales and COGS accounts defined in the job type setup for the job type allocated to the subjob.
Please note, this only works when job lines are first inserted; if you change the subjob type at a later stage it will not go through and update the job lines to the new accounts.
As with all things, please discuss the use of this trigger with your SAP Business One support partner, and test the trigger in a test environment before applying it to a live production system.
The following trigger can be used on a SQL Server Platform / Database:
CREATE TRIGGER ENPRISE_CUSTOM_SETGLCODESBYSUBJOBTYPE
ON ENPRISE_JOBCOST_JOBLINES
FOR INSERT
AS
BEGIN
UPDATE L
SET L.SALESGLCODE = T.DEFAULTSALESCODE,
L.COSGLCODE = T.DEFAULTCOSCODE
FROM ENPRISE_JOBCOST_JOBLINES L
INNER JOIN INSERTED I ON I.SEQNO = L.SEQNO
INNER JOIN ENPRISE_JOBCOST_SUBJOB S ON S.SUBJOBID = I.SUBJOBID
INNER JOIN ENPRISE_JOBCOST_JOBTYPE T ON T.SEQNO = S.JOBTYPE
WHERE I.STATUS IN (1, 2, 3, 5)
AND I.LINETYPE <> 'Q'
END
The following trigger can be used on a HANA Platform / Database Schema:
CREATE TRIGGER ENPRISE_CUSTOM_SETGLCODESBYSUBJOBTYPE
BEFORE INSERT ON ENPRISE_JOBCOST_JOBLINES
REFERENCING NEW ROW inserted
FOR EACH ROW
BEGIN
IF ((:inserted.STATUS = 1 OR :inserted.STATUS = 2 OR :inserted.STATUS = 3 OR :inserted.STATUS = 5) AND :inserted.LINETYPE <> 'Q') THEN
DECLARE default_sales_code NVARCHAR(15);
DECLARE default_cos_code NVARCHAR(15);
SELECT T.DEFAULTSALESCODE, T.DEFAULTCOSCODE INTO default_sales_code, default_cos_code
FROM ENPRISE_JOBCOST_SUBJOB S
INNER JOIN ENPRISE_JOBCOST_JOBTYPE T ON T.SEQNO = S.JOBTYPE
WHERE S.SUBJOBID = :inserted.SUBJOBID;
inserted.SALESGLCODE = default_sales_code;
inserted.COSGLCODE = default_cos_code;
END IF;
END;
Comments
0 comments
Article is closed for comments.