供应商账单响应

本指南介绍了 UBL 2.4 申请响应的适用范围 并符合 UBL 2.4 标准。它的主要功能是 向税务机关提交的结算单据的状态。从 税务机关通过供应商向 Google 提供此类信息,该文件明确说明了 提交状态,并可能会包含通过以下方式生成的任何账单二进制文件的链接: 税务管理部门。

此架构有助于供应商将文档提交结果报告给 Google,涵盖:

  • 文档的接受状态。
  • 税务机关发现的问题或错误。
  • 指向账单或贷记通知单的相关二进制文件的链接。

这种结构化的通信协议可确保 Google、供应商和税务机关,提高账单效率 处理和合规要求。

与用于请求的批处理机制类似, 可将多个文档合并到一个提交内容中, 有效管理。如需详细了解此机制,请参阅 账单响应批量处理 部分。

下图所示的架构结构展示了 组织和关键要素,凸显了确定状态的方法 账单提交报告:

电子账单结算响应架构结构示意图

1.0 应用响应标头

详细说明基本元数据,例如 Google 供应商请求 ID 以及日期和 响应的发出时间(世界协调时间)。

元素 说明 示例
cbc:UUID 账单请求中提供的 Google 供应商请求 ID。 123e4567-e89b-12d3-a456-426614174000
cbc:IssueDate 发出回复的日期。 2023-06-02
cbc:IssueTime 发出响应的时间(采用世界协调时间 [UTC])。 08:20:00-08:00

示例

<ApplicationResponse>
  <cbc:UUID>123e4567-e89b-12d3-a456-426614174000</cbc:UUID>
  <cbc:IssueDate>2023-06-02</cbc:IssueDate>
  <cbc:IssueTime>08:20:00-08:00</cbc:IssueTime>
  <cac:SenderParty>
    <!-- Sender party details -->
  </cac:SenderParty>
  <cac:ReceiverParty>
    <!-- Receiver party details -->
  </cac:ReceiverParty>
  <cac:DocumentResponse>
    <!-- Document Response content -->
  </cac:DocumentResponse>
</ApplicationResponse>

2.0 发送者和接收者信息

此部分提供了有关 应用响应,符合 UBL 标准的必填字段。在本课中, 则发送者应该是将响应 政府系统,接收方应为 Google。

元素 说明 示例
cac:SenderParty/cac:PartyName/cbc:Name 转发政府系统回复的供应商的名称。 Vendor Company
cac:ReceiverParty/cac:PartyName/cbc:Name 接收响应的实体的名称。 Google

示例

<ApplicationResponse>
  ...
  <cac:SenderParty>
    <cac:PartyName>
      <cbc:Name>Vendor Company</cbc:Name>
    </cac:PartyName>
  </cac:SenderParty>

  <cac:ReceiverParty>
    <cac:PartyName>
      <cbc:Name>Google</cbc:Name>
    </cac:PartyName>
  </cac:ReceiverParty>
  ...
</ApplicationResponse>

3.0 文档响应

本部分提供有关文档响应的详细信息,包括 响应的状态以及因此而生成的所有相关文档引用, 能够成功向政府提交文件。

元素 说明 示例
cac:Response 必填。包含与账单提交相关的响应状态。 请参阅第 3.1 部分
cac:DocumentReference 可选。可包含对所生成文档的引用,也可以包含零个或多个引用。 请参阅第 3.2 节

示例

<ApplicationResponse>
  ...
  <cac:DocumentResponse>
    <cac:Response>
      <!-- Response details -->
    </cac:Response>
    <cac:DocumentReference>
      <!-- Document Reference (if applicable) -->
    </cac:DocumentReference>
    <cac:DocumentReference>
      <!-- Document Reference (if applicable) -->
    </cac:DocumentReference>
  </cac:DocumentResponse>
</ApplicationResponse>

3.1 回应

每个申请响应都应包含一个 cac:Response,详细说明 当前状态,与提交的文件相关联。这样可以确保 确保清晰传达每项文档处理结果。

元素 说明 示例
cbc:ReferenceID 税务系统为参考账单返回的唯一标识符。 BIL-123456
cbc:ReferenceID/@schemeID 提供标识符的系统或标准,阐明其来源。 KSEF
cac:Status/cbc:StatusReasonCode 根据预定义的值 list 定义响应或状态原因的代码。 NON
cac:Status/cbc:StatusReason 提供有关状态代码的更多详细信息的描述性文字。 No Issue

示例

<ApplicationResponse>
  ...
  <cac:DocumentResponse>
    <cac:Response>
      <cbc:ReferenceID schemeID="Vendor Company">BIL-123456</cbc:ReferenceID>
      <cac:Status>
        <cbc:StatusReasonCode>NON</cbc:StatusReasonCode>
        <cbc:StatusReason>No Issue</cbc:StatusReason>
      </cac:Status>
    </cac:Response>
    <cac:DocumentReference>
      <!-- Document Reference (if applicable) -->
    </cac:DocumentReference>
    <cac:DocumentReference>
      <!-- Document Reference (if applicable) -->
    </cac:DocumentReference>
  </cac:DocumentResponse>
</ApplicationResponse>

3.2 文档参考文档

此部分用于将引用附加到因 账单提交流程可选,可以包含多个 具体数量取决于税务机关生成的文件数量。

元素 说明 示例
cbc:ID 当地账单编号 BIL-123456
cbc:ID/@schemeID 账单参考发卡机构的标识符 Vendor Company
cbc:IssueDate 税务机关发布此回复的日期 2023-06-02
cbc:DocumentTypeCode 引用的文件类型,以代码表示(如果接受账单) 380
cbc:DocumentType 引用的文档的类型,以文本表示 Invoice
cac:Attachment/cac:ExternalReference/cbc:FormatCode 所生成的账单的格式(XML、PDF、网址) XML
cac:Attachment/cac:ExternalReference/cbc:FileName SFTP 服务器上所生成文件的文件名(适用于 XML 和 PDF 格式代码) invoice_GCEMEAD0000000001.pdf
cac:Attachment/cac:ExternalReference/cbc:URI 用于检索所生成文件的网址(针对网址格式代码) https://example.com/invoice/view

这些示例说明了应用中如何引用文档 响应。第一个示例涉及使用 SFTP 传输的文档, PDF 和 XML 格式,第二个示例演示了可访问的文档 使用网址,从而简化了直接访问,而无需传输文件 协议

示例 1:PDF 和使用 SFTP 传输的 XML 账单附件

<ApplicationResponse>
  <!-- Sender and Receiver Details -->
  <cac:DocumentResponse>
    <cac:Response>
      <!-- Response Details -->
    </cac:Response>
    <cac:DocumentReference>
      <cbc:ID schemeID="Vendor Company">BIL-123456</cbc:ID>
      <cbc:IssueDate>2023-06-02</cbc:IssueDate>
      <cbc:DocumentTypeCode>380</cbc:DocumentTypeCode>
      <cbc:DocumentType>Invoice</cbc:DocumentType>
      <cac:Attachment>
        <cac:ExternalReference>
          <!-- PDF Document stored on SFTP -->
          <cbc:FormatCode>PDF</cbc:FormatCode>
          <cbc:FileName>invoice_GCEMEAD0000000001.pdf</cbc:FileName>
        </cac:ExternalReference>
      </cac:Attachment>
      <cac:Attachment>
        <cac:ExternalReference>
          <!-- XML Document stored on SFTP -->
          <cbc:FormatCode>XML</cbc:FormatCode>
          <cbc:FileName>invoice_GCEMEAD0000000001.xml</cbc:FileName>
        </cac:ExternalReference>
      </cac:Attachment>
    </cac:DocumentReference>
  </cac:DocumentResponse>
</ApplicationResponse>

示例 2:可通过网址访问文档

<ApplicationResponse>
  <!-- Sender and Receiver Details -->
  <cac:DocumentResponse>
    <cac:Response>
      <!-- Response Details -->
    </cac:Response>
    <cac:DocumentReference>
      <cbc:ID schemeID="Vendor Company">BIL-123456</cbc:ID>
      <cbc:IssueDate>2023-06-02</cbc:IssueDate>
      <cbc:DocumentTypeCode>380</cbc:DocumentTypeCode>
      <cbc:DocumentType>Invoice</cbc:DocumentType>
      <cac:Attachment>
        <cac:ExternalReference>
          <!-- Document accessible using URL -->
          <cbc:FormatCode>URL</cbc:FormatCode>
          <cbc:URI>https://example.com/invoice/view</cbc:URI>
        </cac:ExternalReference>
      </cac:Attachment>
    </cac:DocumentReference>
  </cac:DocumentResponse>
</ApplicationResponse>