buddha-code/buco-part-documents

此包已被弃用且不再维护。未建议替代包。

Shopware 插件,用于创建订单的子集位置文档

安装: 6

依赖: 0

建议者: 0

安全: 0

星标: 4

关注者: 0

分支: 1

类型:shopware-plugin

v1.0.0 2019-06-14 08:52 UTC

This package is auto-updated.

Last update: 2020-08-14 11:38:15 UTC


README

Shopware 插件,用于创建订单的子集位置文档。

功能

此插件增加了仅使用订单的一部分创建订单文档的能力。因此,订单的文档选项卡中有一个新的复选框来启用选择。一旦选中,就会出现一个新的位置网格来选择所需的位置。如果没有选择位置,将创建一个空文档。这可能会在文档的注释字段中放置消息很有用。

Order's document tab

为了指示文档是部分文档还是常规(“完整”)文档,将在文档选项卡、文档快速概述和邮件窗口等几个位置引入月亮和半月图标。

Mail attachment

Order liist document quick view

通过电子邮件发送文档将通过一个 $EventResult.bucoIsPartDocument 布尔变量扩展邮件上下文,指示附加文档的状态。因此,可以根据文档的状态渲染不同的输出。例如。

{if $EventResult.bucoIsPartDocument}
    The attached document contains a subset of positions.
{else}
    The attached document contains a all positions.
{/if}

如果邮件只有一个附件,此变量会被设置。如果有多个附件,则该变量的意义会丧失。

配置

可以限制部分文档的创建为特定文档类型或模板。

Order's document tab

迁移

如果您之前使用过 mbdus Teildokumente erstellen 插件,有一个迁移助手可供您使用。这将把 mbdus 部分文档迁移到这个插件中。请注意,此插件的功能比 mbdus 插件少。例如,无法更改收件人的邮政地址。另一方面,这种实现更加简洁,错误更少。

Migration start

Migration finished

内部数据库 ID 将被重新编号。原始主键将被保留在 s_order_documents_attributes.buco_part_document_legacy_id 列中供您使用。

迁移助手受 ACL 资源保护。默认启用 local_admin 用户角色。否则,您可能希望授予其他角色访问 bucopartdocumentsmigration.migrate 特权的权限。

mbdus 插件不再需要安装。在卸载后,插件留下了它的数据表。这些遗留数据足以进行迁移。您将在迁移过程结束时有机会清理这些表。

编程使用

如果您需要程序化创建部分文档,请将以下参数传递给 initDocument() 方法。是的,一些信息是冗余的。这是基于技术限制。请参阅源代码以获取更多详细信息。一个 拉取请求(shopware/shopware#2121) 正在处理这个问题。

\Shopware_Components_Document::initDocument($orderId, $docTypeId, [
    'netto' => false,
    'shippingCostsAsPosition' => true,
    '_renderer' => 'pdf',
    'bucoCreatePartDocument' => true,       // used to create part document
    'bucoPartDocPosIds' => [1,2],           // used to create part document; not an index, but the s_order_details primary key
    '_allowMultipleDocuments' => true,      // used to create part document
    'attributes' => [
        'bucoIsPartDocument' => true        // used to create part document
    ],
    'summaryNet' => [
        'bucoCreatePartDocument' => true,   // used to create part document
        'bucoPartDocPosIds' => [1,2]        // used to create part document; not an index, but the s_order_details primary key
    ]
]);

兼容性

安装

Git 版本

  • /custom/plugins/BucoPartDocuments 中检出插件
  • 使用插件管理器安装并激活插件

使用 composer 安装

  • 切换到 Shopware 的根安装目录
  • 运行命令 composer require buddha-code/buco-part-documents
  • 使用 ./bin/console sw:plugin:install --activate BucoPartDocuments 安装并激活插件

贡献

欢迎fork并提交pull请求!

许可证

本项目使用GPLv3许可证