Paper Industries: Difference between revisions

From eStream Software
No edit summary
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Introduction==
==Introduction==
 
For mostly paper industries, they have to calculate the total weight in KG converted from different packing size like REAM, PKT or MT. This total weight will be printed in the sales order, delivery order and tax invoice.
<br />
<br />


==Updates==
==Updates==
Line 8: Line 7:


==Criterias==
==Criterias==
===Maintain Stock Group===
''[Stock | Maintain Stock Group...]''
Stock group will be used as the Product Grade and Branding to categorise the stock items list. <br />
<br />


===Maintain Stock Item===
===Maintain Stock Item===
''[Stock | Maintain Stock Item...]''
''[Stock | Maintain Stock Item...]''


{| class="wikitable"
1. Stock Master Data.
::{| class="wikitable"
|-
|-
! Types !! Field Name !! Data Types !! Length !! Usage
! Types !! Field Name !! Data Types !! Length !! Usage
Line 24: Line 29:
| STD || Base UOM || String || 10 || stock unit of measurement, usually either enter as REAM or MT or PKT  
| STD || Base UOM || String || 10 || stock unit of measurement, usually either enter as REAM or MT or PKT  
|-
|-
| DIY || GSM || Float || Size :10 <br /> SubSize: 2 || GSM value
| DIY || GSM || Float || Size :10 <br /> SubSize: 2 || GSM value for Weight KG calculation
|-
|-
| DIY || Width || Float ||  
| DIY || Width || Float || Size :10 <br /> SubSize: 2 || Width value for Weight KG calculation
|-
|-
| DIY || Length || Float ||
| DIY || Length || Float || Size :10 <br /> SubSize: 2 || Length value for Weight KG calculation
|-
|-
| DIY || PKT || Float ||
| DIY || PKT || Float || Size :10 <br /> SubSize: 2 || PKT value for Weight KG calculation
|-
|-
| DIY || Weight_MT || Float ||
| DIY || Weight_MT || Float || Size :10 <br /> SubSize: 4 || Weight MT value
|-  
|-  
| DIY || Weight_KG || Float ||
| DIY || Weight_KG || Float || Size :10 <br /> SubSize: 4 || Weight Kgs value
|}
|}
<br />
<br />


3. Click on extra tab. You can enter the road tax, inspection and insurance reminder date for reference.<br />
2. Formula: <br />
::[[File:02 GST MarginScheme MaintainCustomer Extra.jpg | 700px]]<br />
Weight KG = ((GSM x Width x Length)/3100)/PKT
Weight MT = Weight KG/1000
<br />
''Both formula results are rounding up to 4 decimals.''


===Maintain Supplier===
3. Under Tools | DIY | SQL Control Center...Browse to Stock | Stock Item and insert new event '''OnBeforeSave''' with the DIY Script below:<br />
''[Supplier | Maintain Supplier…]''
<syntaxhighlight lang="delphi">
 
Var M : TDataSource;
1. Create new seller name (eg. company name or person name).<br />
2. Click on Tax tab to input the GST No (if applicable).<br />
begin
::[[File:03 GST MarginScheme MaintainSupplier.jpg | 700px]]
  M := TDataSource(Self.FindComponent('dsAccess'));
  M.DataSet.Edit;
  M.DataSet.FindField('UDF_Weight_KG').Value := SimpleRoundToEx((((M.DataSet.FindField('UDF_GSM').AsFloat*
                                                M.DataSet.FindField('UDF_Width').AsFloat*
                                                M.DataSet.FindField('UDF_Length').AsFloat)/3100)/M.DataSet.FindField('UDF_PKT').AsFloat),-4);
                                               
  M.DataSet.FindField('UDF_Weight_MT').Value := SimpleRoundToEx((M.DataSet.FindField('UDF_Weight_KG').AsFloat/1000),-4);                                                 
                                             
end.
</syntaxhighlight>
<br />
<br />


===Maintain Stock Item===
==Sales Documents Entry==
''[Stock | Maintain Stock Item…]''
1. Sales documents entry are:-
1. Create the car model at Maintain Stock Item. For example, TOYOTA VIOS 1.5G(AT)<br />
::* Quotation
2. Click on Vehicle tab to define this item is a "Vehicle".<br />
::* Sales Order
::[[File:04 GST MarginScheme MaintainStockItem Vehicle.jpg | 30PX]]
::* Delivery Order
<br />
::* Invoice
::* Debit Note
::* Credit Note


===Maintain Project===
2. Insert and update the following DIY fields & Script into above mentions sales documents in ''Tools | DIY | SQL Control Center...'' <br />
''[Tools | Maintain Project…]''
a) DIY Fields<br />
1. Create the second car plate number in Maintain Project.<br />
::{| class="wikitable"
2. Update the Vehicle detail.<br />
|-
::[[File:05 GST MarginScheme MaintainProject VehicleDetail.jpg | 140PX]]
! Type !! Field Name !! Data Types !! Length
<br />
|-
3. Leave BLANK to Purchase Invoice Date, Purchase Invoice No and Cost. It will auto update when you are select the project code and save at the Purchase Invoice.<br />
| DIY-F || GSM || Float || Size: 10 <br />SubSize: 2
::[[File:05 GST MarginScheme MaintainProject PurchaseDetail.jpg | 30PX]]
|-
<br />
| DIY-F || Width || Float || Size: 10 <br />SubSize: 2
 
|-
==Record Purchase of Second Hand Car Value==
| DIY-F || Length || Float || Size: 10 <br />SubSize: 2
''[Purchase | Purchase Invoice…]''
 
1. Enter the purchase value of second car at Purchase Invoice. (eg. RM30,000 )<br />
2. You must select the correct car plate number from Project. (eg. PGE3333)<br />
3. Supplier GST No, Purchase invoice number, date and cost will be update automatically after you have save the purchase invoice. <br />
{| class="wikitable"
|-
|-
! Purchase Detail !! Update from
| DIY-F || PKT || Float || Size: 10 <br />SubSize: 2
|-
|-
| Supplier GST No || Maintain Supplier
| DIY-F || Weight_MT || Float || Size: 10 <br />SubSize: 4
|-
|-
| Purchase Invoice No || Purchase Invoice
| DIY-F || Weight_KG || Float || Size: 10 <br />SubSize: 4
|-
|-
| Purchase Invoice Date || Purchase Invoice
| DIY-F || TotWeight_MT || Float || Size: 10 <br />SubSize: 4
|-
|-
| Cost || Purchase Invoice
| DIY-F || TotWeight_KG || Float || Size: 10 <br />SubSize: 4
|}
|}
<br />
<br />


::[[File:06 GST MarginScheme Purchase Invoice.jpg | 440PX]]
b. DIY Script: '''OnGridColumnValueChange''' event<br />
<br />
<syntaxhighlight lang="delphi">
 
var
 
  FComServer : Variant;
''NOTE : ''<br />
''1. This information is required to show in Lampiran 07 -Monthly Report for Relief for Secondhand Goods or Margin Scheme (MS).''<br />
function ComServer: Variant;
''2. Auto update to project purchase detail (Purchase No, Purchase Date and Cost) if tax amount is zero''<br />
begin
 
  if FComServer = Null then begin
 
    FComServer := CreateOleObject('SQLAcc.BizApp');
<br />
  end;
 
  Result := FComServer;
==Record Sale of Second Hand Car Value==
end;
''[Sales | Invoice…]''<br />
===Margin Scheme Input===
var
 
  lBizObj,S,S2 : Variant;
1. Enter the sale value of second car at Invoice. (eg.RM90,113.69)<br />
  lSQL    : String;
2. You must select the correct car plate number from Project.(eg.PGE3333)<br />
  lCdsDataList : TClientDataSet;
3. Initial Purchase Cost will auto upadate after select the project (car plate number). <br />
  D : TDataSource;
4. Tax amount will be calculated based on Margin Scheme method.(See screenshot below)<br />
::a. Sellng Price = 90,113.69<br />
begin
::b. Purchase Cost = 30,000.00<br />
  FComServer  := null;
::c. Margin = 90,113.69 – 30,000.00 = 60,113.69<br />
  lCdsDataList := TClientDataSet.Create(nil);
::d. Tax amount = 60,113.69 x 6/106 = 3,402.66<br />
  D := TDataSource(Self.FindComponent('dsDocDetail'));
 
  try
::[[File:07 GST MarginScheme SalesInvoice.jpg | 440PX]]
    lSQL                := 'Code='+ QuotedStr(D.DataSet.FindField('ItemCode').AsString);
<br />
    lBizObj              := ComServer.BizObjects.Find('ST_ITEM');
 
6. Invoice no, invoice date, selling price, margin, and margin tax amount will be shown in Lampiran 07 -Monthly Report for Relief for Secondhand Goods or Margin Scheme (MS)<br />
    lCdsDataList.XMLData := lBizObj.Select('UDF_GSM, UDF_Width, UDF_Length, UDF_PKT, UDF_Weight_KG, UDF_Weight_MT',lSQL,'','SX',',','');
 
    if SameText(EditingField, 'ItemCode') or
===Other Information===
    SameText(EditingField, 'Qty') then begin
 
        D.DataSet.edit;
1. Customer Particular tab.<br />
        D.DataSet.FindField('UDF_GSM').Value := lCdsDataList.FindField('UDF_GSM').Value;
::[[File:07 GST MarginScheme SalesInvoice CustParticular.jpg | 440PX]]
        D.DataSet.FindField('UDF_Width').Value := lCdsDataList.FindField('UDF_Width').Value;
<br />
        D.DataSet.FindField('UDF_Length').Value := lCdsDataList.FindField('UDF_Length').Value;
2. Deposit Info (For record purpose, no posting to account).<br />
        D.DataSet.FindField('UDF_PKT').Value := lCdsDataList.FindField('UDF_PKT').Value;
::[[File:07 GST MarginScheme SalesInvoice Deposit.jpg | 440PX]]
        D.DataSet.FindField('UDF_Weight_KG').Value := lCdsDataList.FindField('UDF_Weight_KG').Value;
<br />
        D.DataSet.FindField('UDF_Weight_MT').Value := lCdsDataList.FindField('UDF_Weight_MT').Value; 
3. Vehichle Detail (Auto retrieve from Vehicle Detail in Maintain Project).<br />
        D.DataSet.FindField('UDF_TotWeight_KG').value := D.DataSet.FindField('UDF_Weight_KG').AsFloat*
::[[File:07 GST MarginScheme SalesInvoice VehicleDetail.jpg | 440PX]]
                                                        D.DataSet.FindField('Qty').Value;
<br />
        D.DataSet.FindField('UDF_TotWeight_MT').value := D.DataSet.FindField('UDF_Weight_MT').AsFloat*
 
                                                        D.DataSet.FindField('Qty').Value;
==Print for GST Lampiran 07 (Lampiran B0-Penyata-Pemantauan-SM-Syarikat)==
    end;
''[Sales | Print Sales Document Listing…]''
 
  finally
1. Select document to “Invoice Listing” and click APPLY.<br />
    lBizObj    := null;
::[[File:08 GST MarginScheme SalesDocumentListing.jpg | 440PX]]
    FComServer := null;
<br />
    lCdsDataList.Free;
2. Click on preview or print. Select the report name “Lampiran B0-Penyata-Pemantauan-SM-Syarikat”.<br />
  end;
::[[File:08 GST MarginScheme SalesDocumentListingLampiran B.jpg | 40PX]]
end.
</syntaxhighlight>
<br />
<br />


==See also==
==See also==
* Others [[Customisation]]
* Others [[Customisation]]

Latest revision as of 04:05, 17 November 2015

Introduction

For mostly paper industries, they have to calculate the total weight in KG converted from different packing size like REAM, PKT or MT. This total weight will be printed in the sales order, delivery order and tax invoice.

Updates

Last Customisation Update : 06 Nov 2015

Criterias

Maintain Stock Group

[Stock | Maintain Stock Group...]

Stock group will be used as the Product Grade and Branding to categorise the stock items list.

Maintain Stock Item

[Stock | Maintain Stock Item...]

1. Stock Master Data.

Types Field Name Data Types Length Usage
STD Code String 30 Product Code, eg. ACGAAA100SK-31004300
STD Description String 200 Product Name, eg. Matt A/Paper China
STD 2nd Description String 200 Paper packaging size to be display in sales tax invoice, eg. 100gsm 31" x 43"
STD Base UOM String 10 stock unit of measurement, usually either enter as REAM or MT or PKT
DIY GSM Float Size :10
SubSize: 2
GSM value for Weight KG calculation
DIY Width Float Size :10
SubSize: 2
Width value for Weight KG calculation
DIY Length Float Size :10
SubSize: 2
Length value for Weight KG calculation
DIY PKT Float Size :10
SubSize: 2
PKT value for Weight KG calculation
DIY Weight_MT Float Size :10
SubSize: 4
Weight MT value
DIY Weight_KG Float Size :10
SubSize: 4
Weight Kgs value


2. Formula:

Weight KG = ((GSM x Width x Length)/3100)/PKT 
Weight MT = Weight KG/1000 

Both formula results are rounding up to 4 decimals.

3. Under Tools | DIY | SQL Control Center...Browse to Stock | Stock Item and insert new event OnBeforeSave with the DIY Script below:

 Var M : TDataSource;
 
 begin
   M := TDataSource(Self.FindComponent('dsAccess'));
   M.DataSet.Edit;
   M.DataSet.FindField('UDF_Weight_KG').Value := SimpleRoundToEx((((M.DataSet.FindField('UDF_GSM').AsFloat* 
                                                 M.DataSet.FindField('UDF_Width').AsFloat* 
                                                 M.DataSet.FindField('UDF_Length').AsFloat)/3100)/M.DataSet.FindField('UDF_PKT').AsFloat),-4);
                                                
   M.DataSet.FindField('UDF_Weight_MT').Value := SimpleRoundToEx((M.DataSet.FindField('UDF_Weight_KG').AsFloat/1000),-4);                                                  
                                              
 end.


Sales Documents Entry

1. Sales documents entry are:-

  • Quotation
  • Sales Order
  • Delivery Order
  • Invoice
  • Debit Note
  • Credit Note

2. Insert and update the following DIY fields & Script into above mentions sales documents in Tools | DIY | SQL Control Center...
a) DIY Fields

Type Field Name Data Types Length
DIY-F GSM Float Size: 10
SubSize: 2
DIY-F Width Float Size: 10
SubSize: 2
DIY-F Length Float Size: 10
SubSize: 2
DIY-F PKT Float Size: 10
SubSize: 2
DIY-F Weight_MT Float Size: 10
SubSize: 4
DIY-F Weight_KG Float Size: 10
SubSize: 4
DIY-F TotWeight_MT Float Size: 10
SubSize: 4
DIY-F TotWeight_KG Float Size: 10
SubSize: 4


b. DIY Script: OnGridColumnValueChange event

 var
   FComServer : Variant;
 
 function ComServer: Variant;
 begin
   if FComServer = Null then begin
     FComServer := CreateOleObject('SQLAcc.BizApp');
   end;
   Result := FComServer;
 end;
 
 var
   lBizObj,S,S2 : Variant;
   lSQL    : String;
   lCdsDataList : TClientDataSet;
   D : TDataSource;
 
 begin
   FComServer   := null;
   lCdsDataList := TClientDataSet.Create(nil);
   D := TDataSource(Self.FindComponent('dsDocDetail'));
   try
     lSQL                 := 'Code='+ QuotedStr(D.DataSet.FindField('ItemCode').AsString);
     lBizObj              := ComServer.BizObjects.Find('ST_ITEM');
 
     lCdsDataList.XMLData := lBizObj.Select('UDF_GSM, UDF_Width, UDF_Length, UDF_PKT, UDF_Weight_KG, UDF_Weight_MT',lSQL,'','SX',',','');
     if SameText(EditingField, 'ItemCode') or
     SameText(EditingField, 'Qty') then begin
        D.DataSet.edit;
        D.DataSet.FindField('UDF_GSM').Value := lCdsDataList.FindField('UDF_GSM').Value;
        D.DataSet.FindField('UDF_Width').Value := lCdsDataList.FindField('UDF_Width').Value;
        D.DataSet.FindField('UDF_Length').Value := lCdsDataList.FindField('UDF_Length').Value;
        D.DataSet.FindField('UDF_PKT').Value := lCdsDataList.FindField('UDF_PKT').Value;
        D.DataSet.FindField('UDF_Weight_KG').Value := lCdsDataList.FindField('UDF_Weight_KG').Value;
        D.DataSet.FindField('UDF_Weight_MT').Value := lCdsDataList.FindField('UDF_Weight_MT').Value;  
        D.DataSet.FindField('UDF_TotWeight_KG').value := D.DataSet.FindField('UDF_Weight_KG').AsFloat*
                                                         D.DataSet.FindField('Qty').Value;
        D.DataSet.FindField('UDF_TotWeight_MT').value := D.DataSet.FindField('UDF_Weight_MT').AsFloat*
                                                         D.DataSet.FindField('Qty').Value; 
     end;
 
   finally
     lBizObj    := null;
     FComServer := null;
     lCdsDataList.Free;
   end;
 end.


See also