|
@@ -36,7 +36,19 @@ func init() {
|
|
|
JyInvoiceManager.Auth.CallBackInit()
|
|
|
//go JyInvoiceManager.RunOneJob(context.Background())//流程
|
|
|
//go JyInvoiceManager.Demo(context.Background()) //开票
|
|
|
+ //go JyInvoiceManager.Auth.Login() //登录
|
|
|
//go JyInvoiceManager.RedDemo(context.Background())//红冲
|
|
|
+ //err = JyInvoiceManager.Auth.AddTaxCode([]Billitem{{
|
|
|
+ // Name: "技术服务费",
|
|
|
+ // Ssflbm: "3040205000000000000",
|
|
|
+ // Thirdid: "6f2e6a7a-18a7-4f21-b52e-a47437f817cc",
|
|
|
+ //}})
|
|
|
+ //if err != nil {
|
|
|
+ // panic(err)
|
|
|
+ //}
|
|
|
+ //list, err := JyInvoiceManager.Auth.GetSuccessTaxCodeList()
|
|
|
+ //g.Dump(list, err)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
func createInvoiceManager() *InvoiceManager {
|
|
@@ -138,7 +150,7 @@ func (im *InvoiceManager) simpleMakeInvoice(ctx context.Context) (total, okNum i
|
|
|
res gdb.Result
|
|
|
)
|
|
|
//查询需要开票的数据
|
|
|
- res, err = g.DB().Query(ctx, "SELECT a.*,b.pay_way,b.order_money,b.pay_money FROM invoice a INNER JOIN dataexport_order b ON a.order_code=b.order_code WHERE a.invoice_status=0 AND a.invoice_changed=0 AND a.invoice_variety='普通发票(电子发票)' AND a.invoice_order_code is NULL")
|
|
|
+ res, err = g.DB().Query(ctx, "SELECT a.*,b.pay_way,b.order_money,b.pay_money FROM invoice a INNER JOIN dataexport_order b ON a.order_code=b.order_code WHERE a.invoice_status=0 AND a.invoice_changed=0 AND a.invoice_variety='普通发票(电子发票)' AND a.invoice_order_code is NULL AND a.create_time > ? ", consts.InvoiceStartTime)
|
|
|
if err != nil {
|
|
|
return -1, -1, gerror.Wrap(err, "simpleMakeInvoice-查询待开票异常")
|
|
|
}
|
|
@@ -205,7 +217,7 @@ func (im *InvoiceManager) selfMakeInvoice(ctx context.Context) (total, okNum int
|
|
|
var (
|
|
|
res gdb.Result
|
|
|
)
|
|
|
- res, err = g.DB().Query(ctx, "SELECT a.invoice_money,a.only_Identifying,a.invoice_type,a.company_name,a.taxpayer_identnum,a.remark FROM invoice a WHERE a.invoice_status=0 AND a.invoice_changed=0 AND a.invoice_variety='电子普通发票' AND a.invoice_order_code is not NULL GROUP BY invoice_order_code")
|
|
|
+ res, err = g.DB().Query(ctx, "SELECT a.invoice_money,a.only_Identifying,a.invoice_type,a.company_name,a.taxpayer_identnum,a.remark FROM invoice a WHERE a.invoice_status=0 AND a.invoice_changed=0 AND a.invoice_variety='电子普通发票' AND a.invoice_order_code is not NULL AND a.create_time > ? GROUP BY invoice_order_code", consts.InvoiceStartTime)
|
|
|
if err != nil {
|
|
|
return -1, -1, gerror.Wrap(err, "selfMakeInvoice-查询待开票异常")
|
|
|
}
|