@powerhousedao/contributor-billing 0.0.10 → 0.0.12

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 (63) hide show
  1. package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -1
  2. package/dist/document-models/invoice/gen/document-model.js +14 -36
  3. package/dist/document-models/invoice/gen/general/actions.d.ts +2 -5
  4. package/dist/document-models/invoice/gen/general/actions.d.ts.map +1 -1
  5. package/dist/document-models/invoice/gen/general/creators.d.ts +2 -5
  6. package/dist/document-models/invoice/gen/general/creators.d.ts.map +1 -1
  7. package/dist/document-models/invoice/gen/general/creators.js +0 -3
  8. package/dist/document-models/invoice/gen/general/object.d.ts +1 -4
  9. package/dist/document-models/invoice/gen/general/object.d.ts.map +1 -1
  10. package/dist/document-models/invoice/gen/general/object.js +1 -10
  11. package/dist/document-models/invoice/gen/general/operations.d.ts +1 -4
  12. package/dist/document-models/invoice/gen/general/operations.d.ts.map +1 -1
  13. package/dist/document-models/invoice/gen/items/actions.d.ts +3 -2
  14. package/dist/document-models/invoice/gen/items/actions.d.ts.map +1 -1
  15. package/dist/document-models/invoice/gen/items/creators.d.ts +3 -2
  16. package/dist/document-models/invoice/gen/items/creators.d.ts.map +1 -1
  17. package/dist/document-models/invoice/gen/items/creators.js +1 -0
  18. package/dist/document-models/invoice/gen/items/object.d.ts +2 -1
  19. package/dist/document-models/invoice/gen/items/object.d.ts.map +1 -1
  20. package/dist/document-models/invoice/gen/items/object.js +4 -1
  21. package/dist/document-models/invoice/gen/items/operations.d.ts +2 -1
  22. package/dist/document-models/invoice/gen/items/operations.d.ts.map +1 -1
  23. package/dist/document-models/invoice/gen/reducer.d.ts.map +1 -1
  24. package/dist/document-models/invoice/gen/reducer.js +4 -12
  25. package/dist/document-models/invoice/gen/schema/types.d.ts +14 -17
  26. package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
  27. package/dist/document-models/invoice/gen/schema/zod.d.ts +3 -5
  28. package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
  29. package/dist/document-models/invoice/gen/schema/zod.js +19 -26
  30. package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
  31. package/dist/document-models/invoice/gen/utils.js +2 -1
  32. package/dist/document-models/invoice/index.d.ts +1 -3
  33. package/dist/document-models/invoice/index.d.ts.map +1 -1
  34. package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
  35. package/dist/document-models/invoice/src/reducers/general.js +1 -38
  36. package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
  37. package/dist/document-models/invoice/src/reducers/items.js +29 -0
  38. package/dist/document-models/invoice/src/tests/general.test.js +0 -10
  39. package/dist/editors/invoice/InvoicePDF.d.ts.map +1 -1
  40. package/dist/editors/invoice/InvoicePDF.js +24 -6
  41. package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
  42. package/dist/editors/invoice/components/countryForm.js +1 -1
  43. package/dist/editors/invoice/components/numberForm.d.ts +2 -1
  44. package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
  45. package/dist/editors/invoice/components/numberForm.js +3 -2
  46. package/dist/editors/invoice/editor.d.ts.map +1 -1
  47. package/dist/editors/invoice/editor.js +44 -5
  48. package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts +4 -5
  49. package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
  50. package/dist/editors/invoice/lineItemTags/lineItemTags.js +59 -35
  51. package/dist/editors/invoice/lineItemTags/tagMapping.d.ts +1 -0
  52. package/dist/editors/invoice/lineItemTags/tagMapping.d.ts.map +1 -1
  53. package/dist/editors/invoice/lineItemTags/tagMapping.js +15 -0
  54. package/dist/editors/invoice/lineItems.d.ts +3 -3
  55. package/dist/editors/invoice/lineItems.d.ts.map +1 -1
  56. package/dist/editors/invoice/lineItems.js +6 -12
  57. package/dist/style.css +51 -45
  58. package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
  59. package/dist/subgraphs/invoice/resolvers.js +9 -23
  60. package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
  61. package/dist/subgraphs/invoice/schema.js +18 -31
  62. package/dist/tailwind.config.js +0 -1
  63. package/package.json +1 -1
@@ -1,47 +1,71 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
2
  import { X, Tag } from "lucide-react";
4
3
  import { Button } from "@powerhousedao/design-system";
5
- import { Select } from "@powerhousedao/document-engineering/ui";
6
- import { expenseAccountOptions } from "./tagMapping.js";
4
+ import { Select, DatePicker } from "@powerhousedao/document-engineering/ui";
5
+ import { expenseAccountOptions, paymentAccountOptions } from "./tagMapping.js";
7
6
  import { actions } from "../../../document-models/invoice/index.js";
8
- export function LineItemTagsTable({ lineItems, onSave, onClose, dispatch, paymentAccounts, }) {
9
- const [taggedItems, setTaggedItems] = useState(lineItems);
10
- const [paymentAccount, setPaymentAccount] = useState("Powerhouse USD");
11
- const periodOptions = [
12
- "Jan 2025",
13
- "Feb 2025",
14
- "Mar 2025",
15
- "Apr 2025",
16
- "May 2025",
17
- "Jun 2025",
18
- ];
19
- const handleSave = () => {
20
- onSave(taggedItems, paymentAccount);
21
- onClose();
7
+ import { InputField } from "../components/inputField.js";
8
+ export function LineItemTagsTable({ lineItems, onClose, dispatch, paymentAccounts, }) {
9
+ const handleReset = () => {
10
+ // Resetting all tags to empty values
11
+ lineItems.forEach((item) => {
12
+ item.lineItemTag.forEach((tag) => {
13
+ dispatch(actions.setLineItemTag({
14
+ lineItemId: item.id,
15
+ dimension: tag.dimension,
16
+ value: "",
17
+ label: "",
18
+ }));
19
+ });
20
+ });
21
+ // Reset the payment account to empty value
22
+ paymentAccounts.forEach((tag) => {
23
+ dispatch(actions.setInvoiceTag({
24
+ dimension: tag.dimension,
25
+ value: "",
26
+ label: "",
27
+ }));
28
+ });
22
29
  };
23
- const handleBackdropClick = (e) => {
24
- if (e.target === e.currentTarget) {
25
- onClose();
26
- }
27
- };
28
- return (_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 p-6 bg-white z-10", children: [_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: "Assign Tags " }), _jsx(Tag, { style: { width: 28, height: 28, color: "white", fill: "#475264" } })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { color: "light", size: "medium", children: ["Reset", " "] }), _jsx("button", { onClick: onClose, className: "rounded-full p-2 hover:bg-gray-100", children: _jsx(X, { size: 24, className: "text-gray-500" }) })] })] }), _jsx("div", { className: "overflow-x-auto rounded-lg border border-gray-200", children: _jsxs("table", { className: "w-full border-collapse bg-white", children: [_jsx("thead", { className: "bg-gray-50 z-10", children: _jsxs("tr", { children: [_jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Item" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Period" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Xero Expense Account" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Total" })] }) }), _jsx("tbody", { children: taggedItems.map((item) => (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "border-b border-gray-200 p-3", children: _jsx("input", { type: "text", value: item.item, onChange: (e) => setTaggedItems((prev) => prev.map((row) => row.id === item.id
29
- ? { ...row, item: e.target.value }
30
- : row)), className: "w-full rounded border border-gray-300 px-3 py-2 focus:border-blue-500 focus:outline-none" }) }), _jsx("td", { className: "border-b border-gray-200 p-3", children: _jsxs("select", { value: item.period, onChange: (e) => setTaggedItems((prev) => prev.map((row) => row.id === item.id
31
- ? { ...row, period: e.target.value }
32
- : row)), className: "w-full rounded border border-gray-300 px-3 py-2 focus:border-blue-500 focus:outline-none", children: [_jsx("option", { value: "", children: "Select Period" }), periodOptions.map((period) => (_jsx("option", { value: period, children: period }, period)))] }) }), _jsx("td", { className: "border-b border-gray-200 p-3", children: _jsx(Select, { options: expenseAccountOptions, value: item.lineItemTag.find((tag) => tag.dimension === "xero-expense-account")?.value || "", placeholder: "Select Expense Account", searchable: true, onChange: (value) => {
30
+ // Get the last payment account value from the paymentAccounts to display in the payment account select
31
+ const selectedPaymentAccountValue = paymentAccounts && paymentAccounts.length > 0
32
+ ? (paymentAccounts[paymentAccounts.length - 1].value ?? "")
33
+ : "";
34
+ return (_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 p-6 bg-white z-10", children: [_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: "Assign Tags " }), _jsx(Tag, { style: { width: 28, height: 28, color: "white", fill: "#475264" } })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { color: "light", size: "medium", onClick: handleReset, children: ["Reset", " "] }), _jsx("button", { onClick: onClose, className: "rounded-full p-2 hover:bg-gray-100", children: _jsx(X, { size: 24, className: "text-gray-500" }) })] })] }), _jsx("div", { className: "overflow-x-auto rounded-lg border border-gray-200", children: _jsxs("table", { className: "w-full border-collapse bg-white", children: [_jsx("thead", { className: "bg-gray-50 z-10", children: _jsxs("tr", { children: [_jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Item" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Period" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Xero Expense Account" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Total" })] }) }), _jsx("tbody", { children: lineItems.map((item) => (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "border-b border-gray-200 p-3", children: _jsx(InputField, { value: item.item, handleInputChange: (e) => { }, onBlur: (e) => {
35
+ dispatch(actions.editLineItem({
36
+ id: item.id,
37
+ description: e.target.value,
38
+ }));
39
+ }, className: "w-full" }) }), _jsx("td", { className: "border-b border-gray-200 p-3", style: { width: "100px" }, children: _jsx(DatePicker, { name: "period", dateFormat: "YYYY-MM-DD", autoClose: true, placeholder: "Select Period", value: item.lineItemTag.find((tag) => tag.dimension === "accounting-period")?.label || "", onChange: (e) => dispatch(actions.setLineItemTag({
40
+ lineItemId: item.id,
41
+ dimension: "accounting-period",
42
+ value: new Date(e.target.value)
43
+ .toLocaleDateString("en-US", {
44
+ year: "numeric",
45
+ month: "numeric",
46
+ })
47
+ .split("/")
48
+ .reverse()
49
+ .join("/"),
50
+ label: new Date(e.target.value).toLocaleDateString("en-US", {
51
+ month: "long",
52
+ year: "numeric",
53
+ }),
54
+ })) }) }), _jsx("td", { className: "border-b border-gray-200 p-3", children: _jsx(Select, { options: expenseAccountOptions, value: item.lineItemTag.find((tag) => tag.dimension === "xero-expense-account")?.value || "", placeholder: "Select Expense Account", searchable: true, onChange: (value) => {
33
55
  dispatch(actions.setLineItemTag({
34
56
  lineItemId: item.id,
35
57
  dimension: "xero-expense-account",
36
58
  value: value,
37
59
  label: expenseAccountOptions.find((option) => option.value === value)?.label,
38
60
  }));
39
- } }) }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right font-medium", children: item.total })] }, item.id))) })] }) }), _jsx("div", { className: "border-t border-gray-200 p-6", children: _jsxs("div", { className: "flex items-center justify-end gap-4", children: [_jsx("label", { className: "text-lg font-medium text-gray-900", children: "Payment Account" }), _jsx(Select, { options: [
40
- { label: "Powerhouse USD", value: "Powerhouse USD" },
41
- { label: "Powerhouse EUR", value: "Powerhouse EUR" },
42
- ], value: paymentAccounts && paymentAccounts.length > 0
43
- ? paymentAccounts[0]
44
- : "", placeholder: "Select Payment Account", searchable: true, onChange: (value) => {
45
- dispatch(actions.addPaymentAccount({ paymentAccount: value }));
46
- } })] }) }), _jsx("div", { className: "border-t border-gray-200 p-6", children: _jsx("div", { className: "flex justify-end", children: _jsx("button", { onClick: handleSave, className: "rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700", children: "Save Tags" }) }) })] }));
61
+ } }) }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right font-medium", children: item.total })] }, item.id))) })] }) }), _jsx("div", { className: "border-t border-gray-200 p-6", children: _jsxs("div", { className: "flex items-center justify-end gap-4", children: [_jsx("label", { className: "text-lg font-medium text-gray-900", children: "Payment Account" }), _jsx(Select, { options: paymentAccountOptions, value: paymentAccountOptions.find((option) => option.value === selectedPaymentAccountValue)?.value ?? "", placeholder: "Select Payment Account", searchable: true, onChange: (value) => {
62
+ const selectedLabel = paymentAccountOptions.find((option) => option.value === value)
63
+ ?.label || "";
64
+ const cleanLabel = selectedLabel.replace(/\s+\w+$/, "").trim();
65
+ dispatch(actions.setInvoiceTag({
66
+ dimension: "xero-payment-account",
67
+ value: value,
68
+ label: cleanLabel,
69
+ }));
70
+ }, style: { width: "230px" } })] }) })] }));
47
71
  }
@@ -1,3 +1,4 @@
1
1
  import { SelectOption } from "@powerhousedao/document-engineering/ui";
2
2
  export declare const expenseAccountOptions: SelectOption[];
3
+ export declare const paymentAccountOptions: SelectOption[];
3
4
  //# sourceMappingURL=tagMapping.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tagMapping.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/tagMapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,qBAAqB,EAAE,YAAY,EA6D/C,CAAC"}
1
+ {"version":3,"file":"tagMapping.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/tagMapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,qBAAqB,EAAE,YAAY,EA6D/C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAc/C,CAAC"}
@@ -60,3 +60,18 @@ export const expenseAccountOptions = [
60
60
  { label: "Retained Earnings", value: "960" },
61
61
  { label: "Owner A Share Capital", value: "970" }
62
62
  ];
63
+ export const paymentAccountOptions = [
64
+ { label: "Clearing Account USD", value: "USD" },
65
+ { label: "Clearing Account EUR", value: "EUR" },
66
+ { label: "Clearing Account DKK", value: "DKK" },
67
+ { label: "Clearing Account GBP", value: "GBP" },
68
+ { label: "Clearing Account JPY", value: "JPY" },
69
+ { label: "Clearing Account CNY", value: "CNY" },
70
+ { label: "Clearing Account CHF", value: "CHF" },
71
+ { label: "Wallet USDS", value: "USDS" },
72
+ { label: "Wallet DAI", value: "DAI" },
73
+ { label: "Wallet EURe", value: "EURe" },
74
+ { label: "Wallet SKY", value: "SKY" },
75
+ { label: "Wallet MKR", value: "MKR" },
76
+ { label: "Wallet USDC", value: "USDC" },
77
+ ];
@@ -1,4 +1,4 @@
1
- import { EditInvoiceInput, DeleteLineItemInput, InvoiceLineItemTag } from "../../document-models/invoice/index.js";
1
+ import { EditInvoiceInput, DeleteLineItemInput, InvoiceTag } from "../../document-models/invoice/index.js";
2
2
  import { Dispatch } from "react";
3
3
  export declare function formatNumber(value: number): string;
4
4
  type LineItem = {
@@ -11,7 +11,7 @@ type LineItem = {
11
11
  totalPriceTaxIncl: number;
12
12
  unitPriceTaxExcl: number;
13
13
  unitPriceTaxIncl: number;
14
- lineItemTag: InvoiceLineItemTag[];
14
+ lineItemTag: InvoiceTag[];
15
15
  };
16
16
  type LineItemsTableProps = {
17
17
  readonly lineItems: LineItem[];
@@ -21,7 +21,7 @@ type LineItemsTableProps = {
21
21
  readonly onDeleteItem: (input: DeleteLineItemInput) => void;
22
22
  readonly onUpdateCurrency: (input: EditInvoiceInput) => void;
23
23
  readonly dispatch: Dispatch<any>;
24
- readonly paymentAccounts: string[];
24
+ readonly paymentAccounts: InvoiceTag[];
25
25
  };
26
26
  export declare function LineItemsTable({ lineItems, currency, onAddItem, onUpdateItem, onDeleteItem, onUpdateCurrency, dispatch, paymentAccounts }: LineItemsTableProps): import("react/jsx-runtime").JSX.Element;
27
27
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"lineItems.d.ts","sourceRoot":"","sources":["../../../editors/invoice/lineItems.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACnH,OAAO,EAA0D,QAAQ,EAAE,MAAM,OAAO,CAAC;AAqBzF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAsBlD;AAED,KAAK,QAAQ,GAAG;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC,CAAC;AAoNF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;CACpC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,eAAe,EAChB,EAAE,mBAAmB,2CAuKrB"}
1
+ {"version":3,"file":"lineItems.d.ts","sourceRoot":"","sources":["../../../editors/invoice/lineItems.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC3G,OAAO,EAA0D,QAAQ,EAAE,MAAM,OAAO,CAAC;AAqBzF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAsBlD;AAED,KAAK,QAAQ,GAAG;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAuNF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;CACxC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,eAAe,EAChB,EAAE,mBAAmB,2CA+IrB"}
@@ -139,9 +139,9 @@ const EditableLineItem = forwardRef(function EditableLineItem(props, ref) {
139
139
  };
140
140
  onSave(completeItem);
141
141
  }
142
- return (_jsxs("tr", { ref: ref, className: "hover:bg-gray-50", children: [_jsx("td", { className: "border border-gray-200 p-3", style: { width: '38%' }, children: _jsx(InputField, { onBlur: () => { }, handleInputChange: (e) => {
142
+ return (_jsxs("tr", { ref: ref, className: "hover:bg-gray-50 table-row", children: [_jsx("td", { className: "border border-gray-200 p-3 table-cell", children: _jsx(InputField, { onBlur: () => { }, handleInputChange: (e) => {
143
143
  setEditedItem((prev) => ({ ...prev, description: e.target.value }));
144
- }, value: editedItem.description ?? "", placeholder: "Description" }) }), _jsx("td", { className: "border border-gray-200 p-3", style: { width: '8%' }, children: _jsx(NumberForm, { number: editedItem.quantity ?? "", precision: 0, handleInputChange: handleInputChange("quantity"), placeholder: "Quantity" }) }), _jsx("td", { className: "border border-gray-200 p-3", style: { width: '16%' }, children: _jsx(NumberForm, { number: editedItem.unitPriceTaxExcl ?? "", precision: getCurrencyPrecision(currency), handleInputChange: handleInputChange("unitPriceTaxExcl"), placeholder: "Unit Price (excl. tax)" }) }), _jsx("td", { className: "border border-gray-200 p-3", style: { width: '8%' }, children: _jsx(NumberForm, { number: editedItem.taxPercent ?? "", precision: 0, min: 0, max: 100, handleInputChange: handleInputChange("taxPercent"), placeholder: "Tax %" }) }), _jsx("td", { className: "border border-gray-200 p-3 text-right font-medium", style: { width: '14%' }, children: formatNumber(calculatedValues.totalPriceTaxExcl) }), _jsx("td", { className: "border border-gray-200 p-3 text-right font-medium", style: { width: '14%' }, children: formatNumber(calculatedValues.totalPriceTaxIncl) }), _jsx("td", { className: "border border-gray-200 p-3", children: _jsxs("div", { className: "flex space-x-2", children: [_jsx("button", { style: { backgroundColor: "blue" }, className: "rounded bg-blue-600 px-3 py-1 text-white hover:bg-blue-700", onClick: handleSave, children: "Save" }), _jsx("button", { className: "rounded bg-gray-500 px-3 py-1 text-white hover:bg-gray-600", onClick: onCancel, children: "Cancel" })] }) })] }));
144
+ }, value: editedItem.description ?? "", placeholder: "Description", className: "" }) }), _jsx("td", { className: "border border-gray-200 p-3 table-cell", children: _jsx(NumberForm, { number: editedItem.quantity ?? "", precision: 0, handleInputChange: handleInputChange("quantity"), placeholder: "Quantity", className: "" }) }), _jsx("td", { className: "border border-gray-200 p-3 table-cell", children: _jsx(NumberForm, { number: editedItem.unitPriceTaxExcl ?? "", precision: getCurrencyPrecision(currency), handleInputChange: handleInputChange("unitPriceTaxExcl"), placeholder: "Unit Price (excl. tax)", className: "" }) }), _jsx("td", { className: "border border-gray-200 p-3 table-cell", children: _jsx(NumberForm, { number: editedItem.taxPercent ?? "", precision: 0, min: 0, max: 100, handleInputChange: handleInputChange("taxPercent"), placeholder: "Tax %", className: "" }) }), _jsx("td", { className: "border border-gray-200 p-3 text-right font-medium table-cell", children: formatNumber(calculatedValues.totalPriceTaxExcl) }), _jsx("td", { className: "border border-gray-200 p-3 text-right font-medium table-cell", children: formatNumber(calculatedValues.totalPriceTaxIncl) }), _jsx("td", { className: "border border-gray-200 p-3 table-cell", children: _jsxs("div", { className: "flex space-x-2", children: [_jsx("button", { className: "rounded bg-blue-500 px-3 py-1 text-white hover:bg-blue-700", onClick: handleSave, children: "Save" }), _jsx("button", { className: "rounded bg-gray-500 px-3 py-1 text-white hover:bg-gray-600", onClick: onCancel, children: "Cancel" })] }) })] }));
145
145
  });
146
146
  export function LineItemsTable({ lineItems, currency, onAddItem, onUpdateItem, onDeleteItem, onUpdateCurrency, dispatch, paymentAccounts }) {
147
147
  const [editingId, setEditingId] = useState(null);
@@ -165,22 +165,16 @@ export function LineItemsTable({ lineItems, currency, onAddItem, onUpdateItem, o
165
165
  const tagAssignmentRows = lineItems.map(item => ({
166
166
  id: item.id,
167
167
  item: item.description,
168
- period: 'Jan 2025', // Default value
168
+ period: '', // Default value
169
169
  expenseAccount: '', // Default value
170
170
  total: `$${formatNumber(item.totalPriceTaxIncl)}`,
171
171
  lineItemTag: item.lineItemTag,
172
172
  }));
173
- const handleTagsSave = (updatedTaggedItems, paymentAccount) => {
174
- // Handle the saved tags here if needed
175
- setShowTagTable(false);
176
- };
177
173
  if (showTagTable) {
178
- return (_jsx(LineItemTagsTable, { lineItems: tagAssignmentRows, onSave: handleTagsSave, onClose: () => setShowTagTable(false), dispatch: dispatch, paymentAccounts: paymentAccounts }));
174
+ return (_jsx(LineItemTagsTable, { lineItems: tagAssignmentRows, onClose: () => setShowTagTable(false), dispatch: dispatch, paymentAccounts: paymentAccounts }));
179
175
  }
180
- return (_jsx("div", { ref: containerRef, className: "relative w-full", children: _jsxs("div", { className: "mt-4", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between", children: [_jsx("div", { className: "flex items-center gap-4", children: _jsx("h4", { className: "text-xl font-semibold text-gray-900", children: "Line Items" }) }), _jsx(RWAButton, { className: "mb-2", disabled: isAddingNew, onClick: handleAddClick, children: "Add Line Item" })] }), _jsx("div", { ref: tableContainerRef, className: "overflow-x-auto rounded-lg border border-gray-200", children: _jsxs("table", { ref: tableRef, className: "w-full table-fixed border-collapse bg-white", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "border-b border-gray-200 p-3 text-left", style: { width: '38%' }, children: "Description" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", style: { width: '8%' }, children: "Quantity" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", style: { width: '16%' }, children: "Unit Price (excl. tax)" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", style: { width: '8%' }, children: "Tax %" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", style: { width: '14%' }, children: "Total (excl. tax)" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", style: { width: '14%' }, children: "Total (incl. tax)" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-center", children: _jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx("span", { className: "text-sm", children: "Actions" }), _jsx(Tag, { onClick: () => setShowTagTable(true), style: { cursor: "pointer", width: 28, height: 28, color: "white", fill: "#475264" } })] }) })] }) }), _jsxs("tbody", { children: [lineItems.map((item) => editingId === item.id ? (_jsx(EditableLineItem, { currency: currency, item: item, onCancel: () => setEditingId(null), onSave: (updatedItem) => {
176
+ return (_jsx("div", { ref: containerRef, className: "relative w-full", children: _jsxs("div", { className: "mt-4", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between", children: [_jsx("div", { className: "flex items-center gap-4", children: _jsx("h4", { className: "text-xl font-semibold text-gray-900", children: "Line Items" }) }), _jsx(RWAButton, { className: "mb-2", disabled: isAddingNew, onClick: handleAddClick, children: "Add Line Item" })] }), _jsx("div", { ref: tableContainerRef, className: "overflow-x-auto rounded-lg border border-gray-200", children: _jsxs("table", { ref: tableRef, className: "w-full table-fixed border-collapse bg-white", children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: '30%' } }), _jsx("col", { style: { width: '10%' } }), _jsx("col", { style: { width: '12%' } }), _jsx("col", { style: { width: '8%' } }), _jsx("col", {}), _jsx("col", {}), _jsx("col", {})] }), _jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "border-b border-gray-200 p-3 text-left", children: "Description" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Quantity" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Unit Price (excl. tax)" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Tax %" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Total (excl. tax)" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-right", children: "Total (incl. tax)" }), _jsx("th", { className: "border-b border-gray-200 p-3 text-center", children: _jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx("span", { className: "text-sm", children: "Actions" }), _jsx(Tag, { onClick: () => setShowTagTable(true), style: { cursor: "pointer", width: 28, height: 28, color: "white", fill: "#475264" } })] }) })] }) }), _jsxs("tbody", { children: [lineItems.map((item) => editingId === item.id ? (_jsx(EditableLineItem, { currency: currency, item: item, onCancel: () => setEditingId(null), onSave: (updatedItem) => {
181
177
  onUpdateItem(updatedItem);
182
178
  setEditingId(null);
183
- } }, item.id)) : (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "border-b border-gray-200 p-3", children: item.description }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right", children: item.quantity }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right", children: formatNumber(item.unitPriceTaxExcl) }), _jsxs("td", { className: "border-b border-gray-200 p-3 text-right", children: [typeof item.taxPercent === "number"
184
- ? Math.round(item.taxPercent)
185
- : 0, "%"] }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right font-medium", children: formatNumber(item.totalPriceTaxExcl) }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right font-medium", children: formatNumber(item.totalPriceTaxIncl) }), _jsx("td", { className: "border-b border-gray-200 p-3", children: _jsxs("div", { className: "flex justify-center space-x-2", children: [_jsx("button", { style: { backgroundColor: "lightblue" }, className: "rounded bg-blue-600 px-3 py-1 text-white hover:bg-blue-700", onClick: () => setEditingId(item.id), children: "Edit" }), _jsx("button", { className: "rounded bg-red-600 px-3 py-1 text-white hover:bg-red-700", onClick: () => onDeleteItem({ id: item.id }), children: "Delete" })] }) })] }, item.id))), isAddingNew ? (_jsx(EditableLineItem, { currency: currency, item: {}, onCancel: handleCancelNewItem, onSave: handleSaveNewItem })) : null] })] }) })] }) }));
179
+ } }, item.id)) : (_jsxs("tr", { className: "hover:bg-gray-50 table-row", children: [_jsx("td", { className: "border-b border-gray-200 p-3 table-cell", children: item.description }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right table-cell", children: item.quantity }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right table-cell", children: formatNumber(item.unitPriceTaxExcl) }), _jsxs("td", { className: "border-b border-gray-200 p-3 text-right table-cell", children: [typeof item.taxPercent === "number" ? Math.round(item.taxPercent) : 0, "%"] }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right font-medium table-cell", children: formatNumber(item.totalPriceTaxExcl) }), _jsx("td", { className: "border-b border-gray-200 p-3 text-right font-medium table-cell", children: formatNumber(item.totalPriceTaxIncl) }), _jsx("td", { className: "border-b border-gray-200 p-3 table-cell", children: _jsxs("div", { className: "flex justify-center space-x-2", children: [_jsx("button", { style: { backgroundColor: "lightblue" }, className: "rounded bg-blue-600 px-3 py-1 text-white hover:bg-blue-700", onClick: () => setEditingId(item.id), children: "Edit" }), _jsx("button", { className: "rounded bg-red-600 px-3 py-1 text-white hover:bg-red-700", onClick: () => onDeleteItem({ id: item.id }), children: "Delete" })] }) })] }, item.id))), isAddingNew ? (_jsx(EditableLineItem, { currency: currency, item: {}, onCancel: handleCancelNewItem, onSave: handleSaveNewItem })) : null] })] }) })] }) }));
186
180
  }
package/dist/style.css CHANGED
@@ -63,7 +63,6 @@
63
63
  --container-xs: 20rem;
64
64
  --container-md: 28rem;
65
65
  --container-4xl: 56rem;
66
- --container-7xl: 80rem;
67
66
  --text-xs: 0.75rem;
68
67
  --text-xs--line-height: calc(1 / 0.75);
69
68
  --text-sm: 0.875rem;
@@ -282,6 +281,9 @@
282
281
  .z-50 {
283
282
  z-index: 50;
284
283
  }
284
+ .col-span-1 {
285
+ grid-column: span 1 / span 1;
286
+ }
285
287
  .container {
286
288
  width: 100%;
287
289
  @media (width >= 40rem) {
@@ -300,9 +302,6 @@
300
302
  max-width: 96rem;
301
303
  }
302
304
  }
303
- .mx-auto {
304
- margin-inline: auto;
305
- }
306
305
  .mt-1 {
307
306
  margin-top: calc(var(--spacing) * 1);
308
307
  }
@@ -354,6 +353,9 @@
354
353
  .hidden {
355
354
  display: none;
356
355
  }
356
+ .inline {
357
+ display: inline;
358
+ }
357
359
  .inline-block {
358
360
  display: inline-block;
359
361
  }
@@ -363,6 +365,12 @@
363
365
  .table {
364
366
  display: table;
365
367
  }
368
+ .table-cell {
369
+ display: table-cell;
370
+ }
371
+ .table-row {
372
+ display: table-row;
373
+ }
366
374
  .size-4 {
367
375
  width: calc(var(--spacing) * 4);
368
376
  height: calc(var(--spacing) * 4);
@@ -376,6 +384,9 @@
376
384
  .h-10 {
377
385
  height: calc(var(--spacing) * 10);
378
386
  }
387
+ .h-32 {
388
+ height: calc(var(--spacing) * 32);
389
+ }
379
390
  .h-full {
380
391
  height: 100%;
381
392
  }
@@ -400,9 +411,6 @@
400
411
  .w-full {
401
412
  width: 100%;
402
413
  }
403
- .max-w-7xl {
404
- max-width: var(--container-7xl);
405
- }
406
414
  .flex-1 {
407
415
  flex: 1;
408
416
  }
@@ -424,11 +432,14 @@
424
432
  --tw-translate-y: calc(calc(1/2 * 100%) * -1);
425
433
  translate: var(--tw-translate-x) var(--tw-translate-y);
426
434
  }
435
+ .transform {
436
+ transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
437
+ }
427
438
  .cursor-pointer {
428
439
  cursor: pointer;
429
440
  }
430
- .grid-cols-1 {
431
- grid-template-columns: repeat(1, minmax(0, 1fr));
441
+ .resize {
442
+ resize: both;
432
443
  }
433
444
  .grid-cols-2 {
434
445
  grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -460,12 +471,6 @@
460
471
  .gap-4 {
461
472
  gap: calc(var(--spacing) * 4);
462
473
  }
463
- .gap-6 {
464
- gap: calc(var(--spacing) * 6);
465
- }
466
- .gap-8 {
467
- gap: calc(var(--spacing) * 8);
468
- }
469
474
  .space-y-1 {
470
475
  :where(& > :not(:last-child)) {
471
476
  --tw-space-y-reverse: 0;
@@ -649,9 +654,15 @@
649
654
  .pt-4 {
650
655
  padding-top: calc(var(--spacing) * 4);
651
656
  }
657
+ .pt-6 {
658
+ padding-top: calc(var(--spacing) * 6);
659
+ }
652
660
  .pr-8 {
653
661
  padding-right: calc(var(--spacing) * 8);
654
662
  }
663
+ .pb-5 {
664
+ padding-bottom: calc(var(--spacing) * 5);
665
+ }
655
666
  .text-center {
656
667
  text-align: center;
657
668
  }
@@ -909,11 +920,6 @@
909
920
  padding: calc(var(--spacing) * 0);
910
921
  }
911
922
  }
912
- .md\:col-start-2 {
913
- @media (width >= 48rem) {
914
- grid-column-start: 2;
915
- }
916
- }
917
923
  .md\:grid-cols-2 {
918
924
  @media (width >= 48rem) {
919
925
  grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -6040,26 +6046,6 @@ input[type="number"] {
6040
6046
  inherits: false;
6041
6047
  initial-value: 1;
6042
6048
  }
6043
- @property --tw-rotate-x {
6044
- syntax: "*";
6045
- inherits: false;
6046
- }
6047
- @property --tw-rotate-y {
6048
- syntax: "*";
6049
- inherits: false;
6050
- }
6051
- @property --tw-rotate-z {
6052
- syntax: "*";
6053
- inherits: false;
6054
- }
6055
- @property --tw-skew-x {
6056
- syntax: "*";
6057
- inherits: false;
6058
- }
6059
- @property --tw-skew-y {
6060
- syntax: "*";
6061
- inherits: false;
6062
- }
6063
6049
  @property --tw-divide-y-reverse {
6064
6050
  syntax: "*";
6065
6051
  inherits: false;
@@ -6298,6 +6284,26 @@ input[type="number"] {
6298
6284
  inherits: false;
6299
6285
  initial-value: 0;
6300
6286
  }
6287
+ @property --tw-rotate-x {
6288
+ syntax: "*";
6289
+ inherits: false;
6290
+ }
6291
+ @property --tw-rotate-y {
6292
+ syntax: "*";
6293
+ inherits: false;
6294
+ }
6295
+ @property --tw-rotate-z {
6296
+ syntax: "*";
6297
+ inherits: false;
6298
+ }
6299
+ @property --tw-skew-x {
6300
+ syntax: "*";
6301
+ inherits: false;
6302
+ }
6303
+ @property --tw-skew-y {
6304
+ syntax: "*";
6305
+ inherits: false;
6306
+ }
6301
6307
  @property --tw-space-y-reverse {
6302
6308
  syntax: "*";
6303
6309
  inherits: false;
@@ -6420,6 +6426,11 @@ input[type="number"] {
6420
6426
  --tw-translate-x: 0;
6421
6427
  --tw-translate-y: 0;
6422
6428
  --tw-translate-z: 0;
6429
+ --tw-rotate-x: initial;
6430
+ --tw-rotate-y: initial;
6431
+ --tw-rotate-z: initial;
6432
+ --tw-skew-x: initial;
6433
+ --tw-skew-y: initial;
6423
6434
  --tw-space-y-reverse: 0;
6424
6435
  --tw-space-x-reverse: 0;
6425
6436
  --tw-border-style: solid;
@@ -6446,11 +6457,6 @@ input[type="number"] {
6446
6457
  --tw-scale-x: 1;
6447
6458
  --tw-scale-y: 1;
6448
6459
  --tw-scale-z: 1;
6449
- --tw-rotate-x: initial;
6450
- --tw-rotate-y: initial;
6451
- --tw-rotate-z: initial;
6452
- --tw-skew-x: initial;
6453
- --tw-skew-y: initial;
6454
6460
  --tw-divide-y-reverse: 0;
6455
6461
  --tw-leading: initial;
6456
6462
  --tw-tracking: initial;
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/resolvers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAyUnE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/resolvers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA8SnE,CAAC"}
@@ -99,27 +99,6 @@ export const getResolvers = (subgraph) => {
99
99
  await reactor.addAction(driveId, docId, actions.deleteRef({ ...args.input }));
100
100
  return doc.revision.global + 1;
101
101
  },
102
- Invoice_addPaymentAccount: async (_, args) => {
103
- const driveId = args.driveId || DEFAULT_DRIVE_ID;
104
- const docId = args.docId || "";
105
- const doc = await reactor.getDocument(driveId, docId);
106
- await reactor.addAction(driveId, docId, actions.addPaymentAccount({ ...args.input }));
107
- return doc.revision.global + 1;
108
- },
109
- Invoice_editPaymentAccount: async (_, args) => {
110
- const driveId = args.driveId || DEFAULT_DRIVE_ID;
111
- const docId = args.docId || "";
112
- const doc = await reactor.getDocument(driveId, docId);
113
- await reactor.addAction(driveId, docId, actions.editPaymentAccount({ ...args.input }));
114
- return doc.revision.global + 1;
115
- },
116
- Invoice_deletePaymentAccount: async (_, args) => {
117
- const driveId = args.driveId || DEFAULT_DRIVE_ID;
118
- const docId = args.docId || "";
119
- const doc = await reactor.getDocument(driveId, docId);
120
- await reactor.addAction(driveId, docId, actions.deletePaymentAccount({ ...args.input }));
121
- return doc.revision.global + 1;
122
- },
123
102
  Invoice_editIssuer: async (_, args) => {
124
103
  const driveId = args.driveId || DEFAULT_DRIVE_ID;
125
104
  const docId = args.docId || "";
@@ -190,9 +169,16 @@ export const getResolvers = (subgraph) => {
190
169
  await reactor.addAction(driveId, docId, actions.setLineItemTag({ ...args.input }));
191
170
  return doc.revision.global + 1;
192
171
  },
193
- Invoice_uploadInvoicePdfChunk,
194
- Invoice_createRequestFinancePayment,
172
+ Invoice_setInvoiceTag: async (_, args) => {
173
+ const driveId = args.driveId || DEFAULT_DRIVE_ID;
174
+ const docId = args.docId || "";
175
+ const doc = await reactor.getDocument(driveId, docId);
176
+ await reactor.addAction(driveId, docId, actions.setInvoiceTag({ ...args.input }));
177
+ return doc.revision.global + 1;
178
+ },
195
179
  Invoice_processGnosisPayment,
180
+ Invoice_createRequestFinancePayment,
181
+ Invoice_uploadInvoicePdfChunk,
196
182
  },
197
183
  };
198
184
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA2dpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA8cpB,CAAC"}
@@ -16,7 +16,8 @@ export const schema = gql `
16
16
  lineItems: [InvoiceLineItem!]!
17
17
  totalPriceTaxExcl: Float!
18
18
  totalPriceTaxIncl: Float!
19
- paymentAccounts: [String!]
19
+ invoiceTags: [InvoiceTag!]! # e.g. {'xero-payment-account', '090', 'PowerhouseUSD'}
20
+ notes: String
20
21
  }
21
22
 
22
23
  type Ref {
@@ -102,13 +103,13 @@ export const schema = gql `
102
103
  unitPriceTaxIncl: Float!
103
104
  totalPriceTaxExcl: Float!
104
105
  totalPriceTaxIncl: Float!
105
- lineItemTag: [InvoiceLineItemTag!]
106
+ lineItemTag: [InvoiceTag!]
106
107
  }
107
108
 
108
- type InvoiceLineItemTag {
109
- dimension: String!
110
- value: String!
111
- label: String
109
+ type InvoiceTag {
110
+ dimension: String! # "xero-expense-account", "xero-payment-account", "accounting-period", ...
111
+ value: String! # "627", ..., "090", ..., "2025/05", "2025/Q1", ...
112
+ label: String # "Marketing", ..., "Business Bank", ..., "May 2025"
112
113
  }
113
114
 
114
115
  union LegalEntityId = LegalEntityTaxId | LegalEntityCorporateRegistrationId
@@ -191,21 +192,6 @@ export const schema = gql `
191
192
  docId: PHID
192
193
  input: Invoice_DeleteRefInput
193
194
  ): Int
194
- Invoice_addPaymentAccount(
195
- driveId: String
196
- docId: PHID
197
- input: Invoice_AddPaymentAccountInput
198
- ): Int
199
- Invoice_editPaymentAccount(
200
- driveId: String
201
- docId: PHID
202
- input: Invoice_EditPaymentAccountInput
203
- ): Int
204
- Invoice_deletePaymentAccount(
205
- driveId: String
206
- docId: PHID
207
- input: Invoice_DeletePaymentAccountInput
208
- ): Int
209
195
  Invoice_editIssuer(
210
196
  driveId: String
211
197
  docId: PHID
@@ -256,6 +242,11 @@ export const schema = gql `
256
242
  docId: PHID
257
243
  input: Invoice_SetLineItemTagInput
258
244
  ): Int
245
+ Invoice_setInvoiceTag(
246
+ driveId: String
247
+ docId: PHID
248
+ input: Invoice_SetInvoiceTagInput
249
+ ): Int
259
250
  Invoice_uploadInvoicePdfChunk(
260
251
  chunk: String!
261
252
  chunkIndex: Int!
@@ -311,6 +302,7 @@ export const schema = gql `
311
302
  dateDue: String
312
303
  dateDelivered: String
313
304
  currency: String
305
+ notes: String
314
306
  }
315
307
  input Invoice_EditStatusInput {
316
308
  status: Status!
@@ -326,16 +318,6 @@ export const schema = gql `
326
318
  input Invoice_DeleteRefInput {
327
319
  id: OID!
328
320
  }
329
- input Invoice_AddPaymentAccountInput {
330
- paymentAccount: String!
331
- }
332
- input Invoice_EditPaymentAccountInput {
333
- existingPaymentAccount: String!
334
- newPaymentAccount: String!
335
- }
336
- input Invoice_DeletePaymentAccountInput {
337
- paymentAccount: String!
338
- }
339
321
 
340
322
  """
341
323
  Module: Parties
@@ -474,4 +456,9 @@ export const schema = gql `
474
456
  value: String!
475
457
  label: String
476
458
  }
459
+ input Invoice_SetInvoiceTagInput {
460
+ dimension: String!
461
+ value: String!
462
+ label: String
463
+ }
477
464
  `;
@@ -3,7 +3,6 @@ export default {
3
3
  content: [
4
4
  "./index.html",
5
5
  "./src/**/*.{js,ts,jsx,tsx}",
6
- "./editors/**/*.{js,ts,jsx,tsx}",
7
6
  ],
8
7
  theme: {
9
8
  extend: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powerhousedao/contributor-billing",
3
3
  "description": "Document models that help contributors of open organisations get paid anonymously for their work on a monthly basis.",
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "files": [