Skip to content

Commit

Permalink
UPD - Aggiornato ad oggi tutti i submodules a v16 + pr linkate qui #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jado95 committed Jan 8, 2025
1 parent 5195c45 commit 6af61f8
Show file tree
Hide file tree
Showing 62 changed files with 2,110 additions and 77 deletions.
42 changes: 42 additions & 0 deletions fiscal_epos_print/static/src/js/epson_epos_print.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,48 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) {
'" message="------------------" messageType="3" index="5" font="2" />';
var index = 5;
_.each(receipt.ticket.split("<br />"), function (msg) {
if (msg.includes("Data:") || msg.includes("Date:")) {
return true;
}
if (msg.includes("Ora:") || msg.includes("Time:")) {
return true;
}
if (msg.includes("PAN seq.:")) {
return true;
}
if (msg.includes("Nome prof.:") || msg.includes("Pref. name:")) {
return true;
}
if (msg.includes("metodo di pagamento:") || msg.includes("Payment Method:")) {
return true;
}
if (msg.includes("Payment variant:")) {
return true;
}
if (msg.includes("Modalità immissione:") || msg.includes("Entry mode:")) {
return true;
}
if (msg.includes("AID:")) {
return true;
}
if (msg.includes("MID:")) {
return true;
}
if (msg.includes("TID:")) {
return true;
}
if (msg.includes("PTID:")) {
return true;
}
if (msg.includes("Tender:")) {
return true;
}
if (msg.includes("Riferimento:") || msg.includes("Reference:")) {
return true;
}
if (msg.includes("Tipo:") || msg.includes("Type:")) {
return true;
}
index += 1;
tag +=
"<printRecMessage " +
Expand Down
13 changes: 8 additions & 5 deletions l10n_it_account_stamp/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def is_tax_stamp_applicable(self):
raise UserError(_("Missing tax stamp product in company settings!"))
total_tax_base = sum(
(
inv_tax.price_subtotal
abs(inv_tax.balance)
for inv_tax in self.line_ids.filtered(
lambda line: set(line.tax_ids.ids)
& set(stamp_product_id.stamp_apply_tax_ids.ids)
Expand All @@ -42,14 +42,13 @@ def is_tax_stamp_applicable(self):
return total_tax_base >= stamp_product_id.stamp_apply_min_total_base

@api.depends(
"invoice_line_ids.price_subtotal",
"line_ids.price_total",
"line_ids.balance",
"currency_id",
"company_id",
"invoice_date",
"move_type",
"manually_apply_tax_stamp",
"invoice_line_ids.tax_ids",
"line_ids.tax_ids",
)
def _compute_tax_stamp(self):
for invoice in self:
Expand Down Expand Up @@ -81,14 +80,18 @@ def add_tax_stamp_line(self):
_("Missing account income configuration for %s")
% stamp_product_id.name
)
currency_id = stamp_product_id.currency_id or inv.company_currency_id
price_unit = currency_id._convert(
stamp_product_id.list_price, inv.currency_id, inv.company_id, inv.date
)
invoice_line_vals = {
"move_id": inv.id,
"product_id": stamp_product_id.id,
"is_stamp_line": True,
"name": stamp_product_id.description_sale,
"sequence": 99999,
"account_id": stamp_account.id,
"price_unit": stamp_product_id.list_price,
"price_unit": price_unit,
"quantity": 1,
"display_type": "product",
"product_uom_id": stamp_product_id.uom_id.id,
Expand Down
12 changes: 11 additions & 1 deletion l10n_it_delivery_note/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ To configure this module, go to:
1. *Inventory → Configuration → Settings - Delivery Notes*

Checking 'Use Advanced DN Features' allows you to manage more picking
on one delivery note.
on one delivery note. Checking 'Group Invoice Lines by Delivery Note
which generated them' too, you will have invoice lines grouped and it
can be useful if you invoice many DNs with same product and you want
to show the details to your customer.

Checking 'Display Ref. Order in Delivery Note Report' or 'Display
Ref. Customer in Delivery Note Report" enables in report fields
Expand Down Expand Up @@ -153,6 +156,13 @@ permessi dell'utente.
Le fatture generate dai DDT contengono i riferimenti al DDT stesso nelle
righe nota.

Raggruppa righe fattura per DDT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attivando le funzionalità avanzate viene mostrata l'opzione per
abilitare il raggruppamento delle righe fattura in base al DDT che le ha
generate ("Raggruppa righe fattura per le DN che le hanno generate").

Accesso da portale
------------------

Expand Down
44 changes: 44 additions & 0 deletions l10n_it_delivery_note/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def goto_invoice(self, **kwargs):
}

def _prepare_note_dn_value(self, sequence, delivery_note_id):
if self.env.company.invoice_lines_grouped_by_dn:
delivery_note_line_sequence = self.invoice_line_ids.filtered(
lambda x: x.delivery_note_id == delivery_note_id
).mapped("sequence")
if delivery_note_line_sequence:
sequence = min(delivery_note_line_sequence) - 1
return {
"sequence": sequence,
"display_type": "line_note",
Expand Down Expand Up @@ -123,6 +129,44 @@ def update_delivery_note_lines(self):
),
)
)
elif self.env.company.invoice_lines_grouped_by_dn:
sequence = 1
done_invoice_lines = self.env["account.move.line"]
delivery_notes = invoice.mapped(
"invoice_line_ids.sale_line_ids.delivery_note_line_ids."
"delivery_note_id"
).sorted(key="name")
for dn in delivery_notes:
dn_invoice_lines = invoice.invoice_line_ids.filtered(
lambda x, dn=dn, done_invoice_lines=done_invoice_lines: x
not in done_invoice_lines
and dn
in x.mapped(
"sale_line_ids.delivery_note_line_ids.delivery_note_id"
)
# fixme test invoice from 2 sale lines
)
done_invoice_lines |= dn_invoice_lines
for note_line in dn.line_ids.filtered(
lambda line: line.invoice_status == DOMAIN_INVOICE_STATUSES[2]
):
for invoice_line in dn_invoice_lines.filtered(
lambda x: not x.delivery_note_id
):
if (
note_line
in invoice_line.sale_line_ids.delivery_note_line_ids
):
invoice_line.delivery_note_id = (
note_line.delivery_note_id.id
)
new_lines.append(
(
0,
False,
self._prepare_note_dn_value(sequence, dn),
)
)
else:
for line in invoice.invoice_line_ids:
sequence = line.sequence - 1
Expand Down
4 changes: 4 additions & 0 deletions l10n_it_delivery_note/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ class ResCompany(models.Model):
"Display Delivery Method in Delivery Note Report",
default=False,
)
invoice_lines_grouped_by_dn = fields.Boolean(
"Group Delivery note invoices by quantity",
default=False,
)
5 changes: 5 additions & 0 deletions l10n_it_delivery_note/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ def _default_virtual_locations_root(self):
related="company_id.display_delivery_method_dn_report",
readonly=False,
)
invoice_lines_grouped_by_dn = fields.Boolean(
string="Group Invoice Lines by Delivery Note",
related="company_id.invoice_lines_grouped_by_dn",
readonly=False,
)
Loading

0 comments on commit 6af61f8

Please sign in to comment.