fix
This commit is contained in:
@@ -50,17 +50,17 @@ function buildPaymentLinkHtml(invoice) {
|
||||
// GET all invoices
|
||||
router.get('/', async (req, res) => {
|
||||
try {
|
||||
const { has_parts_or_subscription, empty_cost_only } = req.query;
|
||||
const { has_parts, empty_cost_only } = req.query;
|
||||
|
||||
let whereClauses = [];
|
||||
if (has_parts_or_subscription === 'true') {
|
||||
if (has_parts === 'true') {
|
||||
const costCondition = empty_cost_only === 'true'
|
||||
? `AND (ii.unit_cost IS NULL OR ii.unit_cost = '')`
|
||||
: '';
|
||||
whereClauses.push(`EXISTS (
|
||||
SELECT 1 FROM invoice_items ii
|
||||
WHERE ii.invoice_id = i.id
|
||||
AND (ii.qbo_item_id = '9' OR ii.qbo_item_id = '115')
|
||||
AND ii.qbo_item_id = '9'
|
||||
${costCondition}
|
||||
)`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user