Skip to content

Commit

Permalink
fix: set device id for receipts syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
iRaySpace committed May 10, 2019
1 parent 8276e45 commit cd13dce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/container/PaymentContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default class PaymentContainer extends React.Component {
.then(res => setCurrentTable(-1));
}

async onPay() {
onPay = async () => {
const paymentValue = parseFloat(this.props.stateStore.payment_value);
const amountDue = parseFloat(this.props.stateStore.amount_due);

Expand All @@ -177,7 +177,13 @@ export default class PaymentContainer extends React.Component {
finalReceiptNumber = finalReceiptNumber + "0";
}
finalReceiptNumber = finalReceiptNumber + receiptNumber.toString();
let receiptCurrent = this.props.receiptStore.defaultReceipt;

const receiptCurrent = this.props.receiptStore.defaultReceipt;
const { deviceId } = this.props.stateStore;

if (deviceId) {
receiptCurrent.setDeviceId(deviceId);
}

BluetoothSerial.isConnected().then(res => {
let totalPurchase = 0.0;
Expand Down Expand Up @@ -1117,7 +1123,7 @@ export default class PaymentContainer extends React.Component {
? this.props.receiptStore.defaultCustomer.name.toString()
: "Default customer"
}
onPay={() => this.onPay()}
onPay={this.onPay}
onPrinterChange={value => this.onPrinterChange(value)}
searchCustomer={text => this.searchCustomer(text)}
searchedCustomers={this.state.arrayObjects}
Expand Down

0 comments on commit cd13dce

Please sign in to comment.