Is it bad practice to calculate within the insert query?
INSERT INTO hr (hr_sign, hr_job, hr_code, hr_subject, hr_qty, hr_ppu, hr_sum)
SELECT 'JD',
       '20-0001',
       code_id,
       'testing',
       CASE code_id WHEN 'PM' THEN 1.25
                    WHEN 'COPY' THEN 2.25
                    END, 
       code_ppu, 
       code_ppu * CASE code_id WHEN 'PM' THEN 1.25
                               WHEN 'COPY' THEN 2.25
                               END
FROM code
WHERE code_id IN ('PM','COPY');

PS. It is safe to store the relation between code_id and according coefficient (set into hr_qty and used during hr_sum calculation) in separate table and use this table in data source instead of CASEs.


Is it smart or bad practice to do this calculation in the SQL query?

Calculations is a norma. But shown subqueries usage - hardly...


How do I transfer them as parameters?

For example, something like (not tested)
INSERT INTO hr (hr_sign, hr_job, hr_code, hr_subject, hr_qty, hr_ppu, hr_sum)
WITH 
cte1 AS ( SELECT one_row
          FROM REGEXP_SPLIT_TO_TABLE(@packed_csv, ',') AS parameters(one_row) ),
cte2 AS ( SELECT SPLIT_PART(one_row, ':', 1) AS code_id,
                 SPLIT_PART(one_row, ':', 2)::DECIMAL AS multiplier 
          FROM cte1 )
SELECT 'JD',
       '20-0001',
       code.code_id,
       'testing',
       cte2.multiplier, 
       code.code_ppu, 
       code.code_ppu * cte2.multiplier
FROM code
JOIN cte2 ON code.code_id = cte2.code_id;

where @packed_csv is a string like 'PM:1.25,COPY:2.25',