|
@@ -1,7 +1,6 @@
|
|
|
package com.pan_american.android.ui.efficiency_tools.daily_payment
|
|
|
|
|
|
import android.os.Bundle
|
|
|
-import android.util.Log
|
|
|
import android.view.Gravity
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
@@ -10,7 +9,6 @@ import android.widget.PopupWindow
|
|
|
import android.widget.TextView
|
|
|
import androidx.core.content.res.ResourcesCompat
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
-import com.google.gson.Gson
|
|
|
import com.pan_american.android.OASystem
|
|
|
import com.pan_american.android.R
|
|
|
import com.pan_american.android.base.BaseActivity
|
|
@@ -442,10 +440,10 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
|
|
|
dailyPaymentList.add(
|
|
|
DailyPaymentListItem(
|
|
|
paymentItemName.text.toString(),
|
|
|
- paymentItemCount.text.toString().toInt(),
|
|
|
- paymentItemPrice.text.toString().toFloat(),
|
|
|
+ paymentItemCount.text.toString().toDouble(),
|
|
|
+ paymentItemPrice.text.toString().toDouble(),
|
|
|
paymentItemCount.text.toString()
|
|
|
- .toInt() * paymentItemPrice.text.toString().toDouble(),
|
|
|
+ .toDouble() * paymentItemPrice.text.toString().toDouble(),
|
|
|
paymentItemRemark.getText().trim()
|
|
|
)
|
|
|
)
|
|
@@ -616,7 +614,12 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
|
|
|
)
|
|
|
paymentItemPrice.isFocusable = false
|
|
|
|
|
|
- paymentItemRemark.setText(item.remark)
|
|
|
+ if (item.remark.isBlank()) {
|
|
|
+ paymentItemRemark.setText(resources.getString(R.string.none))
|
|
|
+ } else {
|
|
|
+ paymentItemRemark.setText(item.remark)
|
|
|
+ }
|
|
|
+
|
|
|
paymentItemRemark.isEnabled(false)
|
|
|
|
|
|
commit.setOnClickListener {
|
|
@@ -645,7 +648,7 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
|
|
|
}
|
|
|
|
|
|
private fun deletePaymentItem(position: Int) {
|
|
|
- totalPayment -= dailyPaymentList[position].quantity * dailyPaymentList[position].price
|
|
|
+ totalPayment -= dailyPaymentList[position].itemTotal
|
|
|
|
|
|
dailyPaymentList.removeAt(position)
|
|
|
binding.paymentItemList.adapter!!.notifyItemRemoved(position)
|
|
@@ -666,18 +669,18 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
|
|
|
|
|
|
binding.updateLoading.visibility = View.VISIBLE
|
|
|
|
|
|
- Log.e(
|
|
|
- "request", Gson().toJson(
|
|
|
- AddDailyPaymentRequest(
|
|
|
- binding.paymentNotes.getText().trim(),
|
|
|
- totalPayment,
|
|
|
- transferIdentifyId,
|
|
|
- feeSubTypeId,
|
|
|
- companyId,
|
|
|
- dailyPaymentList
|
|
|
- )
|
|
|
- )
|
|
|
- )
|
|
|
+// Log.e(
|
|
|
+// "request", Gson().toJson(
|
|
|
+// AddDailyPaymentRequest(
|
|
|
+// binding.paymentNotes.getText().trim(),
|
|
|
+// totalPayment,
|
|
|
+// transferIdentifyId,
|
|
|
+// feeSubTypeId,
|
|
|
+// companyId,
|
|
|
+// dailyPaymentList
|
|
|
+// )
|
|
|
+// )
|
|
|
+// )
|
|
|
|
|
|
apiService.addDailyPayment(
|
|
|
AddDailyPaymentRequest(
|
|
@@ -812,19 +815,19 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
|
|
|
|
|
|
binding.updateLoading.visibility = View.VISIBLE
|
|
|
|
|
|
- Log.e(
|
|
|
- "request", Gson().toJson(
|
|
|
- UpdateDailyPaymentRequest(
|
|
|
- dailyPaymentId,
|
|
|
- binding.paymentNotes.getText().trim(),
|
|
|
- totalPayment,
|
|
|
- transferIdentifyId,
|
|
|
- feeSubTypeId,
|
|
|
- companyId,
|
|
|
- dailyPaymentList
|
|
|
- )
|
|
|
- )
|
|
|
- )
|
|
|
+// Log.e(
|
|
|
+// "request", Gson().toJson(
|
|
|
+// UpdateDailyPaymentRequest(
|
|
|
+// dailyPaymentId,
|
|
|
+// binding.paymentNotes.getText().trim(),
|
|
|
+// totalPayment,
|
|
|
+// transferIdentifyId,
|
|
|
+// feeSubTypeId,
|
|
|
+// companyId,
|
|
|
+// dailyPaymentList
|
|
|
+// )
|
|
|
+// )
|
|
|
+// )
|
|
|
|
|
|
apiService.updateDailyPaymentDetail(
|
|
|
UpdateDailyPaymentRequest(
|