Advertisement
Guest User

Untitled

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