Select with dynamic columns
WITH abc AS (
SELECT
   i.InvoiceId
   ,h.BusinessName
   ,h.BranchId
   ,ItemCode
   ,Quantity
FROM InvoiceItem i
INNER JOIN InvoiceHeader h ON i.InvoiceId = h.InvoiceId
)
SELECT PT.InvoiceId, PT.BusinessName, PT.BranchId,
    ISNULL(PT.SNACK1,0) as Snack1,
    ISNULL(PT.SNACK2,0) as Snack2,
    ISNULL(PT.SNACK3,0) as Snack3,
    ISNULL(PT.SNACK4,0) as Snack4
FROM abc
PIVOT( SUM(Quantity)
       FOR ItemCode in ("SNACK1","SNACK2","SNACK3","SNACK4")
       ) as PT


output:

SQLfiddle

| InvoiceId | BusinessName | BranchId | Snack1 | Snack2 | Snack3 | Snack4 |
|-----------|--------------|----------|--------|--------|--------|--------|
|         1 |      BSN INC |        1 |    150 |    120 |      0 |      0 |
|         2 |      BSN INC |        2 |    100 |    150 |      0 |      0 |
|         3 |   SAMPLE INC |        1 |    150 |    150 |    110 |      0 |
|         4 |  ANOTHER INC |        1 |     90 |     80 |    120 |      0 |
|         5 |  ANOTHER INC |        3 |     50 |     70 |     90 |     70 |