@rs_solutions/seru-react-native-print-template
v0.128.0
Published
seru-react-native-print-template
Downloads
383
Readme
Seru React Native Print Template
Pacote focado a padronização de componentes para Notas Fiscais e DAV's (Documento auxiliar de venda).
Instalação
yarn add seru-react-native-print-template
Casos de uso
PrintOrder
import { PrintOrder } from 'seru-react-native-print-template'
<PrintOrder
devicePrinter="1"
printFullNameItem={true}
resale={{
name: 'Revenda 01',
site: 'https://revenda01.com.br'
}}
systemVersion="1.0.0"
order={{
company: {
logoUrl: "",
name: "",
document: "",
stateInscription: "",
address: {
street: "",
number: "",
neighborhood: "",
city: "",
state: "",
postalCode: "",
complement: "",
};
},
code: "001",
operator: "Operador Teste",
password: "28",
passwordPanelUrl: "",
passwordType: "password",
tableNumber: "",
tableTicket: "",
customer: {
name: "Cliente Teste",
document: "";
phoneNumber: "",
address: {
street: "",
number: "",
neighborhood: "",
city: "",
state: "",
postalCode: "",
complement: "",
}
},
note: "",
items: [{
name: "X Tudo",
quantity: 1,
unitPrice: 25,
fullPrice: 30,
sku: "xtd"
discount: 0,
note: "",
taxe: 0,
additionals: [{
name: "Adicionais";
options: [{
name: "Dobro de Bacon";
quantity: 1,
price: 5,
removable: false,
}],
removable: false,
}],
canceled: false,
items: [],
shippingAmount: 0
}],
discount: 0,
taxes: 0,
subtotal: 0,
total: 0,
personQuantity: 0,
change: 0,
payments: [{
value: 10,
method: "Dinheiro",
canceled: true
},
{
value: 1,
method: "Dinheiro",
}],
licensePlate: "",
shippingAmount: 0,
deliveryType: "Levar"
}}
/>PrintTaxInvoice
import { PrintTaxInvoice } from 'seru-react-native-print-template'
<PrintTaxInvoice
devicePrinter="1"
printFullNameItem={true}
resale={{
name: 'Revenda 01',
site: 'https://revenda01.com.br'
}}
systemVersion="1.0.0"
order={{
company: {
logoUrl: "",
name: "",
document: "",
stateInscription: "",
address: {
street: "",
number: "",
neighborhood: "",
city: "",
state: "",
postalCode: "",
complement: "",
};
},
password: "28",
passwordPanelUrl: "",
passwordType: "password",
status: 'authorized',
key: '',
qrCode: '',
number: '',
tributes: '',
taxe: '',
serie: '',
receiptDate: new Date(),
items: [{
_id: "fac17064-3bc5-44fd-abec-757f756c90ca",
name: "X Tudo",
canceled: false,
quantity: 1,
discount: 0,
taxe: 0,
shippingAmount: 0,
unitPrice: 25,
fullPrice: 30,
additionalUnitPrice: 5,
additionalsFullPrice: 5,
sku: 'xtd'
}],
payments: [{
value: 10,
method: "Dinheiro"
}],
change: 0,
customer: {
name: "Cliente Teste",
document: ""
},
discount: 0,
shippingAmount: 0,
fullAmount: 30,
licensePlate: ''
}}
/>Interfaces / Enums
Campos comuns componentes
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
| devicePrinter | string * | Modelo de impressora
| printFullNameItem | boolean | Se deseja exibir a descrição do produto em uma linha inteira
| order | IPrintOrder * | Dados do pedido
| taxInvoice | IPrintTaxInvoice * | Dados da nota fiscal
| resale | IPrintResale | Dados da revenda
| systemVersion | string | Versão do sistema de origem
| app | AppEnum | Aplicativo de origem
IPrinterCompany
Empresa
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|logoUrl | string | Logo da empresa
|name | string * | Nome da empresa
|document | string * | CNPJ da empresa
|stateInscription | string * | Inscrição estadual da empresa
|address | IPrintAddress * | Endereço da empresa
IPrintResale
Revenda
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|name | string | Nome da revenda
|site | string | Site da revenda
IPrintCustomer
Cliente
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|name | string | Nome do cliente
|document | string | CPF/CNPJ do cliente
|phoneNumber | string | Telefone do cliente
|address | IPrintAddress | Endereço do cliente
IPrintAddress
Endereço
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|street | string | Rua
|number | string | Número
|neighborhood | string | Bairro
|city | string | Cidade
|state | string | Estado
|postalCode | string | Código postal
|complement | string | Complmento
Order
IPrintOrder
Pedido
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|company | IPrinterCompany | Empresa
|code | string | Código
|operator | string | Nome do operador
|password | string | Senha do pedido
|passwordPanelUrl | string | URL do painel de senha
|passwordType | name ou password | Tipo de senha
|tableNumber | string | Número da mesa
|tableTicket | string | Número da comanda
|customer | IPrintCustomer | Cliente
|note | string | Observação
|items | ArrayOf<IPrintOrderItem> | Itens do pedido
|discount | number | Total de desconto
|taxes | number | Total de taxa de serviço
|subtotal | number | Subtotal
|total | number | Total
|personQuantity | number | Quantidade de pessoas
|change | number | Total do troco
|payments | ArrayOf<IPrintOrderPayment> | Pagamentos
|licensePlate | string | Placa do carro
|shippingAmount | number | Total de entrega
|deliveryType | string | Tipo de delivery
IPrintOrderItem
Item do pedido
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|name | string | Nome
|quantity | number | Quantidade
|unitPrice | number | Valor unitário
|fullPrice | number | Valor total
|sku | string | Sku
|discount | number | Valor total de desconto
|note | string | Observação
|taxe | number | Valor total taxa de serviço
|additionals | ArrayOf<IPrintOrderItemAdditional> | Adicionais
|canceled | boolean | Cancelado
|items | ArrayOf<IPrintOrderItem> | Itens de combo
|comboType | journey ou automatic ou carvery | Tipo de combo
|shippingAmount | Valor total de entrega | Valor total de entrega
IPrintOrderItemAdditional
Adicional
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|name | string | Nome
|options | ArrayOf<IPrintOrderItemAdditionalOption> | Opções
|removable | number | Pra remoção
IPrintOrderItemAdditionalOption
Opção do adicional
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|name | string | Nome
|quantity | number | Quantidade
|price | number | Valor
|removable | number | Pra remoção
IPrintOrderPayment
Pagamento do pedido
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|value | number | Valor
|method | string | Método de pagamento
|canceled | boolean | Cancelado
TaxInvoice
TaxInvoiceStatusEnum
Lista de status
| Valor | Descrição |
|--------------|--------------|
| pending | Pendente |
| queued | Em fila |
| failed | Falha |
| authorized | Autorizado |
| canceled | Cancelado |
| concluded | Concluído |
| unusable | Inutilizável |
| contingency | Contingência |
IPrintTaxInvoice
Nota fiscal
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|company | IPrinterCompany | Empresa
|password | string | Senha do pedido
|passwordType | string | Tipo de senha
|passwordPanelUrl | string | URL do painel de senha
|status | TaxInvoiceStatusEnum | Status
|key | string | Chave
|qrCode | string | QR Code
|number | string | Número
|tributes | number | Tributos
|taxe | number | Valor total taxa de serviço
|serie | string | Série
|receiptDate | Date | Data de emissão
|items | ArrayOf<IPrintTaxInvoiceItem> | Itens da nota
|payments | ArrayOf<IPrintTaxInvoicePayment> | Pagamentos da nota
|change | number | Valor total de troco
|itemServiceCharge | IPrintTaxInvoiceItemServiceCharge | Dados do item caso 'workItemService' seja 'true'
|workItemService | boolean | Se o item é ou não de taxa de serviço
|customer | IPrintCustomer | Cliente
|discount | number | Desconto
|shippingAmount | number | Valor total de entrega
|fullAmount | number | Valor total
|licensePlate | string | Placa do carro
IPrintTaxInvoiceItem
Item da nota fiscal
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|_id | string | Id do item na nota fiscal
|name | string | Nome
|canceled | boolean | Cancelado
|quantity | number | Quantidade
|discount | number | Valor total de desconto
|taxe | number | Valor total de taxa de serviço
|shippingAmount | number | Valor total de entrega
|unitPrice | number | Valor unitário
|fullPrice | number | Valor total
|additionalUnitPrice | number | Valor unitário dos adicionais
|additionalsFullPrice | number | Valor total dos adicionais
|workItemService | boolean | Se o item é de taxa de serviço ou não
|sku | string | Sku
IPrintTaxInvoicePayment
Pagamento da nota fiscal
| Campo | Tipo | Descrição |
| ----------------- | ----------------------------------|------------------------------ |
|value | string | Valor
|method | string | Método de pagamento Exp: Dinheiro
