Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Container, Content, Icon, Text, View } from 'native-base'
import { Colors } from '../../Themes'
import LoginActions from '../../Redux/LoginRedux'
import I18n from '../../I18n'
import { FlatList, Image, RefreshControl, StatusBar, StyleSheet, TouchableOpacity } from 'react-native'
import { createPaymentUrl, ifIphoneX, lang, TWAlert } from '../../Lib/functions'
import { appFont, boldFont, regularFont } from '../../Config/Globals'
import { FormInput, FormItem, FormPicker } from '../../Components/Form'
export async function createPaymentUrl (total_price, test = false) {
const api = apisauce.create({
baseURL: 'https://api.upayments.com',
headers: {
'Cache-Control': 'no-cache',
'content-type': 'application/json',
},
timeout: 10000,
})
@midoalone
midoalone / Tools
Created January 26, 2022 12:55
Tools and libraries we use on our react native apps
1- For debugging we use Reactotron
https://github.com/infinitered/reactotron
2- For Redux we use reduxsauce
https://github.com/jkeam/reduxsauce
3- For API calls we use apisauce
https://github.com/infinitered/apisauce
4- For UI Components we mainly use UI Kitten System
<?php
namespace App\Containers\Returned\Tasks;
use App\Containers\Accounthistories\Models\Accounthistories;
use App\Containers\Accounts\Models\Accounts;
use App\Containers\Products\Models\Products;
use App\Containers\Returned\Data\Repositories\ReturnedRepository;
use App\Containers\ReturnedItems\Models\ReturnedItems;
use App\Ship\Parents\Tasks\Task;
<?php
namespace App\Containers\Invoices\Tasks;
use App\Containers\Accounthistories\Models\Accounthistories;
use App\Containers\Accounts\Models\Accounts;
use App\Containers\Invoiceitems\Models\Invoiceitems;
use App\Containers\Invoices\Data\Repositories\InvoicesRepository;
use App\Containers\Products\Models\Products;
use App\Ship\Parents\Tasks\Task;
function add_new_sales_item_post($item, $rel_id, $rel_type)
{
$custom_fields = false;
if (isset($item['custom_fields'])) {
$custom_fields = $item['custom_fields'];
}
$CI = &get_instance();
@midoalone
midoalone / my_functions_helper.php
Created January 14, 2022 09:05
This file is the recommended way to add custom helper functions on perfex CRM. Here I added some functions to manibulate data on invoice module based on client's requirements.
<?php
/* TAWFIK */
/* Custom helper functions */
// Check if invoice can be edited
function is_invoice_editable( $id ) {
if(get_option('disable_invoice_edit') == 1) {
return check_invoice_is_draft( $id ) == true;
}
# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH
# Add all the files:
git add -A
# Commit the changes:
git commit -am "Initial commit"
# Delete the old branch:
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
@midoalone
midoalone / asdasd.skema
Last active April 21, 2020 21:28
the description for this gist
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c