forked from fastruby/afip_bill
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] #1
Open
ceneon
wants to merge
36
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP] #1
Changes from 13 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
801d2dd
New documents: credit and debit notes
nan-apps dbcccce
New bill attribute: custom text
nan-apps 0d2ca8c
path fix
nan-apps d539408
ajustando algunos margenes
nan-apps 6d52034
Ajuste en nombre de fantasia en encabezado
nan-apps 28faad5
Fixed margins and zoom level WOMM
ceneon a4af56c
Merge branch 'develop' of github.com:wecodeio/afip_bill into develop
ceneon af71fc7
Main margin improvements
ceneon f7d81b2
Compress items' lines to fit more of them
ceneon 9a0d972
Improve alignment for unit prices
ceneon c83bdec
Merge remote-tracking branch 'origin/develop' into develop
nan-apps 2c8e20e
some width and alignment fixes
nan-apps 02a8a84
different iva's in lines and totals
nan-apps 27df05d
Alignment fix in B notes
nan-apps fbff3a8
Some small fixes
nan-apps e4845ab
configuration fix
nan-apps 1301416
condition sale configurable and with default value "Otra" for backwar…
nan-apps 8c3a697
missing space
nan-apps 02d6ce7
fix in logo size
nan-apps dcde884
preparing for c invoicing
nan-apps 5af2f91
more description space in A invoices lines
nan-apps 67969c7
more descripcion space in all documents and some other adjustments
nan-apps 2e76403
css fix in client address
nan-apps 1ae14b3
adding code parameter to line item
nan-apps e6bf0dd
small codefix
nan-apps 4c9ad82
gaining more space for companies bank information
nan-apps 3923eeb
lines number formating
nan-apps 2979175
adjusting totals in notes A with new template image
nan-apps 84e38ff
ganing code space from amount and using smaller font when code too long
nan-apps 8eab777
quantity position fix in b template
nan-apps 1b6ab03
fixed width for line descriptions
nan-apps c0b12f8
related invoice data for notes
nan-apps 86c8ff3
Reorganized footer to display AFIP QR code
866350e
removed trash css
c9ffb24
Addes header_obs to invoices (remit number etc)
ceneon 728d715
Added invoice discounts mode
ceneon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
module AfipBill | ||
class LineItem | ||
attr_reader :name, :quantity, :imp_unitario | ||
IVA = 21.freeze | ||
attr_reader :name, :quantity, :imp_unitario, :iva | ||
#IVA = 21.freeze | ||
|
||
def initialize(name, quantity, imp_unitario) | ||
def initialize(name, quantity, imp_unitario, iva=nil) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. por compatibilidad si esto se va a volver una serie de PRs en el repo original, el default de iva acá debería ser 21 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hecho! |
||
@name = name | ||
@quantity = quantity | ||
@imp_unitario = imp_unitario | ||
@iva = iva | ||
end | ||
|
||
def imp_total_unitario | ||
quantity * imp_unitario | ||
end | ||
|
||
def imp_iva | ||
imp_total_unitario * IVA / 100 | ||
imp_total_unitario * iva / 100 | ||
end | ||
|
||
def imp_total_unitario_con_iva | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
<%= @template_header %> | ||
|
||
<div style="left:19.00px;top:272.04px" class="cls_010"><span class="cls_010">Código</span></div> | ||
<div style="left:60.00px;top:272.04px" class="cls_010"><span class="cls_010">Producto / Servicio</span></div> | ||
<div style="left:211.39px;top:272.04px" class="cls_010"><span class="cls_010">Cantidad</span></div> | ||
<div style="left:263.61px;top:272.04px" class="cls_010"><span class="cls_010">U. Medida</span></div> | ||
<div style="left:324.05px;top:272.66px" class="cls_011"><span class="cls_011">Precio Unit.</span></div> | ||
<div style="left:386.97px;top:272.66px" class="cls_011"><span class="cls_011">% Bonif</span></div> | ||
<div style="left:434.42px;top:272.66px" class="cls_011"><span class="cls_011">Imp. Bonif.</span></div> | ||
<div style="left:520.50px;top:272.66px" class="cls_011"><span class="cls_011">Subtotal</span></div> | ||
<div style="left:19.00px;top:270.04px" class="cls_010"><span class="cls_010">Código</span></div> | ||
<div style="left:60.00px;top:270.04px" class="cls_010"><span class="cls_010">Producto / Servicio</span></div> | ||
<div style="left:211.39px;top:270.04px" class="cls_010"><span class="cls_010">Cantidad</span></div> | ||
<div style="left:263.61px;top:270.04px" class="cls_010"><span class="cls_010">U. Medida</span></div> | ||
<div style="left:324.05px;top:270.66px" class="cls_011"><span class="cls_011">Precio Unit.</span></div> | ||
<div style="left:386.97px;top:270.66px" class="cls_011"><span class="cls_011">% Bonif</span></div> | ||
<div style="left:434.42px;top:270.66px" class="cls_011"><span class="cls_011">Imp. Bonif.</span></div> | ||
<div style="left:520.50px;top:270.66px" class="cls_011"><span class="cls_011">Subtotal</span></div> | ||
|
||
<% top = 293 %> | ||
<% @line_items.each_with_index do |line_item, index| %> | ||
<div style="left:18.00px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= (index + 1).to_s.rjust(3, "0") %></span></div> | ||
<div style="left:57.00px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.name %></span></div> | ||
<div style="width:60px;left:37.5%;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.quantity.round(2).to_s.tr(".", ",") %></span></div> | ||
<div style="left:268.30px;top:<%= top %>px" class="cls_012"><span class="cls_012">unidades</span></div> | ||
<div style="left:357.54px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.imp_unitario.round(2).to_s.tr(".", ",") %></span></div> | ||
<div style="left:380px;top:<%= top %>px" class="cls_008"><span class="cls_008" style="position:absolute;right:0"><%= line_item.imp_unitario.to_s.tr(".", ",") %></span></div> | ||
<div style="left:392.22px;top:<%= top %>px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="left:471.43px;top:<%= top %>px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="width:60px;left:91%;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.imp_total_unitario.round(2).to_s.tr(".", ",") %></span></div> | ||
<% top += 25 %> | ||
<% top += 15 %> | ||
<% end %> | ||
|
||
<div style="left:444.50px;top:616.59px" class="cls_002"><span class="cls_002">Subtotal: $</span></div> | ||
<div style="width:60px;left:89.6%;top:616.59px" class="cls_002"><span class="cls_002"><%= afip_bill["imp_total"] %></span></div> | ||
<div style="left:17.00px;top:500.97px" class="cls_008"><span class="cls_008"> | ||
<%= afip_bill["custom_text"] %> | ||
</span></div> | ||
|
||
<div style="left:444.50px;top:616.59px; " class="cls_002"> | ||
<span class="cls_002">Subtotal: $</span> | ||
</div> | ||
<div style="text-align: right; width:60px;right: 20.49px;top:616.59px" class="cls_002"><span class="cls_002"><%= afip_bill["imp_total"] %></span></div> | ||
<div style="left:382.49px;top:634.59px" class="cls_002"><span class="cls_002">Importe Otros Tributos: $</span></div> | ||
<div style="left:555.49px;top:634.59px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="text-align: right; width:60px; right: 20.49px;top:634.59px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="left:415.99px;top:652.54px" class="cls_005"><span class="cls_005">Importe Total: $</span></div> | ||
<div style="width:60px;left:88.8%;top:652.54px" class="cls_005"><span class="cls_005"><%= afip_bill["imp_total"] %></span></div> | ||
<div style="text-align: right; width:60px;right: 20.49px;top:652.54px" class="cls_005"><span class="cls_005"><%= afip_bill["imp_total"] %></span></div> | ||
|
||
<%= @template_footer %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<%= @template_header %> | ||
|
||
<div style="left:484.19px;top:259.63px" class="cls_011"><span class="cls_011">Alicuota</span></div> | ||
<div style="left:19.00px;top:263.04px" class="cls_010"><span class="cls_010">Código</span></div> | ||
<div style="left:59.00px;top:263.04px" class="cls_010"><span class="cls_010">Producto / Servicio</span></div> | ||
<div style="left:239.39px;top:263.04px" class="cls_010"><span class="cls_010">Cantidad</span></div> | ||
<div style="left:285.77px;top:263.66px" class="cls_011"><span class="cls_011">U. medida</span></div> | ||
<div style="left:335.05px;top:263.66px" class="cls_011"><span class="cls_011">Precio Unit.</span></div> | ||
<div style="left:388.47px;top:263.66px" class="cls_011"><span class="cls_011">% Bonif</span></div> | ||
<div style="left:434.50px;top:263.66px" class="cls_011"><span class="cls_011">Subtotal</span></div> | ||
<div style="left:524.27px;top:263.66px" class="cls_011"><span class="cls_011">Subtotal c/IVA</span></div> | ||
<div style="left:492.17px;top:267.68px" class="cls_011"><span class="cls_011">IVA</span></div> | ||
|
||
<% top = 283 %> | ||
<% @line_items.each_with_index do |line_item, index| %> | ||
<div style="left:18.00px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= (index + 1).to_s.rjust(3, "0") %></span></div> | ||
<div style="left:57.00px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.name %></span></div> | ||
<div style="width:60px;left:37%;top:<%= top %>px" class="cls_008"><span style="position:absolute;right:0" class="cls_008"><%= line_item.quantity.to_s.tr(".", ",") %> </span></div> | ||
<div style="left:288.30px;top:<%= top %>px" class="cls_012"><span class="cls_012">unidades</span></div> | ||
<div style="left:360.54px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.imp_unitario.to_s.tr(".", ",") %></span></div> | ||
<div style="left:398.43px;top:<%= top %>px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="width:60px;left:70.4%;top:<%= top %>px" class="cls_008"><span style="position:absolute;right:0" class="cls_008"><%= line_item.imp_total_unitario.round(2).to_s.tr(".", ",") %></span></div> | ||
<div style="left:490.00px;top:<%= top %>px" class="cls_008"><span class="cls_008"><%= line_item.iva %>%</span></div> | ||
<div style="width:60px;left:87%;top:<%= top %>px" class="cls_008"><span style="position:absolute;right:0" class="cls_008"><%= line_item.imp_total_unitario_con_iva.round(2).to_s.tr(".", ",") %></span></div> | ||
<% top += 25 %> | ||
<% end %> | ||
|
||
<div style="left:17.00px;top:511.97px" class="cls_010"><span class="cls_010">Otros Tributos</span></div> | ||
<div style="left:21.00px;top:524.54px" class="cls_008"><span class="cls_008">Descripción</span></div> | ||
<div style="left:184.00px;top:524.54px" class="cls_008"><span class="cls_008">Detalle</span></div> | ||
<div style="left:270.61px;top:525.16px" class="cls_012"><span class="cls_012">Alíc. %</span></div> | ||
<div style="left:317.88px;top:524.54px" class="cls_008"><span class="cls_008">Importe</span></div> | ||
<div style="left:18.00px;top:538.63px" class="cls_008"><span class="cls_008">Per./Ret. de Impuesto a las Ganancias</span></div> | ||
<div style="left:331.43px;top:538.63px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="left:18.00px;top:556.63px" class="cls_008"><span class="cls_008">Per./Ret. de IVA</span></div> | ||
<div style="left:331.43px;top:556.63px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="left:397.98px;top:551.41px" class="cls_002"><span class="cls_002">Importe Neto Gravado: $</span></div> | ||
<div style="width:60px;left:86.6%;top:551.41px" class="cls_002"><span style="position:absolute;right:0" class="cls_002"><%= afip_bill["imp_neto"] %></span></div> | ||
<div style="left:18.00px;top:567.63px" class="cls_008"><span class="cls_008">Per./Ret. Ingresos Brutos</span></div> | ||
<div style="left:331.43px;top:567.63px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="left:456.98px;top:564.41px" class="cls_002"><span class="cls_002">IVA 27%: $</span></div> | ||
<div style="left:557.49px;top:564.41px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="left:18.00px;top:578.63px" class="cls_008"><span class="cls_008">Impuestos Internos</span></div> | ||
<div style="left:331.43px;top:578.63px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="left:18.00px;top:589.63px" class="cls_008"><span class="cls_008">Impuestos Municipales</span></div> | ||
<div style="left:331.43px;top:589.63px" class="cls_008"><span class="cls_008">0,00</span></div> | ||
<div style="left:456.98px;top:577.41px" class="cls_002"><span class="cls_002">IVA 21%: $</span></div> | ||
<div style="width:60px;left:86.6%;top:577.41px" class="cls_002"><span style="position:absolute;right:0" class="cls_002"><%= afip_bill["imp_iva_21"] || '0,00' %></span></div> | ||
<div style="left:186.97px;top:602.91px" class="cls_006"><span class="cls_006">Importe Otros Tributos: $</span></div> | ||
<div style="left:329.49px;top:602.91px" class="cls_006"><span class="cls_006">0,00</span></div> | ||
<div style="width:60px;left:449.48px;top:590.41px" class="cls_002"><span class="cls_002">IVA 10.5%: $</span></div> | ||
<div style="width:60px;left:86.6%;top:590.41px" class="cls_002"><span style="position:absolute;right:0" class="cls_002"><%= afip_bill["imp_iva_105"] || '0,00' %></span></div> | ||
<div style="left:461.99px;top:603.41px" class="cls_002"><span class="cls_002">IVA 5%: $</span></div> | ||
<div style="left:557.49px;top:603.41px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="left:454.48px;top:616.41px" class="cls_002"><span class="cls_002">IVA 2.5%: $</span></div> | ||
<div style="left:557.49px;top:616.41px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="left:461.99px;top:629.41px" class="cls_002"><span class="cls_002">IVA 0%: $</span></div> | ||
<div style="left:557.49px;top:629.41px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="left:394.49px;top:642.41px" class="cls_002"><span class="cls_002">Importe Otros Tributos: $</span></div> | ||
<div style="left:557.49px;top:642.41px" class="cls_002"><span class="cls_002">0,00</span></div> | ||
<div style="left:427.99px;top:656.29px" class="cls_005"><span class="cls_005">Importe Total: $</span></div> | ||
<div style="width:60px;left:86.6%;top:656.29px" class="cls_005"><span style="position:absolute;right:0" class="cls_005"><%= afip_bill["imp_total"] %></span></div> | ||
|
||
<%= @template_footer %> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nan-apps empresa 1 vende algunos items con IVA 10.5% 😱