Add invoiceType to payment.

This commit is contained in:
Gucheng Wang 2022-04-25 20:58:53 +08:00
parent 9e5a64c021
commit 3f90c18a19
9 changed files with 59 additions and 3 deletions

View File

@ -49,6 +49,7 @@ type Payment struct {
PersonIdCard string `xorm:"varchar(100)" json:"personIdCard"`
PersonEmail string `xorm:"varchar(100)" json:"personEmail"`
PersonPhone string `xorm:"varchar(100)" json:"personPhone"`
InvoiceType string `xorm:"varchar(100)" json:"invoiceType"`
InvoiceTitle string `xorm:"varchar(100)" json:"invoiceTitle"`
InvoiceTaxId string `xorm:"varchar(100)" json:"invoiceTaxId"`
InvoiceRemark string `xorm:"varchar(100)" json:"invoiceRemark"`

View File

@ -13,11 +13,13 @@
// limitations under the License.
import React from "react";
import {Button, Card, Col, Input, Row} from 'antd';
import {Button, Card, Col, Input, Row, Select} from 'antd';
import * as PaymentBackend from "./backend/PaymentBackend";
import * as Setting from "./Setting";
import i18next from "i18next";
const { Option } = Select;
class PaymentEditPage extends React.Component {
constructor(props) {
super(props);
@ -177,6 +179,10 @@ class PaymentEditPage extends React.Component {
<Col span={22} >
<Input value={this.state.payment.personName} onChange={e => {
this.updatePaymentField('personName', e.target.value);
if (this.state.payment.invoiceType === "Individual") {
this.updatePaymentField('invoiceTitle', e.target.value);
this.updatePaymentField('invoiceTaxId', "");
}
}} />
</Col>
</Row>
@ -210,12 +216,33 @@ class PaymentEditPage extends React.Component {
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("payment:Invoice type"), i18next.t("payment:Invoice type - Tooltip"))} :
</Col>
<Col span={22} >
<Select virtual={false} style={{width: '100%'}} value={this.state.payment.invoiceType} onChange={(value => {
this.updatePaymentField('invoiceType', value);
if (value === "Individual") {
this.updatePaymentField('invoiceTitle', this.state.payment.personName);
this.updatePaymentField('invoiceTaxId', "");
}
})}>
{
[
{id: 'Individual', name: i18next.t("payment:Individual")},
{id: 'Organization', name: i18next.t("payment:Organization")},
].map((item, index) => <Option key={index} value={item.id}>{item.name}</Option>)
}
</Select>
</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 => {
<Input disabled={this.state.payment.invoiceType === "Individual"} value={this.state.payment.invoiceTitle} onChange={e => {
this.updatePaymentField('invoiceTitle', e.target.value);
}} />
</Col>
@ -225,7 +252,7 @@ class PaymentEditPage extends React.Component {
{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 => {
<Input disabled={this.state.payment.invoiceType === "Individual"} value={this.state.payment.invoiceTaxId} onChange={e => {
this.updatePaymentField('invoiceTaxId', e.target.value);
}} />
</Col>

View File

@ -261,15 +261,19 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment",
"Individual": "Individual",
"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",
"Invoice type": "Invoice type",
"Invoice type - Tooltip": "Invoice type - Tooltip",
"Message": "Message",
"Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment",
"Organization": "Organization",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",

View File

@ -261,15 +261,19 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment",
"Individual": "Individual",
"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",
"Invoice type": "Invoice type",
"Invoice type - Tooltip": "Invoice type - Tooltip",
"Message": "Message",
"Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment",
"Organization": "Organization",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",

View File

@ -261,15 +261,19 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment",
"Individual": "Individual",
"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",
"Invoice type": "Invoice type",
"Invoice type - Tooltip": "Invoice type - Tooltip",
"Message": "Message",
"Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment",
"Organization": "Organization",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",

View File

@ -261,15 +261,19 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment",
"Individual": "Individual",
"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",
"Invoice type": "Invoice type",
"Invoice type - Tooltip": "Invoice type - Tooltip",
"Message": "Message",
"Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment",
"Organization": "Organization",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",

View File

@ -261,15 +261,19 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment",
"Individual": "Individual",
"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",
"Invoice type": "Invoice type",
"Invoice type - Tooltip": "Invoice type - Tooltip",
"Message": "Message",
"Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment",
"Organization": "Organization",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",

View File

@ -261,15 +261,19 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"Edit Payment": "Edit Payment",
"Individual": "Individual",
"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",
"Invoice type": "Invoice type",
"Invoice type - Tooltip": "Invoice type - Tooltip",
"Message": "Message",
"Message - Tooltip": "Message - Tooltip",
"New Payment": "New Payment",
"Organization": "Organization",
"Person Email": "Person Email",
"Person Email - Tooltip": "Person Email - Tooltip",
"Person ID card": "Person ID card",

View File

@ -261,15 +261,19 @@
"Currency": "币种",
"Currency - Tooltip": "如USD美元CNY人民币等",
"Edit Payment": "编辑付款",
"Individual": "个人",
"Invoice Tax ID": "纳税人识别号",
"Invoice Tax ID - Tooltip": "开票类型为单位时,必须输入单位纳税人识别号;开票类型为个人时,不需要填写",
"Invoice remark": "发票备注",
"Invoice remark - Tooltip": "备注不超过50个字",
"Invoice title": "发票抬头",
"Invoice title - Tooltip": "开票类型为单位时,发票抬头可输入单位名称;开票类型为个人时,系统自动填写为缴费人姓名",
"Invoice type": "开票类型",
"Invoice type - Tooltip": "开票类型可以为个人或者单位",
"Message": "消息",
"Message - Tooltip": "付款处理结果消息",
"New Payment": "添加付款",
"Organization": "单位",
"Person Email": "缴费人电子邮箱",
"Person Email - Tooltip": "缴费人本人的电子邮箱",
"Person ID card": "缴费人身份证号",