@fayz-ai/plugin-financial 0.26.4 → 0.27.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/dist/{FinancialPage-NZFBBVY4.js → FinancialPage-HIVSEGJE.js} +3 -3
- package/dist/{FinancialPage-NZFBBVY4.js.map → FinancialPage-HIVSEGJE.js.map} +1 -1
- package/dist/{chunk-K37Q7SKX.js → chunk-IQHWMVUM.js} +112 -13
- package/dist/chunk-IQHWMVUM.js.map +1 -0
- package/dist/data/registries.d.ts.map +1 -1
- package/dist/index.js +122 -15
- package/dist/index.js.map +1 -1
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/main.browser.js +2 -1
- package/dist/migrations/main.browser.js.map +1 -1
- package/dist/migrations/main.js +286 -2
- package/dist/migrations/main.js.map +1 -1
- package/dist/views/InvoiceDetailView.d.ts.map +1 -1
- package/dist/views/InvoiceFormView.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-K37Q7SKX.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/data/registries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/data/registries.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,eAAe,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAsf9C;mEACmE;AACnE,eAAO,MAAM,sBAAsB,oCAAoB,CAAA;AAEvD,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAuGlD,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderCardChip, BankPicker, PaymentModal, InvoiceFormView, InvoiceDetailView, renderAccountAvatar, ACCOUNTS_ROUTE } from './chunk-
|
|
2
|
-
export { FINANCIAL_INVOICE_ZONES } from './chunk-
|
|
1
|
+
import { renderCardChip, BankPicker, PaymentModal, InvoiceFormView, InvoiceDetailView, renderAccountAvatar, ACCOUNTS_ROUTE } from './chunk-IQHWMVUM.js';
|
|
2
|
+
export { FINANCIAL_INVOICE_ZONES } from './chunk-IQHWMVUM.js';
|
|
3
3
|
import './chunk-7VKJLBYY.js';
|
|
4
4
|
import { FINANCIAL_MODULE_DEFAULTS } from './chunk-POYZFEAN.js';
|
|
5
5
|
import { FinancialContextProvider, useFinancialProvider, formatCurrency, useFinancialConfig, useFinancialStore } from './chunk-CNXAVGSW.js';
|
|
@@ -12,7 +12,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
12
12
|
import { createSafeFinancialProvider, createFinancialStore } from '@fayz-ai/financial/store';
|
|
13
13
|
export { createSafeFinancialProvider } from '@fayz-ai/financial/store';
|
|
14
14
|
import { FINANCIAL_ZONES } from '@fayz-ai/financial/views/zones';
|
|
15
|
-
import { fayzConnectorOAuth, defineSettingsTab, RightRailPage, useConnectors, useConnectorsPanelAvailable, SettingsForm, ConnectorMark, StateChip, ConnectorDetail, openConnectorsPanel, createCrudPage, PluginSettingsPanel, useTenantPluginSettings, usePermissionOptional } from '@fayz-ai/admin';
|
|
15
|
+
import { addAllProductsToPriceTable, fayzConnectorOAuth, defineSettingsTab, RightRailPage, useConnectors, useConnectorsPanelAvailable, SettingsForm, ConnectorMark, StateChip, ConnectorDetail, openConnectorsPanel, createCrudPage, PluginSettingsPanel, useTenantPluginSettings, usePermissionOptional } from '@fayz-ai/admin';
|
|
16
16
|
import { invoiceOpensForEditing } from '@fayz-ai/financial/domain/invoice';
|
|
17
17
|
import { T } from '@fayz-ai/financial/data/tables';
|
|
18
18
|
import { buildChartTree, rootIds, searchVisibleIds, isGroupNode, descendantIds, accountLabel, suggestNextCode, childIds } from '@fayz-ai/financial/domain/chart-of-accounts';
|
|
@@ -842,6 +842,11 @@ var en = {
|
|
|
842
842
|
"financial.invoiceForm.searchMinChars": "Type at least 2 characters to search.",
|
|
843
843
|
"financial.invoiceForm.searchUnit": "Search unit...",
|
|
844
844
|
"financial.invoiceForm.selectInstallments": "Select installment count above",
|
|
845
|
+
"financial.invoiceForm.priceTable": "Price table",
|
|
846
|
+
"financial.invoiceForm.priceTableNone": "No table (base prices)",
|
|
847
|
+
"financial.invoiceForm.priceTableHint": "Items are searched in this table and come in at its price.",
|
|
848
|
+
"financial.invoiceForm.priceTableRepriced": "{{count}} item(s) repriced from {{table}}.",
|
|
849
|
+
"financial.invoiceForm.priceTableMissing": "{{count}} item(s) are not in {{table}} and kept their price.",
|
|
845
850
|
"financial.invoiceForm.selectContactFirst": "Select who will pay or receive before adding items.",
|
|
846
851
|
"financial.invoiceForm.selectItemType": "Select item type:",
|
|
847
852
|
"financial.invoiceForm.selectUnit": "Select unit",
|
|
@@ -1859,6 +1864,11 @@ var ptBR = {
|
|
|
1859
1864
|
"financial.invoiceForm.searchMinChars": "Digite pelo menos 2 caracteres para buscar.",
|
|
1860
1865
|
"financial.invoiceForm.searchUnit": "Buscar unidade...",
|
|
1861
1866
|
"financial.invoiceForm.selectInstallments": "Selecione a quantidade de parcelas acima",
|
|
1867
|
+
"financial.invoiceForm.priceTable": "Tabela de pre\xE7o",
|
|
1868
|
+
"financial.invoiceForm.priceTableNone": "Sem tabela (pre\xE7o base)",
|
|
1869
|
+
"financial.invoiceForm.priceTableHint": "Os itens s\xE3o buscados nesta tabela e entram com o pre\xE7o dela.",
|
|
1870
|
+
"financial.invoiceForm.priceTableRepriced": "{{count}} item(ns) agora com o pre\xE7o da tabela {{table}}.",
|
|
1871
|
+
"financial.invoiceForm.priceTableMissing": "{{count}} item(ns) n\xE3o est\xE3o na tabela {{table}} e mantiveram o pre\xE7o.",
|
|
1862
1872
|
"financial.invoiceForm.selectContactFirst": "Selecione primeiro quem vai pagar ou receber para adicionar itens.",
|
|
1863
1873
|
"financial.invoiceForm.selectItemType": "Selecione o tipo do item:",
|
|
1864
1874
|
"financial.invoiceForm.selectUnit": "Selecionar unidade",
|
|
@@ -3876,19 +3886,115 @@ var commissionRuleEntity = {
|
|
|
3876
3886
|
],
|
|
3877
3887
|
data: { table: T.commissionRules, tenantScoped: true }
|
|
3878
3888
|
};
|
|
3889
|
+
var priceTableItemEntity = {
|
|
3890
|
+
name: tl("Item", "Item"),
|
|
3891
|
+
namePlural: tl("Items", "Itens da tabela"),
|
|
3892
|
+
icon: "Package",
|
|
3893
|
+
displayField: "productId",
|
|
3894
|
+
defaultSort: "createdAt",
|
|
3895
|
+
fields: [
|
|
3896
|
+
{
|
|
3897
|
+
key: "productId",
|
|
3898
|
+
label: tl("Item", "Item"),
|
|
3899
|
+
type: "relation",
|
|
3900
|
+
required: true,
|
|
3901
|
+
showInTable: true,
|
|
3902
|
+
relation: { table: "products", labelField: "name", priceField: "price", filter: { is_active: true } }
|
|
3903
|
+
},
|
|
3904
|
+
// Picking the item fills its base price; the table price is then typed over it.
|
|
3905
|
+
{
|
|
3906
|
+
key: "price",
|
|
3907
|
+
label: tl("Table price", "Pre\xE7o na tabela"),
|
|
3908
|
+
type: "currency",
|
|
3909
|
+
required: true,
|
|
3910
|
+
defaultValue: 0,
|
|
3911
|
+
showInTable: true,
|
|
3912
|
+
fillFrom: { field: "productId", source: "price" }
|
|
3913
|
+
},
|
|
3914
|
+
{ key: "minQty", label: tl("From qty", "A partir de (qtd)"), type: "number", min: 1, defaultValue: 1, showInTable: true }
|
|
3915
|
+
],
|
|
3916
|
+
data: { table: "price_table_items", tenantScoped: true }
|
|
3917
|
+
};
|
|
3879
3918
|
var priceTableEntity = {
|
|
3880
|
-
name: "Price Table",
|
|
3881
|
-
namePlural: "Price Tables",
|
|
3919
|
+
name: tl("Price Table", "Tabela de pre\xE7o"),
|
|
3920
|
+
namePlural: tl("Price Tables", "Tabelas de pre\xE7o"),
|
|
3882
3921
|
icon: "Tag",
|
|
3883
|
-
displayField: "
|
|
3884
|
-
defaultSort: "
|
|
3885
|
-
|
|
3922
|
+
displayField: "name",
|
|
3923
|
+
defaultSort: "name",
|
|
3924
|
+
formColumns: 2,
|
|
3925
|
+
facets: [activeFacet({ active: "Ativas", inactive: "Inativas", all: "Todas" })],
|
|
3926
|
+
fieldGroups: [
|
|
3927
|
+
{ id: "identity", label: tl("Identification", "Identifica\xE7\xE3o"), columns: 2 },
|
|
3928
|
+
{
|
|
3929
|
+
id: "rules",
|
|
3930
|
+
label: tl("What it sells", "O que ela vende"),
|
|
3931
|
+
columns: 2,
|
|
3932
|
+
description: tl(
|
|
3933
|
+
"Picked on a receivable after the customer: the item search then shows this table's items at this table's price.",
|
|
3934
|
+
"Escolhida no lan\xE7amento, depois do cliente: a busca de itens passa a mostrar os itens desta tabela, com o pre\xE7o dela."
|
|
3935
|
+
)
|
|
3936
|
+
},
|
|
3937
|
+
{ ...RECORD_GROUP }
|
|
3938
|
+
],
|
|
3886
3939
|
fields: [
|
|
3887
|
-
{ key: "
|
|
3888
|
-
{ key: "
|
|
3889
|
-
{ key: "validFrom", label: tl("Valid
|
|
3890
|
-
{ key: "
|
|
3891
|
-
|
|
3940
|
+
{ key: "name", label: tl("Name", "Nome"), type: "text", required: true, showInTable: true, searchable: true, group: "identity" },
|
|
3941
|
+
{ key: "description", label: tl("Description", "Descri\xE7\xE3o"), type: "textarea", showInTable: false, group: "identity" },
|
|
3942
|
+
{ key: "validFrom", label: tl("Valid from", "V\xE1lida desde"), type: "date", showInTable: true, group: "identity" },
|
|
3943
|
+
{ key: "validTo", label: tl("Valid until", "V\xE1lida at\xE9"), type: "date", showInTable: true, group: "identity" },
|
|
3944
|
+
{
|
|
3945
|
+
key: "itemsOnly",
|
|
3946
|
+
label: tl("Sells only the items listed below", "Vende s\xF3 os itens listados abaixo"),
|
|
3947
|
+
type: "boolean",
|
|
3948
|
+
defaultValue: true,
|
|
3949
|
+
showInTable: false,
|
|
3950
|
+
group: "rules",
|
|
3951
|
+
hint: tl(
|
|
3952
|
+
"Off: every for-sale item is offered, at the price below when listed and at the base price (\xB1 the adjustment) otherwise.",
|
|
3953
|
+
"Desligado: todo item \xE0 venda aparece, com o pre\xE7o abaixo quando listado e o pre\xE7o base (\xB1 o ajuste) quando n\xE3o."
|
|
3954
|
+
)
|
|
3955
|
+
},
|
|
3956
|
+
{
|
|
3957
|
+
key: "adjustmentPercent",
|
|
3958
|
+
label: tl("Adjustment on base price (%)", "Ajuste sobre o pre\xE7o base (%)"),
|
|
3959
|
+
type: "number",
|
|
3960
|
+
showInTable: false,
|
|
3961
|
+
group: "rules",
|
|
3962
|
+
hint: tl("For items not listed. \u221210 = 10% off, 15 = 15% more.", "Para itens n\xE3o listados. \u221210 = 10% de desconto, 15 = 15% a mais.")
|
|
3963
|
+
},
|
|
3964
|
+
{
|
|
3965
|
+
key: "isDefault",
|
|
3966
|
+
label: tl("House default", "Tabela padr\xE3o da casa"),
|
|
3967
|
+
type: "boolean",
|
|
3968
|
+
defaultValue: false,
|
|
3969
|
+
showInTable: true,
|
|
3970
|
+
group: "rules",
|
|
3971
|
+
hint: tl("Pre-picked when the customer has no table of their own.", "J\xE1 vem escolhida quando o cliente n\xE3o tem tabela pr\xF3pria.")
|
|
3972
|
+
},
|
|
3973
|
+
{ key: "currency", label: tl("Currency", "Moeda"), type: "text", defaultValue: "BRL", showInTable: false, showInForm: false, group: "rules" },
|
|
3974
|
+
...recordRailFields({ tagsTable: "price_tables", activeLabel: tl("Active", "Ativa"), unit: true })
|
|
3975
|
+
],
|
|
3976
|
+
relatedSections: [
|
|
3977
|
+
{
|
|
3978
|
+
id: "price-table-items",
|
|
3979
|
+
entity: priceTableItemEntity,
|
|
3980
|
+
foreignKey: "priceTableId",
|
|
3981
|
+
icon: "ListChecks",
|
|
3982
|
+
display: "grid",
|
|
3983
|
+
pageSize: 1e3,
|
|
3984
|
+
emptyHint: tl(
|
|
3985
|
+
"No item yet. Add them one by one, or add every for-sale product at its base price and adjust.",
|
|
3986
|
+
"Nenhum item ainda. Adicione um a um, ou adicione todos os produtos \xE0 venda pelo pre\xE7o base e ajuste."
|
|
3987
|
+
),
|
|
3988
|
+
actions: [{
|
|
3989
|
+
id: "add-all-products",
|
|
3990
|
+
label: tl("Add all products", "Adicionar todos os produtos"),
|
|
3991
|
+
icon: "ListPlus",
|
|
3992
|
+
run: async (tableId) => {
|
|
3993
|
+
const added = await addAllProductsToPriceTable(tableId, ["good"]);
|
|
3994
|
+
return added > 0 ? tl(`${added} product(s) added at the base price.`, `${added} produto(s) adicionado(s) pelo pre\xE7o base.`) : tl("Every for-sale product is already in this table.", "Todos os produtos \xE0 venda j\xE1 est\xE3o nesta tabela.");
|
|
3995
|
+
}
|
|
3996
|
+
}]
|
|
3997
|
+
}
|
|
3892
3998
|
],
|
|
3893
3999
|
data: { table: "price_tables", tenantScoped: true }
|
|
3894
4000
|
};
|
|
@@ -3968,7 +4074,8 @@ var financialRegistries = [
|
|
|
3968
4074
|
id: "price-tables",
|
|
3969
4075
|
entity: priceTableEntity,
|
|
3970
4076
|
icon: "Tag",
|
|
3971
|
-
description: "
|
|
4077
|
+
description: "Sale price tables (restaurant, resale, retail\u2026), picked on a receivable after the customer",
|
|
4078
|
+
agentHint: "Sale price TABLES: a named set of item prices picked on a receivable. Not a product price and not a discount reason.",
|
|
3972
4079
|
display: "table"
|
|
3973
4080
|
},
|
|
3974
4081
|
{
|
|
@@ -5679,7 +5786,7 @@ function createFinancialPlugin(options) {
|
|
|
5679
5786
|
locales: financialLocales
|
|
5680
5787
|
};
|
|
5681
5788
|
}
|
|
5682
|
-
var FinancialPage = React5__default.lazy(() => import('./FinancialPage-
|
|
5789
|
+
var FinancialPage = React5__default.lazy(() => import('./FinancialPage-HIVSEGJE.js').then((m) => ({ default: m.FinancialPage })));
|
|
5683
5790
|
var FinancialGeneralSettings = lazyComponent(() => import('./FinancialGeneralSettings-WXJOCJPZ.js').then((m) => m.FinancialGeneralSettings));
|
|
5684
5791
|
var CommissionRulesView = lazyComponent(() => import('./CommissionRulesView-2RW4ZCDT.js').then((m) => m.CommissionRulesView));
|
|
5685
5792
|
var PersonStatementWidget = lazyComponent(() => import('./PersonStatementWidget-ULXXXYZ4.js').then((m) => m.PersonStatementWidget));
|