Nodejs Weekly billing implementation

Nodejs weekly billing implentation workflow

Nodejs Weekly billing implementation
Nodejs Weekly billing implementation

 

This is the weekly billing implementation. I’m using cronjobs to trigger the script every start of the week and bill all weekly transactions so job posters can pay the working hours. After that, it will scan all transactions of the week and bill it according to the job poster. The output will be on the billing page to let them know they have weekly bills.

 

 

Moment.JS cheatsheet

Today:

moment().startOf(‘day’),

Tommorw:

moment(today).add(1, ‘days’);

 

This week:

moment().startOf('isoWeek')
moment().endOf('isoWeek')

Next week:

moment().add(1, 'weeks').startOf('isoWeek')
moment().add(1, 'weeks').endOf('isoWeek')

Last week:

moment().subtract(1, 'weeks').startOf('isoWeek')
moment().subtract(1, 'weeks').endOf('isoWeek')

Mongodb queries find results by date

Cheatsheet in finding data's by date


var d = new Date(),
hour = d.getHours(),
min = d.getMinutes(),
month = d.getMonths(),
year = d.getFullYear(),
sec = d.getSeconds(),
day = d.getDate();


Submission.find({
  /* First Case: Hour */
  created: { $lt: new Date(), $gt: new Date(year+','+month+','+day+','+hour+','+min+','+sec) } // Get results from start of current hour to current time.
  /* Second Case: Day */
  created: { $lt: new Date(), $gt: new Date(year+','+month+','+day) } // Get results from start of current day to current time.
  /* Third Case: Month */
  created: { $lt: new Date(), $gt: new Date(year+','+month) } // Get results from start of current month to current time.
  /* Fourth Case: Year */
  created: { $lt: new Date(), $gt: new Date(year) } // Get results from start of current year to current time.
})

Time Tracker Schema

Scenario: Time tracker to get working hours.. daily,monthly,yearly with unique jobID and specific user.

 

/*
* Descripition: Schema for the Time Tracker
*
*/

Schema: TimeTracker

{
Memo: "Test Memo",
DateNow: 12345,
WorkedHours: 5,
JobID: 12345,
StartTime: 12345,
EndTime:12345,
UserId:12345,
TotalHours: 5
screenshots: ""
}

/*
* Description: Output current working hours (day).
* Solution: Find the JobID and UserID then add all TotalHours Provided the Current Date.
*/

GetToday();

/*
* Description: Output Weekly consumed hours (Week).
* Solution: Find the JobID and UserID, then add all TotalHours From the Starting Date upto EndDate (Week)
*/

GetWeekly();

/*
* Description: Output Monthly consumed hours (month).
* Solution: Find the JobID and UserID, then add all TotalHours From the Starting Date upto EndDate (Month)
*/

GetMonthly();

 

// Javascript Sample Algorithms:
/*
* Getting current date
*/

var CurrentDate = Date.now();

/*
* Getting total hours
*/

var hours = Math.abs(1438669482758 - 1438669509312) / 36e5;

/*
* Timestamp to human readble format
* timestamp = 1382086394000;
*/

function TimestampToHuman(timestamp){
d = new Date(timestamp);
return d;
};

Installing google chrome on Ubuntu

google-chrome-stable is availeble on 3rd Party Repository: Google Chrome (For Stable).

Follow the instruction for installation:

  1. Add Key:
    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
    
  2. Set repository:
    sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
    
  3. Install package:
    sudo apt-get update 
    sudo apt-get install google-chrome-stable

Timer Based bug/exploit (hoax)?

This one is quite interesting because it left me with questions how and why the timer changed by just dialing “#” and then sticking it on the timer. If anyone can explain why it happened please comment on the comment section.

Although I’ve seen my neighbors hacking the “Hulog Piso” computers through a “L” shaped metal to bypass the sensors of the timer. This one is quite different. Check it out. Quite amazing.

 

Iligan outsourcing services

If you are looking for Iligan outsourcing services, You came on the right website.

How can this article help you find the right candidate for your outsourcing jobs?
If you are an investor that is looking for outsourcing services in iligan city, This article will help you.  I will focuse here why and what are the benefits in outsourcing your services or products.

This is the ultimate guide in building your automated online empire with the help of fast and dedicated people. (y)

Why Outsource in Iligan ?

Simply because Iligan City generates  top performing graduates in the philippines. Mostly, these graduates can perform and deliver you top notch results in their field or your given field. Although some or not all can perform advance/realistic approach. The best thing about hiring them is that they have the capabilities to learn in a fast phase.

It’s not just the graduates but rather the naturally born talent they posses.

What are the benefits in providing us outsourcing services?

  • Hard Worker
    • You will have Iligan City professionals that is, by nature hard workers. They take great pride in their work and focus on quality assurance.
  • Proven Success
    • Demand for Philippines outsourcing services is growing at over 30% per year (faster than India).
  • English Speaking
    • English is a national language (3rd largest English-speaking nation in the world with 93% literacy rate). English is the primary language for business and education in the Philippines.
  • Service Oriented
    • The Filipino Service-oriented cultureproduces extremely polite employees with world-class customer service.
  • Cost saving
    • Salaries in the Philippines are a fraction of those in the Western world, with the daily minimum wage set around $3 per hour
  • Educated
    • An advanced western university system. The Philippines graduates over 37,000 IT graduates annually from internationally recognised Universities.

Conclusion:

If you need the right person for your job add me on skype “adrivanrex”.

Or simply comment on the comment section below.

PS:

This is also a part of a Search Engine Optimization ranking ” Iligan Outsourcing ” keyword on google.

You can  check the keyword ranking 5 days after posting this on my blog.