|
@@ -60,70 +60,114 @@ class EntryAndExitFeeTotalFragment : BaseFragment<FragmentEntryAndExitFeeTotalBi
|
|
|
|
|
|
override fun initViews() {
|
|
|
OASystem.entryAndExitDetailResponse.apply {
|
|
|
+
|
|
|
+ economyTotalPayment = 0.0
|
|
|
+ bussinessTotalPayment = 0.0
|
|
|
+ firstClassTotalPayment = 0.0
|
|
|
+
|
|
|
binding.checkInBoard.isChecked = choiceOne == 1
|
|
|
+
|
|
|
binding.inBoardTotal.text = String.format(
|
|
|
resources.getString(R.string.total_per_fee_format),
|
|
|
choiceOneTotalCost
|
|
|
)
|
|
|
|
|
|
+ if (choiceOne == 1) {
|
|
|
+ economyTotalPayment += choiceOneTotalCost
|
|
|
+ bussinessTotalPayment += choiceOneTotalCost
|
|
|
+ firstClassTotalPayment += choiceOneTotalCost
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkEconomyClass.isChecked = choiceTwoJJ == 1
|
|
|
+
|
|
|
+ if (choiceTwoJJ == 1) {
|
|
|
+ binding.economyClass.text = String.format(resources.getString(R.string.economy_class_price), outsideJJPay)
|
|
|
+ economyTotalPayment += outsideJJPay
|
|
|
+ } else {
|
|
|
+ binding.economyClass.text = String.format(resources.getString(R.string.economy_class_price), 0.0)
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkBusinessClass.isChecked = choiceTwoGW == 1
|
|
|
+
|
|
|
+ if (choiceTwoGW == 1) {
|
|
|
+ binding.businessClass.text = String.format(resources.getString(R.string.business_class_price), outsideGWPay)
|
|
|
+ bussinessTotalPayment += outsideGWPay
|
|
|
+ } else {
|
|
|
+ binding.businessClass.text = String.format(resources.getString(R.string.business_class_price), 0.0)
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkFirstClass.isChecked = choiceTwoTD == 1
|
|
|
|
|
|
+ if (choiceTwoTD == 1) {
|
|
|
+ binding.firstClass.text = String.format(resources.getString(R.string.first_class_price), outsideTDPay)
|
|
|
+ firstClassTotalPayment += outsideTDPay
|
|
|
+ } else {
|
|
|
+ binding.firstClass.text = String.format(resources.getString(R.string.first_class_price), 0.0)
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkAccommodationFee.isChecked = choiceThree == 1
|
|
|
+
|
|
|
binding.accommodationTotal.text = String.format(
|
|
|
resources.getString(R.string.total_per_fee_format),
|
|
|
choiceThreeTotalCost
|
|
|
)
|
|
|
|
|
|
+ if (choiceThree == 1) {
|
|
|
+ economyTotalPayment += choiceThreeTotalCost
|
|
|
+ bussinessTotalPayment += choiceThreeTotalCost
|
|
|
+ firstClassTotalPayment += choiceThreeTotalCost
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkMealFee.isChecked = choiceFour == 1
|
|
|
+
|
|
|
binding.mealTotal.text = String.format(
|
|
|
resources.getString(R.string.total_per_fee_format),
|
|
|
choiceFourTotalCost
|
|
|
)
|
|
|
|
|
|
+ if (choiceFour == 1) {
|
|
|
+ economyTotalPayment += choiceFourTotalCost
|
|
|
+ bussinessTotalPayment += choiceFourTotalCost
|
|
|
+ firstClassTotalPayment += choiceFourTotalCost
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkPublicAndMiscellaneous.isChecked = choiceFive == 1
|
|
|
+
|
|
|
binding.publicAndMiscellaneousTotal.text = String.format(
|
|
|
resources.getString(R.string.total_per_fee_format),
|
|
|
choiceFiveTotalCost
|
|
|
)
|
|
|
|
|
|
+ if (choiceFive == 1) {
|
|
|
+ economyTotalPayment += choiceFiveTotalCost
|
|
|
+ bussinessTotalPayment += choiceFiveTotalCost
|
|
|
+ firstClassTotalPayment += choiceFiveTotalCost
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkTraining.isChecked = choiceSix == 1
|
|
|
+
|
|
|
binding.trainingTotal.text = String.format(
|
|
|
resources.getString(R.string.total_per_fee_format),
|
|
|
choiceSixTotalCost
|
|
|
)
|
|
|
|
|
|
+ if (choiceSix == 1) {
|
|
|
+ economyTotalPayment += choiceSixTotalCost
|
|
|
+ bussinessTotalPayment += choiceSixTotalCost
|
|
|
+ firstClassTotalPayment += choiceSixTotalCost
|
|
|
+ }
|
|
|
+
|
|
|
binding.checkOther.isChecked = otherExpenses_Checked == 1
|
|
|
+
|
|
|
binding.otherTotal.text = String.format(
|
|
|
resources.getString(R.string.total_per_fee_format),
|
|
|
otherExpensesTotalCost
|
|
|
)
|
|
|
|
|
|
- binding.economyClass.text = if (choiceTwoJJ == 1) {
|
|
|
- String.format(resources.getString(R.string.economy_class_price), outsideJJPay)
|
|
|
- } else {
|
|
|
- String.format(resources.getString(R.string.economy_class_price), 0.0)
|
|
|
- }
|
|
|
- binding.businessClass.text = if (choiceTwoGW == 1) {
|
|
|
- String.format(resources.getString(R.string.business_class_price), outsideGWPay)
|
|
|
- } else {
|
|
|
- String.format(resources.getString(R.string.business_class_price), 0.0)
|
|
|
- }
|
|
|
- binding.firstClass.text = if (choiceTwoTD == 1) {
|
|
|
- String.format(resources.getString(R.string.first_class_price), outsideTDPay)
|
|
|
- } else {
|
|
|
- String.format(resources.getString(R.string.first_class_price), 0.0)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- OASystem.entryAndExitDetailResponse.apply {
|
|
|
- economyTotalPayment =
|
|
|
- choiceOneTotalCost + outsideJJPay + choiceThreeTotalCost + choiceFourTotalCost + choiceFiveTotalCost
|
|
|
- bussinessTotalPayment =
|
|
|
- choiceOneTotalCost + outsideGWPay + choiceThreeTotalCost + choiceFourTotalCost + choiceFiveTotalCost
|
|
|
- firstClassTotalPayment =
|
|
|
- choiceOneTotalCost + outsideTDPay + choiceThreeTotalCost + choiceFourTotalCost + choiceFiveTotalCost
|
|
|
+ if (otherExpenses_Checked == 1) {
|
|
|
+ economyTotalPayment += otherExpensesTotalCost
|
|
|
+ bussinessTotalPayment += otherExpensesTotalCost
|
|
|
+ firstClassTotalPayment += otherExpensesTotalCost
|
|
|
}
|
|
|
|
|
|
binding.economyClassTotal.text = if (choiceTwoJJ == 1) {
|
|
@@ -313,6 +357,11 @@ class EntryAndExitFeeTotalFragment : BaseFragment<FragmentEntryAndExitFeeTotalBi
|
|
|
}
|
|
|
|
|
|
private fun exportPaymentToCollectionBill() {
|
|
|
+
|
|
|
+ if (!isAdded) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
apiService.exportPaymentToCollectionBill(groupId = OASystem.entryAndExitDetailResponse.diId)
|
|
|
.enqueue(object :
|
|
|
Callback<BaseResponse> {
|
|
@@ -335,6 +384,11 @@ class EntryAndExitFeeTotalFragment : BaseFragment<FragmentEntryAndExitFeeTotalBi
|
|
|
}
|
|
|
|
|
|
private fun downloadCustomerList() {
|
|
|
+
|
|
|
+ if (!isAdded) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
apiService.downloadCustomerList(DownloadCustomerListRequest(diId = OASystem.entryAndExitDetailResponse.diId)).enqueue(object : Callback<DownloadCustomerListResponse> {
|
|
|
override fun onResponse(
|
|
|
call: Call<DownloadCustomerListResponse>,
|