Add new payment fields

This commit is contained in:
Gucheng Wang 2022-04-25 20:40:50 +08:00
parent 4263af6f2c
commit 9e5a64c021
9 changed files with 187 additions and 11 deletions

View File

@ -44,6 +44,14 @@ type Payment struct {
ReturnUrl string `xorm:"varchar(1000)" json:"returnUrl"` ReturnUrl string `xorm:"varchar(1000)" json:"returnUrl"`
State string `xorm:"varchar(100)" json:"state"` State string `xorm:"varchar(100)" json:"state"`
Message string `xorm:"varchar(1000)" json:"message"` Message string `xorm:"varchar(1000)" json:"message"`
PersonName string `xorm:"varchar(100)" json:"personName"`
PersonIdCard string `xorm:"varchar(100)" json:"personIdCard"`
PersonEmail string `xorm:"varchar(100)" json:"personEmail"`
PersonPhone string `xorm:"varchar(100)" json:"personPhone"`
InvoiceTitle string `xorm:"varchar(100)" json:"invoiceTitle"`
InvoiceTaxId string `xorm:"varchar(100)" json:"invoiceTaxId"`
InvoiceRemark string `xorm:"varchar(100)" json:"invoiceRemark"`
} }
func GetPaymentCount(owner, field, value string) int { func GetPaymentCount(owner, field, value string) int {

View File

@ -75,7 +75,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} : {Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.organization} onChange={e => { <Input disabled={true} value={this.state.payment.organization} onChange={e => {
// this.updatePaymentField('organization', e.target.value); // this.updatePaymentField('organization', e.target.value);
}} /> }} />
</Col> </Col>
@ -85,7 +85,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} : {Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.name} onChange={e => { <Input disabled={true} value={this.state.payment.name} onChange={e => {
// this.updatePaymentField('name', e.target.value); // this.updatePaymentField('name', e.target.value);
}} /> }} />
</Col> </Col>
@ -95,7 +95,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Display name"), i18next.t("general:Display name - Tooltip"))} : {Setting.getLabel(i18next.t("general:Display name"), i18next.t("general:Display name - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.displayName} onChange={e => { <Input disabled={true} value={this.state.payment.displayName} onChange={e => {
this.updatePaymentField('displayName', e.target.value); this.updatePaymentField('displayName', e.target.value);
}} /> }} />
</Col> </Col>
@ -105,7 +105,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Provider"), i18next.t("general:Provider - Tooltip"))} : {Setting.getLabel(i18next.t("general:Provider"), i18next.t("general:Provider - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.provider} onChange={e => { <Input disabled={true} value={this.state.payment.provider} onChange={e => {
// this.updatePaymentField('provider', e.target.value); // this.updatePaymentField('provider', e.target.value);
}} /> }} />
</Col> </Col>
@ -115,7 +115,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Type"), i18next.t("payment:Type - Tooltip"))} : {Setting.getLabel(i18next.t("payment:Type"), i18next.t("payment:Type - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.type} onChange={e => { <Input disabled={true} value={this.state.payment.type} onChange={e => {
// this.updatePaymentField('type', e.target.value); // this.updatePaymentField('type', e.target.value);
}} /> }} />
</Col> </Col>
@ -125,7 +125,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Product"), i18next.t("payment:Product - Tooltip"))} : {Setting.getLabel(i18next.t("payment:Product"), i18next.t("payment:Product - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.productName} onChange={e => { <Input disabled={true} value={this.state.payment.productName} onChange={e => {
// this.updatePaymentField('productName', e.target.value); // this.updatePaymentField('productName', e.target.value);
}} /> }} />
</Col> </Col>
@ -135,7 +135,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Price"), i18next.t("payment:Price - Tooltip"))} : {Setting.getLabel(i18next.t("payment:Price"), i18next.t("payment:Price - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.price} onChange={e => { <Input disabled={true} value={this.state.payment.price} onChange={e => {
// this.updatePaymentField('amount', e.target.value); // this.updatePaymentField('amount', e.target.value);
}} /> }} />
</Col> </Col>
@ -145,7 +145,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Currency"), i18next.t("payment:Currency - Tooltip"))} : {Setting.getLabel(i18next.t("payment:Currency"), i18next.t("payment:Currency - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.currency} onChange={e => { <Input disabled={true} value={this.state.payment.currency} onChange={e => {
// this.updatePaymentField('currency', e.target.value); // this.updatePaymentField('currency', e.target.value);
}} /> }} />
</Col> </Col>
@ -155,7 +155,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:State"), i18next.t("payment:State - Tooltip"))} : {Setting.getLabel(i18next.t("payment:State"), i18next.t("payment:State - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.state} onChange={e => { <Input disabled={true} value={this.state.payment.state} onChange={e => {
// this.updatePaymentField('state', e.target.value); // this.updatePaymentField('state', e.target.value);
}} /> }} />
</Col> </Col>
@ -165,18 +165,88 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Message"), i18next.t("payment:Message - Tooltip"))} : {Setting.getLabel(i18next.t("payment:Message"), i18next.t("payment:Message - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.payment.message} onChange={e => { <Input disabled={true} value={this.state.payment.message} onChange={e => {
// this.updatePaymentField('message', e.target.value); // this.updatePaymentField('message', e.target.value);
}} /> }} />
</Col> </Col>
</Row> </Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Person name"), i18next.t("payment:Person name - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.personName} onChange={e => {
this.updatePaymentField('personName', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Person ID card"), i18next.t("payment:Person ID card - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.personIdCard} onChange={e => {
this.updatePaymentField('personIdCard', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Person Email"), i18next.t("payment:Person Email - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.personEmail} onChange={e => {
this.updatePaymentField('personEmail', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Person phone"), i18next.t("payment:Person phone - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.personPhone} onChange={e => {
this.updatePaymentField('personPhone', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Invoice title"), i18next.t("payment:Invoice title - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.invoiceTitle} onChange={e => {
this.updatePaymentField('invoiceTitle', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Invoice Tax ID"), i18next.t("payment:Invoice Tax ID - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.invoiceTaxId} onChange={e => {
this.updatePaymentField('invoiceTaxId', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Invoice remark"), i18next.t("payment:Invoice remark - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.payment.invoiceRemark} onChange={e => {
this.updatePaymentField('invoiceRemark', e.target.value);
}} />
</Col>
</Row>
</Card> </Card>
) )
} }
submitPaymentEdit(willExist) { submitPaymentEdit(willExist) {
let payment = Setting.deepCopy(this.state.payment); let payment = Setting.deepCopy(this.state.payment);
PaymentBackend.updatePayment(this.state.organizationName, this.state.paymentName, payment) PaymentBackend.updatePayment(this.state.payment.owner, this.state.paymentName, payment)
.then((res) => { .then((res) => {
if (res.msg === "") { if (res.msg === "") {
Setting.showMessage("success", `Successfully saved`); Setting.showMessage("success", `Successfully saved`);

View File

@ -261,9 +261,23 @@
"Currency": "Currency", "Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip", "Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment", "Edit Payment": "Edit Payment",
"Invoice Tax ID": "Invoice Tax ID",
"Invoice Tax ID - Tooltip": "Invoice Tax ID - Tooltip",
"Invoice remark": "Invoice remark",
"Invoice remark - Tooltip": "Invoice remark - Tooltip",
"Invoice title": "Invoice title",
"Invoice title - Tooltip": "Invoice title - Tooltip",
"Message": "Message", "Message": "Message",
"Message - Tooltip": "Message - Tooltip", "Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment", "New Payment": "New Payment",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",
"Person ID card - Tooltip": "Person ID card - Tooltip",
"Person name": "Person name",
"Person name - Tooltip": "Person name - Tooltip",
"Person phone": "Person phone",
"Person phone - Tooltip": "Person phone - Tooltip",
"Please click the below button to return to the original website": "Please click the below button to return to the original website", "Please click the below button to return to the original website": "Please click the below button to return to the original website",
"Price": "Price", "Price": "Price",
"Price - Tooltip": "Price - Tooltip", "Price - Tooltip": "Price - Tooltip",

View File

@ -261,9 +261,23 @@
"Currency": "Currency", "Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip", "Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment", "Edit Payment": "Edit Payment",
"Invoice Tax ID": "Invoice Tax ID",
"Invoice Tax ID - Tooltip": "Invoice Tax ID - Tooltip",
"Invoice remark": "Invoice remark",
"Invoice remark - Tooltip": "Invoice remark - Tooltip",
"Invoice title": "Invoice title",
"Invoice title - Tooltip": "Invoice title - Tooltip",
"Message": "Message", "Message": "Message",
"Message - Tooltip": "Message - Tooltip", "Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment", "New Payment": "New Payment",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",
"Person ID card - Tooltip": "Person ID card - Tooltip",
"Person name": "Person name",
"Person name - Tooltip": "Person name - Tooltip",
"Person phone": "Person phone",
"Person phone - Tooltip": "Person phone - Tooltip",
"Please click the below button to return to the original website": "Please click the below button to return to the original website", "Please click the below button to return to the original website": "Please click the below button to return to the original website",
"Price": "Price", "Price": "Price",
"Price - Tooltip": "Price - Tooltip", "Price - Tooltip": "Price - Tooltip",

View File

@ -261,9 +261,23 @@
"Currency": "Currency", "Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip", "Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment", "Edit Payment": "Edit Payment",
"Invoice Tax ID": "Invoice Tax ID",
"Invoice Tax ID - Tooltip": "Invoice Tax ID - Tooltip",
"Invoice remark": "Invoice remark",
"Invoice remark - Tooltip": "Invoice remark - Tooltip",
"Invoice title": "Invoice title",
"Invoice title - Tooltip": "Invoice title - Tooltip",
"Message": "Message", "Message": "Message",
"Message - Tooltip": "Message - Tooltip", "Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment", "New Payment": "New Payment",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",
"Person ID card - Tooltip": "Person ID card - Tooltip",
"Person name": "Person name",
"Person name - Tooltip": "Person name - Tooltip",
"Person phone": "Person phone",
"Person phone - Tooltip": "Person phone - Tooltip",
"Please click the below button to return to the original website": "Please click the below button to return to the original website", "Please click the below button to return to the original website": "Please click the below button to return to the original website",
"Price": "Price", "Price": "Price",
"Price - Tooltip": "Price - Tooltip", "Price - Tooltip": "Price - Tooltip",

View File

@ -261,9 +261,23 @@
"Currency": "Currency", "Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip", "Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment", "Edit Payment": "Edit Payment",
"Invoice Tax ID": "Invoice Tax ID",
"Invoice Tax ID - Tooltip": "Invoice Tax ID - Tooltip",
"Invoice remark": "Invoice remark",
"Invoice remark - Tooltip": "Invoice remark - Tooltip",
"Invoice title": "Invoice title",
"Invoice title - Tooltip": "Invoice title - Tooltip",
"Message": "Message", "Message": "Message",
"Message - Tooltip": "Message - Tooltip", "Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment", "New Payment": "New Payment",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",
"Person ID card - Tooltip": "Person ID card - Tooltip",
"Person name": "Person name",
"Person name - Tooltip": "Person name - Tooltip",
"Person phone": "Person phone",
"Person phone - Tooltip": "Person phone - Tooltip",
"Please click the below button to return to the original website": "Please click the below button to return to the original website", "Please click the below button to return to the original website": "Please click the below button to return to the original website",
"Price": "Price", "Price": "Price",
"Price - Tooltip": "Price - Tooltip", "Price - Tooltip": "Price - Tooltip",

View File

@ -261,9 +261,23 @@
"Currency": "Currency", "Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip", "Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment", "Edit Payment": "Edit Payment",
"Invoice Tax ID": "Invoice Tax ID",
"Invoice Tax ID - Tooltip": "Invoice Tax ID - Tooltip",
"Invoice remark": "Invoice remark",
"Invoice remark - Tooltip": "Invoice remark - Tooltip",
"Invoice title": "Invoice title",
"Invoice title - Tooltip": "Invoice title - Tooltip",
"Message": "Message", "Message": "Message",
"Message - Tooltip": "Message - Tooltip", "Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment", "New Payment": "New Payment",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",
"Person ID card - Tooltip": "Person ID card - Tooltip",
"Person name": "Person name",
"Person name - Tooltip": "Person name - Tooltip",
"Person phone": "Person phone",
"Person phone - Tooltip": "Person phone - Tooltip",
"Please click the below button to return to the original website": "Please click the below button to return to the original website", "Please click the below button to return to the original website": "Please click the below button to return to the original website",
"Price": "Price", "Price": "Price",
"Price - Tooltip": "Price - Tooltip", "Price - Tooltip": "Price - Tooltip",

View File

@ -261,9 +261,23 @@
"Currency": "Currency", "Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip", "Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment", "Edit Payment": "Edit Payment",
"Invoice Tax ID": "Invoice Tax ID",
"Invoice Tax ID - Tooltip": "Invoice Tax ID - Tooltip",
"Invoice remark": "Invoice remark",
"Invoice remark - Tooltip": "Invoice remark - Tooltip",
"Invoice title": "Invoice title",
"Invoice title - Tooltip": "Invoice title - Tooltip",
"Message": "Message", "Message": "Message",
"Message - Tooltip": "Message - Tooltip", "Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment", "New Payment": "New Payment",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",
"Person ID card - Tooltip": "Person ID card - Tooltip",
"Person name": "Person name",
"Person name - Tooltip": "Person name - Tooltip",
"Person phone": "Person phone",
"Person phone - Tooltip": "Person phone - Tooltip",
"Please click the below button to return to the original website": "Please click the below button to return to the original website", "Please click the below button to return to the original website": "Please click the below button to return to the original website",
"Price": "Price", "Price": "Price",
"Price - Tooltip": "Price - Tooltip", "Price - Tooltip": "Price - Tooltip",

View File

@ -261,9 +261,23 @@
"Currency": "币种", "Currency": "币种",
"Currency - Tooltip": "如USD美元CNY人民币等", "Currency - Tooltip": "如USD美元CNY人民币等",
"Edit Payment": "编辑付款", "Edit Payment": "编辑付款",
"Invoice Tax ID": "纳税人识别号",
"Invoice Tax ID - Tooltip": "开票类型为单位时,必须输入单位纳税人识别号;开票类型为个人时,不需要填写",
"Invoice remark": "发票备注",
"Invoice remark - Tooltip": "备注不超过50个字",
"Invoice title": "发票抬头",
"Invoice title - Tooltip": "开票类型为单位时,发票抬头可输入单位名称;开票类型为个人时,系统自动填写为缴费人姓名",
"Message": "消息", "Message": "消息",
"Message - Tooltip": "付款处理结果消息", "Message - Tooltip": "付款处理结果消息",
"New Payment": "添加付款", "New Payment": "添加付款",
"Person Email": "缴费人电子邮箱",
"Person Email - Tooltip": "缴费人本人的电子邮箱",
"Person ID card": "缴费人身份证号",
"Person ID card - Tooltip": "缴费人本人的身份证号",
"Person name": "缴费人姓名",
"Person name - Tooltip": "缴费人本人的姓名",
"Person phone": "缴费人手机号",
"Person phone - Tooltip": "缴费人本人的手机号",
"Please click the below button to return to the original website": "请点击下方按钮返回原网站", "Please click the below button to return to the original website": "请点击下方按钮返回原网站",
"Price": "价格", "Price": "价格",
"Price - Tooltip": "商品价格", "Price - Tooltip": "商品价格",