Skip to content

Commit

Permalink
Add new payment fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Apr 25, 2022
1 parent 4263af6 commit 9e5a64c
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 11 deletions.
8 changes: 8 additions & 0 deletions object/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ type Payment struct {
ReturnUrl string `xorm:"varchar(1000)" json:"returnUrl"`
State string `xorm:"varchar(100)" json:"state"`
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 {
Expand Down
92 changes: 81 additions & 11 deletions web/src/PaymentEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -85,7 +85,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -95,7 +95,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Display name"), i18next.t("general:Display name - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -105,7 +105,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("general:Provider"), i18next.t("general:Provider - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -115,7 +115,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Type"), i18next.t("payment:Type - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -125,7 +125,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Product"), i18next.t("payment:Product - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -135,7 +135,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Price"), i18next.t("payment:Price - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -145,7 +145,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Currency"), i18next.t("payment:Currency - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -155,7 +155,7 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:State"), i18next.t("payment:State - Tooltip"))} :
</Col>
<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);
}} />
</Col>
Expand All @@ -165,18 +165,88 @@ class PaymentEditPage extends React.Component {
{Setting.getLabel(i18next.t("payment:Message"), i18next.t("payment:Message - Tooltip"))} :
</Col>
<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);
}} />
</Col>
</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>
)
}

submitPaymentEdit(willExist) {
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) => {
if (res.msg === "") {
Setting.showMessage("success", `Successfully saved`);
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/de/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"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 - Tooltip": "Message - Tooltip",
"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",
"Price": "Price",
"Price - Tooltip": "Price - Tooltip",
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/en/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"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 - Tooltip": "Message - Tooltip",
"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",
"Price": "Price",
"Price - Tooltip": "Price - Tooltip",
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/fr/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"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 - Tooltip": "Message - Tooltip",
"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",
"Price": "Price",
"Price - Tooltip": "Price - Tooltip",
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/ja/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"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 - Tooltip": "Message - Tooltip",
"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",
"Price": "Price",
"Price - Tooltip": "Price - Tooltip",
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/ko/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"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 - Tooltip": "Message - Tooltip",
"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",
"Price": "Price",
"Price - Tooltip": "Price - Tooltip",
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/ru/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "Currency",
"Currency - Tooltip": "Currency - Tooltip",
"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 - Tooltip": "Message - Tooltip",
"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",
"Price": "Price",
"Price - Tooltip": "Price - Tooltip",
Expand Down
14 changes: 14 additions & 0 deletions web/src/locales/zh/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,23 @@
"Currency": "币种",
"Currency - Tooltip": "如USD(美元),CNY(人民币)等",
"Edit Payment": "编辑付款",
"Invoice Tax ID": "纳税人识别号",
"Invoice Tax ID - Tooltip": "开票类型为单位时,必须输入单位纳税人识别号;开票类型为个人时,不需要填写",
"Invoice remark": "发票备注",
"Invoice remark - Tooltip": "备注不超过50个字",
"Invoice title": "发票抬头",
"Invoice title - Tooltip": "开票类型为单位时,发票抬头可输入单位名称;开票类型为个人时,系统自动填写为缴费人姓名",
"Message": "消息",
"Message - Tooltip": "付款处理结果消息",
"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": "请点击下方按钮返回原网站",
"Price": "价格",
"Price - Tooltip": "商品价格",
Expand Down

0 comments on commit 9e5a64c

Please sign in to comment.