Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
L
lefilament_tdb
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
lefilament_tdb
Validations
630f529e
Valider
630f529e
rédigé
Il y a 1 mois
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[CLN] remove python part moved to JS
parent
19a6b50a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
models/lefilament_tdb.py
+0
-176
0 ajout, 176 suppressions
models/lefilament_tdb.py
avec
0 ajout
et
176 suppressions
models/lefilament_tdb.py
+
0
−
176
Voir le fichier @
630f529e
...
@@ -159,182 +159,6 @@ class LeFilamentTdb(models.Model):
...
@@ -159,182 +159,6 @@ class LeFilamentTdb(models.Model):
def
_format_monetary
(
amount
):
def
_format_monetary
(
amount
):
return
f
"
{
amount
:
,
}
"
.
replace
(
"
,
"
,
"
"
)
+
"
€
"
return
f
"
{
amount
:
,
}
"
.
replace
(
"
,
"
,
"
"
)
+
"
€
"
# @api.model
# def retrieve_datas_dashboard(self):
# # Get fiscal years
# fiscal_date = date(
# date.today().year,
# int(self.env.company.fiscalyear_last_month),
# int(self.env.company.fiscalyear_last_day),
# )
# if date.today() > fiscal_date:
# fiscal_year = fiscal_date
# fiscal_year_next = fiscal_date + relativedelta(years=1)
# else:
# fiscal_year = fiscal_date - relativedelta(years=1)
# fiscal_year_next = fiscal_date
#
# # Invoices
# invoiced = (
# self.env["account.move"]
# .read_group(
# [
# ("move_type", "in", ("out_invoice", "out_refund")),
# ("state", "=", "posted"),
# ("invoice_date", ">", fiscal_year),
# ("invoice_date", "<=", fiscal_year_next),
# ],
# ["amount_untaxed_signed:sum"],
# [],
# )[0]
# .get("amount_untaxed_signed", 0.0)
# )
# # Orders
# ordered = (
# self.env["sale.order.line"]
# .read_group(
# [
# ("invoice_status", "=", "to invoice"),
# ],
# ["price_subtotal:sum"],
# [],
# )[0]
# .get("price_subtotal", 0.0)
# )
# # Leads
# pipe_win = (
# self.env["crm.lead"]
# .read_group(
# [
# ("probability", "=", 100),
# "|",
# ("date_deadline", "<=", fiscal_year_next),
# ("date_deadline", "=", False),
# ],
# ["prorated_revenue:sum"],
# [],
# )[0]
# .get("prorated_revenue", 0.0)
# )
# pipe = (
# self.env["crm.lead"]
# .read_group(
# [
# "|",
# ("date_deadline", "<=", fiscal_year_next),
# ("date_deadline", "=", False),
# ],
# ["prorated_revenue:sum"],
# [],
# )[0]
# .get("prorated_revenue", 0.0)
# )
#
# target = self.env.company.ca_target
# invoiced_percentage = round(invoiced / target * 100) if target else 0
# ordered_percentage = round(ordered / target * 100) if target else 0
# toinvoice = target - invoiced
# toinvoice_percentage = round(toinvoice / target * 100) if target else 0
# pipe_win_percentage = round(pipe_win / target * 100) if target else 0
# ongoing = invoiced + ordered + pipe_win
# ongoing_percentage = (
# round((invoiced + ordered + pipe_win) / target * 100) if target else 0
# )
#
# to_get = (
# self.env["account.move"]
# .read_group(
# [
# ("move_type", "in", ("out_invoice", "out_refund")),
# ("state", "=", "posted"),
# ("payment_state", "in", ["not_paid", "partial", "in_payment"]),
# ],
# ["amount_untaxed_signed:sum"],
# [],
# )[0]
# .get("amount_untaxed_signed", 0.0)
# )
# to_pay = (
# self.env["account.move"]
# .read_group(
# [
# ("move_type", "in", ("in_invoice", "in_refund")),
# ("state", "=", "posted"),
# ("payment_state", "in", ["not_paid", "partial", "in_payment"]),
# ],
# ["amount_untaxed_signed:sum"],
# [],
# )[0]
# .get("amount_untaxed_signed", 0.0)
# )
#
# date_maj = (
# self.env["account.bank.statement.line"]
# .search([], order="date desc", limit=1)
# .date.strftime("%d/%m/%Y")
# )
# available_cash = (
# self.env["account.bank.statement.line"]
# .read_group([], ["amount:sum"], [])[0]
# .get("amount", 0.0)
# )
# cash_by_bank = self.env["account.bank.statement.line"].read_group(
# domain=[],
# fields=["journal_id", "amount"],
# groupby=["journal_id"],
# orderby="journal_id",
# )
#
# cash_in = (
# self.env["account.bank.statement.line"]
# .read_group(
# [
# ("amount", ">", 0),
# ("date", ">", fiscal_year),
# ],
# ["amount:sum"],
# [],
# )[0]
# .get("amount", 0.0)
# )
# cash_out = (
# self.env["account.bank.statement.line"]
# .read_group(
# [
# ("amount", "<", 0),
# ("date", ">", fiscal_year),
# ],
# ["amount:sum"],
# [],
# )[0]
# .get("amount", 0.0)
# )
#
# variation = cash_in + cash_out
#
# return {
# "invoiced": self._format_monetary(invoiced),
# "toinvoice": self._format_monetary(toinvoice),
# "ordered": self._format_monetary(ordered),
# "pipe_win": self._format_monetary(pipe_win),
# "pipe": self._format_monetary(pipe),
# "ongoing": self._format_monetary(ongoing),
# "target": self._format_monetary(target),
# "invoiced_percentage": invoiced_percentage,
# "toinvoice_percentage": toinvoice_percentage,
# "ordered_percentage": ordered_percentage,
# "pipe_win_percentage": pipe_win_percentage,
# "ongoing_percentage": ongoing_percentage,
# "date_maj": date_maj,
# "available_cash": self._format_monetary(available_cash),
# "cash_by_bank": cash_by_bank,
# "to_get": self._format_monetary(to_get),
# "to_pay": self._format_monetary(to_pay),
# "variation": self._format_monetary(variation),
# "cash_in": self._format_monetary(cash_in),
# "cash_out": self._format_monetary(cash_out),
# }
@api.model
@api.model
def
dashboard_detail_values
(
self
,
date_start
=
None
,
date_end
=
None
):
def
dashboard_detail_values
(
self
,
date_start
=
None
,
date_end
=
None
):
customer
=
self
.
_customer_detail
(
date_start
,
date_end
)
customer
=
self
.
_customer_detail
(
date_start
,
date_end
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter