Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
titleSQL code for User Labels
SELECT  Sub.*, IIF( Qty_Hours = 0, NULL, FORMAT ( LTRIM(STR(INT(Hours_fmt))) & ':' & LTRIM(STR((Hours_fmt - INT(Hours_fmt)) * 60)), 'Short Time')) AS Hours_fmtHm,
'@user_custom1' as authorized_by,'TRUE'  as approved, '@user_custom2' as RegistrationNumber
FROM 
(
 SELECT 
  TBSLA.*, 
  ir_Customers.CardIdentification,
  FORMAT(TBSLA.InvoiceDate, 'yyyy-mm-dd') AS InvoiceDate_fmt,
  FORMAT(TBSLA.LineDate, 'yyyy-mm-dd') AS InvoiceLineDate_fmt,
  IIF(TBSLA.Qty_Units = 0, NULL, TBSLA.Qty_Units) AS Quantity_fmt,
  IIF(TBSLA.Qty_Hours = 0, NULL, TBSLA.Qty_Hours) AS Hours_fmt,
  FORMAT(TBSLA.TaxExclusiveRate, 'Fixed') AS UnitPrice_fmt,   
  IIF(TX.TaxCode = 'FRE', 'Tax Free (0%)',
  IIF(TX.TaxCode = 'GST', 'Tax Claimable (10%)', 'Oops')) AS GSTCode_fmt
 FROM ir_Taxcodes AS TX INNER JOIN 
 (ir_TimeBillingSaleLinesAll AS TBSLA INNER JOIN ir_Customers
  ON TBSLA.CardRecordID = ir_Customers.CustomerID) 
  ON TX.TaxCodeID = TBSLA.TaxCodeID
) AS Sub

 

  

Bulk Claim Upload Specification 1.2.doc