Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.02 KB | None | 0 0
  1. import React, { Component } from "react";
  2. import { Collapse, CollapseHeader, CollapseBody } from "accordion-collapse-react-native";
  3. import {
  4. Platform,
  5. StyleSheet,
  6. View,
  7. Image,
  8. Text,
  9. StatusBar,
  10. ScrollView,
  11. AsyncStorage,
  12. FlatList,
  13. Alert,
  14. TouchableOpacity,
  15. ActivityIndicator
  16. } from "react-native";
  17. import {
  18. Container,
  19. Header,
  20. Title,
  21. Content,
  22. Footer,
  23. FooterTab,
  24. Button,
  25. Left,
  26. Right,
  27. Card,
  28. CardItem,
  29. Body,
  30. Fab,
  31. Textarea,
  32. Icon,
  33. Picker,
  34. Form,
  35. Input,
  36. Label,
  37. Item,
  38. Accordion,
  39. Thumbnail, List, Separator
  40. } from "native-base";
  41.  
  42. import GlobalConfig from '../../components/GlobalConfig';
  43. import styles from "../styles/Financial";
  44. import colors from "../../../styles/colors";
  45.  
  46. class ListItem extends React.PureComponent {
  47. render() {
  48. return (
  49. <View style={[styles.container]}>
  50. <View style={{width:'100%', paddingTop: 3, paddingLeft:10, paddingRight:10,marginBottom:5,}}>
  51. <View>
  52. <Collapse>
  53. <CollapseHeader>
  54. <Separator bordered>
  55. <Text>FORWARD</Text>
  56. </Separator>
  57. </CollapseHeader>
  58. <CollapseBody>
  59. <View>
  60. <Text>{this.props.data.rule_statement}</Text>
  61. <Text>{this.props.data.rule_statement}</Text>
  62. </View>
  63. </CollapseBody>
  64. </Collapse>
  65. </View>
  66. </View>
  67. </View>
  68. );
  69. }
  70. }
  71.  
  72. export default class FincanialInput extends Component {
  73. constructor(props) {
  74. super(props);
  75. this.state = {
  76. active: 'true',
  77. dataSource: [],
  78. isLoading: true,
  79. tabNumber:'tab1',
  80. visibleDialogSubmit: false,
  81. enableScrollViewScroll: true,
  82. sub_kategori_id:'',
  83. value:'',
  84. idUser:'',
  85. tabungan:'22000000',
  86. deposito:'',
  87. rumah:'500000000',
  88. mobil:'',
  89. motor:'25000000',
  90. pribadi:'',
  91. sewa:'',
  92. kos:'',
  93. unit:'7000000',
  94. saham:'',
  95. emas:'',
  96. mitra:'',
  97. kredit:'',
  98. kendaraan:'',
  99. kpr:'418000000',
  100. tetap:'8000000',
  101. ttetap:'2000000',
  102. ptabungan:'1000000',
  103. amal:'200000',
  104. pkpr:'2500000',
  105. tkpr:'',
  106. kkendaraan:'',
  107. asuransi:'1000000',
  108. pajak:'2200000',
  109. lifestyle:'1300000',
  110. liburan:'',
  111. kebutuhan:'3000000',
  112. resultData:[],
  113. resultDataRule:[],
  114.  
  115. rasioLikuid:'',
  116. rasioLikuidKekayaan:'',
  117. rasioTabungan:'',
  118. rasioHutangAsset:'',
  119. rasioPelunasanHutang:'',
  120. rasioAssetInvestKekayaan:'',
  121.  
  122. likuiditasState1:'',
  123. likuiditasSaran1:'',
  124. likuiditasState2:'',
  125. likuiditasSaran2:'',
  126. likuiditasState3:'',
  127. likuiditasSaran3:'',
  128. likuiditasState4:'',
  129. likuiditasSaran4:'',
  130. likuiditasState5:'',
  131. likuiditasSaran5:'',
  132. likuiditasState6:'',
  133. likuiditasSaran6:'',
  134.  
  135.  
  136. };
  137. }
  138.  
  139.  
  140.  
  141. static navigationOptions = {
  142. header: null
  143. };
  144.  
  145.  
  146. componentDidMount() {
  147. AsyncStorage.getItem("profil").then(dataUser => {
  148. this.setState({ idUser: JSON.parse(dataUser).id });
  149. });
  150. this._onFocusListener = this.props.navigation.addListener(
  151. "didFocus",
  152. payload => {
  153. this.setState({
  154. visibleDialogSubmit: false
  155. });
  156. }
  157. );
  158.  
  159. }
  160.  
  161. validasiFieldTab1(){
  162. this.setState({
  163. tabNumber:'tab2'
  164. })
  165.  
  166. }
  167.  
  168. validasiFieldTab2(){
  169. this.setState({
  170. tabNumber:'tab3'
  171. })
  172.  
  173. }
  174.  
  175. validasiFieldTab3(){
  176. this.setState({
  177. tabNumber:'tab4'
  178. })
  179. }
  180.  
  181. validasiFieldTab4(){
  182. this.setState({
  183. tabNumber:'tab5'
  184. })
  185. }
  186.  
  187.  
  188. financialCreate(){
  189. this.setState({
  190. visibleDialogSubmit: true
  191. });
  192.  
  193. var myArray=[
  194. {
  195. "sub_kategori_id":17,
  196. 'value':this.state.tabungan
  197. },
  198. {
  199. "sub_kategori_id":18,
  200. 'value':this.state.deposito
  201. },
  202. {
  203. "sub_kategori_id":19,
  204. 'value':this.state.rumah
  205. },
  206. {
  207. "sub_kategori_id":20,
  208. 'value':this.state.mobil
  209. },
  210. {
  211. "sub_kategori_id":21,
  212. 'value':this.state.motor
  213. },
  214. {
  215. "sub_kategori_id":22,
  216. 'value':this.state.pribadi
  217. },
  218. {
  219. "sub_kategori_id":23,
  220. 'value':this.state.sewa
  221. },
  222. {
  223. "sub_kategori_id":24,
  224. 'value':this.state.kos
  225. },
  226. {
  227. "sub_kategori_id":25,
  228. 'value':this.state.unit
  229. },
  230. {
  231. "sub_kategori_id":26,
  232. 'value':this.state.saham
  233. },
  234. {
  235. "sub_kategori_id":27,
  236. 'value':this.state.emas
  237. },
  238. {
  239. "sub_kategori_id":28,
  240. 'value':this.state.mitra
  241. },
  242. {
  243. "sub_kategori_id":29,
  244. 'value':this.state.kredit
  245. },
  246. {
  247. "sub_kategori_id":30,
  248. 'value':this.state.kendaraan
  249. },
  250. {
  251. "sub_kategori_id":31,
  252. 'value':this.state.kpr
  253. },
  254. {
  255. "sub_kategori_id":8,
  256. 'value':this.state.tetap
  257. },
  258. {
  259. "sub_kategori_id":9,
  260. 'value':this.state.ttetap
  261. },
  262. {
  263. "sub_kategori_id":10,
  264. 'value':this.state.ptabungan
  265. },
  266. {
  267. "sub_kategori_id":11,
  268. 'value':this.state.amal
  269. },
  270. {
  271. "sub_kategori_id":33,
  272. 'value':this.state.pkpr
  273. },
  274. {
  275. "sub_kategori_id":34,
  276. 'value':this.state.tkpr
  277. },
  278. {
  279. "sub_kategori_id":35,
  280. 'value':this.state.kkendaraan
  281. },
  282. {
  283. "sub_kategori_id":36,
  284. 'value':this.state.asuransi
  285. },
  286. {
  287. "sub_kategori_id":37,
  288. 'value':this.state.pajak
  289. },
  290. {
  291. "sub_kategori_id":38,
  292. 'value':this.state.lifestyle
  293. },
  294. {
  295. "sub_kategori_id":39,
  296. 'value':this.state.liburan
  297. },
  298. {
  299. "sub_kategori_id":40,
  300. 'value':this.state.kebutuhan
  301. },
  302.  
  303.  
  304. ];
  305.  
  306. var url = GlobalConfig.SERVERHOST + "add-inputan/"+this.state.idUser;
  307. var formData = new FormData();
  308. formData.append("data", JSON.stringify(myArray));
  309. //alert(JSON.stringify(myArray))
  310. //console.log(formData)
  311.  
  312.  
  313. fetch(url, {
  314. headers: {
  315. "Content-Type": "multipart/form-data"
  316. },
  317. method: "POST",
  318. body: formData,
  319. })
  320. .then(response => response.json())
  321. .then(response => {
  322. //alert(JSON.stringify(response))
  323. if (response.code == 302) {
  324.  
  325. this.setState({
  326. visibleDialogSubmit: false,
  327. tabNumber:'tab5'
  328. });
  329.  
  330. var urlCalculate = GlobalConfig.SERVERHOST + "hitungan/"+this.state.idUser;
  331. fetch(urlCalculate, {
  332. headers: {
  333. headers: {
  334. "Content-Type": "multipart/form-data"
  335. },
  336. },
  337. method: "GET",
  338. })
  339. .then(responseCalculate => responseCalculate.json())
  340. .then(responseCalculate => {
  341. if (responseCalculate.code == 302) {
  342. //alert(JSON.stringify(responseCalculate))
  343. this.setState({
  344. rasioLikuid: JSON.stringify(responseCalculate.data.rasioLikuid) ,
  345. rasioLikuidKekayaan: JSON.stringify(responseCalculate.data.rasioLikuidKekayaan),
  346. rasioTabungan: JSON.stringify(responseCalculate.data.rasioTabungan),
  347. rasioHutangAsset: JSON.stringify(responseCalculate.data.rasioHutangAsset),
  348. rasioPelunasanHutang : JSON.stringify(responseCalculate.data.rasioPelunasanHutang),
  349. rasioAssetInvestKekayaan : JSON.stringify(responseCalculate.data.rasioAssetInvestKekayaan),
  350.  
  351. likuiditasState1 : responseCalculate.dataRule[0].rule_statement,
  352. likuiditasSaran1: responseCalculate.dataRule[0].rule_saran,
  353.  
  354. likuiditasState2 : responseCalculate.dataRule[1].rule_statement,
  355. likuiditasSaran2: responseCalculate.dataRule[1].rule_saran,
  356.  
  357. likuiditasState3 : responseCalculate.dataRule[2].rule_statement,
  358. likuiditasSaran3 : responseCalculate.dataRule[2].rule_saran,
  359.  
  360. likuiditasState4 : responseCalculate.dataRule[3].rule_statement,
  361. likuiditasSaran4 : responseCalculate.dataRule[3].rule_saran,
  362.  
  363. likuiditasState5 : responseCalculate.dataRule[4].rule_statement,
  364. likuiditasSaran5: responseCalculate.dataRule[4].rule_saran,
  365.  
  366. likuiditasState6 : responseCalculate.dataRule[5].rule_statement,
  367. likuiditasSaran6 : responseCalculate.dataRule[5].rule_saran,
  368.  
  369. });
  370.  
  371. }
  372. })
  373. Alert.alert('Success', 'Create Financial Checkup Success', [{
  374. text: 'Okay'
  375. }]
  376. )
  377. } else {
  378. this.setState({
  379. visibleDialogSubmit: true
  380. });
  381. Alert.alert('Error', 'Create Financial Checkup Failed', [{
  382. text: 'Okay'
  383. }])
  384. }
  385. }).catch(error =>{
  386. // this.setState({
  387. // visibleDialogSubmit: false
  388. // });
  389. Alert.alert('Error', 'Create Financial Checkup Failed', [{
  390. text: 'Ok'
  391. }])
  392. //alert(error)
  393. })
  394. }
  395.  
  396.  
  397. focusNextField(nextField){
  398. this.ref[nextField].focus();
  399. }
  400.  
  401. _renderItem = ({ item, item2 }) => <ListItem data={item} data2={item2}/>;
  402.  
  403. render() {
  404. return (
  405. <Container style={styles.wrapper}>
  406. <Header style={styles.header}>
  407. <Left style={{flex:1}}>
  408. {this.state.tabNumber=='tab1' ? (
  409. <Button
  410. transparent
  411. onPress={() => this.props.navigation.navigate("HomeMenu")}
  412. >
  413. <Icon
  414. name="arrow-back"
  415. size={20}
  416.  
  417. />
  418. </Button>
  419. ):this.state.tabNumber=='tab2' ? (
  420. <Button
  421. transparent
  422. onPress={() => this.setState({
  423. tabNumber:'tab1'
  424. })}
  425. >
  426. <Icon
  427. name="arrow-back"
  428. size={20}
  429.  
  430. />
  431. </Button>
  432. ):this.state.tabNumber=='tab3' ? (
  433. <Button
  434. transparent
  435. onPress={() => this.setState({
  436. tabNumber:'tab2'
  437. })}
  438. >
  439. <Icon
  440. name="arrow-back"
  441. size={20}
  442.  
  443. />
  444. </Button>
  445. ):this.state.tabNumber=='tab4' ? (
  446. <Button
  447. transparent
  448. onPress={() => this.setState({
  449. tabNumber:'tab3'
  450. })}
  451. >
  452. <Icon
  453. name="arrow-back"
  454. size={20}
  455.  
  456. />
  457. </Button>
  458. ):(
  459. <Button
  460. transparent
  461. onPress={() => this.setState({
  462. tabNumber:'tab4'
  463. })}
  464. >
  465. <Icon
  466. name="arrow-back"
  467. size={20}
  468.  
  469. />
  470. </Button>
  471. )}
  472. </Left>
  473. <Body style={{ flex:3, alignItems:'center' }}>
  474. <Title style={styles.textbody}>Financial Checkup</Title>
  475. </Body>
  476. <Right style={{flex:1}}/>
  477. </Header>
  478. <StatusBar backgroundColor={colors.white} barStyle="light-content" />
  479. <View style={{ flex: 1 }}
  480. >
  481. <Content style={{ marginTop: 0 }}
  482. scrollEnabled={this.state.enableScrollViewScroll}
  483. ref={myScroll => (this._myScroll = myScroll)}>
  484. <View style={{ backgroundColor:colors.gray }}>
  485. {this.state.tabNumber=='tab1' ? (
  486. <View>
  487. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  488. <View style={{ flex: 1, flexDirection: 'row'}}>
  489. <View style={{width:'25%', alignItems:'center'}}>
  490. <Icon
  491. name="ios-radio-button-on"
  492. size={10}
  493. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  494. />
  495. <Text style={{fontSize:10, fontWeight:'bold'}}>Asset</Text>
  496. </View>
  497. <View style={{width:'25%', alignItems:'center'}}>
  498. <Icon
  499. name="ios-radio-button-on"
  500. size={10}
  501. style={{color: colors.graydar, fontSize: 20, paddingLeft:8}}
  502. />
  503. <Text style={{fontSize:10, fontWeight:'bold', color:colors.graydar}}>Hutang</Text>
  504. </View>
  505. <View style={{width:'25%', alignItems:'center'}}>
  506. <Icon
  507. name="ios-radio-button-on"
  508. size={10}
  509. style={{color: colors.graydar, fontSize: 20, paddingLeft:8}}
  510. />
  511. <Text style={{fontSize:10, fontWeight:'bold', color:colors.graydar}}>Pendapatan</Text>
  512. </View>
  513. <View style={{width:'25%', alignItems:'center'}}>
  514. <Icon
  515. name="ios-radio-button-on"
  516. size={10}
  517. style={{color: colors.graydar, fontSize: 20, paddingLeft:8}}
  518. />
  519. <Text style={{fontSize:10, fontWeight:'bold', color:colors.graydar}}>Pengeluaran</Text>
  520. </View>
  521. </View>
  522. </CardItem>
  523. <CardItem style={{ marginTop:'5%', backgroundColor:colors.white }}>
  524. <View style={{ flex: 1}}>
  525. <Item stackedLabel style={{marginTop:'5%'}}>
  526. <Label style={styles.weatherText}>KAS/Setarra Kas</Label>
  527. <Item floatingLabel >
  528. <Label>Tabungan</Label>
  529. <Input returnKeyType='next' keyboardType='numeric' value={this.state.tabungan} thousandSeparator={true} prefix={'Rp'} onChangeText={(text) => this.setState({ tabungan: text })} />
  530. </Item>
  531. <Item floatingLabel style={{marginTop:'2%'}}>
  532. <Label>Deposito</Label>
  533. <Input returnKeyType='next' keyboardType='numeric' value={this.state.deposito} onChangeText={(text) => this.setState({ deposito: text })} />
  534. </Item>
  535. </Item>
  536. <Item stackedLabel style={{marginTop:'5%'}}>
  537. <Label style={styles.weatherText}>Pribadi</Label>
  538. <Item floatingLabel>
  539. <Label>Rumah</Label>
  540. <Input returnKeyType='next' keyboardType='numeric' value={this.state.rumah} onChangeText={(text) => this.setState({ rumah: text })} />
  541. </Item>
  542. <Item floatingLabel style={{marginTop:'2%'}}>
  543. <Label>Mobil</Label>
  544. <Input returnKeyType='next' keyboardType='numeric' value={this.state.mobil} onChangeText={(text) => this.setState({ mobil: text })} />
  545. </Item>
  546. <Item floatingLabel style={{marginTop:'2%'}}>
  547. <Label>Motor</Label>
  548. <Input returnKeyType='next' keyboardType='numeric' value={this.state.motor} onChangeText={(text) => this.setState({ motor: text })} />
  549. </Item>
  550. <Item floatingLabel style={{marginTop:'2%'}}>
  551. <Label>Barang Pribadi</Label>
  552. <Input returnKeyType='next' keyboardType='numeric' value={this.state.pribadi} onChangeText={(text) => this.setState({ pribadi: text })} />
  553. </Item>
  554. </Item>
  555. <Item stackedLabel style={{marginTop:'5%'}}>
  556. <Label style={styles.weatherText}>Investasi</Label>
  557. <Item floatingLabel>
  558. <Label>Rumah Sewa</Label>
  559. <Input returnKeyType='next' keyboardType='numeric' value={this.state.sewa} onChangeText={(text) => this.setState({ sewa: text })} />
  560. </Item>
  561. <Item floatingLabel style={{marginTop:'2%'}}>
  562. <Label>Kos</Label>
  563. <Input returnKeyType='next' keyboardType='numeric' value={this.state.kos} onChangeText={(text) => this.setState({ kos: text })} />
  564. </Item>
  565. <Item floatingLabel style={{marginTop:'2%'}}>
  566. <Label>Unit Link</Label>
  567. <Input returnKeyType='next' keyboardType='numeric' value={this.state.unit} onChangeText={(text) => this.setState({ unit: text })} />
  568. </Item>
  569. <Item floatingLabel style={{marginTop:'2%'}}>
  570. <Label>Portfolio Saham</Label>
  571. <Input returnKeyType='next' keyboardType='numeric' value={this.state.saham} onChangeText={(text) => this.setState({ saham: text })} />
  572. </Item>
  573. <Item floatingLabel style={{marginTop:'2%'}}>
  574. <Label>Emas</Label>
  575. <Input returnKeyType='next' keyboardType='numeric' value={this.state.emas} onChangeText={(text) => this.setState({ emas: text })} />
  576. </Item>
  577. <Item floatingLabel style={{marginTop:'2%'}}>
  578. <Label>Kemitraan Usaha</Label>
  579. <Input returnKeyType='next' keyboardType='numeric' value={this.state.mitra} onChangeText={(text) => this.setState({ mitra: text })} />
  580. </Item>
  581. </Item>
  582. </View>
  583. </CardItem>
  584. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  585. <View style={{ flex: 1}}>
  586. <View style={styles.Contentsave}>
  587. <Button
  588. block
  589. style={{
  590. width:'100%',
  591. height: 45,
  592. marginBottom: 20,
  593. borderWidth: 1,
  594. backgroundColor: "#525252",
  595. borderColor: "#525252"
  596.  
  597. }}
  598. onPress={() => this.validasiFieldTab1()}
  599. >
  600. <Text style={{color:colors.white}}>Lanjutkan</Text>
  601. </Button>
  602. </View>
  603. </View>
  604. </CardItem>
  605. </View>
  606. ):this.state.tabNumber=='tab2' ? (
  607. <View>
  608. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.white}}>
  609. <View style={{ flex: 1, flexDirection: 'row'}}>
  610. <View style={{width:'25%', alignItems:'center'}}>
  611. <Icon
  612. name="ios-radio-button-on"
  613. size={20}
  614. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  615. />
  616. <Text style={{fontSize:10, fontWeight:'bold'}}>Asset</Text>
  617. </View>
  618. <View style={{width:'25%', alignItems:'center'}}>
  619. <Icon
  620. name="ios-radio-button-on"
  621. size={20}
  622. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  623. />
  624. <Text style={{fontSize:10, fontWeight:'bold'}}>Hutang</Text>
  625. </View>
  626. <View style={{width:'25%', alignItems:'center'}}>
  627. <Icon
  628. name="ios-radio-button-on"
  629. size={20}
  630. style={{color: colors.graydar, fontSize: 20, paddingLeft:8}}
  631. />
  632. <Text style={{fontSize:10, fontWeight:'bold', color:colors.graydar}}>Pendapatan</Text>
  633. </View>
  634. <View style={{width:'25%', alignItems:'center'}}>
  635. <Icon
  636. name="ios-radio-button-on"
  637. size={20}
  638. style={{color: colors.graydar, fontSize: 20, paddingLeft:8}}
  639. />
  640. <Text style={{fontSize:10, fontWeight:'bold', color:colors.graydar}}>Pengeluaran</Text>
  641. </View>
  642. </View>
  643. </CardItem>
  644. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.white}}>
  645. <View style={{ flex: 1}}>
  646. <Item stackedLabel style={{marginTop:'5%'}}>
  647. <Label style={styles.weatherText}>Jangka Pendek</Label>
  648. <Item floatingLabel>
  649. <Label>Kartu Kredit</Label>
  650. <Input returnKeyType='next' keyboardType='numeric' value={this.state.kredit} onChangeText={(text) => this.setState({ kredit: text })} />
  651. </Item>
  652. </Item>
  653. <Item stackedLabel style={{marginTop:'5%'}}>
  654. <Label style={styles.weatherText}>Jangka Panjang</Label>
  655. <Item floatingLabel>
  656. <Label>Kendaraan (motor, mobil, dll)</Label>
  657. <Input returnKeyType='next' keyboardType='numeric' value={this.state.kendaraan} onChangeText={(text) => this.setState({ kendaraan: text })} />
  658. </Item>
  659. <Item floatingLabel style={{marginTop:'2%'}}>
  660. <Label>Pinjaman Hipotek (KPR)</Label>
  661. <Input returnKeyType='next' keyboardType='numeric' value={this.state.kpr} onChangeText={(text) => this.setState({ kpr: text })} />
  662. </Item>
  663. </Item>
  664. </View>
  665. </CardItem>
  666. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  667. <View style={{ flex: 1}}>
  668. <View style={styles.Contentsave}>
  669. <Button
  670. block
  671. style={{
  672. width:'100%',
  673. height: 45,
  674. marginBottom: 20,
  675. borderWidth: 1,
  676. backgroundColor: "#525252",
  677. borderColor: "#525252"
  678. }}
  679. onPress={() => this.validasiFieldTab2()}
  680. >
  681. <Text style={{color:colors.white}}>Lanjutkan</Text>
  682. </Button>
  683. </View>
  684. </View>
  685. </CardItem>
  686. </View>
  687. ):this.state.tabNumber=='tab3' ? (
  688. <View>
  689. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  690. <View style={{ flex: 1, flexDirection: 'row'}}>
  691. <View style={{width:'25%', alignItems:'center'}}>
  692. <Icon
  693. name="ios-radio-button-on"
  694. size={20}
  695. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  696. />
  697. <Text style={{fontSize:10, fontWeight:'bold'}}>Asset</Text>
  698. </View>
  699. <View style={{width:'25%', alignItems:'center'}}>
  700. <Icon
  701. name="ios-radio-button-on"
  702. size={20}
  703. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  704. />
  705. <Text style={{fontSize:10, fontWeight:'bold'}}>Hutang</Text>
  706. </View>
  707. <View style={{width:'25%', alignItems:'center'}}>
  708. <Icon
  709. name="ios-radio-button-on"
  710. size={20}
  711. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  712. />
  713. <Text style={{fontSize:10, fontWeight:'bold'}}>Pendapatan</Text>
  714. </View>
  715. <View style={{width:'25%', alignItems:'center'}}>
  716. <Icon
  717. name="ios-radio-button-on"
  718. size={20}
  719. style={{color: colors.graydar, fontSize: 20, paddingLeft:8}}
  720. />
  721. <Text style={{fontSize:10, fontWeight:'bold', color:colors.graydar}}>Pengeluaran</Text>
  722. </View>
  723. </View>
  724. </CardItem>
  725. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.white}}>
  726. <View style={{ flex: 1}}>
  727. <Item stackedLabel style={{marginTop:'5%'}}>
  728. <Label style={styles.weatherText}>Gaji Tetap</Label>
  729. <Item floatingLabel>
  730. <Label>Income</Label>
  731. <Input returnKeyType='next' keyboardType='numeric' value={this.state.tetap} onChangeText={(text) => this.setState({ tetap: text })} />
  732. </Item>
  733. </Item>
  734. <Item stackedLabel style={{marginTop:'5%'}}>
  735. <Label style={styles.weatherText}>Gaji Tidak Tetap</Label>
  736. <Item floatingLabel>
  737. <Label>Income</Label>
  738. <Input returnKeyType='next' keyboardType='numeric' value={this.state.ttetap} onChangeText={(text) => this.setState({ ttetap: text })} />
  739. </Item>
  740. </Item>
  741. </View>
  742. </CardItem>
  743. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  744. <View style={{ flex: 1}}>
  745. <View style={styles.Contentsave}>
  746. <Button
  747. block
  748. style={{
  749. width:'100%',
  750. height: 45,
  751. marginBottom: 20,
  752. borderWidth: 1,
  753. backgroundColor: "#525252",
  754. borderColor: "#525252"
  755.  
  756. }}
  757. onPress={() => this.validasiFieldTab3()}
  758. >
  759. <Text style={{color:colors.white}}>Lanjutkan</Text>
  760. </Button>
  761. </View>
  762. </View>
  763. </CardItem>
  764. </View>
  765. ):this.state.tabNumber=='tab4' ? (
  766. <View>
  767. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  768. <View style={{ flex: 1, flexDirection: 'row'}}>
  769. <View style={{width:'25%', alignItems:'center'}}>
  770. <Icon
  771. name="ios-radio-button-on"
  772. size={20}
  773. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  774. />
  775. <Text style={{fontSize:10, fontWeight:'bold'}}>Asset</Text>
  776. </View>
  777. <View style={{width:'25%', alignItems:'center'}}>
  778. <Icon
  779. name="ios-radio-button-on"
  780. size={20}
  781. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  782. />
  783. <Text style={{fontSize:10, fontWeight:'bold'}}>Hutang</Text>
  784. </View>
  785. <View style={{width:'25%', alignItems:'center'}}>
  786. <Icon
  787. name="ios-radio-button-on"
  788. size={20}
  789. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  790. />
  791. <Text style={{fontSize:10, fontWeight:'bold'}}>Pendapatan</Text>
  792. </View>
  793. <View style={{width:'25%', alignItems:'center'}}>
  794. <Icon
  795. name="ios-radio-button-on"
  796. size={20}
  797. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  798. />
  799. <Text style={{fontSize:10, fontWeight:'bold'}}>Pengeluaran</Text>
  800. </View>
  801. </View>
  802. </CardItem>
  803. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.white}}>
  804. <View style={{ flex: 1}}>
  805. <Item stackedLabel style={{marginTop:'5%'}}>
  806. <Item floatingLabel>
  807. <Label>Tabungan</Label>
  808. <Input returnKeyType='next' keyboardType='numeric' value={this.state.ptabungan} onChangeText={(text) => this.setState({ ptabungan: text })} />
  809. </Item>
  810. <Item floatingLabel style={{marginTop:'5%'}}>
  811. <Label>Sosial (amal)</Label>
  812. <Input returnKeyType='next' keyboardType='numeric' value={this.state.amal} onChangeText={(text) => this.setState({ amal: text })} />
  813. </Item>
  814. </Item>
  815. <Item stackedLabel style={{marginTop:'5%'}}>
  816. <Label style={styles.weatherText}>Pengeluaran Tetap</Label>
  817. <Item floatingLabel>
  818. <Label>KPR (Kredit Rumah)</Label>
  819. <Input returnKeyType='next' keyboardType='numeric' value={this.state.pkpr} onChangeText={(text) => this.setState({ pkpr: text })} />
  820. </Item>
  821. <Item floatingLabel style={{marginTop:'2%'}}>
  822. <Label>Tambahan KPR</Label>
  823. <Input returnKeyType='next' keyboardType='numeric' value={this.state.tkpr} onChangeText={(text) => this.setState({ tkpr: text })} />
  824. </Item>
  825. <Item floatingLabel style={{marginTop:'2%'}}>
  826. <Label>Kredit Kendaraan (motor/mobil/dll)</Label>
  827. <Input returnKeyType='next' keyboardType='numeric' value={this.state.kkendaraan} onChangeText={(text) => this.setState({ kkendaraan: text })} />
  828. </Item>
  829. <Item floatingLabel style={{marginTop:'2%'}}>
  830. <Label>Asuransi (Jiwa,Kendaraan, dll)</Label>
  831. <Input returnKeyType='next' keyboardType='numeric' value={this.state.asuransi} onChangeText={(text) => this.setState({ asuransi: text })} />
  832. </Item>
  833. </Item>
  834. <Item stackedLabel style={{marginTop:'5%'}}>
  835. <Label style={styles.weatherText}>Pengeluaran Variabel (tidak tetap)</Label>
  836. <Item floatingLabel>
  837. <Label>Pajak</Label>
  838. <Input returnKeyType='next' keyboardType='numeric' value={this.state.pajak} onChangeText={(text) => this.setState({ pajak: text })} />
  839. </Item>
  840. <Item floatingLabel style={{marginTop:'2%'}}>
  841. <Label>Lifestyle</Label>
  842. <Input returnKeyType='next' keyboardType='numeric' value={this.state.lifestyle} onChangeText={(text) => this.setState({ lifestyle: text })} />
  843. </Item>
  844. <Item floatingLabel style={{marginTop:'2%'}}>
  845. <Label>Liburan</Label>
  846. <Input returnKeyType='next' keyboardType='numeric' value={this.state.liburan} onChangeText={(text) => this.setState({ liburan: text })} />
  847. </Item>
  848. <Item floatingLabel style={{marginTop:'2%'}}>
  849. <Label>Kebutuhan Pokok</Label>
  850. <Input returnKeyType='next' keyboardType='numeric' value={this.state.kebutuhan} onChangeText={(text) => this.setState({ kebutuhan: text })} />
  851. </Item>
  852. </Item>
  853. </View>
  854. </CardItem>
  855. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  856. <View style={{ flex: 1}}>
  857. <View style={styles.Contentsave}>
  858. <Button
  859. block
  860. style={{
  861. width:'100%',
  862. height: 45,
  863. marginBottom: 20,
  864. borderWidth: 1,
  865. backgroundColor: "#525252",
  866. borderColor: "#525252"
  867.  
  868. }}
  869. onPress={() => this.financialCreate()}
  870. >
  871. <Text style={{color:colors.white}}>Hitung Kondisi Keuangan</Text>
  872. </Button>
  873. </View>
  874. </View>
  875. </CardItem>
  876. </View>
  877. ):this.state.tabNumber=='tab5' ?(
  878. <View>
  879. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.gray }}>
  880. <View style={{ flex: 1, flexDirection: 'row'}}>
  881. <View style={{width:'100%', alignItems:'center'}}>
  882. <Icon
  883. name="ios-radio-button-on"
  884. size={20}
  885. style={{color: colors.red, fontSize: 20, paddingLeft:8}}
  886. />
  887. <Text style={{fontSize:10, fontWeight:'bold'}}>HASIL</Text>
  888. </View>
  889. </View>
  890. </CardItem>
  891. <CardItem style={{ borderRadius: 0, marginTop:0, backgroundColor:colors.white}}>
  892. <View style={{ flex: 1}}>
  893. <Container>
  894. <Content padder style={{color: colors.blue}}>
  895. <View>
  896. <Collapse>
  897. <CollapseHeader style={{height:40}}>
  898. <Separator bordered>
  899. <Text style={{fontWeight:"bold", marginBottom: -5}}>Likuiditas</Text>
  900. </Separator>
  901. </CollapseHeader>
  902. <CollapseBody>
  903. <View>
  904. <Text style={{marginLeft:10, marginTop:10}}>Nilai : {this.state.rasioLikuid} Bulan</Text>
  905. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Statement : {"\n"}{this.state.likuiditasState1}</Text>
  906. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Saran : {"\n"}{this.state.likuiditasSaran1}{"\n"}</Text>
  907. </View>
  908. </CollapseBody>
  909. </Collapse>
  910. <Collapse>
  911. <CollapseHeader style={{height:55}}>
  912. <Separator bordered>
  913. <Text style={{fontWeight:"bold", marginBottom: -5,paddingRight:40}}>Aset Likuiditas dibanding Nilai Bersih Kekayaan</Text>
  914. </Separator>
  915. </CollapseHeader>
  916. <CollapseBody>
  917. <View>
  918. <Text style={{marginLeft:10, marginTop:10}}>Nilai : {this.state.rasioLikuidKekayaan} %</Text>
  919. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Statement : {"\n"}{this.state.likuiditasState2}</Text>
  920. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Saran : {"\n"}{this.state.likuiditasSaran2}{"\n"}</Text>
  921. </View>
  922. </CollapseBody>
  923. </Collapse>
  924. <Collapse>
  925. <CollapseHeader style={{height:40}}>
  926. <Separator bordered>
  927. <Text style={{fontWeight:"bold", marginBottom: -5}}>Tabungan</Text>
  928. </Separator>
  929. </CollapseHeader>
  930. <CollapseBody>
  931. <View>
  932. <Text style={{marginLeft:10, marginTop:10}}>Nilai : {this.state.rasioTabungan} %</Text>
  933. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Statement : {"\n"}{this.state.likuiditasState3}</Text>
  934. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Saran : {"\n"}{this.state.likuiditasSaran3}{"\n"}</Text>
  935. </View>
  936. </CollapseBody>
  937. </Collapse>
  938. <Collapse>
  939. <CollapseHeader style={{height:40}}>
  940. <Separator bordered>
  941. <Text style={{fontWeight:"bold", marginBottom: -5}}>Perbandngan Hutang terhadap Aset</Text>
  942. </Separator>
  943. </CollapseHeader>
  944. <CollapseBody>
  945. <View>
  946. <Text style={{marginLeft:10, marginTop:10}}>Nilai : {this.state.rasioHutangAsset} %</Text>
  947. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Statement : {"\n"}{this.state.likuiditasState4}</Text>
  948. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Saran : {"\n"}{this.state.likuiditasSaran4}{"\n"}</Text>
  949. </View>
  950. </CollapseBody>
  951. </Collapse>
  952. <Collapse>
  953. <CollapseHeader style={{height:40}}>
  954. <Separator bordered>
  955. <Text style={{fontWeight:"bold", marginBottom: -5}}>Kemampuan Pelunasan Hutang</Text>
  956. </Separator>
  957. </CollapseHeader>
  958. <CollapseBody>
  959. <View>
  960. <Text style={{marginLeft:10, marginTop:10}}>Nilai : {this.state.rasioPelunasanHutang} %</Text>
  961. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Statement : {"\n"}{this.state.likuiditasState5}</Text>
  962. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Saran : {"\n"}{this.state.likuiditasSaran5}{"\n"}</Text>
  963. </View>
  964. </CollapseBody>
  965. </Collapse>
  966. <Collapse>
  967. <CollapseHeader style={{height:55}}>
  968. <Separator bordered>
  969. <Text style={{fontWeight:"bold", marginBottom: -5, paddingRight:40}}>Perbandingan Nilai Bersih Aset Investasi terhadap Nilai Bersih Kekayaan</Text>
  970. </Separator>
  971. </CollapseHeader>
  972. <CollapseBody>
  973. <View>
  974. <Text style={{marginLeft:10, marginTop:10}}>Nilai : {this.state.rasioAssetInvestKekayaan} %</Text>
  975. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Statement : {"\n"}{this.state.likuiditasState6}</Text>
  976. <Text style={{marginLeft:10, marginTop:10}}>{"\n"}Saran : {"\n"}{this.state.likuiditasSaran6}{"\n"}</Text>
  977. </View>
  978. </CollapseBody>
  979. </Collapse>
  980.  
  981.  
  982.  
  983. </View>
  984.  
  985. <View
  986. style={{
  987. marginLeft: "40%",
  988. marginTop: 10,
  989. width: 80,
  990. height: 80,
  991. justifyContent: "center",
  992. alignItems: "baseline",
  993.  
  994. }}
  995. >
  996. <TouchableOpacity
  997. transparent
  998. onPress={() =>
  999. //this.navigateToScreen("ListHistory", this.state.id)
  1000. this.props.navigation.navigate("HomeMenu")
  1001. }
  1002. >
  1003. <Image
  1004. source={require("../../../assets/images/Home.png")}
  1005. style={{ width: 60, height: 60 }}
  1006. />
  1007. <Text style={{ fontSize: 15, textAlign: "center" }}>Home</Text>
  1008. </TouchableOpacity>
  1009. </View>
  1010. </Content>
  1011.  
  1012. </Container>
  1013.  
  1014. </View>
  1015. </CardItem>
  1016.  
  1017. </View>
  1018. ):(
  1019. <View></View>
  1020. )}
  1021. </View>
  1022. </Content>
  1023. </View>
  1024. </Container>
  1025.  
  1026. );
  1027. }
  1028. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement