Skip to content
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

Sales orders #3

Merged
merged 90 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
08dbfcc
Show product id erorrs
hunterboerner Feb 10, 2025
a1c63bc
Sales orders
hunterboerner Feb 10, 2025
079076d
Changing product
hunterboerner Feb 10, 2025
09cfc54
Styling
hunterboerner Feb 10, 2025
67db501
Breadcrumbs for sales orders
hunterboerner Feb 10, 2025
0dd0d9d
Styling
hunterboerner Feb 10, 2025
f2c9401
Margin
hunterboerner Feb 10, 2025
b641a27
Fix margin
hunterboerner Feb 10, 2025
56d605e
Add states
hunterboerner Feb 10, 2025
442d428
More styling
hunterboerner Feb 10, 2025
976c4b2
People resource
hunterboerner Feb 10, 2025
82517f9
Add people routes
hunterboerner Feb 10, 2025
c4791bd
editing entities
hunterboerner Feb 10, 2025
5192970
Add sales orders to entities
hunterboerner Feb 10, 2025
6cce69d
remove unused alias
hunterboerner Feb 10, 2025
740bd30
Destroying people
hunterboerner Feb 10, 2025
4d6b6df
Styling the pages
hunterboerner Feb 10, 2025
a577544
Checkpoint
hunterboerner Feb 11, 2025
69160bd
Show values in ready state
hunterboerner Feb 11, 2025
34972e7
Remove button on ready stte
hunterboerner Feb 11, 2025
b9a3188
don't allow changes when not draft
hunterboerner Feb 11, 2025
f1c3cbe
Return to draft
hunterboerner Feb 11, 2025
fc0a218
Remove inspect
hunterboerner Feb 11, 2025
82edde5
Test with the problem
hunterboerner Feb 11, 2025
d37f844
fix/removed tests
hunterboerner Feb 11, 2025
e22ca4a
showing active prie
hunterboerner Feb 11, 2025
addf2b2
Proper passing of new values
hunterboerner Feb 11, 2025
32f41c4
Load all initial products
hunterboerner Feb 11, 2025
0144dea
Use full width
hunterboerner Feb 11, 2025
0081d99
Format the numbers
hunterboerner Feb 11, 2025
8e75ed5
Remove border rounded
hunterboerner Feb 11, 2025
51b48d0
Fix name for crumb
hunterboerner Feb 11, 2025
7782d4a
Fix some bugs
hunterboerner Feb 11, 2025
d1ee3f8
Sales lines
hunterboerner Feb 11, 2025
23b538b
Change reversions
hunterboerner Feb 11, 2025
412fca6
Reverting
hunterboerner Feb 11, 2025
c2dfe30
Unused args
hunterboerner Feb 11, 2025
378e8ee
Fix some bugs
hunterboerner Feb 12, 2025
c0d85e3
Update show.ex
hunterboerner Feb 12, 2025
6254f46
Fixing reset
hunterboerner Feb 12, 2025
ef4ab08
Operations on costs and prices
hunterboerner Feb 12, 2025
0fe3537
Work on forms
hunterboerner Feb 12, 2025
dd65cce
Fix saving values
hunterboerner Feb 12, 2025
74bb315
Fix the sort order
hunterboerner Feb 12, 2025
c9c5e43
Add total cost and dollar signs
hunterboerner Feb 12, 2025
a1a6fd1
add price summary
hunterboerner Feb 12, 2025
88cd7b3
Add links to products
hunterboerner Feb 12, 2025
4dc0e4f
Sales was in wrong folder
hunterboerner Feb 13, 2025
5978c96
Fix some bugs and add address
hunterboerner Feb 13, 2025
626bf24
Progress
hunterboerner Feb 13, 2025
e97d02a
Customer create
hunterboerner Feb 13, 2025
44e64cf
Work on address selection
hunterboerner Feb 14, 2025
f0fb44e
Add credo
hunterboerner Feb 14, 2025
0c2f01b
use reraise instead of raise
hunterboerner Feb 14, 2025
280579f
remove io inspect
hunterboerner Feb 14, 2025
72ef6c1
Addresses
hunterboerner Feb 14, 2025
96dd1ae
Style address
hunterboerner Feb 14, 2025
dfc1bc2
fix address when customer changes
hunterboerner Feb 14, 2025
49a4da5
Format address
hunterboerner Feb 14, 2025
6c89504
Show addresses on entity page
hunterboerner Feb 14, 2025
de0170e
Add saleable and purchaseable
hunterboerner Feb 14, 2025
3d7711c
Don't use modal form for editing
hunterboerner Feb 14, 2025
b4a64bb
Render saleable and purchasable on product index page
hunterboerner Feb 14, 2025
e8efddf
Add comment
hunterboerner Feb 15, 2025
f997a52
remove the zero check
hunterboerner Feb 15, 2025
50d826d
use ash calculations
hunterboerner Feb 15, 2025
2b986fd
Fix price changes
hunterboerner Feb 15, 2025
64806e3
add product categories link
hunterboerner Feb 15, 2025
05487e0
adding cost to products
hunterboerner Feb 15, 2025
d7cd012
Copy over price and cost to sales line
hunterboerner Feb 15, 2025
cd57695
Product listing
hunterboerner Feb 15, 2025
c9068ff
Progress
hunterboerner Feb 15, 2025
a49d9a4
Fix resetting monies
hunterboerner Feb 16, 2025
f28300a
Highlight empty fields
hunterboerner Feb 16, 2025
f1f4a34
Remove rendered math
hunterboerner Feb 16, 2025
d214c01
Fix border stylig
hunterboerner Feb 16, 2025
2307a3b
Remove warning
hunterboerner Feb 16, 2025
83d92ed
Create invoices
hunterboerner Feb 16, 2025
4b927a1
line items
hunterboerner Feb 16, 2025
3c7a04a
add product to line item
hunterboerner Feb 16, 2025
d5ca6b1
Write the test
hunterboerner Feb 16, 2025
eb5d0d1
Work on invoice line items
hunterboerner Feb 16, 2025
2666956
Line items for invoices
hunterboerner Feb 16, 2025
c3fd921
Work on invoices
hunterboerner Feb 16, 2025
c2c2f4a
Fix new product breadcrumbs
hunterboerner Feb 17, 2025
0ec26d0
Add GitHub workflow
hunterboerner Feb 17, 2025
f0f7422
pin in the test
hunterboerner Feb 17, 2025
a74b6bd
Warnings as errors
hunterboerner Feb 17, 2025
c0b6cef
Fix warnings
hunterboerner Feb 17, 2025
3cfd07f
Tool versions and mix version bump
hunterboerner Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Elixir CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
build:
name: Build and test
runs-on: ubuntu-22.04

steps:
- uses: ikalnytskyi/action-setup-postgres@v7 # https://github.com/marketplace/actions/setup-postgresql-for-linux-macos-windows

- run: psql postgresql://postgres:postgres@localhost:5432/postgres -c "SELECT 1"
- run: psql service=postgres -c "SELECT 1"
- run: psql -c "SELECT 1"
env:
PGSERVICE: postgres

- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 https://github.com/erlef/setup-beam/releases/tag/v1.16.0
with:
elixir-version: "1.18.2" # [Required] Define the Elixir version
otp-version: "27.2" # [Required] Define the Erlang/OTP version
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test --warnings-as-errors
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
elixir 1.18.2
erlang 27.2.2
127 changes: 122 additions & 5 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

/* This file is for your main application CSS */

.inline-container {
@apply h-full relative;
display: inline-block;
}

.inline-text-input {
}

Expand All @@ -27,11 +22,19 @@
@apply hover:bg-transparent !important;
}

.inline-container {
@apply h-full relative;
display: inline-block;
}

.inline-container:hover + .link-to-inside-field > a > span {
visibility: visible;
}

.link-to-inside-field {
position: absolute;
margin-top: 22px;

span {
position: relative;
left: -35px;
Expand All @@ -43,6 +46,25 @@
}
}

.link-to-inside-field.address-link {
span {
left: -135px;
}
}

.revert-button {
position: absolute;
/* margin-top: 22px; */
color: black;
@apply border-transparent bg-transparent;
@apply hover:bg-transparent !important;

span {
position: relative;
left: -35px;
}
}

.breadcrumbs {
@apply text-sm;

Expand All @@ -64,6 +86,101 @@

input {
@apply border-transparent hover:border-solid hover:border-zinc-300;
@apply border-b-brand;
}
}
}

.product-category-table {
@apply text-left;

td {
div {
width: 100%;
}

padding-left: 0;
}
}

.product-name-field {
display: inline-block;
input {
field-sizing: content;
@apply border-transparent hover:border-solid hover:border-zinc-300;
@apply border-b-brand;
}
}

.input-icon {
position: relative;
}

.input-icon > i {
position: absolute;
display: block;
transform: translate(0, -40%);
top: 50%;
pointer-events: none;
width: 25px;
text-align: center;
font-style: normal;
}

.input-icon input {
padding-left: 25px;
padding-right: 0;
}

.cost-summary {
width: 200px;
float: right;

div {
text-align: right;

span {
float: left;
}
}
}

.address-container {
display: inline-block;
width: 400px;
}

.address div {
height: 1.5em;
}

.address-container div select {
display: inline-block;
width: 200px;
}

.fieldsetlike {
width: 500px;
overflow-x: scroll;
padding: 20px;
border: 1px solid lightgray;
}

.fieldsetlikelabel {
position: relative;
top: 14px; /* change this how you need */
left: 20px; /* change this how you need */
background-color: white;
display: inline-block;
}

.address-city-state-zip {
div {
display: inline-block;
}
}

.empty-field {
@apply border-red-500 border-solid border-2;
box-sizing: border-box;
}
62 changes: 62 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,68 @@ const hooks = {
...live_select,
};

hooks.Sidebar = {
mounted() {
let menuOpen = false;

let listeners = (a) =>
a.addEventListener("click", () => {
if (!menuOpen) {
menuOpen = true;
document
.getElementById("off-canvas-menu")
.classList.add("translate-x-0");

document
.getElementById("off-canvas-menu")
.classList.remove("-translate-x-full");

document.getElementById("close-sidebar").classList.add("opacity-100");

document
.getElementById("close-sidebar")
.classList.remove("opacity-0");

document.getElementById("menu-backdrop").classList.add("opacity-100");

document
.getElementById("menu-backdrop")
.classList.remove("opacity-0");

document.getElementById("off-canvas").classList.add("z-50");

document.getElementById("off-canvas").style.display = "initial";
} else {
menuOpen = false;
document
.getElementById("off-canvas-menu")
.classList.add("-translate-x-full");

document
.getElementById("off-canvas-menu")
.classList.remove("translate-x-0");

document.getElementById("close-sidebar").classList.add("opacity-0");

document
.getElementById("close-sidebar")
.classList.remove("opacity-100");

document.getElementById("menu-backdrop").classList.add("opacity-0");

document
.getElementById("menu-backdrop")
.classList.remove("opacity-100");
document.getElementById("off-canvas").classList.remove("z-50");
document.getElementById("off-canvas").style.display = "none";
}
});

listeners(document.getElementById("open-sidebar"));
listeners(document.getElementById("close-sidebar"));
},
};

let liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: { _csrf_token: csrfToken },
Expand Down
29 changes: 29 additions & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,35 @@ module.exports = {

// Options: slate, gray, zinc, neutral, stone
gray: colors.gray,

// Logo based reds
mojo: {
50: "#fdf4f3",
100: "#fce7e4",
200: "#fad4ce",
300: "#f5b7ac",
400: "#ee8c7b",
500: "#e26651",
600: "#bf432e",
700: "#ad3b28",
800: "#8f3425",
900: "#783024",
950: "#40160f",
},
// Logo based greens
eagle: {
50: "#f6f6f4",
100: "#e5e6df",
200: "#ccccbb",
300: "#b7b7a0",
400: "#9f9d80",
500: "#918c6f",
600: "#7f7860",
700: "#6b6352",
800: "#595247",
900: "#4b453c",
950: "#29251f",
},
},
},
},
Expand Down
9 changes: 8 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ config :spark,
config :therons_erp,
ecto_repos: [TheronsErp.Repo],
generators: [timestamp_type: :utc_datetime],
ash_domains: [TheronsErp.Sales, TheronsErp.Inventory, TheronsErp.Ledger, TheronsErp.Accounts]
ash_domains: [
TheronsErp.Invoices,
TheronsErp.People,
TheronsErp.Sales,
TheronsErp.Inventory,
TheronsErp.Ledger,
TheronsErp.Accounts
]

# Configures the endpoint
config :therons_erp, TheronsErpWeb.Endpoint,
Expand Down
3 changes: 3 additions & 0 deletions lib/therons_erp/inventory.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ defmodule TheronsErp.Inventory do
resource TheronsErp.Inventory.Product do
define :create_product, args: [:name, :sales_price], action: :create
define :update_product, args: [:name, :sales_price], action: :update
define :create_product_stub, action: :create_stub
define :get_saleable_products, action: :list_saleable
define :get_products, action: :list
end
end
end
Loading