Browse Source

2024-11-07 修改

修改:
1. 财务模块 - 收款退还 BUG修改
zhaiy 2 months ago
parent
commit
49cc960746

+ 4 - 2
app/src/main/java/com/pan_american/android/data/model/financial_module/payment_refund/entity/PaymentRefundDetail.kt

@@ -1,12 +1,14 @@
 package com.pan_american.android.data.model.financial_module.payment_refund.entity
 
+import com.pan_american.android.OASystem
+
 open class PaymentRefundDetail(
     var id: Int = 0,
-    var ccpId: Int = 0,
+    val ccpId: Int = OASystem.C_TABLE_PAYMENT_REFUND,
     var diId: Int = 0,
     var priceName: String = "",
     var price: Double = 0.0,
-    var currencyId: Int = 836,
+    val currencyId: Int = 836,
     var payee: String = "",
     var payDId: Int = 0,
     var orbitalPrivateTransfer: Int = 0,

+ 15 - 3
app/src/main/java/com/pan_american/android/ui/financial_module/payment_refund/AddPaymentRefundActivity.kt

@@ -1,8 +1,10 @@
 package com.pan_american.android.ui.financial_module.payment_refund
 
 import android.os.Bundle
+import android.util.Log
 import android.widget.TextView
 import androidx.core.content.res.ResourcesCompat
+import com.google.gson.Gson
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
 import com.pan_american.android.base.BaseActivity
@@ -261,7 +263,7 @@ class AddPaymentRefundActivity : BaseActivity<ActivityAddPaymentRefundBinding>()
                 showMessage(resources.getString(R.string.payee_hint))
                 return@setOnClickListener
             } else {
-                updatePaymentRefundRequest.payee = binding.payee.toString()
+                updatePaymentRefundRequest.payee = binding.payee.text.toString()
             }
 
             if (binding.otherBankName.text.isNullOrBlank()) {
@@ -292,11 +294,18 @@ class AddPaymentRefundActivity : BaseActivity<ActivityAddPaymentRefundBinding>()
                 updatePaymentRefundRequest.orbitalPrivateTransfer = paymentMarkId
             }
 
+            if (binding.consumeWay.text.isNullOrBlank()) {
+                showMessage(resources.getString(R.string.consume_way_hint))
+                return@setOnClickListener
+            } else {
+                updatePaymentRefundRequest.consumptionPatterns = binding.consumeWay.text.toString()
+            }
+
             if (paymentTypeId == -1) {
                 showMessage(resources.getString(R.string.payment_type_select_hint))
                 return@setOnClickListener
             } else {
-                updatePaymentRefundRequest.ccpId = paymentTypeId
+                updatePaymentRefundRequest.payType = paymentTypeId
             }
 
             if (binding.notes.getText().isNotBlank()) {
@@ -309,6 +318,8 @@ class AddPaymentRefundActivity : BaseActivity<ActivityAddPaymentRefundBinding>()
                 updatePaymentRefundRequest.status = 1
             }
 
+            updatePaymentRefundRequest.diId = groupId
+
             updatePaymentRefund()
         }
     }
@@ -352,7 +363,7 @@ class AddPaymentRefundActivity : BaseActivity<ActivityAddPaymentRefundBinding>()
                             binding.consumeWay.setText(consumptionPatterns)
 
                             for (item in paymentTypeList) {
-                                if (item.id == ccpId) {
+                                if (item.id == payType) {
                                     binding.paymentType.text = item.name
                                 }
                             }
@@ -372,6 +383,7 @@ class AddPaymentRefundActivity : BaseActivity<ActivityAddPaymentRefundBinding>()
     }
 
     private fun updatePaymentRefund() {
+        Log.e("request", Gson().toJson(updatePaymentRefundRequest))
         apiService.updatePaymentRefundDetail(updatePaymentRefundRequest).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
                 val updateResponse = response.body()

+ 2 - 1
app/src/main/java/com/pan_american/android/ui/financial_module/payment_refund/PaymentRefundListFragment.kt

@@ -227,6 +227,7 @@ class PaymentRefundListFragment : BaseFragment<FragmentPaymentRefundListBinding>
                     val intent = Intent(OASystem.context, AddPaymentRefundActivity::class.java)
                     intent.putExtra("fromList", true)
                     intent.putExtra("id", groupPaymentRefundList[position].id)
+                    intent.putExtra("groupId", groupId)
                     startActivity(intent)
                 } else {
                     return
@@ -245,7 +246,7 @@ class PaymentRefundListFragment : BaseFragment<FragmentPaymentRefundListBinding>
 
                         deletePaymentRefundItem(position)
                     }
-                }
+                }.show()
             }
         }