-- Invoice labels moved from script update to plugin update.
-- Keep this idempotent for re-install/re-run safety.

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice', 'backend', 'Invoices Menu', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Invoices Menu', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionIndex', 'backend', 'Invoice settings', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionIndex' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Invoice settings', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionInvoices', 'backend', 'Invoices List', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionInvoices' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Invoices List', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionGetInvoices', 'backend', 'Load invoices', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionGetInvoices' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Load invoices', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionView', 'backend', 'View invoice', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionView' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'View invoice', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionSend', 'backend', 'Send invoice', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionSend' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Send invoice', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionPrint', 'backend', 'Print invoice', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionPrint' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Print invoice', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionCreate', 'backend', 'Create invoice', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionCreate' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Create invoice', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionDelete', 'backend', 'Delete invoice', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionDelete' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Delete invoice', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionGeneratePdf', 'backend', 'Download PDF', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionGeneratePdf' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Download PDF', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_generatePdf', 'backend', 'Generate PDF', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_generatePdf' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Generate PDF', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionDownloadBulk', 'backend', 'Download invoice PDFs', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionDownloadBulk' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Download invoice PDFs', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionDeleteBulk', 'backend', 'Delete multiple invoices', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionDeleteBulk' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Delete multiple invoices', 'script');

INSERT IGNORE INTO `fields` VALUES (NULL, 'pjInvoice_pjActionSaveInvoice', 'backend', 'Edit invoice status', 'script', NULL);
SET @id := (SELECT `id` FROM `fields` WHERE `key` = 'pjInvoice_pjActionSaveInvoice' LIMIT 1);
INSERT IGNORE INTO `multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Edit invoice status', 'script');
