Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
add shortName on products and ebarimt
Browse files Browse the repository at this point in the history
  • Loading branch information
munkhsaikhan committed Oct 11, 2023
1 parent 199baf7 commit 07873d3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions client-portal/modules/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ export interface IProductCategory {
export interface IProduct {
_id: string;
name: string;
shortName: string;
type: string;
categoryId: string;
description: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default {
stocks: items.map(item => ({
code: productById[item.productId].code,
name: productById[item.productId].name,
shortName: productById[item.productId].shortName,
measureUnit: productById[item.productId].uom || 'ш',
qty: item.count,
unitPrice: item.unitPrice,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const types = `
type PoscProduct {
${commonFieldDefs}
shortName: String
type: String
barcodes: [String]
barcodeDescription: String
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-posclient-api/src/models/PutData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class PutData<IListArgs extends IPutDataArgs> {
code: detail.inventoryCode,
barCode: detail.barcode || this.defaultGScode,
name: product.name,
shortName: product.shortName,
measureUnit: product.uom || 'ш',
qty: formatNumber(detail.count),
unitPrice: formatNumber(detail.amount / (detail.count || 1)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface IPrice {

export interface IProduct extends IProductCommonFields {
categoryId?: string;
shortName?: string;
type?: string;
barcodes?: string[];
barcodeDescription?: string;
Expand Down Expand Up @@ -94,6 +95,7 @@ export const productSchema = schemaWrapper(
_id: field({ pkey: true }),
categoryId: field({ type: String, label: 'Category' }),
name: field({ type: String, label: 'Name' }),
shortName: field({ type: String, optional: true, label: 'Short name' }),
code: field({ type: String, label: 'Code' }),
barcodes: field({
type: [String],
Expand Down
4 changes: 2 additions & 2 deletions pos/app/reciept/components/Stocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ interface IStock {

const Stocks = ({ stocks }: { stocks: IStock[] }) => {
const renderItem = (item: any, idx: number) => {
const { unitPrice, totalAmount, name, qty } = item
const { unitPrice, totalAmount, name, qty, shortName } = item
return (
<div key={idx}>
<div className="flex items-start leading-none">
<div className="w-5/12">{name}</div>
<div className="w-5/12">{shortName || name}</div>
<div className="w-3/12 text-center">{formatNum(unitPrice)}</div>
<div className="w-1/12 text-right">{formatNum(qty)}</div>
<div className="w-3/12 text-right">{formatNum(totalAmount)}</div>
Expand Down
6 changes: 3 additions & 3 deletions pos/public/js/env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.env = {
NEXT_PUBLIC_MAIN_API_DOMAIN: "https://staging.erxes.io/gateway",
NEXT_PUBLIC_MAIN_SUBS_DOMAIN: "wss://staging.erxes.io/gateway/graphql",
NEXT_PUBLIC_SERVER_API_DOMAIN: "https://staging.erxes.io/gateway",
NEXT_PUBLIC_MAIN_API_DOMAIN: "http://localhost:4000",
NEXT_PUBLIC_MAIN_SUBS_DOMAIN: "ws://localhost:4000/graphql",
NEXT_PUBLIC_SERVER_API_DOMAIN: "http://localhost:4000",
NEXT_PUBLIC_SERVER_DOMAIN: "http://localhost:3000",
}

0 comments on commit 07873d3

Please sign in to comment.