hevelop / invoice-request
这是在结账时生成发票请求并在订单中保存数据的模块
1.2.5
2023-01-03 09:39 UTC
Requires
- magento/module-backend: 101.*||102.*
- magento/module-checkout: >=100.3.3
- magento/module-quote: 101.*
- magento/module-sales: 102.*||103.*
This package is auto-updated.
Last update: 2024-08-30 01:55:12 UTC
README
安装
- Composer
composer require hevelop/invoice-request
- 下载模块
Download module from GitHub and copy/paste it under dir your_magento_root/app/code/Hevelop/InvoiceRequest
安装后,启用模块
bin/magento module:enable Hevelop_InvoiceRequest
升级数据库
bin/magento setup:upgrade
并编译 Magento 依赖注入
bin/magento setup:di:compile
结账
在支付步骤中,结账界面添加了一个新部分。新部分包含“我想要发票”复选框。如果选中,用户可以选择是否以私人或公司身份请求发票。
如果是私人
- "Tax/Va Number" field (required if checked "I want invoice")
If the user is registered, it will be pre-filled with the "tax vat number" field relating to his account.
If he is a guest, with the one entered during checkout.
In both cases, the user can change it if necessary.
如果是公司
- "Company" field (required if checked "I want invoice")
If the user is registered, it will be pre-filled with the company field relating to the registered address.
If he is a guest, with the one entered during checkout.
In both cases, the user can change it if necessary.
- "VAT number" field (required if checked "I want invoice")
If the user is registered, it will be pre-filled with the vat_id field relating to the registered address.
If he is a guest, with the one entered during checkout.
In both cases, the user can change it if necessary.
- "Tax code" field (optional)
If the user is registered, it will be pre-filled with the taxvat field relating to his account.
If it is a guest, with the one entered during compilation.
In both cases, the user can change it if necessary, the field has been left for companies that have different CF and VAT numbers.
- "Recipient code (SDI)" field
The italian electronic invoicing field appears only if the billing address has set Italy as country, in this case it is also required.
If the billing address has another country, the field is emptied and hidden.
If the user is registered, it will be pre-filled with the sdi_code field relating to the registered address.
If it is a guest, with the one entered during compilation.
In both cases, the user can change it if necessary.
如果用户已注册且更改了预填字段,则更改将仅对单个订单有效。您的账户中不会发生任何更改,在下次订单中,您将找到它们已预填注册数据。
客户账户
在客户账户中,用户将找到
- 由 Magento 在客户实体中提供的原生的“税务/增值税号”字段
- 由 Magento 在客户地址实体中提供的原生的“公司”字段
- 由 Magento 在客户地址实体中提供的原生的“增值税号”字段
- 由模块提供的用于意大利发票的新“SDI 码”字段,在客户地址实体中
订单
在订单级别,如果客户在结账时勾选“我想要发票”,则会注册“想要发票”字段。该字段在后台订单网格中可见并可筛选。订单的账单地址将填写用户在结账新部分中输入的字段。如果字段与预填字段相比已更改,则它们将在订单中修改,但仅针对此订单。
配置
- 必须在“商店 -> 配置 -> 客户配置”中激活 Magento 原生的税务/增值税号
- 必须在“商店 -> 配置 -> 客户配置”中激活 Magento 原生的增值税号
- 必须在“商店 -> 配置 -> 客户配置”中的地址模板中添加意大利发票的 SDI 码
示例。
{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
{{depend company}}{{var company}}{{/depend}}
{{if street1}}{{var street1}}
{{/if}}
{{depend street2}}{{var street2}}{{/depend}}
{{depend street3}}{{var street3}}{{/depend}}
{{depend street4}}{{var street4}}{{/depend}}
{{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}
{{var country}}
{{depend telephone}}T: {{var telephone}}{{/depend}}
{{depend fax}}F: {{var fax}}{{/depend}}
{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}
{{depend sdi_code}}SDI: {{var sdi_code}}{{/depend}}
翻译
模块为意大利语、法语和西班牙语提供了 i18n 翻译。
Stripe
- 兼容 stripe/module-payments 2.5
意大利发票请求结账模块
结账
在支付步骤中添加了一个新部分。如果勾选“我想要发票”,则用户可以选择是否以私人或公司身份请求发票。
如果是私人
- Campo "codice fiscale" (obbligatorio se spuntata "desidero fattura")
Se l'utente è registrato, verrà pre-compilato con il campo "taxvat" relativo al suo account.
Se è guest, con quello inserito in fase di compilazione checkout.
In entrambi in casi potrà eventualmente modificarlo.
如果是公司
- Campo "azienda" (obbligatorio se spuntata "desidero fattura")
Se l'utente è registrato, verrà pre-compilato con il campo company relativo all'indirizzo registrato.
Se è guest, con quello inserito in fase di compilazione checkout.
In entrambi in casi potrà eventualmente modificarlo.
- Campo "partita iva" (obbligatorio se spuntata "desidero fattura")
Se l'utente è registrato, verrà pre-compilato con il campo vat_id relativo all'indirizzo registrato.
Se è guest, con quello inserito in fase di compilazione checkout.
In entrambi in casi potrà eventualmente modificarlo.
- Campo "codice fiscale" (facoltativo)
Se l'utente è registrato, verrà pre-compilato con il campo taxvat relativo al suo account.
Se è guest, con quello inserito in fase di compilazione.
In entrambi in casi potrà eventualmente modificarlo, il campo è stato lasciato per le aziende che hanno CF e P.IVA differente.
- Campo "codice destinatario (SDI)"
Il campo per la fatturazione elettronica, appare solo se il billing address ha impostato come country l'Italia, in questo caso è anche obbligatorio.
Se il billing address presenta un country estero, il campo viene svuotato e nascosto.
Se l'utente è registrato, verrà pre-compilato con il campo sdi_code relativo all'indirizzo registrato.
Se è guest, con quello inserito in fase di compilazione.
In entrambi in casi potrà eventualmente modificarlo.
如果用户已注册并修改了预填字段,则更改将仅对单个订单有效。您的账户中不会发生任何更改,在下次订单中,您将找到它们已预填注册数据。
用户账户
用户将找到
- 在账户级别,税务识别号(taxvat,原生 Magento)
- 在地址级别,公司(company,原生 Magento)
- 在地址级别,增值税号(vat_id,原生 Magento)
- 在地址级别,SDI 码(sdi_code,模块添加的字段)
订单
如果用户请求了发票(want_invoice),则会在订单级别进行注册。该字段在后台订单网格中可见并可筛选。订单的账单地址将填写用户在结账新部分中输入的字段。如果字段与预填字段相比已更改,则它们将在订单中修改,但仅针对此订单。
配置
- 税号(taxvat)需要在“商店 -> 配置 -> 客户配置”中由客户配置激活
- 增值税号(vat_id)需要在“商店 -> 配置 -> 客户配置”中由客户配置激活
- SDI(sdi code)需要在“商店 -> 配置 -> 客户配置”中的地址模板中添加客户配置
例如:
{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
{{depend company}}{{var company}}{{/depend}}
{{if street1}}{{var street1}}
{{/if}}
{{depend street2}}{{var street2}}{{/depend}}
{{depend street3}}{{var street3}}{{/depend}}
{{depend street4}}{{var street4}}{{/depend}}
{{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}
{{var country}}
{{depend telephone}}T: {{var telephone}}{{/depend}}
{{depend fax}}F: {{var fax}}{{/depend}}
{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}
{{depend sdi_code}}SDI: {{var sdi_code}}{{/depend}}
翻译
条目使用英文,已添加意大利语、法语和西班牙语的翻译。
Stripe
- 与 stripe/module-payments 2.5 兼容