maade it so sales display points earned
This commit is contained in:
@@ -111,6 +111,7 @@ public class SaleDetailFragment extends Fragment {
|
||||
binding.llLoyaltyPoints.setVisibility(View.GONE);
|
||||
binding.cbUseLoyaltyPoints.setChecked(false);
|
||||
}
|
||||
updateTotal();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -420,6 +421,15 @@ public class SaleDetailFragment extends Fragment {
|
||||
}
|
||||
|
||||
binding.tvSaleDetailTotal.setText("Total: $" + String.format(Locale.getDefault(), "%.2f", total));
|
||||
|
||||
CustomerDTO customer = viewModel.getSelectedCustomerData().getValue();
|
||||
if (customer != null && !viewModel.isViewOnly()) {
|
||||
int pointsToEarn = total.max(BigDecimal.ZERO).intValue();
|
||||
binding.tvPointsToEarn.setText("+" + pointsToEarn + " pts");
|
||||
binding.llPointsToEarn.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
binding.llPointsToEarn.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void saveSale() {
|
||||
|
||||
@@ -444,6 +444,30 @@
|
||||
android:textColor="@color/accent_coral"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="12dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llPointsToEarn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="4dp"
|
||||
android:visibility="gone">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Points to earn: "
|
||||
android:textColor="#4ECDC4"
|
||||
android:textSize="13sp"/>
|
||||
<TextView
|
||||
android:id="@+id/tvPointsToEarn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+0 pts"
|
||||
android:textColor="#4ECDC4"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user