Skip to content

Instantly share code, notes, and snippets.

View MaxMorais's full-sized avatar
🏢
Building TechMax Soluções

Maxwell Morais MaxMorais

🏢
Building TechMax Soluções
View GitHub Profile
@MaxMorais
MaxMorais / maskedentry.py
Last active October 24, 2023 12:06
Masked Entry Widget for TkinterFormWidget for Tkinter - Like web2py FormWidget, with label, entry and tooltipTo future, ensure validation.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
# Name: maskedit.py
# Purpose:
#
# Author: Maxwell Morais (max.morais.dmm@gmail.com)
#
# Created: 10/04/2013
from webclient import *
server = "http://myaccount.erpnext.com/server.py"
user = "your user name"
password = "your password"
login()
customer = get_doc("Customer", customer_name)
# coding: utf-8
from weasyprint import HTML, CSS
from weasyprint.document import _prepare
def get_page_body(boxes):
for box in boxes:
if box.element_tag == 'body':
return box
from functools import wraps
from flask import Flask, request, Response
app = Flask(__name__)
def check_auth(username, password):
"""This function is called to check if a username /
password combination is valid.
"""
return username == 'username' and password == 'pass'

The ERPNEXT translation process for beginners.

If you want contribute with ERPNext translations you must take these steps

  1. Get the latest updates
  • Goto Setup => Update ERNext and Click on Get Latest Updates
  1. Build the message files
  • Open the shell
  • Goto ERPNext install folder eg: cd /var/www-data/erp
@MaxMorais
MaxMorais / ApacheCGI.conf
Created October 27, 2013 20:31
2 ways to setup ERPNext with Apache and WSGI
Listen 8080
NameVirtualHost *:8080
<VirtualHosst *:8080>
ServerName localhost
# you ERPNext folder
DocumentRoot /var/www/erpnext/public
AddHandler cgi-script .cgi .xml .py
AddType application/vnd.ms-fontobject .eot
@MaxMorais
MaxMorais / features\report-role.features
Last active December 28, 2015 07:29
report-role test case with lettuce/salad
Feature: Ensuring that report-role works, and the page loads
In order to make sure that report-role works
As a tester
I open the ERPNext website using salad
Scenario Outline: Login in erpnext as test user with JS enabled (firefox)
Given I am using firefox
When I visite the local erpnext test url "login"
And I wait 1 second
And I fill the field <finder_login_id> with "test@localhost.com"
@MaxMorais
MaxMorais / index.js
Created January 26, 2014 08:29
Smallest JavaScript template engine
function TemplateEngine(html, options) {
var re = /<%(.+?)%>/g, reExp = /(^( )?(if|for|else|switch|case|break|{|}|;))(.*)?/g, code = 'var r=[];\n', cursor = 0, result;
var add = function(line, js) {
js? (code += line.match(reExp) ? line + '\n' : 'r.push(this.' + line + ');\n') :
(code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");\n' : '');
return add;
}
while(match = re.exec(html)) {
add(html.slice(cursor, match.index))(match[1], true);
cursor = match.index + match[0].length;
@MaxMorais
MaxMorais / plugin_solid_table.py
Created May 9, 2014 01:02
Web2Py Solid Table Plugin
from gluon import *
from gluon.sqlhtml import table_field, represent, Row
import urllib
# For referencing static and views from other application
import os
APP = os.path.basename(os.path.dirname(os.path.dirname(__file__)))
class SOLIDTABLE(SQLTABLE):

TAX

Brazil is a country with a high tax burden and a complex tax system.

There are Federal, State and City taxes over a company’s operation, as well as social security and labor charges. There are also specific charges over the functioning of customs system and taxes related to specific operations, such as inbound and outbound wire transfers.

Depending on the kind of operation the company practices, specific taxes will apply. A service providing company, for instance, will be directly taxed for ISS (service tax, generally 5% of gross revenue). A sales company, on the other hand, will be instead taxed by ICMS (a VAT-like state tax, generally 19% minus credits on previous operations).

Taxes paid to clear customs may be recoverable or not. This will depend on company taxation system (for federal taxes), destination of the imported item (manufacturing, consumption, resale).