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
f5fa03cc
Commit
f5fa03cc
authored
Apr 14, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
f50cf729
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
21 deletions
+38
-21
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
+30
-19
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+8
-2
No files found.
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
View file @
f5fa03cc
var
system
=
require
(
"../../../system"
)
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
CtlBase
=
require
(
"../../ctlms.base"
);
var
moment
=
require
(
'moment'
);
var
moment
=
require
(
'moment'
);
class
InvoiceCtl
extends
CtlBase
{
class
InvoiceCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
invoiceSve
=
system
.
getObject
(
"service.invoice.invoiceSve"
);
this
.
invoiceSve
=
system
.
getObject
(
"service.invoice.invoiceSve"
);
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
INVOICE_TYPE
=
[
"10"
,
"20"
,
"30"
];
this
.
INVOICE_TYPE
=
[
"10"
,
"20"
,
"30"
];
}
}
/**
/**
...
@@ -128,18 +129,18 @@ class InvoiceCtl extends CtlBase {
...
@@ -128,18 +129,18 @@ class InvoiceCtl extends CtlBase {
return
res
;
return
res
;
}
}
/**
/
/ /
**
* 发票试算接口
//
* 发票试算接口
* @param {*} pobj
// * @param {*} pobj
*/
//
*/
async
calcInvoice
(
pobj
)
{
//
async calcInvoice(pobj) {
try
{
//
try {
return
await
this
.
invoiceSve
.
calcInvoice
(
pobj
);
//
return await this.invoiceSve.calcInvoice(pobj);
}
catch
(
error
)
{
//
} catch (error) {
console
.
log
(
error
);
//
console.log(error);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
//
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
//
}
}
//
}
/**
/**
* 发票试算接口
* 发票试算接口
...
@@ -168,15 +169,24 @@ class InvoiceCtl extends CtlBase {
...
@@ -168,15 +169,24 @@ class InvoiceCtl extends CtlBase {
}
}
try
{
try
{
let
rs
=
await
this
.
invoiceSve
.
calcInvoice
(
params
);
let
rs
=
await
this
.
invoiceSve
.
calcInvoice
(
params
);
if
(
!
rs
)
{
if
(
rs
.
status
!==
0
)
{
r
s
=
{
r
es
.
push
(
{
credit_code
:
item
.
credit_code
,
credit_code
:
item
.
credit_code
,
msg
:
"试算失败"
status
:
rs
.
status
,
};
msg
:
rs
.
msg
});
continue
;
}
}
res
.
push
(
rs
);
let
data
=
rs
.
data
;
data
.
status
=
rs
.
status
;
res
.
push
(
data
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
res
.
push
({
credit_code
:
item
.
credit_code
,
status
:
rs
.
status
,
msg
:
"试算异常,"
+
error
.
message
});
}
}
}
}
return
system
.
getResult
(
res
);
return
system
.
getResult
(
res
);
...
@@ -234,7 +244,6 @@ class InvoiceCtl extends CtlBase {
...
@@ -234,7 +244,6 @@ class InvoiceCtl extends CtlBase {
// }
// }
// /**
// /**
// * 计算发票增值税
// * 计算发票增值税
// * @param {*} pobj
// * @param {*} pobj
...
@@ -430,4 +439,5 @@ class InvoiceCtl extends CtlBase {
...
@@ -430,4 +439,5 @@ class InvoiceCtl extends CtlBase {
// }
// }
// }
// }
}
}
module
.
exports
=
InvoiceCtl
;
module
.
exports
=
InvoiceCtl
;
\ No newline at end of file
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
f5fa03cc
...
@@ -377,10 +377,16 @@ class InvoiceService extends ServiceBase {
...
@@ -377,10 +377,16 @@ class InvoiceService extends ServiceBase {
value_added_tax
=
system
.
f2y
(
value_added_tax
);
value_added_tax
=
system
.
f2y
(
value_added_tax
);
additional_tax
=
system
.
f2y
(
additional_tax
);
additional_tax
=
system
.
f2y
(
additional_tax
);
service_amount
=
system
.
f2y
(
service_amount
);
service_amount
=
system
.
f2y
(
service_amount
);
return
{
personal_invoice_tax
:
personal_invoice_tax
,
value_added_tax
:
value_added_tax
,
additional_tax
:
additional_tax
,
service_amount
:
service_amount
,
credit_code
:
params
.
credit_code
};
return
system
.
getResultSuccess
({
personal_invoice_tax
:
personal_invoice_tax
,
value_added_tax
:
value_added_tax
,
additional_tax
:
additional_tax
,
service_amount
:
service_amount
,
credit_code
:
params
.
credit_code
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
return
null
;
return
system
.
getResult
(
null
,
"试算失败"
)
;
}
}
}
}
...
...
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