Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
6f37be80
Commit
6f37be80
authored
Apr 08, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddg]
parent
336af170
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
16 deletions
+70
-16
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
+17
-12
xgg-admin/app/base/service/impl/business/businessmenSve.js
+10
-0
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+39
-0
xgg-admin/app/base/system.js
+4
-4
No files found.
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
View file @
6f37be80
...
@@ -56,6 +56,11 @@ class InvoiceCtl extends CtlBase {
...
@@ -56,6 +56,11 @@ class InvoiceCtl extends CtlBase {
async
invoiceApply
(
pobj
,
pobj2
,
req
)
{
async
invoiceApply
(
pobj
,
pobj2
,
req
)
{
try
{
try
{
pobj
.
invoice_amount
=
system
.
y2f
(
pobj
.
invoice_amount
);
pobj
.
invoice_amount
=
system
.
y2f
(
pobj
.
invoice_amount
);
pobj
.
additional_tax
=
system
.
y2f
(
pobj
.
additional_tax
);
pobj
.
value_added_tax
=
system
.
y2f
(
pobj
.
value_added_tax
);
pobj
.
personal_invoice_tax
=
system
.
y2f
(
pobj
.
personal_invoice_tax
);
pobj
.
invoice_content
=
system
.
y2f
(
pobj
.
invoice_content
);
return
await
this
.
invoiceSve
.
invoiceApply
(
pobj
);
return
await
this
.
invoiceSve
.
invoiceApply
(
pobj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -170,18 +175,18 @@ class InvoiceCtl extends CtlBase {
...
@@ -170,18 +175,18 @@ class InvoiceCtl extends CtlBase {
// }
// }
// }
// }
/
/ /
**
/**
//
* 发票试算接口
* 发票试算接口
//
* @param {*} pobj
* @param {*} pobj
//
*/
*/
//
async calcInvoice(pobj) {
async
calcInvoice
(
pobj
)
{
//
try {
try
{
// return await this.invoiceSve.apiC
alcInvoice(pobj);
return
await
this
.
invoiceSve
.
c
alcInvoice
(
pobj
);
//
} catch (error) {
}
catch
(
error
)
{
//
console.log(error);
console
.
log
(
error
);
//
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
//
}
}
//
}
}
// /**
// /**
// * 计算发票增值税
// * 计算发票增值税
...
...
xgg-admin/app/base/service/impl/business/businessmenSve.js
View file @
6f37be80
...
@@ -44,6 +44,16 @@ class BusinessmenService extends ServiceBase {
...
@@ -44,6 +44,16 @@ class BusinessmenService extends ServiceBase {
}
}
}
}
async
queryObusinessmenByCreditCode
(
params
)
{
try
{
return
await
this
.
callms
(
"order"
,
"queryObusinessmenByCreditCode"
,
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
error
);
}
}
/**
/**
* @params 建仗
* @params 建仗
*/
*/
...
...
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
6f37be80
...
@@ -7,6 +7,7 @@ class InvoiceService extends ServiceBase {
...
@@ -7,6 +7,7 @@ class InvoiceService extends ServiceBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
businessmenSve
=
system
.
getObject
(
"service.business.businessmenSve"
);
}
}
async
processDics
(
params
)
{
async
processDics
(
params
)
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"processDics"
,
params
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"processDics"
,
params
);
...
@@ -245,6 +246,44 @@ class InvoiceService extends ServiceBase {
...
@@ -245,6 +246,44 @@ class InvoiceService extends ServiceBase {
}
}
}
}
/**
* 发票试算
* @param {*} params
*
* credit_code :统一社会信用代码
*
*
*/
async
calcInvoice
(
params
){
if
(
!
params
.
credit_code
){
return
system
.
getResult
(
null
,
`参数错误 统一社会信用代码不能为空`
);
}
//取出个体工商户信息
var
businessRes
=
await
this
.
businessmenSve
.
queryObusinessmenByCreditCode
({
credit_code
:
this
.
trim
(
params
.
credit_code
)});
if
(
businessRes
.
status
!=
0
&&
!
businessRes
.
data
){
return
system
.
getResult
(
null
,
`个体户不存在`
);
}
let
businessmenBean
=
businessRes
.
data
;
if
(
!
businessmenBean
.
sign_time
){
return
system
.
getResult
(
null
,
`个体户未签约`
);
}
//增值税累计类型 1按月 2按季度 add_value_up_type
//个税累计类型 1按月累计 2按季度累计 tax_up_type
let
accumulatedAmountParams
=
{
add_value_up_type
:
businessmenBean
.
add_value_up_type
,
tax_up_type
:
businessmenBean
.
tax_up_type
,
credit_code
:
this
.
trim
(
params
.
credit_code
),
invoiced_time
:
this
.
trim
(
params
.
invoiced_time
)
};
//取出累计开票金额
var
invoiceRes
=
await
this
.
callms
(
"invoice"
,
"accumulatedAmount"
,
accumulatedAmountParams
);
return
system
.
getResultSuccess
();
}
}
}
...
...
xgg-admin/app/base/system.js
View file @
6f37be80
...
@@ -182,12 +182,12 @@ class System {
...
@@ -182,12 +182,12 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
// 订单服务
//
order: domain2 + ":3103" + path,
order
:
domain2
+
":3103"
+
path
,
order
:
domain
+
":3103"
+
path
,
//
order: domain + ":3103" + path,
// 发票服务
// 发票服务
//
invoice: domain2 + ":3105" + path,
invoice
:
domain2
+
":3105"
+
path
,
invoice
:
domain
+
":3105"
+
path
,
//
invoice: domain + ":3105" + path,
// 用户中心
// 用户中心
uc
:
domain
+
":3106"
+
path
,
uc
:
domain
+
":3106"
+
path
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment