void by invoice
This commit is contained in:
parent
1e29fd9fab
commit
afd3d925e1
@ -13,6 +13,39 @@
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="unitTest">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-01-20T10:19:44.274945Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=0123456789ABCDEF" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="androidTest">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-01-20T10:19:44.274945Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=0123456789ABCDEF" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="main">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-01-20T10:19:44.274945Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=0123456789ABCDEF" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
@ -116,7 +116,14 @@ public class InputTraceNoFragment extends DataBindingFragment {
|
||||
|
||||
clearInputView();
|
||||
|
||||
setToolBarTitleWithBackIcon(getResourceString(R.string.title_trace_number));
|
||||
TransactionsType currentTransType = sharedViewModel.transactionsType.getValue();
|
||||
if (currentTransType == TransactionsType.VOID
|
||||
|| currentTransType == TransactionsType.TIP_ADJUSTMENT
|
||||
|| currentTransType == TransactionsType.PRE_AUTH_COMPLETE_VOID) {
|
||||
setToolBarTitleWithBackIcon(getResourceString(R.string.title_invoice_number));
|
||||
} else {
|
||||
setToolBarTitleWithBackIcon(getResourceString(R.string.title_trace_number));
|
||||
}
|
||||
|
||||
if (sharedViewModel.isEcr.getValue() != null) {
|
||||
if (sharedViewModel.isEcr.getValue()) {
|
||||
@ -151,10 +158,9 @@ public class InputTraceNoFragment extends DataBindingFragment {
|
||||
configTime = "23:00";
|
||||
}
|
||||
|
||||
LogUtil.d(TAG,"Input trace :"+traceNo);
|
||||
LogUtil.d(TAG,"Input invoice :"+traceNo);
|
||||
|
||||
// voidViewModel.getGenericVoidTransactions(transType,POSUtil.getInstance().formatTrace(traceNo),isEmv).observe(getViewLifecycleOwner(), new Observer<PayDetail>() {
|
||||
voidViewModel.getVoidTrans(transType,POSUtil.getInstance().formatTrace(traceNo)).observe(getViewLifecycleOwner(), new Observer<PayDetail>() {
|
||||
voidViewModel.getVoidTransByInvoice(transType, POSUtil.getInstance().formatTrace(traceNo)).observe(getViewLifecycleOwner(), new Observer<PayDetail>() {
|
||||
@Override
|
||||
public void onChanged(PayDetail payDetail) {
|
||||
|
||||
|
||||
@ -39,6 +39,10 @@ public class VoidViewModel extends ViewModel {
|
||||
return repository.getVoidTransaction(transType,voucherNo);
|
||||
}
|
||||
|
||||
public LiveData<PayDetail> getVoidTransByInvoice(int transType, String invoiceNo) {
|
||||
return repository.getVoidTransactionByInvoice(transType, invoiceNo);
|
||||
}
|
||||
|
||||
|
||||
public void observeVoidTrans(int transType) {
|
||||
getVoidTransactions(transType).observeForever(new Observer<List<PayDetail>>() {
|
||||
|
||||
@ -120,6 +120,9 @@ public interface PayDetailDao {
|
||||
@Query("SELECT * FROM paydetail WHERE isSettle = 0 AND transactionType IN(:transType) AND voucherNo IN(:voucherNo)")
|
||||
LiveData<PayDetail> getVoidTrans(int transType,String voucherNo);
|
||||
|
||||
@Query("SELECT * FROM paydetail WHERE isSettle = 0 AND transactionType IN(:transType) AND invoiceNo IN(:invoiceNo)")
|
||||
LiveData<PayDetail> getVoidTransByInvoice(int transType, String invoiceNo);
|
||||
|
||||
// 5 = PRE_SALE
|
||||
|
||||
@Query("SELECT * FROM paydetail WHERE isCanceled = 0 AND transactionType = 5 AND voucherNo IN(:voucherNo) AND accountType != 'MPU'")
|
||||
|
||||
@ -185,7 +185,10 @@ public class Repository {
|
||||
|
||||
public LiveData<PayDetail> getVoidTransaction(int transType,String voucherNo) {
|
||||
return payDetailDao.getVoidTrans(transType,voucherNo);
|
||||
}
|
||||
|
||||
public LiveData<PayDetail> getVoidTransactionByInvoice(int transType, String invoiceNo) {
|
||||
return payDetailDao.getVoidTransByInvoice(transType, invoiceNo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user