@nuxt-customer-portal/invoice-timesheets 0.6.0 → 0.7.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @nuxt-customer-portal/invoice-timesheets
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @nuxt-customer-portal/core@0.7.0
8
+ - @nuxt-customer-portal/invoices@0.7.0
9
+ - @nuxt-customer-portal/timesheets@0.7.0
10
+
11
+ ## 0.6.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 41e297d: Add reusable Harvest export and one-time migration commands with read-only previews, explicit member/client mappings, invoice and payment reconciliation, atomic imports, and duplicate protection.
16
+
17
+ Preserve distinct disabled historical users, credit and written-off invoices, original invoice lifecycle events and source metadata. Track externally billed time independently of invoice links to prevent edits and rebilling. Disambiguate duplicate project names and consolidate duplicate contact email records with explicit provenance. Apply the Timesheets and Invoices history migrations before importing.
18
+
19
+ - Updated dependencies [41e297d]
20
+ - @nuxt-customer-portal/timesheets@0.6.1
21
+ - @nuxt-customer-portal/invoices@0.6.1
22
+ - @nuxt-customer-portal/core@0.6.1
23
+
3
24
  ## 0.6.0
4
25
 
5
26
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt-customer-portal/invoice-timesheets",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://nuxt-customer-portal.com",
6
6
  "repository": {
@@ -36,9 +36,9 @@
36
36
  "nanoid": "^5.1.6",
37
37
  "pg": "^8.22.0",
38
38
  "zod": "^4.4.3",
39
- "@nuxt-customer-portal/core": "^0.6.0",
40
- "@nuxt-customer-portal/invoices": "^0.6.0",
41
- "@nuxt-customer-portal/timesheets": "^0.6.0"
39
+ "@nuxt-customer-portal/core": "^0.7.0",
40
+ "@nuxt-customer-portal/invoices": "^0.7.0",
41
+ "@nuxt-customer-portal/timesheets": "^0.7.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "nuxt": "^4.5.1",
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  id: 'invoice-timesheets',
3
- version: '0.6.0',
3
+ version: '0.7.0',
4
4
  source: '@nuxt-customer-portal/invoice-timesheets',
5
5
  dependsOn: ['core', 'invoices', 'timesheets'],
6
6
  schema: './server/db/schema/invoice-timesheets.ts',
@@ -42,7 +42,14 @@ export const listTimesheetInvoiceSources = async (organizationId: string, from?:
42
42
  projectId: timeEntry.projectId
43
43
  })
44
44
  .from(timeEntry)
45
- .where(and(eq(timeEntry.organizationId, organizationId), inArray(timeEntry.id, ids), clientPeriodApproved)),
45
+ .where(
46
+ and(
47
+ eq(timeEntry.organizationId, organizationId),
48
+ inArray(timeEntry.id, ids),
49
+ eq(timeEntry.externallyBilled, false),
50
+ clientPeriodApproved
51
+ )
52
+ ),
46
53
  db
47
54
  .select({ timeEntryId: invoiceTimeEntry.timeEntryId })
48
55
  .from(invoiceTimeEntry)
@@ -139,6 +146,7 @@ export const createInvoiceFromTimesheets = async (
139
146
  eq(timeEntry.organizationId, organizationId),
140
147
  eq(timeEntry.clientOrganizationId, input.clientOrganizationId),
141
148
  inArray(timeEntry.id, sourceIds),
149
+ eq(timeEntry.externallyBilled, false),
142
150
  clientPeriodApproved
143
151
  )
144
152
  ),
@@ -214,6 +222,20 @@ export const hasActiveInvoiceSource = async (organizationId: string, entryIds: s
214
222
  if (!entryIds.length) {
215
223
  return false
216
224
  }
225
+ const [historical] = await db
226
+ .select({ id: timeEntry.id })
227
+ .from(timeEntry)
228
+ .where(
229
+ and(
230
+ eq(timeEntry.organizationId, organizationId),
231
+ inArray(timeEntry.id, entryIds),
232
+ eq(timeEntry.externallyBilled, true)
233
+ )
234
+ )
235
+ .limit(1)
236
+ if (historical) {
237
+ return true
238
+ }
217
239
  const [selected] = await db
218
240
  .select({ id: invoiceTimeEntry.id })
219
241
  .from(invoiceTimeEntry)