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 / 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).

"""
Inspired by http://code.activestate.com/recipes/578253-an-entry-with-autocompletion-for-the-tkinter-gui/
Changes:
- Fixed AttributeError: 'AutocompleteEntry' object has no attribute 'listbox'
- Fixed scrolling listbox
- Case-insensitive search
- Added focus to entry field
- Custom listbox length, listbox width matches entry field width
- Custom matches function
"""
{background-color: #465455} // barra superior
BUSCA
{background-color: #ECEDEF} // campo busca
{background-color: #5A6668} // botão busca
{background-color: #FFFFFF} // ícone busca
{background-color: #2D2D2D} // fundo
Description
def gera_boleto():
import datetime
import pyboleto
from pyboleto.bank.caixa import BoletoCaixa
from pyboleto.pdf import BoletoPDF
import os
listaDadosCaixa = []
for i in range(2):
d = BoletoCaixa()
@MaxMorais
MaxMorais / refresh_event_fix.patch
Created December 9, 2014 21:28
Refresh Event Fix Patch
From eeb8334a9238e04d6b411c5759f5a8cb929effa4 Mon Sep 17 00:00:00 2001
From: MaxMorais <max.morais.dmm@gmail.com>
Date: Tue, 9 Dec 2014 16:14:20 -0500
Subject: [PATCH] This commit fix the refresh event for TableControl with more
than 100 fields, and allow the support for nested tables
---
frappe/public/js/frappe/form/control.js | 78 +++++++++++++++++++++++++--------
frappe/public/js/frappe/form/grid.js | 8 ++--
frappe/public/js/frappe/form/layout.js | 11 ++---
@MaxMorais
MaxMorais / extended_controls.js
Created January 28, 2015 21:36
Custom Formatters for frappe ControlData
frappe.ui.form.ControlData = frappe.ui.form.ControlData.extend({
format_for_input: function(v, callback){
v = this._super(v, callback);
if (v+''==='') return '';
switch (this.df.options){
case('Phone'):
if (v+''=='') return '';
// phone may start with + and must only have numbers later, '-' and ' ' are stripped
v = v.replace(/ /g, '').replace(/-/g, '').replace(/\(/g, '').replace(/\)/g, '');
@MaxMorais
MaxMorais / document_tracking.py
Created March 31, 2015 12:48
Module config example
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
This file has been truncated, but you can view the full file.
[
{
"fields": [
{
"fields": [
{
"label": "Value",
"fieldType": "text",
"name": "value"