@spaceinvoices/react-ui 0.4.4 → 0.4.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.
Files changed (178) hide show
  1. package/cli/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/src/components/advance-invoices/advance-invoices.hooks.ts +2 -2
  4. package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +151 -45
  5. package/src/components/advance-invoices/create/locales/de.ts +20 -0
  6. package/src/components/advance-invoices/create/locales/es.ts +20 -0
  7. package/src/components/advance-invoices/create/locales/fr.ts +20 -0
  8. package/src/components/advance-invoices/create/locales/hr.ts +20 -0
  9. package/src/components/advance-invoices/create/locales/it.ts +20 -0
  10. package/src/components/advance-invoices/create/locales/nl.ts +20 -0
  11. package/src/components/advance-invoices/create/locales/pl.ts +20 -0
  12. package/src/components/advance-invoices/create/locales/pt.ts +20 -0
  13. package/src/components/advance-invoices/create/locales/sl.ts +20 -0
  14. package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +5 -5
  15. package/src/components/advance-invoices/list/list-row-actions.tsx +48 -1
  16. package/src/components/advance-invoices/list/list-table.tsx +21 -1
  17. package/src/components/advance-invoices/list/locales/de.ts +4 -0
  18. package/src/components/advance-invoices/list/locales/en.ts +3 -0
  19. package/src/components/advance-invoices/list/locales/es.ts +4 -0
  20. package/src/components/advance-invoices/list/locales/fr.ts +4 -0
  21. package/src/components/advance-invoices/list/locales/hr.ts +3 -0
  22. package/src/components/advance-invoices/list/locales/it.ts +4 -0
  23. package/src/components/advance-invoices/list/locales/nl.ts +4 -0
  24. package/src/components/advance-invoices/list/locales/pl.ts +3 -0
  25. package/src/components/advance-invoices/list/locales/pt.ts +4 -0
  26. package/src/components/advance-invoices/list/locales/sl.ts +3 -0
  27. package/src/components/credit-notes/create/create-credit-note-form.tsx +161 -42
  28. package/src/components/credit-notes/create/locales/de.ts +21 -0
  29. package/src/components/credit-notes/create/locales/es.ts +21 -0
  30. package/src/components/credit-notes/create/locales/fr.ts +21 -0
  31. package/src/components/credit-notes/create/locales/hr.ts +21 -0
  32. package/src/components/credit-notes/create/locales/it.ts +21 -0
  33. package/src/components/credit-notes/create/locales/nl.ts +21 -0
  34. package/src/components/credit-notes/create/locales/pl.ts +21 -0
  35. package/src/components/credit-notes/create/locales/pt.ts +21 -0
  36. package/src/components/credit-notes/create/locales/sl.ts +22 -1
  37. package/src/components/credit-notes/credit-notes.hooks.ts +2 -2
  38. package/src/components/credit-notes/list/list-row-actions.tsx +44 -1
  39. package/src/components/credit-notes/list/list-table.tsx +16 -2
  40. package/src/components/credit-notes/list/locales/de.ts +2 -0
  41. package/src/components/credit-notes/list/locales/en.ts +2 -0
  42. package/src/components/credit-notes/list/locales/es.ts +2 -0
  43. package/src/components/credit-notes/list/locales/fr.ts +2 -0
  44. package/src/components/credit-notes/list/locales/hr.ts +2 -0
  45. package/src/components/credit-notes/list/locales/it.ts +2 -0
  46. package/src/components/credit-notes/list/locales/nl.ts +2 -0
  47. package/src/components/credit-notes/list/locales/pl.ts +2 -0
  48. package/src/components/credit-notes/list/locales/pt.ts +2 -0
  49. package/src/components/credit-notes/list/locales/sl.ts +2 -0
  50. package/src/components/dashboard/collection-rate-card/use-collection-rate.ts +48 -9
  51. package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +77 -48
  52. package/src/components/dashboard/shared/use-revenue-data.ts +77 -9
  53. package/src/components/delivery-notes/create/create-delivery-note-form.tsx +114 -7
  54. package/src/components/delivery-notes/create/locales/de.ts +21 -0
  55. package/src/components/delivery-notes/create/locales/es.ts +21 -0
  56. package/src/components/delivery-notes/create/locales/fr.ts +21 -0
  57. package/src/components/delivery-notes/create/locales/hr.ts +21 -0
  58. package/src/components/delivery-notes/create/locales/it.ts +21 -0
  59. package/src/components/delivery-notes/create/locales/nl.ts +21 -0
  60. package/src/components/delivery-notes/create/locales/pl.ts +21 -0
  61. package/src/components/delivery-notes/create/locales/pt.ts +21 -0
  62. package/src/components/delivery-notes/create/locales/sl.ts +22 -1
  63. package/src/components/delivery-notes/list/list-table.tsx +17 -8
  64. package/src/components/delivery-notes/list/locales/de.ts +32 -1
  65. package/src/components/delivery-notes/list/locales/en.ts +31 -0
  66. package/src/components/delivery-notes/list/locales/es.ts +32 -1
  67. package/src/components/delivery-notes/list/locales/fr.ts +32 -1
  68. package/src/components/delivery-notes/list/locales/hr.ts +32 -1
  69. package/src/components/delivery-notes/list/locales/it.ts +32 -1
  70. package/src/components/delivery-notes/list/locales/nl.ts +32 -1
  71. package/src/components/delivery-notes/list/locales/pl.ts +32 -1
  72. package/src/components/delivery-notes/list/locales/pt.ts +32 -1
  73. package/src/components/delivery-notes/list/locales/sl.ts +32 -1
  74. package/src/components/documents/create/document-add-item-form.tsx +70 -0
  75. package/src/components/documents/create/document-details-section.tsx +590 -344
  76. package/src/components/documents/create/document-items-section.tsx +21 -4
  77. package/src/components/documents/create/live-preview.tsx +24 -4
  78. package/src/components/documents/create/mark-as-paid-section.tsx +29 -20
  79. package/src/components/documents/create/prepare-document-submission.ts +22 -8
  80. package/src/components/documents/create/smart-code-insert-button.tsx +6 -0
  81. package/src/components/documents/shared/document-preview-display.tsx +3 -4
  82. package/src/components/documents/view/document-actions-bar.tsx +7 -27
  83. package/src/components/documents/view/document-details-card.tsx +32 -9
  84. package/src/components/documents/view/locales/de.ts +3 -0
  85. package/src/components/documents/view/locales/es.ts +3 -0
  86. package/src/components/documents/view/locales/fr.ts +3 -0
  87. package/src/components/documents/view/locales/hr.ts +3 -0
  88. package/src/components/documents/view/locales/it.ts +3 -0
  89. package/src/components/documents/view/locales/nl.ts +3 -0
  90. package/src/components/documents/view/locales/pl.ts +3 -0
  91. package/src/components/documents/view/locales/pt.ts +3 -0
  92. package/src/components/documents/view/locales/sl.ts +4 -1
  93. package/src/components/documents/view/use-document-download.ts +6 -3
  94. package/src/components/entities/create-entity-form.tsx +2 -1
  95. package/src/components/entities/entity-settings-form/email-template-variables-info.tsx +6 -0
  96. package/src/components/entities/entity-settings-form/input-with-preview.tsx +2 -117
  97. package/src/components/entities/entity-settings-form/locales/de.ts +5 -0
  98. package/src/components/entities/entity-settings-form/locales/es.ts +5 -0
  99. package/src/components/entities/entity-settings-form/locales/fr.ts +5 -0
  100. package/src/components/entities/entity-settings-form/locales/hr.ts +5 -0
  101. package/src/components/entities/entity-settings-form/locales/it.ts +5 -0
  102. package/src/components/entities/entity-settings-form/locales/nl.ts +5 -0
  103. package/src/components/entities/entity-settings-form/locales/pl.ts +5 -0
  104. package/src/components/entities/entity-settings-form/locales/pt.ts +5 -0
  105. package/src/components/entities/entity-settings-form/locales/sl.ts +5 -0
  106. package/src/components/entities/fina-settings-form/fina-settings-form.tsx +15 -0
  107. package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +5 -1
  108. package/src/components/entities/fina-settings-form/locales/de.ts +3 -0
  109. package/src/components/entities/fina-settings-form/locales/en.ts +3 -0
  110. package/src/components/entities/fina-settings-form/locales/es.ts +3 -0
  111. package/src/components/entities/fina-settings-form/locales/fr.ts +3 -0
  112. package/src/components/entities/fina-settings-form/locales/hr.ts +3 -0
  113. package/src/components/entities/fina-settings-form/locales/it.ts +3 -0
  114. package/src/components/entities/fina-settings-form/locales/nl.ts +3 -0
  115. package/src/components/entities/fina-settings-form/locales/pl.ts +3 -0
  116. package/src/components/entities/fina-settings-form/locales/pt.ts +3 -0
  117. package/src/components/entities/fina-settings-form/locales/sl.ts +3 -0
  118. package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +4 -4
  119. package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +3 -3
  120. package/src/components/entities/settings/company-settings-form.tsx +173 -20
  121. package/src/components/entities/settings/defaults-settings-form.tsx +38 -1
  122. package/src/components/entities/settings/tax-rules-settings-form.tsx +1 -2
  123. package/src/components/estimates/create/create-estimate-form.tsx +107 -8
  124. package/src/components/estimates/create/locales/de.ts +21 -0
  125. package/src/components/estimates/create/locales/es.ts +21 -0
  126. package/src/components/estimates/create/locales/fr.ts +21 -0
  127. package/src/components/estimates/create/locales/hr.ts +21 -0
  128. package/src/components/estimates/create/locales/it.ts +21 -0
  129. package/src/components/estimates/create/locales/nl.ts +21 -0
  130. package/src/components/estimates/create/locales/pl.ts +21 -0
  131. package/src/components/estimates/create/locales/pt.ts +21 -0
  132. package/src/components/estimates/create/locales/sl.ts +22 -1
  133. package/src/components/estimates/list/list-table.tsx +11 -2
  134. package/src/components/estimates/list/locales/de.ts +1 -0
  135. package/src/components/estimates/list/locales/en.ts +1 -0
  136. package/src/components/estimates/list/locales/es.ts +1 -0
  137. package/src/components/estimates/list/locales/fr.ts +1 -0
  138. package/src/components/estimates/list/locales/hr.ts +1 -0
  139. package/src/components/estimates/list/locales/it.ts +1 -0
  140. package/src/components/estimates/list/locales/nl.ts +1 -0
  141. package/src/components/estimates/list/locales/pl.ts +1 -0
  142. package/src/components/estimates/list/locales/pt.ts +1 -0
  143. package/src/components/estimates/list/locales/sl.ts +1 -0
  144. package/src/components/export/document-export-form.tsx +46 -12
  145. package/src/components/invoices/create/create-invoice-form.tsx +186 -48
  146. package/src/components/invoices/create/locales/de.ts +28 -0
  147. package/src/components/invoices/create/locales/es.ts +28 -0
  148. package/src/components/invoices/create/locales/fr.ts +28 -0
  149. package/src/components/invoices/create/locales/hr.ts +28 -0
  150. package/src/components/invoices/create/locales/it.ts +28 -0
  151. package/src/components/invoices/create/locales/nl.ts +28 -0
  152. package/src/components/invoices/create/locales/pl.ts +28 -0
  153. package/src/components/invoices/create/locales/pt.ts +28 -0
  154. package/src/components/invoices/create/locales/sl.ts +29 -1
  155. package/src/components/invoices/create/prepare-invoice-submission.ts +5 -5
  156. package/src/components/invoices/invoices.hooks.ts +2 -2
  157. package/src/components/invoices/view/fiscalization-status-card.tsx +10 -8
  158. package/src/components/table/search-input.tsx +17 -0
  159. package/src/components/table/table-pagination.tsx +1 -1
  160. package/src/generated/schemas/advanceinvoice.ts +6 -2
  161. package/src/generated/schemas/creditnote.ts +3 -1
  162. package/src/generated/schemas/deliverynote.ts +3 -1
  163. package/src/generated/schemas/entity.ts +4 -4
  164. package/src/generated/schemas/entityapikey.ts +19 -0
  165. package/src/generated/schemas/estimate.ts +6 -2
  166. package/src/generated/schemas/index.ts +1 -0
  167. package/src/generated/schemas/invoice.ts +4 -1
  168. package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +17 -23
  169. package/src/generated/schemas/rendercreditnotepreview_body.ts +17 -23
  170. package/src/generated/schemas/renderdeliverynotepreview_body.ts +17 -23
  171. package/src/generated/schemas/renderestimatepreview_body.ts +17 -23
  172. package/src/generated/schemas/renderinvoicepreview_body.ts +19 -23
  173. package/src/generated/schemas/startpdfexport_body.ts +14 -2
  174. package/src/generated/schemas/webhook.ts +4 -0
  175. package/src/hooks/use-duplicate-document.ts +16 -9
  176. package/src/hooks/use-vies-check.ts +3 -0
  177. package/src/lib/template-variables.tsx +167 -0
  178. package/src/providers/entities-context.tsx +2 -2
@@ -39,6 +39,9 @@ export default {
39
39
  "Insert variable": "Variable einfügen",
40
40
  "Add payment instructions, terms, or other notes...":
41
41
  "Zahlungsanweisungen, Bedingungen oder andere Notizen hinzufügen...",
42
+ // Signature field
43
+ Signature: "Unterschrift",
44
+ "Add signature text...": "Unterschriftstext hinzufügen...",
42
45
  // Payment terms field
43
46
  "Payment Terms": "Zahlungsbedingungen",
44
47
  "Add payment terms...": "Zahlungsbedingungen hinzufügen...",
@@ -76,4 +79,22 @@ export default {
76
79
  Device: "Gerät",
77
80
  "FINA fiscalized invoices always use the current date":
78
81
  "FINA-fiskalisierte Dokumente verwenden immer das aktuelle Datum",
82
+ // Separator items
83
+ "Add separator": "Trennzeile hinzufügen",
84
+ "Section header": "Abschnittsüberschrift",
85
+ "Section title...": "Abschnittstitel...",
86
+ // Transaction type
87
+ "Transaction type": "Transaktionstyp",
88
+ Domestic: "Inland",
89
+ "EU B2B": "EU B2B",
90
+ "EU B2C": "EU B2C",
91
+ Export: "Export",
92
+ "Determining transaction type...": "Transaktionstyp wird ermittelt...",
93
+ "This invoice will not be fiscalized (non-domestic transaction)":
94
+ "Diese Rechnung wird nicht fiskalisiert (nicht-inländische Transaktion)",
95
+ "Tax Clause": "Steuerklausel",
96
+ "Add tax clause...": "Steuerklausel hinzufügen...",
97
+ Footer: "Fußzeile",
98
+ "Add document footer...": "Dokumentfußzeile hinzufügen...",
99
+ "Reverse charge - tax exempt EU B2B sale": "Umkehrung der Steuerschuldnerschaft - steuerbefreiter EU B2B Verkauf",
79
100
  } as const;
@@ -38,6 +38,9 @@ export default {
38
38
  Note: "Nota",
39
39
  "Insert variable": "Insertar variable",
40
40
  "Add payment instructions, terms, or other notes...": "Agregue instrucciones de pago, terminos u otras notas...",
41
+ // Signature field
42
+ Signature: "Firma",
43
+ "Add signature text...": "Añadir texto de firma...",
41
44
  // Payment terms field
42
45
  "Payment Terms": "Terminos de pago",
43
46
  "Add payment terms...": "Agregue terminos de pago...",
@@ -75,4 +78,22 @@ export default {
75
78
  Device: "Dispositivo",
76
79
  "FINA fiscalized invoices always use the current date":
77
80
  "Los documentos fiscalizados con FINA siempre usan la fecha actual",
81
+ // Separator items
82
+ "Add separator": "Añadir separador",
83
+ "Section header": "Encabezado de sección",
84
+ "Section title...": "Título de sección...",
85
+ // Transaction type
86
+ "Transaction type": "Tipo de transacción",
87
+ Domestic: "Nacional",
88
+ "EU B2B": "EU B2B",
89
+ "EU B2C": "EU B2C",
90
+ Export: "Exportación",
91
+ "Determining transaction type...": "Determinando tipo de transacción...",
92
+ "This invoice will not be fiscalized (non-domestic transaction)":
93
+ "Esta factura no será fiscalizada (transacción no nacional)",
94
+ "Tax Clause": "Cláusula fiscal",
95
+ "Add tax clause...": "Agregar cláusula fiscal...",
96
+ Footer: "Pie de página",
97
+ "Add document footer...": "Añadir pie de página del documento...",
98
+ "Reverse charge - tax exempt EU B2B sale": "Inversión del sujeto pasivo - venta EU B2B exenta de impuestos",
78
99
  } as const;
@@ -39,6 +39,9 @@ export default {
39
39
  "Insert variable": "Inserer une variable",
40
40
  "Add payment instructions, terms, or other notes...":
41
41
  "Ajoutez des instructions de paiement, des conditions ou d'autres notes...",
42
+ // Signature field
43
+ Signature: "Signature",
44
+ "Add signature text...": "Ajouter un texte de signature...",
42
45
  // Payment terms field
43
46
  "Payment Terms": "Conditions de paiement",
44
47
  "Add payment terms...": "Ajoutez des conditions de paiement...",
@@ -75,4 +78,22 @@ export default {
75
78
  Device: "Appareil",
76
79
  "FINA fiscalized invoices always use the current date":
77
80
  "Les documents fiscalisés FINA utilisent toujours la date actuelle",
81
+ // Separator items
82
+ "Add separator": "Ajouter un séparateur",
83
+ "Section header": "En-tête de section",
84
+ "Section title...": "Titre de section...",
85
+ // Transaction type
86
+ "Transaction type": "Type de transaction",
87
+ Domestic: "Nationale",
88
+ "EU B2B": "EU B2B",
89
+ "EU B2C": "EU B2C",
90
+ Export: "Exportation",
91
+ "Determining transaction type...": "Détermination du type de transaction...",
92
+ "This invoice will not be fiscalized (non-domestic transaction)":
93
+ "Cette facture ne sera pas fiscalisée (transaction non nationale)",
94
+ "Tax Clause": "Clause fiscale",
95
+ "Add tax clause...": "Ajouter une clause fiscale...",
96
+ Footer: "Pied de page",
97
+ "Add document footer...": "Ajouter un pied de page...",
98
+ "Reverse charge - tax exempt EU B2B sale": "Autoliquidation - vente B2B UE exonérée de taxe",
78
99
  } as const;
@@ -38,6 +38,9 @@ export default {
38
38
  Note: "Napomena",
39
39
  "Insert variable": "Umetni varijablu",
40
40
  "Add payment instructions, terms, or other notes...": "Dodajte upute za placanje, uvjete ili druge napomene...",
41
+ // Signature field
42
+ Signature: "Potpis",
43
+ "Add signature text...": "Dodaj tekst potpisa...",
41
44
  // Payment terms field
42
45
  "Payment Terms": "Uvjeti placanja",
43
46
  "Add payment terms...": "Dodajte uvjete placanja...",
@@ -73,4 +76,22 @@ export default {
73
76
  Premise: "Prostor",
74
77
  Device: "Uredaj",
75
78
  "FINA fiscalized invoices always use the current date": "FINA fiskalizirani dokumenti uvijek koriste trenutni datum",
79
+ // Separator items
80
+ "Add separator": "Dodaj separator",
81
+ "Section header": "Naslov odjeljka",
82
+ "Section title...": "Naslov odjeljka...",
83
+ // Transaction type
84
+ "Transaction type": "Vrsta transakcije",
85
+ Domestic: "Domaća",
86
+ "EU B2B": "EU B2B",
87
+ "EU B2C": "EU B2C",
88
+ Export: "Izvoz",
89
+ "Determining transaction type...": "Određivanje vrste transakcije...",
90
+ "This invoice will not be fiscalized (non-domestic transaction)":
91
+ "Ovaj račun neće biti fiskaliziran (nedomaća transakcija)",
92
+ "Tax Clause": "Porezna klauzula",
93
+ "Add tax clause...": "Dodajte poreznu klauzulu...",
94
+ Footer: "Podnožje",
95
+ "Add document footer...": "Dodajte podnožje dokumenta...",
96
+ "Reverse charge - tax exempt EU B2B sale": "Prijenos porezne obveze - porezno oslobođena EU B2B prodaja",
76
97
  } as const;
@@ -38,6 +38,9 @@ export default {
38
38
  Note: "Nota",
39
39
  "Insert variable": "Inserisci variabile",
40
40
  "Add payment instructions, terms, or other notes...": "Aggiungi istruzioni di pagamento, termini o altre note...",
41
+ // Signature field
42
+ Signature: "Firma",
43
+ "Add signature text...": "Aggiungi testo della firma...",
41
44
  // Payment terms field
42
45
  "Payment Terms": "Termini di pagamento",
43
46
  "Add payment terms...": "Aggiungi termini di pagamento...",
@@ -76,4 +79,22 @@ export default {
76
79
  Device: "Dispositivo",
77
80
  "FINA fiscalized invoices always use the current date":
78
81
  "I documenti fiscalizzati FINA utilizzano sempre la data corrente",
82
+ // Separator items
83
+ "Add separator": "Aggiungi separatore",
84
+ "Section header": "Intestazione sezione",
85
+ "Section title...": "Titolo sezione...",
86
+ // Transaction type
87
+ "Transaction type": "Tipo di transazione",
88
+ Domestic: "Nazionale",
89
+ "EU B2B": "EU B2B",
90
+ "EU B2C": "EU B2C",
91
+ Export: "Esportazione",
92
+ "Determining transaction type...": "Determinazione tipo di transazione...",
93
+ "This invoice will not be fiscalized (non-domestic transaction)":
94
+ "Questa fattura non sarà fiscalizzata (transazione non nazionale)",
95
+ "Tax Clause": "Clausola fiscale",
96
+ "Add tax clause...": "Aggiungi clausola fiscale...",
97
+ Footer: "Piè di pagina",
98
+ "Add document footer...": "Aggiungi piè di pagina del documento...",
99
+ "Reverse charge - tax exempt EU B2B sale": "Inversione contabile - vendita B2B UE esente da imposta",
79
100
  } as const;
@@ -39,6 +39,9 @@ export default {
39
39
  "Insert variable": "Variabele invoegen",
40
40
  "Add payment instructions, terms, or other notes...":
41
41
  "Voeg betalingsinstructies, voorwaarden of andere opmerkingen toe...",
42
+ // Signature field
43
+ Signature: "Handtekening",
44
+ "Add signature text...": "Handtekeningtekst toevoegen...",
42
45
  // Payment terms field
43
46
  "Payment Terms": "Betalingsvoorwaarden",
44
47
  "Add payment terms...": "Voeg betalingsvoorwaarden toe...",
@@ -75,4 +78,22 @@ export default {
75
78
  Device: "Apparaat",
76
79
  "FINA fiscalized invoices always use the current date":
77
80
  "FINA-gefiscaliseerde documenten gebruiken altijd de huidige datum",
81
+ // Separator items
82
+ "Add separator": "Scheidingslijn toevoegen",
83
+ "Section header": "Sectiekop",
84
+ "Section title...": "Sectietitel...",
85
+ // Transaction type
86
+ "Transaction type": "Transactietype",
87
+ Domestic: "Binnenland",
88
+ "EU B2B": "EU B2B",
89
+ "EU B2C": "EU B2C",
90
+ Export: "Export",
91
+ "Determining transaction type...": "Transactietype bepalen...",
92
+ "This invoice will not be fiscalized (non-domestic transaction)":
93
+ "Deze factuur wordt niet gefiscaliseerd (niet-binnenlandse transactie)",
94
+ "Tax Clause": "Belastingclausule",
95
+ "Add tax clause...": "Belastingclausule toevoegen...",
96
+ Footer: "Voettekst",
97
+ "Add document footer...": "Documentvoettekst toevoegen...",
98
+ "Reverse charge - tax exempt EU B2B sale": "Verlegging - belastingvrijgestelde EU B2B verkoop",
78
99
  } as const;
@@ -38,6 +38,9 @@ export default {
38
38
  Note: "Notatka",
39
39
  "Insert variable": "Wstaw zmienna",
40
40
  "Add payment instructions, terms, or other notes...": "Dodaj instrukcje platnosci, warunki lub inne uwagi...",
41
+ // Signature field
42
+ Signature: "Podpis",
43
+ "Add signature text...": "Dodaj tekst podpisu...",
41
44
  // Payment terms field
42
45
  "Payment Terms": "Warunki platnosci",
43
46
  "Add payment terms...": "Dodaj warunki platnosci...",
@@ -73,4 +76,22 @@ export default {
73
76
  Premise: "Lokal",
74
77
  Device: "Urządzenie",
75
78
  "FINA fiscalized invoices always use the current date": "Dokumenty fiskalizowane FINA zawsze używają bieżącej daty",
79
+ // Separator items
80
+ "Add separator": "Dodaj separator",
81
+ "Section header": "Nagłówek sekcji",
82
+ "Section title...": "Tytuł sekcji...",
83
+ // Transaction type
84
+ "Transaction type": "Typ transakcji",
85
+ Domestic: "Krajowa",
86
+ "EU B2B": "EU B2B",
87
+ "EU B2C": "EU B2C",
88
+ Export: "Eksport",
89
+ "Determining transaction type...": "Określanie typu transakcji...",
90
+ "This invoice will not be fiscalized (non-domestic transaction)":
91
+ "Ta faktura nie będzie fiskalizowana (transakcja niekrajowa)",
92
+ "Tax Clause": "Klauzula podatkowa",
93
+ "Add tax clause...": "Dodaj klauzulę podatkową...",
94
+ Footer: "Stopka",
95
+ "Add document footer...": "Dodaj stopkę dokumentu...",
96
+ "Reverse charge - tax exempt EU B2B sale": "Odwrotne obciążenie - zwolniona z podatku sprzedaż EU B2B",
76
97
  } as const;
@@ -38,6 +38,9 @@ export default {
38
38
  Note: "Nota",
39
39
  "Insert variable": "Inserir variavel",
40
40
  "Add payment instructions, terms, or other notes...": "Adicione instrucoes de pagamento, termos ou outras notas...",
41
+ // Signature field
42
+ Signature: "Assinatura",
43
+ "Add signature text...": "Adicionar texto de assinatura...",
41
44
  // Payment terms field
42
45
  "Payment Terms": "Condicoes de pagamento",
43
46
  "Add payment terms...": "Adicione condicoes de pagamento...",
@@ -73,4 +76,22 @@ export default {
73
76
  Premise: "Estabelecimento",
74
77
  Device: "Dispositivo",
75
78
  "FINA fiscalized invoices always use the current date": "Os documentos fiscalizados FINA usam sempre a data atual",
79
+ // Separator items
80
+ "Add separator": "Adicionar separador",
81
+ "Section header": "Cabeçalho da secção",
82
+ "Section title...": "Título da secção...",
83
+ // Transaction type
84
+ "Transaction type": "Tipo de transação",
85
+ Domestic: "Nacional",
86
+ "EU B2B": "EU B2B",
87
+ "EU B2C": "EU B2C",
88
+ Export: "Exportação",
89
+ "Determining transaction type...": "Determinando tipo de transação...",
90
+ "This invoice will not be fiscalized (non-domestic transaction)":
91
+ "Esta fatura não será fiscalizada (transação não nacional)",
92
+ "Tax Clause": "Cláusula fiscal",
93
+ "Add tax clause...": "Adicionar cláusula fiscal...",
94
+ Footer: "Rodapé",
95
+ "Add document footer...": "Adicionar rodapé do documento...",
96
+ "Reverse charge - tax exempt EU B2B sale": "Autoliquidação - venda B2B UE isenta de imposto",
76
97
  } as const;
@@ -15,7 +15,7 @@ export default {
15
15
  Price: "Cena",
16
16
  Unit: "Enota",
17
17
  Discount: "Popust",
18
- Tax: "Davek",
18
+ Tax: "DDV",
19
19
  "Tax rate": "Davčna stopnja",
20
20
  "Add tax": "Dodaj davek",
21
21
  "Select tax...": "Izberi davek...",
@@ -37,6 +37,9 @@ export default {
37
37
  Note: "Opomba",
38
38
  "Insert variable": "Vstavi spremenljivko",
39
39
  "Add payment instructions, terms, or other notes...": "Dodajte navodila za plačilo, pogoje ali druge opombe...",
40
+ // Signature field
41
+ Signature: "Podpis",
42
+ "Add signature text...": "Dodaj besedilo podpisa...",
40
43
  // Payment terms field
41
44
  "Payment Terms": "Plačilni pogoji",
42
45
  "Add payment terms...": "Dodajte plačilne pogoje...",
@@ -72,4 +75,22 @@ export default {
72
75
  Premise: "Poslovni prostor",
73
76
  Device: "Naprava",
74
77
  "FINA fiscalized invoices always use the current date": "FINA fiskalizirani dokumenti vedno uporabijo trenutni datum",
78
+ // Separator items
79
+ "Add separator": "Dodaj ločilnik",
80
+ "Section header": "Naslov razdelka",
81
+ "Section title...": "Naslov razdelka...",
82
+ // Transaction type
83
+ "Transaction type": "Vrsta transakcije",
84
+ Domestic: "Domača",
85
+ "EU B2B": "EU B2B",
86
+ "EU B2C": "EU B2C",
87
+ Export: "Izvoz",
88
+ "Determining transaction type...": "Določanje vrste transakcije...",
89
+ "This invoice will not be fiscalized (non-domestic transaction)":
90
+ "Ta račun ne bo fiskaliziran (nedomača transakcija)",
91
+ "Tax Clause": "Davčna klavzula",
92
+ "Add tax clause...": "Dodajte davčno klavzulo...",
93
+ Footer: "Noga dokumenta",
94
+ "Add document footer...": "Dodajte nogo dokumenta...",
95
+ "Reverse charge - tax exempt EU B2B sale": "Obrnjena davčna obveznost - davka oproščena EU B2B prodaja",
75
96
  } as const;
@@ -58,8 +58,8 @@ export function setLastUsedFursCombo(entityId: string, combo: FursCombo): void {
58
58
  const FINA_CN_LAST_USED_KEY = "hr:fina:cn:last-used";
59
59
 
60
60
  export type FinaCombo = {
61
- premise_id: string;
62
- device_id: string;
61
+ business_premise_name: string;
62
+ electronic_device_name: string;
63
63
  };
64
64
 
65
65
  export function getLastUsedFinaCombo(entityId: string): FinaCombo | null {
@@ -1,4 +1,4 @@
1
- import { Copy, Download, Eye, Link2Off, Loader2, MoreHorizontal, Plus } from "lucide-react";
1
+ import { Ban, Copy, Download, Eye, Link2Off, Loader2, MoreHorizontal, Plus } from "lucide-react";
2
2
  import { Button } from "@/ui/components/ui/button";
3
3
  import {
4
4
  DropdownMenu,
@@ -9,6 +9,7 @@ import {
9
9
  DropdownMenuSeparator,
10
10
  DropdownMenuTrigger,
11
11
  } from "@/ui/components/ui/dropdown-menu";
12
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@/ui/components/ui/tooltip";
12
13
  import type { ComponentTranslationProps } from "@/ui/lib/translation";
13
14
  import { createTranslation } from "@/ui/lib/translation";
14
15
  import { useCreditNoteDownload } from "./use-credit-note-download";
@@ -26,6 +27,8 @@ type CreditNoteListRowActionsProps = {
26
27
  onDownloadError?: (error: string) => void;
27
28
  onUnshare?: (creditNote: CreditNote) => Promise<void>;
28
29
  isUnsharing?: boolean;
30
+ onVoid?: (creditNote: CreditNote) => void;
31
+ isVoiding?: boolean;
29
32
  } & ComponentTranslationProps;
30
33
 
31
34
  export default function CreditNoteListRowActions({
@@ -38,6 +41,8 @@ export default function CreditNoteListRowActions({
38
41
  onDownloadError,
39
42
  onUnshare,
40
43
  isUnsharing,
44
+ onVoid,
45
+ isVoiding,
41
46
  ...i18nProps
42
47
  }: CreditNoteListRowActionsProps) {
43
48
  const t = createTranslation(i18nProps);
@@ -107,6 +112,44 @@ export default function CreditNoteListRowActions({
107
112
  </DropdownMenuGroup>
108
113
  </>
109
114
  )}
115
+ {onVoid &&
116
+ !creditNote.voided_at &&
117
+ !creditNote.is_draft &&
118
+ (() => {
119
+ const isFiscalized = !!(creditNote.furs || creditNote.fina);
120
+ const voidDisabled = isVoiding || isFiscalized;
121
+ const voidItem = (
122
+ <DropdownMenuItem
123
+ className={
124
+ voidDisabled
125
+ ? "text-destructive opacity-50"
126
+ : "cursor-pointer text-destructive focus:text-destructive"
127
+ }
128
+ onClick={() => !voidDisabled && onVoid(creditNote)}
129
+ disabled={voidDisabled}
130
+ >
131
+ {isVoiding ? <Loader2 className="h-4 w-4 animate-spin" /> : <Ban className="h-4 w-4" />}
132
+ {t("Void")}
133
+ </DropdownMenuItem>
134
+ );
135
+ return (
136
+ <>
137
+ <DropdownMenuSeparator />
138
+ <DropdownMenuGroup>
139
+ {isFiscalized ? (
140
+ <Tooltip>
141
+ <TooltipTrigger asChild>
142
+ <div>{voidItem}</div>
143
+ </TooltipTrigger>
144
+ <TooltipContent side="left">{t("Cannot void a fiscalized credit note")}</TooltipContent>
145
+ </Tooltip>
146
+ ) : (
147
+ voidItem
148
+ )}
149
+ </DropdownMenuGroup>
150
+ </>
151
+ );
152
+ })()}
110
153
  </DropdownMenuContent>
111
154
  </DropdownMenu>
112
155
  );
@@ -59,6 +59,8 @@ type CreditNoteListTableProps = {
59
59
  onRetryFiscalization?: (documentIds: string[]) => void;
60
60
  fiscalizationFeatures?: ("furs" | "fina")[];
61
61
  onCreateNew?: () => void;
62
+ onVoid?: (creditNote: CreditNote) => void;
63
+ isVoiding?: boolean;
62
64
  } & ListTableProps<CreditNote>;
63
65
 
64
66
  export default function CreditNoteListTable({
@@ -76,6 +78,8 @@ export default function CreditNoteListTable({
76
78
  onRetryFiscalization,
77
79
  fiscalizationFeatures,
78
80
  onCreateNew,
81
+ onVoid,
82
+ isVoiding,
79
83
  ...i18nProps
80
84
  }: CreditNoteListTableProps) {
81
85
  const t = createTranslation({
@@ -97,6 +101,7 @@ export default function CreditNoteListTable({
97
101
  prev_cursor: params.prev_cursor,
98
102
  search: params.search,
99
103
  query: params.query,
104
+ include: "document_relations",
100
105
  });
101
106
  return response as unknown as TableQueryResponse<CreditNote>;
102
107
  }, entityId);
@@ -210,13 +215,13 @@ export default function CreditNoteListTable({
210
215
  id: "total",
211
216
  header: t("Total"),
212
217
  align: "right",
213
- cell: (creditNote) => creditNote.total,
218
+ cell: (creditNote) => -creditNote.total,
214
219
  },
215
220
  {
216
221
  id: "total_with_tax",
217
222
  header: t("Total with Tax"),
218
223
  align: "right",
219
- cell: (creditNote) => creditNote.total_with_tax,
224
+ cell: (creditNote) => -creditNote.total_with_tax,
220
225
  },
221
226
  {
222
227
  id: "status",
@@ -236,6 +241,8 @@ export default function CreditNoteListTable({
236
241
  onDownloadStart={onDownloadStart}
237
242
  onDownloadSuccess={onDownloadSuccess}
238
243
  onDownloadError={onDownloadError}
244
+ onVoid={onVoid}
245
+ isVoiding={isVoiding}
239
246
  t={t}
240
247
  locale={i18nProps.locale}
241
248
  />
@@ -251,6 +258,8 @@ export default function CreditNoteListTable({
251
258
  onDownloadStart,
252
259
  onDownloadSuccess,
253
260
  onDownloadError,
261
+ onVoid,
262
+ isVoiding,
254
263
  i18nProps.locale,
255
264
  fiscalizationFeatures,
256
265
  ],
@@ -290,6 +299,11 @@ function CreditNoteStatusBadge({ creditNote, t }: { creditNote: CreditNote; t: (
290
299
  if ((creditNote as any).is_draft) {
291
300
  return null;
292
301
  }
302
+ // Hide payment badges for void-created credit notes (has "credit_for" relation)
303
+ const isVoidCreated = (creditNote as any).document_relations?.some((rel: any) => rel.relation_type === "credit_for");
304
+ if (isVoidCreated) {
305
+ return null;
306
+ }
293
307
  if (creditNote.paid_in_full) {
294
308
  return (
295
309
  <Badge
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Stornieren",
50
+ "Cannot void a fiscalized credit note": "Stornierung einer fiskalisierten Gutschrift nicht möglich",
49
51
  } as const;
@@ -14,4 +14,6 @@ export default {
14
14
  "FINA fiscalization failed": "FINA fiscalization failed",
15
15
  "Retry Fiscalization": "Retry Fiscalization",
16
16
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
17
+ Void: "Void",
18
+ "Cannot void a fiscalized credit note": "Cannot void a fiscalized credit note",
17
19
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Anular",
50
+ "Cannot void a fiscalized credit note": "No se puede anular una nota de crédito fiscalizada",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Annuler",
50
+ "Cannot void a fiscalized credit note": "Impossible d'annuler un avoir fiscalisé",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiskalizacija nije uspjela",
47
47
  "Retry Fiscalization": "Ponovi fiskalizaciju",
48
48
  "Some selected documents don't have failed fiscalization": "Neki odabrani dokumenti nemaju neuspjelu fiskalizaciju",
49
+ Void: "Storniraj",
50
+ "Cannot void a fiscalized credit note": "Nije moguće poništiti fiskalizirani dobropis",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Annulla",
50
+ "Cannot void a fiscalized credit note": "Impossibile annullare una nota di credito fiscalizzata",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Nietig verklaren",
50
+ "Cannot void a fiscalized credit note": "Kan een gefiscaliseerde creditnota niet ongeldig maken",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Anuluj",
50
+ "Cannot void a fiscalized credit note": "Nie można anulować zafiskalizowanej noty kredytowej",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiscalization failed",
47
47
  "Retry Fiscalization": "Retry Fiscalization",
48
48
  "Some selected documents don't have failed fiscalization": "Some selected documents don't have failed fiscalization",
49
+ Void: "Anular",
50
+ "Cannot void a fiscalized credit note": "Não é possível anular uma nota de crédito fiscalizada",
49
51
  } as const;
@@ -46,4 +46,6 @@ export default {
46
46
  "FINA fiscalization failed": "FINA fiskalizacija ni uspela",
47
47
  "Retry Fiscalization": "Ponovi fiskalizacijo",
48
48
  "Some selected documents don't have failed fiscalization": "Nekateri izbrani dokumenti nimajo neuspele fiskalizacije",
49
+ Void: "Storniraj",
50
+ "Cannot void a fiscalized credit note": "Ni mogoče razveljaviti fiskalizirane dobropisa",
49
51
  } as const;
@@ -20,7 +20,7 @@ export function useCollectionRateData(entityId: string | undefined) {
20
20
 
21
21
  const queries = useQueries({
22
22
  queries: [
23
- // Total invoiced (non-voided)
23
+ // Total invoiced (including voided — counter credit notes cancel them out)
24
24
  {
25
25
  queryKey: [STATS_QUERY_CACHE_KEY, entityId, "total-invoiced"],
26
26
  queryFn: async () => {
@@ -29,7 +29,7 @@ export function useCollectionRateData(entityId: string | undefined) {
29
29
  {
30
30
  metrics: [{ type: "sum", field: "total_with_tax", alias: "total" }],
31
31
  table: "invoices",
32
- filters: { is_draft: false, voided_at: null },
32
+ filters: { is_draft: false },
33
33
  },
34
34
  { entity_id: entityId },
35
35
  );
@@ -37,15 +37,50 @@ export function useCollectionRateData(entityId: string | undefined) {
37
37
  enabled: !!entityId && !!sdk,
38
38
  staleTime: 120_000,
39
39
  },
40
- // Total collected (payments)
40
+ // Invoice payments (credit_note_id IS NULL)
41
41
  {
42
- queryKey: [STATS_QUERY_CACHE_KEY, entityId, "total-collected"],
42
+ queryKey: [STATS_QUERY_CACHE_KEY, entityId, "invoice-payments"],
43
43
  queryFn: async () => {
44
44
  if (!entityId || !sdk) throw new Error("Missing entity or SDK");
45
45
  return sdk.entityStats.queryEntityStats(
46
46
  {
47
47
  metrics: [{ type: "sum", field: "amount", alias: "total" }],
48
48
  table: "payments",
49
+ filters: { credit_note_id: null },
50
+ },
51
+ { entity_id: entityId },
52
+ );
53
+ },
54
+ enabled: !!entityId && !!sdk,
55
+ staleTime: 120_000,
56
+ },
57
+ // Credit note payments / refunds (credit_note_id IS NOT NULL)
58
+ {
59
+ queryKey: [STATS_QUERY_CACHE_KEY, entityId, "cn-payments"],
60
+ queryFn: async () => {
61
+ if (!entityId || !sdk) throw new Error("Missing entity or SDK");
62
+ return sdk.entityStats.queryEntityStats(
63
+ {
64
+ metrics: [{ type: "sum", field: "amount", alias: "total" }],
65
+ table: "payments",
66
+ filters: { credit_note_id: { not: null } },
67
+ },
68
+ { entity_id: entityId },
69
+ );
70
+ },
71
+ enabled: !!entityId && !!sdk,
72
+ staleTime: 120_000,
73
+ },
74
+ // Credit notes total (subtracted from invoiced to get net revenue)
75
+ {
76
+ queryKey: [STATS_QUERY_CACHE_KEY, entityId, "cn-total"],
77
+ queryFn: async () => {
78
+ if (!entityId || !sdk) throw new Error("Missing entity or SDK");
79
+ return sdk.entityStats.queryEntityStats(
80
+ {
81
+ metrics: [{ type: "sum", field: "total_with_tax", alias: "total" }],
82
+ table: "credit_notes",
83
+ filters: { is_draft: false },
49
84
  },
50
85
  { entity_id: entityId },
51
86
  );
@@ -56,17 +91,21 @@ export function useCollectionRateData(entityId: string | undefined) {
56
91
  ],
57
92
  });
58
93
 
59
- const [invoicedQuery, collectedQuery] = queries;
94
+ const [invoicedQuery, invoicePaymentsQuery, cnPaymentsQuery, cnQuery] = queries;
60
95
 
61
96
  const totalInvoiced = Number(invoicedQuery.data?.data?.[0]?.total) || 0;
62
- const totalCollected = Number(collectedQuery.data?.data?.[0]?.total) || 0;
63
- const collectionRate = totalInvoiced > 0 ? (totalCollected / totalInvoiced) * 100 : 0;
97
+ const invoicePayments = Number(invoicePaymentsQuery.data?.data?.[0]?.total) || 0;
98
+ const cnPayments = Number(cnPaymentsQuery.data?.data?.[0]?.total) || 0;
99
+ const cnTotal = Number(cnQuery.data?.data?.[0]?.total) || 0;
100
+ const netInvoiced = totalInvoiced - cnTotal;
101
+ const netCollected = invoicePayments - cnPayments;
102
+ const collectionRate = netInvoiced > 0 ? (netCollected / netInvoiced) * 100 : 0;
64
103
 
65
104
  return {
66
105
  data: {
67
106
  collectionRate,
68
- totalCollected,
69
- totalInvoiced,
107
+ totalCollected: netCollected,
108
+ totalInvoiced: netInvoiced,
70
109
  currency: "EUR", // TODO: Get from entity settings
71
110
  } as CollectionRateData,
72
111
  isLoading: queries.some((q) => q.isLoading),