diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceApi.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceApi.cs index e9f8a5482e..c18354b957 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceApi.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceApi.cs @@ -42,6 +42,9 @@ and limitations under the License. 修改标识:Senparc - 20181018 修改描述:【异步方法】批量查询报销发票信息接口去掉无意义参数,更新reimburseStatus为枚举值 + 修改标识:Senparc - 20181023 + 修改描述:修正发票信息实体,区分开票平台提交的发票信息实体与报销方获取的发票信息实体 + ----------------------------------------------------------------*/ diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs index ff531da9ae..aacf9907c1 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformData.cs @@ -114,13 +114,13 @@ public class CardExtInfo /// public class UserCard { - public InvoiceUserData invoice_user_data { get; set; } + public InvoicePlatformUserData invoice_user_data { get; set; } } /// - /// + /// 发票信息基础公用信息(开票平台,报销方) /// - public class InvoiceUserData + public abstract class InvoiceBaseUseData { /// /// 发票的金额,以分为单位 @@ -155,14 +155,6 @@ public class InvoiceUserData /// public int tax { get; set; } /// - /// 发票pdf文件上传到微信发票平台后,会生成一个发票 - /// - public string s_pdf_media_id { get; set; } - /// - /// 其它消费附件的PDF - /// - public string s_trip_pdf_media_id { get; set; } - /// /// 校验码,发票pdf右上角,开票日期下的校验码 /// public string check_code { get; set; } @@ -204,6 +196,61 @@ public class InvoiceUserData public string maker { get; set; } } + /// + /// 开票平台将电子发票卡券插入用户卡包时的发票信息 + /// + public class InvoicePlatformUserData: InvoiceBaseUseData + { + /// + /// 发票pdf文件上传到微信发票平台后,会生成一个发票 + /// + public string s_pdf_media_id { get; set; } + /// + /// 其它消费附件的PDF + /// + public string s_trip_pdf_media_id { get; set; } + } + /// + /// 报销方查询报销发票时的发票信息 + /// + public class InvoiceReimburseUserData : InvoiceBaseUseData + { + /// + /// 这张发票对应的PDF_URL + /// + public string pdf_url { get; set; } + /// + /// 其它消费凭证附件对应的URL,如行程单、水单等 + /// + public string trip_pdf_url { get; set; } + /// + /// 发票报销状态,与对应 + /// + public string reimburse_status { get; set; } + /// + /// 尝试转换为对应枚举,如果转换失败,则返回null + /// + public Reimburse_Status? Status + { + get + { +#if !NET35 + if (System.Enum.TryParse(this.reimburse_status, out Reimburse_Status status)) + { + return status; + } +#else + try + { + return (Reimburse_Status)System.Enum.Parse(typeof(Reimburse_Status), this.reimburse_status); + } + catch { } +#endif + return null; + } + } + } + /// /// 商品详情结构 /// diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs index 792f5e6e0b..79fcbb4bf0 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson/InvoicePlatformResultJson.cs @@ -118,7 +118,7 @@ public class GetInvoiceInfoResultJson : WxJsonResult /// /// 用户可在发票票面看到的主要信息 /// - public InvoiceUserData user_info { get; set; } + public InvoiceReimburseUserData user_info { get; set; } } /// @@ -168,6 +168,6 @@ public class InvoiceItemInfo /// /// 用户可在发票票面看到的主要信息 /// - public InvoiceUserData user_info { get; set; } + public InvoiceReimburseUserData user_info { get; set; } } }