-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tiny): Updating with https://github.com/ecomplus/app-tiny-erp #218
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2ee78ff
fix(tiny): Update app
wisley7l dd356a3
Merge branch 'main' into fix/update-tiny-app
wisley7l ee76188
Merge branch 'main' into fix/update-tiny-app
wisley7l 2a83d6a
feat(tiny): Updating with https://github.com/ecomplus/app-tiny-erp
wisley7l 3a0b845
Merge branch 'main' into fix/update-tiny-app
wisley7l 39d0e1b
fix(tiny): Add object as a parameter in middleware
wisley7l cf737a5
Merge branch 'main' into fix/update-tiny-app
wisley7l 9264ed7
chore(pnpm lock): Update file
wisley7l a3bb8b0
chore(pnpm lock): Update file
wisley7l 69ffb34
chore(pnpm lock): Update file with main branch
wisley7l dcd1681
chore(tiny): Update middleware name
wisley7l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/apps/tiny-erp/src/integration/helpers/format-tiny-date.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,10 @@ export default (order: Orders, appData) => { | |
if (buyer.doc_number && buyer.doc_number.length <= 18) { | ||
tinyCustomer.cpf_cnpj = buyer.doc_number; | ||
} | ||
if (buyer.inscription_number && buyer.inscription_number.length <= 18) { | ||
if ( | ||
buyer.inscription_number && buyer.inscription_number.length <= 18 | ||
&& buyer.inscription_type !== 'Municipal' | ||
) { | ||
tinyCustomer.ie = buyer.inscription_number; | ||
} | ||
if (buyer.main_email && buyer.main_email.length <= 50) { | ||
|
@@ -72,7 +75,7 @@ export default (order: Orders, appData) => { | |
}; | ||
} | ||
|
||
if (shippingAddress && billingAddress) { | ||
if (shippingAddress) { | ||
tinyOrder.endereco_entrega = {}; | ||
parseAddress(shippingAddress, tinyOrder.endereco_entrega); | ||
if (shippingAddress.name) { | ||
|
@@ -83,7 +86,7 @@ export default (order: Orders, appData) => { | |
if (order.items) { | ||
order.items.forEach((item) => { | ||
if (item.quantity) { | ||
const itemRef = (item.sku || item._id || Math.random().toString()).substring(0, 30); | ||
const itemRef = (item.sku || item._id || Math.random().toString()).substring(0, 60); | ||
tinyOrder.itens.push({ | ||
item: { | ||
codigo: itemRef, | ||
|
@@ -124,6 +127,11 @@ export default (order: Orders, appData) => { | |
} | ||
} | ||
|
||
const middlewareOrderParser = global.$tinyErpOrderParser; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Um middleware tá nomeado no imperativo (UpdateTrackingCode) e outro não, é bom tentar manter o padrões... |
||
if (middlewareOrderParser && typeof middlewareOrderParser === 'function') { | ||
middlewareOrderParser({ tinyOrder, order }); | ||
} | ||
|
||
if (order.shipping_method_label) { | ||
tinyOrder.forma_frete = order.shipping_method_label; | ||
} | ||
|
@@ -163,9 +171,6 @@ export default (order: Orders, appData) => { | |
if (amount.tax) { | ||
tinyOrder.valor_frete += amount.tax; | ||
} | ||
if (amount.extra) { | ||
tinyOrder.valor_frete += amount.extra; | ||
} | ||
} | ||
if (amount.discount) { | ||
tinyOrder.valor_desconto = amount.discount; | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Além do tempo verbal no nome das funções, na verdade isso aqui nem necessariamente é pra tracking code inclusive, talvez
global.$tinyErpOnNewOrder
?