tin-spa 20.3.4 → 20.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1532,6 +1532,7 @@ class DataServiceLib {
1532
1532
  this.capTransactionTypes = new CapItem;
1533
1533
  this.capTransactions = new CapItem;
1534
1534
  this.capAccountingInvoices = new CapItem;
1535
+ this.capInvoicing = new CapItem; // Added: Capability for invoicing view
1535
1536
  this.capLoans = new CapItem;
1536
1537
  this.capLoanProducts = new CapItem;
1537
1538
  this.capLoansMain = new CapItem;
@@ -2223,8 +2224,7 @@ class DataServiceLib {
2223
2224
  this.capAccounting.name = "cap27";
2224
2225
  this.capAccounting.display = "Accounting";
2225
2226
  this.capAccounting.icon = "account_balance";
2226
- this.capAccounting.capSubItems = [this.capAccounts, this.capTransactions, this.capAggregates, this.capTransactionTypes, this.capAccountingInvoices,
2227
- this.capAging, this.capAccountingOutstandingInvoices]; // Added: capAging to submenu
2227
+ this.capAccounting.capSubItems = [this.capAccounts, this.capTransactions, this.capAggregates, this.capTransactionTypes,];
2228
2228
  this.capAccounts.name = "cap52"; // Changed: Fixed conflict with capBrands (was cap14)
2229
2229
  this.capAccounts.display = "Accounts";
2230
2230
  this.capAccounts.link = "home/admin/accounting-accounts";
@@ -2233,10 +2233,6 @@ class DataServiceLib {
2233
2233
  this.capAggregates.display = "Aggregates";
2234
2234
  this.capAggregates.link = "home/admin/accounting-aggregates";
2235
2235
  this.capAggregates.icon = "bar_chart";
2236
- this.capAging.name = "cap58"; // Added: Aging capability
2237
- this.capAging.display = "Aging Report";
2238
- this.capAging.link = "home/admin/accounting-aging";
2239
- this.capAging.icon = "schedule";
2240
2236
  this.capTransactionTypes.name = "cap28";
2241
2237
  this.capTransactionTypes.display = "Transaction Types";
2242
2238
  this.capTransactionTypes.link = "home/admin/accounting-transaction-types";
@@ -2245,14 +2241,22 @@ class DataServiceLib {
2245
2241
  this.capTransactions.display = "Transactions";
2246
2242
  this.capTransactions.link = "home/admin/accounting-transactions";
2247
2243
  this.capTransactions.icon = "receipt_long";
2248
- this.capAccountingInvoices.name = "cap53"; // Changed: Fixed conflict with capInventory (was cap34)
2244
+ this.capInvoicing.name = "cap53";
2245
+ this.capInvoicing.display = "Invoicing";
2246
+ this.capInvoicing.icon = "receipt_long";
2247
+ this.capInvoicing.capSubItems = [this.capAccountingInvoices, this.capAging, this.capAccountingOutstandingInvoices];
2248
+ this.capAccountingInvoices.name = "cap53";
2249
2249
  this.capAccountingInvoices.display = "Invoices";
2250
2250
  this.capAccountingInvoices.link = "home/admin/accounting-invoices";
2251
2251
  this.capAccountingInvoices.icon = "receipt_long";
2252
- this.capAccountingOutstandingInvoices.name = "cap54"; // Changed: Fixed conflict with capInventoryDashboard (was cap35)
2252
+ this.capAccountingOutstandingInvoices.name = "cap54";
2253
2253
  this.capAccountingOutstandingInvoices.display = "Outstanding Invoices";
2254
2254
  this.capAccountingOutstandingInvoices.link = "home/admin/accounting-outstanding-invoices";
2255
2255
  this.capAccountingOutstandingInvoices.icon = "account_balance_wallet";
2256
+ this.capAging.name = "cap58";
2257
+ this.capAging.display = "Aging Report";
2258
+ this.capAging.link = "home/admin/accounting-aging";
2259
+ this.capAging.icon = "schedule";
2256
2260
  this.capLoans.name = "cap30";
2257
2261
  this.capLoans.display = "Loans";
2258
2262
  this.capLoans.icon = "payments";
@@ -2272,9 +2276,12 @@ class DataServiceLib {
2272
2276
  this.capInventory.name = "cap34";
2273
2277
  this.capInventory.display = "Inventory";
2274
2278
  this.capInventory.icon = "inventory";
2275
- this.capInventory.capSubItems = [this.capSales, this.capInventoryReceipts, this.capProducts, this.capServiceItems, this.capBundleProducts, this.capInventoryStock, this.capInventoryTransactions, this.capInventoryItems,
2279
+ this.capInventory.capSubItems = [this.capSales, this.capInventoryReceipts, this.capProducts, this.capServiceItems,
2280
+ this.capBundleProducts, this.capInventoryStock, this.capInventoryTransactions, this.capInventoryItems,
2276
2281
  this.capPurchaseOrders, this.capSalesOrders, this.capRequisitions, this.capInventoryAdjustments,
2277
- this.capInventoryReturns, this.capRequisitionReturns, this.capProductionRecipes, this.capProductionOrders, this.capInventoryDashboard]; // Changed: Added capServiceItems to inventory menu
2282
+ this.capInventoryReturns, this.capRequisitionReturns, this.capProductionRecipes, this.capProductionOrders,
2283
+ this.capInventoryDashboard
2284
+ ];
2278
2285
  this.capInventoryDashboard.name = "cap35";
2279
2286
  this.capInventoryDashboard.display = "Dashboard";
2280
2287
  this.capInventoryDashboard.link = "home/admin/inventory-dashboard";
@@ -2849,10 +2856,32 @@ class AccountingService {
2849
2856
  { name: 'description', type: 'text', required: true, alias: 'Description', span: true }, // Changed: Description field (backend will populate for Product/Service)
2850
2857
  { name: 'quantity', type: 'number', required: true, defaultValue: 1 },
2851
2858
  { name: 'unitPrice', type: 'money', alias: 'Unit Price', required: true }, // Changed: Unit price field (backend will populate for Product/Service)
2859
+ { name: 'poNumber', type: 'text', alias: 'PO Number', hint: 'Purchase Order Number' }, // Added: PO Number for invoice bundling
2852
2860
  ],
2853
2861
  loadAction: { url: 'invoiceitems/id/{invoiceItemID}' },
2854
2862
  heroField: 'invoiceItemID',
2855
2863
  };
2864
+ // Added: Move item form configuration - select destination invoice
2865
+ this.invoiceMoveItemFormConfig = {
2866
+ title: 'Move Item',
2867
+ fixedTitle: true,
2868
+ fields: [
2869
+ { name: 'invoiceItemID', type: 'number', hidden: true },
2870
+ { name: 'description', type: 'label', alias: 'Item', readonly: true, span: true },
2871
+ { name: 'invoiceID', type: 'select', alias: 'Move to Invoice', required: true, span: true, loadAction: { url: 'invoiceitems/list/draft-invoices' } }
2872
+ ],
2873
+ loadAction: { url: 'invoiceitems/id/{invoiceItemID}' },
2874
+ heroField: 'invoiceItemID'
2875
+ };
2876
+ // Added: Move item details dialog config
2877
+ this.invoiceMoveItemDetailsConfig = {
2878
+ formConfig: this.invoiceMoveItemFormConfig,
2879
+ heroField: 'invoiceItemID',
2880
+ mode: 'edit',
2881
+ buttons: [
2882
+ { name: 'move', display: 'Move Item', icon: { name: 'swap_horiz', color: 'blue' }, inDialog: true, action: { url: 'invoiceitems?action=move', method: 'post', successMessage: 'Item moved successfully' } }
2883
+ ]
2884
+ };
2856
2885
  // Invoice items table for manual line item entry
2857
2886
  this.invoiceItemsTableConfig = {
2858
2887
  tabTitle: 'Invoice Items',
@@ -2862,22 +2891,16 @@ class AccountingService {
2862
2891
  columns: [
2863
2892
  { name: 'invoiceItemID', type: 'number', alias: 'ID', hiddenCondition: () => true },
2864
2893
  { name: 'description', type: 'text', alias: 'Description' },
2894
+ { name: 'poNumber', type: 'text', alias: 'PO#' }, // Added: Purchase Order Number column
2865
2895
  { name: 'quantity', type: 'number', alias: 'Qty' },
2866
2896
  { name: 'unitPrice', type: 'money', alias: 'Unit Price' },
2867
2897
  { name: 'amount', type: 'money', alias: 'Amount' }
2868
2898
  ],
2869
2899
  buttons: [
2870
- { name: 'create', display: 'Add Item', dialog: true, action: { url: 'invoiceitems?action=create', method: 'post' },
2871
- disabled: x => x.status != InvoiceStatus.Draft
2872
- },
2873
- { name: 'edit', dialog: true, action: { url: 'invoiceitems?action=edit', method: 'post' },
2874
- disabled: x => x.status != InvoiceStatus.Draft
2875
- },
2876
- { name: 'delete', inDialog: true, icon: { name: 'delete', color: 'red' }, action: { url: 'invoiceitems?action=delete', method: 'post',
2877
- successMessage: 'Deleted' },
2878
- confirm: { message: 'Delete this item?' },
2879
- disabled: x => x.status != InvoiceStatus.Draft
2880
- },
2900
+ { name: 'create', display: 'Add Item', dialog: true, action: { url: 'invoiceitems?action=create', method: 'post' }, disabled: x => x.status != InvoiceStatus.Draft },
2901
+ { name: 'edit', dialog: true, action: { url: 'invoiceitems?action=edit', method: 'post' }, disabled: x => x.status != InvoiceStatus.Draft },
2902
+ { name: 'move', display: 'Move', dialog: true, icon: { name: 'swap_horiz' }, detailsConfig: this.invoiceMoveItemDetailsConfig, disabled: x => x.status != InvoiceStatus.Draft }, // Added: Move item button
2903
+ { name: 'delete', inDialog: true, icon: { name: 'delete', color: 'red' }, action: { url: 'invoiceitems?action=delete', method: 'post', successMessage: 'Deleted' }, confirm: { message: 'Delete this item?' }, disabled: x => x.status != InvoiceStatus.Draft },
2881
2904
  ],
2882
2905
  loadAction: { url: 'invoiceitems/x/x' }, loadCriteria: 'invoice', loadIDField: 'invoiceID',
2883
2906
  formConfig: this.invoiceItemsFormConfig // Changed: Reference extracted form config
@@ -2898,7 +2921,7 @@ class AccountingService {
2898
2921
  visible: x => x.status == InvoiceStatus.Draft,
2899
2922
  disabled: x => x.totalAmount == 0
2900
2923
  };
2901
- this.invoiceEditButton = { name: 'edit', dialog: true, action: { url: 'invoices?action=edit', method: 'post', },
2924
+ this.invoiceEditButton = { name: 'edit', display: 'Save', dialog: true, action: { url: 'invoices?action=edit', method: 'post', },
2902
2925
  confirm: { message: 'Proceed ?' },
2903
2926
  visible: x => x.status == InvoiceStatus.Draft // Changed: Draft only
2904
2927
  };
@@ -2908,7 +2931,12 @@ class AccountingService {
2908
2931
  formConfig: this.invoiceFormConfig,
2909
2932
  tableConfigs: [this.invoiceItemsTableConfig, this.invoicePaymentsTableConfig],
2910
2933
  heroField: 'invoiceID',
2911
- buttons: [this.invoiceSubmitButton, this.invoiceRecordPaymentButton, this.invoiceDiscardButton, this.invoiceEditButton]
2934
+ buttons: [
2935
+ this.invoiceSubmitButton,
2936
+ this.invoiceRecordPaymentButton,
2937
+ this.invoiceDiscardButton,
2938
+ this.invoiceEditButton
2939
+ ]
2912
2940
  };
2913
2941
  this.invoiceViewButton = { name: 'view', dialog: true, detailsConfig: this.invoiceDetailsDialogConfig };
2914
2942
  // Invoice summary tiles
@@ -3920,9 +3948,9 @@ class InventoryService {
3920
3948
  includeAudit: true,
3921
3949
  fields: [
3922
3950
  { name: 'name', type: 'text', required: true, alias: 'Service Name' },
3951
+ { name: 'isActive', type: 'checkbox', alias: 'Active', defaultValue: true },
3923
3952
  { name: 'description', type: 'text', alias: 'Description' },
3924
3953
  { name: 'unitPrice', type: 'money', required: true, alias: 'Unit Price' },
3925
- { name: 'isActive', type: 'checkbox', alias: 'Active', defaultValue: true }
3926
3954
  ],
3927
3955
  loadAction: { url: 'serviceitems/id' },
3928
3956
  heroField: 'serviceItemID'