Skip to content

Instantly share code, notes, and snippets.

View diego-aslz's full-sized avatar
🏠
Working from home

Diego Selzlein diego-aslz

🏠
Working from home
View GitHub Profile
@diego-aslz
diego-aslz / 01-procedure.sql
Last active September 22, 2023 02:48
Record trackings procedure
CREATE OR REPLACE PROCEDURE track_record (
p_record_id IN NUMBER,
p_record_type IN VARCHAR2,
p_is_deleted IN BOOLEAN DEFAULT FALSE
)
IS
BEGIN
IF p_is_deleted THEN
UPDATE record_trackings
SET record_deleted_at = SYSTIMESTAMP
@diego-aslz
diego-aslz / translate_subs.rb
Last active December 20, 2022 18:57
Extract and translate MKV subtitles
#!/usr/bin/env ruby
# Ruby script to extract and translate subtitles from MKV files from English to Portuguese (but you can customize this)
#
# Dependencies:
#
# 1. `gem install srt`
# 2. `brew install translate-shell mkvtoolnix`
#
# Usage:
source 'https://rubygems.org'
gem 'rspec'
/home/web/uems/current
SELECT
I.ID_PRODUTO,
P.NOME,
SUM(I.QUANTIDADE) AS QUANTIDADE,
AVG(I.VALOR_UNITARIO) AS VALOR_UNITARIO,
SUM(I.DESCONTO) AS DESCONTO,
SUM(I.VALOR) AS VALOR,
MIN(I.DT_LANCAMENTO) AS DT_LANCAMENTO
FROM ITENS I
JOIN PRODUTOS P
<!-- List all subcategories -->
<div class="article-list subcat">
<ul>
{% for subcategory in subcategories %}
<li class="result article">
<a href="{{subcategory.url}}">
<h2>{{ subcategory.name }}</h2>
</a>
</li>
{% endfor %}
SELECT
MESA,
VALOR
FROM
VENDAS
WHERE
DT_CANCELAMENTO IS NOT NULL
AND
DATEADD(-3 HOUR TO DT_EMISSAO) BETWEEN :DT_INICIO
AND DATEADD(1 DAY TO :DT_FIM)
@diego-aslz
diego-aslz / TFVendasCad.pas
Created May 9, 2016 00:37
Fechamento de Venda
// Substituir todo o conteúdo de ImprimeFechamento pelo seguinte:
procedure TFVendasCad.ImprimeFechamento;
begin
if FRFechamentoVenda = nil then
FRFechamentoVenda := TFRFechamentoVenda.Create(Application);
DMConfiguracoes.QConfiguracoes.Close;
DMConfiguracoes.QConfiguracoes.Open;
FRFechamentoVenda.QRRelatorio.Preview;
end;
@diego-aslz
diego-aslz / UVendasCad.pas
Last active May 8, 2016 18:03
Fechamento de Vendas
// OnClick do botão Relatórios -> Fechamento de Vendas.
procedure TFVendasCad.Fechamento1Click(Sender: TObject);
begin
inherited;
if FVendasParam = nil then
FVendasParam := TFVendasParam.Create(Application);
FVendasParam.AtivaPagina(0);
if FVendasParam.ShowModal = MrOk then
with DMRelatorio do
begin
procedure TFComissoesPgto.BTOkClick(Sender: TObject);
begin
inherited;
QConsulta.First;
if not QConsulta.Eof then
begin
try
while not QConsulta.Eof do
begin
DMSistema.AtualizaBanco('COMISSOES', 'DT_PAGAMENTO', QuotedStr(FormatDateTime('YYYY.MM.DD', Date)), 'ID = ' + QConsultaID.Text);