<?php
include 'includes/config.php';

$id = $_GET['id'] ?? 0;

$stmt = $conn->prepare("SELECT id, product_id, quantity, size_id, sell_price,purchase_price,
            pp_without_discount,
                        (SELECT barcode FROM products WHERE id=purchase_lines.product_id) AS barcode
                        FROM purchase_lines WHERE id=?");
$stmt->execute([$id]);
$row = $stmt->fetch(PDO::FETCH_ASSOC);

echo json_encode($row);


