Skip to content

Commit

Permalink
fix: delete receipt lines
Browse files Browse the repository at this point in the history
  • Loading branch information
iRaySpace committed May 8, 2019
1 parent bd5df71 commit 09e21c8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
Empty file added android/hs_err_pid6492.log
Empty file.
4 changes: 2 additions & 2 deletions src/store/PosStore/ReceiptStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const Receipt = types
clear() {
self.discount = "";
self.discountValue = 0;
self.taxesValue = 0;
self.taxesValue = "0";

// Yay!
self.lines.splice(0, self.lines.length);
Expand Down Expand Up @@ -629,7 +629,7 @@ const Store = types
status: doc.status,
reason: doc.reason,
customer: doc.customer,
taxesValue: doc.taxesValue,
taxesValue: doc.taxesValue.toString(),
taxesAmount: doc.taxesAmount > 0 ? doc.taxesAmount : 0,
receiptNumber: doc.receiptNumber,
discountName: doc.discountName,
Expand Down
39 changes: 28 additions & 11 deletions src/stories/components/EditCheckBoxComponent.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
import * as React from "react";
import { View, Text, StyleSheet } from "react-native";
import { CheckBox } from "native-base";
import { CheckBox, Toast } from "native-base";

const EditCheckBoxComponent = props => (
<View style={styles.view}>
<CheckBox
style={styles.checkbox}
checked={props.checked}
onPress={props.onPress}
/>
<Text style={styles.text}>{props.label}</Text>
</View>
);
class EditCheckBoxComponent extends React.PureComponent {
onPress() {
const { disabled, onPress } = this.props;
if (disabled) {
Toast.show({
text: "Please click the edit (pencil icon) button",
buttonText: "Okay",
});
} else {
onPress();
}
}

render() {
const { checked, label } = this.props;
return (
<View style={styles.view}>
<CheckBox
style={styles.checkbox}
checked={checked}
onPress={this.onPress}
/>
<Text style={styles.text}>{label}</Text>
</View>
);
}
}

const styles = StyleSheet.create({
view: {
Expand Down
1 change: 1 addition & 0 deletions src/stories/components/SyncComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class CompanyComponent extends React.PureComponent {
label="Is HTTPs"
checked={isHttps}
onPress={toggleIsHttps}
disabled={!syncEditStatus}
/>
<EditInput
secure={false}
Expand Down

0 comments on commit 09e21c8

Please sign in to comment.