Skip to content

Instantly share code, notes, and snippets.

schs = Schedule.where("DATE(work_date) >= DATE(?) AND DATE(work_date) <= DATE(?)", '2019-12-01', '2020-01-01')
site_blank = []
schs.each do |sc|
if sc.site.blank?
site_blank << {schedule_id: sc.id, site_id: sc.site_id}
end
end
no_site = []
edited = []
site_blank = [{:schedule_id=>81592, :site_id=>5102}, {:schedule_id=>81586, :site_id=>5085}, {:schedule_id=>81594, :site_id=>5105}, {:schedule_id=>81587, :site_id=>5093}, {:schedule_id=>81591, :site_id=>5096}, {:schedule_id=>81593, :site_id=>5104}, {:schedule_id=>81595, :site_id=>5118}, {:schedule_id=>81588, :site_id=>5112}, {:schedule_id=>81526, :site_id=>5069}]
site_ids = [{site_id: 'JIBA0003', username: 'techaps61'},{site_id: 'JIPA0005', username: 'techaps52'},{site_id: 'JITR0004', username: 'techaps26'},{site_id: 'BTSE0022', username: 'teambanten1'},{site_id: 'BTSE0021', username: 'teambanten1'},{site_id: 'BTSE0019', username: 'teambanten1'},{site_id: 'BTSE0015', username: 'teambanten1'},{site_id: 'BTSR0084', username: 'teambanten1'},{site_id: 'BTSR0083', username: 'teambanten1'},{site_id: 'BTSR0082', username: 'teambanten1'},{site_id: 'BTSR0079', username: 'teambanten1'},{site_id: 'BTSR0078', username: 'teambanten1'},{site_id: 'BTSR0075', username: 'teambanten1'},{site_id: 'BTSR0074', username: 'teambanten1'},{site_id: 'BTSR0072', username: 'teambanten1'},{site_id: 'BTSR0068', username: 'teambanten1'},{site_id: 'BTSR0066', username: 'teambanten1'},{site_id: 'BTSR0065', username: 'teambanten1'},{site_id: 'BTSR0060', username: 'teambanten1'},{site_id: 'BTSR0058', username: 'teambanten1'},{site_id: 'BTSR0056', username: 'teambanten1'},{site_id: 'BTSR0055', username:
@items = [
{
name: 'item-a', # Nama Item
price: 70000, # Harga Maximum
quantity: 1000, # Jumlah item yang akan dikerjakan
production_time: 8, # Lama pengerjaan dalam hari
start_time: '2017-11-14 10:00', # Mulai bidding
end_time: '2017-11-14 12:00' # Akhir bidding
},
{
errors = []
site_ids.each do |data|
site = Site.where("code = ? OR site_id_customer = ? OR site_id_sap = ?",data[:site_id],data[:site_id],data[:site_id_sap]).first
if site.blank?
site = Site.new(code: data[:site_id], site_id_customer: data[:site_id], site_id_sap: data[:site_id_sap], latitude: data[:latitude], longitude: data[:longitude], name: data[:site_name], service_point_id: 8, client_id: 8)
if site.save
site.site_users.create(tenantable_type: 'Operator', tenantable_id: 245)
else
errors << site.errors.full_messages
end
site_ids = [{site_id: 'BTSE0017', username: 'teambanten1'},{site_id: 'BTSE0020', username: 'teambanten1'},{site_id: 'BTSE0018', username: 'teambanten1'},{site_id: 'BTSE0013', username: 'teambanten1'},{site_id: 'BTSR0012', username: 'teambanten1'},{site_id: 'BTSR0077', username: 'teambanten1'},{site_id: 'BTSR0069', username: 'teambanten1'},{site_id: 'BTSR0046', username: 'teambanten1'},{site_id: 'BTLB0047', username: 'teambanten4'},{site_id: 'BTCI0001', username: 'teambanten2'},{site_id: 'BTCI0004', username: 'teambanten2'},{site_id: 'BTCI0006', username: 'teambanten2'},{site_id: 'BTCI0010', username: 'teambanten2'},{site_id: 'BTCI0015', username: 'teambanten2'},{site_id: 'BTCI0021', username: 'teambanten2'},{site_id: 'BTCI0026', username: 'teambanten2'},{site_id: 'BTCI0029', username: 'teambanten2'},{site_id: 'BTCI0035', username: 'teambanten2'},{site_id: 'BTSE0001', username: 'teambanten2'},{site_id: 'BTPD0028', username: 'teambanten2'},{site_id: 'BTPD0030', username: 'teambanten2'},{site_id: 'BTPD0036', use
superadmin
us: superadmin_1
pass: pmttower123
team_leader
us: tl.tester
pass: pmttower123
Coordinator
us: test.coordinator
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Dec 06, 2019 at 11:09 AM
-- Server version: 5.6.38
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
Tambah Column
ALTER TABLE `tb_final_register` ADD `no_bukpot` INT NOT NULL AFTER `nm_pemotong`;
ALTER TABLE `tb_non_final_register` ADD `no_bukpot` INT NOT NULL AFTER `tgl_bukti_potong`;
ALTER TABLE `tb_register_penghasilan` ADD `jumlah_penerima` INT(20) NOT NULL AFTER `ket_ssp`;
ALTER TABLE `tb_jenis_penghasilan` CHANGE `kd_satker` `tipe_bukpot` VARCHAR(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `tb_bayar_ptt` ADD `no_daftar` VARCHAR(45) NOT NULL AFTER `unit_pembayar`;
-- Install React Navigation --
npm install react-navigation
npm install react-native-gesture-handler
npm install react-native-reanimated
npm install react-navigation-stack
cd ios
pod install
cd ..
--pengganti react-native eject jika tidak bisa--